/* ============================================================
   Warm Editorial — djmorgan26.github.io
   Fraunces (display) · Newsreader (reading) · Inter (UI) · JetBrains Mono (meta/code)
   ============================================================ */

:root {
  --bg:        #f7f4ec;
  --bg-soft:   #f0ebdf;
  --ink:       #2b2622;
  --muted:     #6f675c;
  --line:      #e3ddce;
  --accent:    #bd5f3c;
  --accent-2:  #a04b2c;

  --serif-display: "Fraunces", Georgia, "Times New Roman", serif;
  --serif-read: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 640px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:       #1c1a17;
    --bg-soft:  #24211d;
    --ink:      #ece4d6;
    --muted:    #9c9384;
    --line:     #33302a;
    --accent:   #e2885f;
    --accent-2: #eca07e;
  }
}
:root[data-theme="dark"] {
  --bg:       #1c1a17;
  --bg-soft:  #24211d;
  --ink:      #ece4d6;
  --muted:    #9c9384;
  --line:     #33302a;
  --accent:   #e2885f;
  --accent-2: #eca07e;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px;
}
.skip:focus { left: 16px; top: 16px; z-index: 50; }

/* ---- shared bar geometry ---- */
.bar {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ---- header ---- */
.site-header { padding: 30px 0 0; }
.brand {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: .005em;
  color: var(--ink);
}
.brand:hover { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a {
  font-size: 14.5px;
  color: var(--muted);
}
.site-nav a:hover { color: var(--accent); }

.theme-toggle {
  appearance: none; border: 1px solid var(--line); background: transparent;
  color: var(--muted); width: 34px; height: 34px; border-radius: 999px;
  cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center;
  transition: border-color .2s ease, color .2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* toggle glyph: moon in light (→go dark), sun in dark (→go light) */
.t-sun { display: none; }
.t-moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .t-sun { display: inline; }
  :root:not([data-theme]) .t-moon { display: none; }
}
:root[data-theme="dark"] .t-sun { display: inline; }
:root[data-theme="dark"] .t-moon { display: none; }
:root[data-theme="light"] .t-sun { display: none; }
:root[data-theme="light"] .t-moon { display: inline; }

/* ---- main ---- */
.site-main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================================================
   HOME
   ============================================================ */
.home { padding: 58px 0 24px; }
.home-hero {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(31px, 6vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.012em;
  margin: 0 0 18px;
  max-width: 15em;
}
.home-hero em { font-style: italic; color: var(--accent); }
.home-intro {
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--muted);
  margin: 0 0 8px;
  max-width: 34em;
}
.home-note { color: var(--muted); max-width: 34em; }

.post-list { margin-top: 50px; }
.post-item { padding: 28px 0; border-top: 1px solid var(--line); }
.post-item:last-child { border-bottom: 1px solid var(--line); }

.post-date {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.post-title {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.24;
  margin: 11px 0 9px;
  letter-spacing: -0.005em;
}
.post-title a { color: var(--ink); }
.post-title a:hover { color: var(--accent); }
.post-excerpt {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: 36em;
}
.read-more { white-space: nowrap; font-weight: 500; }

/* ============================================================
   POST / PAGE
   ============================================================ */
.post, .page { padding: 56px 0 16px; }
.post-header { margin-bottom: 38px; }
.post-headline {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(30px, 5.4vw, 40px);
  line-height: 1.16;
  letter-spacing: -0.014em;
  margin: 12px 0 0;
}
.page .post-headline { margin-top: 0; }

.post-body {
  font-family: var(--serif-read);
  font-size: 19px;
  line-height: 1.72;
  color: var(--ink);
}
.post-body > p { margin: 0 0 22px; }
.post-body p { max-width: 34em; }

.post-body h2 {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 46px 0 14px;
}
.post-body h3 {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 20px;
  margin: 36px 0 12px;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.post-body a:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
}

.post-body strong { font-weight: 600; color: var(--ink); }
.post-body em { font-style: italic; }

.post-body ul, .post-body ol { max-width: 34em; padding-left: 1.3em; margin: 0 0 22px; }
.post-body li { margin: 8px 0; }
.post-body li::marker { color: var(--accent); }

.post-body blockquote {
  margin: 26px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
  max-width: 34em;
}

.post-body hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 40px 0;
  max-width: 34em;
}
/* the bio footer (after the final hr) reads as a quiet aside */
.post-body hr + p {
  font-family: var(--sans);
  font-size: 14.5px;
  font-style: normal;
  line-height: 1.6;
  color: var(--muted);
}

.post-body img { max-width: 100%; height: auto; border-radius: 8px; }

/* code */
.post-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}
.post-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.55;
}
.post-body pre code {
  background: none; border: 0; padding: 0; font-size: 14px;
}

.post-foot-nav { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); }
.post-foot-nav a { font-family: var(--sans); font-size: 14.5px; color: var(--muted); }
.post-foot-nav a:hover { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: 80px;
  padding: 26px 0 44px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}
.site-footer .dots { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ============================================================
   RESUME
   ============================================================ */
.resume { padding: 50px 0 16px; }
.resume-head { margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.resume-head-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.resume-name {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(30px, 5vw, 38px);
  letter-spacing: -0.014em;
  margin: 0;
}
.resume-download {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 7px 16px;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.resume-download:hover { background: var(--accent); color: var(--bg); }
.resume-contact {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin: 14px 0 0;
  line-height: 1.7;
}
.resume-contact a { color: var(--muted); }
.resume-contact a:hover { color: var(--accent); }
.resume-contact .sep { color: var(--line); margin: 0 4px; }

.resume-body { font-family: var(--sans); font-size: 15px; line-height: 1.6; }
.resume-body > p:first-child {
  font-size: 15.5px;
  color: var(--ink);
  max-width: 44em;
  margin: 0 0 26px;
}
.resume-body h2 {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 34px 0 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.resume-body h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin: 20px 0 2px;
}
.resume-body h3 + p em,
.resume-body h3 + p {
  font-family: var(--mono);
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
  margin: 0 0 10px;
}
.resume-body ul { margin: 6px 0 16px; padding-left: 1.2em; max-width: 46em; }
.resume-body li { margin: 6px 0; }
.resume-body li::marker { color: var(--accent); }
.resume-body strong { font-weight: 600; color: var(--ink); }
.resume-body code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px;
}
.resume-body > p:last-child { max-width: 46em; color: var(--muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 540px) {
  .bar { padding: 0 20px; }
  .site-main { padding: 0 20px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 14px; }
  .post-body { font-size: 18px; }
  .site-footer .bar { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ============================================================
   PRINT  (drives the resume PDF — clean, light, paginated)
   ============================================================ */
@media print {
  @page { margin: 14mm 16mm; }
  :root {
    --bg: #ffffff; --bg-soft: #f4f1ea; --ink: #1d1a17; --muted: #4d4740;
    --line: #d8d2c4; --accent: #a64a28; --accent-2: #8c3d20;
  }
  html, body { background: #fff; color: var(--ink); font-size: 11pt; }
  .site-header, .site-footer, .resume-download, .skip, .theme-toggle { display: none !important; }
  .site-main { max-width: none; padding: 0; }
  .resume { padding: 0; }
  .resume-name { font-size: 22pt; }
  .resume-contact { font-size: 9pt; }
  .resume-body { font-size: 10pt; line-height: 1.45; }
  .resume-body > p:first-child { font-size: 10pt; max-width: none; }
  .resume-body h2 { font-size: 11pt; margin: 16px 0 8px; }
  .resume-body h3 { font-size: 11pt; margin: 12px 0 1px; }
  .resume-body ul, .resume-body li, .resume-body > p { max-width: none; }
  .resume-body h2, .resume-body h3 { break-after: avoid; }
  .resume-body li, .resume-body p { break-inside: avoid; }
  a { color: var(--ink); text-decoration: none; }
}
