/* =========================================================
   Nate Pegram — design system
   Inter · minimal · lots of whitespace
   ========================================================= */

/* ---------- Fonts (self-hosted Inter, variable) ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/Inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/Inter-latinext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/GeistMono.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/Fraunces-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215;
}

/* ---------- Tokens ---------- */
:root {
  /* Light — Kutani porcelain. Jade primary, ochre eyebrow, gold CTA. All AA. (See PALETTE.md) */
  --bg: #faf7f0;            /* porcelain page */
  --bg-soft: #f1ece0;       /* sections */
  --bg-elevated: #ffffff;   /* cards */
  --text: #1b2a36;          /* navy-ink, 13.7:1 on bg */
  --text-soft: #586472;     /* muted */
  --text-faint: #707a86;    /* dates/meta */
  --border: #e6ddca;
  --border-strong: #d8ccb2;
  --accent: #1a7a6a;        /* Kutani jade — links/buttons/highlight, 4.9:1 on bg (AA) */
  --accent-hover: #15665a;
  --fill: #1a7a6a;          /* highlight + primary button */
  --fill-hover: #15665a;
  --eyebrow: #8a6410;       /* Kutani ochre — eyebrows, 4.7:1 */
  --accent-2: #c0432a;      /* Kutani vermilion — status tags (used sparingly) */
  --cta: #d9a441;           /* Kutani lantern gold — primary action: buttons + contact CTA band (both modes) */
  --cta-hover: #c8922e;     /* darker gold for button hover */
  --cta-on: #1b2a36;        /* ink on gold, 6.5:1 */
  --nav-bg: rgba(250, 247, 240, 0.82);
  --shadow: 0 4px 24px rgba(27, 42, 54, 0.07);
  --shadow-hover: 0 12px 40px rgba(27, 42, 54, 0.12);

  --max: 980px;
  --max-wide: 1120px;
  --nav-h: 52px;

  --radius: 0;      /* sharp corners — intentional, matches the editorial/mono direction */
  --radius-sm: 0;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);   /* expo-out: smooth, premium deceleration */
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dark {
  /* Dark — Kutani night: Prussian-navy ground, brighter jade on accents, gold CTA. All AA. */
  --bg: #16243c;            /* Prussian navy night */
  --bg-soft: #1c2c48;       /* sections */
  --bg-elevated: #1f3050;   /* cards (lighter for elevation) */
  --text: #f2ece0;          /* porcelain white, 13.2:1 on bg */
  --text-soft: #a6b2c4;
  --text-faint: #8593a8;
  --border: #2c3f64;
  --border-strong: #3a4e74;
  --accent: #3bb39c;        /* brighter jade so links stay legible on navy — 6.0:1 */
  --accent-hover: #56c6b0;
  --fill: #1a7a6a;          /* jade highlight/button (white text) */
  --fill-hover: #15665a;
  --eyebrow: #e0b24c;       /* gold eyebrow on navy — 7.9:1 */
  --accent-2: #ef6a47;      /* vermilion (brighter for navy) */
  --cta: #d9a441;           /* gold CTA stays gold in both modes */
  --cta-on: #1b2a36;        /* ink on gold */
  --nav-bg: rgba(22, 36, 60, 0.72);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.55);
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  font-optical-sizing: auto;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

img { max-width: 100%; height: auto; display: block; }

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

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.container--wide { max-width: var(--max-wide); }
.container--narrow { max-width: 720px; }

.center { text-align: center; }

.section { padding: 120px 0; }
.section--tight { padding: 80px 0; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.nav__inner {
  width: 100%;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}
.nav__brand:hover { opacity: 0.6; }
.nav__actions { display: flex; align-items: center; gap: 24px; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

/* Hamburger (mobile only) */
.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  margin-right: -10px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav__toggle-bar {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.28s var(--ease), opacity 0.2s var(--ease);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav__link {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--text); }

.theme-toggle {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  cursor: pointer;
  color: var(--text-soft);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-soft); transform: scale(1.05); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
.dark .theme-toggle .icon-sun { display: block; }
.dark .theme-toggle .icon-moon { display: none; }

/* ---------- Typography ---------- */
.display {
  font-weight: 700;
  font-size: clamp(2.9rem, 8vw, 5.5rem);
  line-height: 1.3;        /* must exceed Inter's ~1.21 ascent+descent so stacked .hl bands don't clip descenders */
  letter-spacing: -0.04em;
}
.h2 {
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.h3 {
  font-weight: 600;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--eyebrow);
}
.eyebrow__index { color: var(--accent-2); margin-right: 2px; }  /* Kutani vermilion splash on section numbers */

/* Mono metadata layer — dates, sources, footer (wayfinding, not content) */
.writing-item__date,
.post-item__meta,
.article__date,
.related__date,
.footer,
.scroll-hint {
  font-family: var(--mono);
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.01em;
}
.lead {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.5;
  color: var(--text-soft);
  font-weight: 400;
  letter-spacing: -0.015em;
}
.muted { color: var(--text-soft); }

/* Italic Fraunces ampersand — an ornamental echo of the CTA */
.amp {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.04em;
  letter-spacing: normal;
  margin: 0 0.04em;
}

/* Highlight marker */
.hl {
  background: var(--fill);
  color: #fff;
  padding: 0.06em 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-hover); }

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
  text-align: center;
}
.hero .container { display: flex; flex-direction: column; align-items: center; }
.hero .display { margin-bottom: 26px; }
.hero .lead { max-width: 600px; }
.hero__cta { margin-top: 44px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero__cta .btn { padding: 16px 34px; font-size: 1.08rem; }

/* Choreographed hero entrance — smooth fade + gentle rise (subtle blur-up) */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  60%  { filter: blur(0); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
.hero .display { animation: riseIn 0.9s var(--ease-soft) 0.06s both; }
.hero .lead     { animation: riseIn 0.9s var(--ease-soft) 0.20s both; }
.hero__cta      { animation: riseIn 0.9s var(--ease-soft) 0.32s both; }

.scroll-hint {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  color: var(--text-faint);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: bob 2.4s var(--ease) infinite;
}
@keyframes bob { 0%,100%{transform:translate(-50%,0)} 50%{transform:translate(-50%,7px)} }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 0;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--cta); color: var(--cta-on); }
.btn--primary:hover { background: var(--cta-hover); color: var(--cta-on); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { color: var(--text); border-color: var(--text-soft); background: var(--bg-soft); }

/* ---------- About / prose ---------- */
.prose { max-width: 660px; }
.prose p { font-size: 1.15rem; line-height: 1.65; color: var(--text-soft); margin-bottom: 1.25rem; letter-spacing: -0.014em; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 600; }
.prose--center { margin: 26px auto 0; }

.eyebrow + .h2 { margin-top: 16px; }
.section-lead { max-width: 560px; margin: 18px auto 0; }

/* ---------- Writing list (home) ---------- */
.writing-list { margin-top: 44px; border-top: 1px solid var(--border); }
.writing-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  text-align: left;
  transition: padding 0.26s var(--ease);
}
.writing-item:hover { padding-left: 14px; padding-right: 0; }
.writing-item:hover .writing-item__title { color: var(--accent); }
.writing-item__title { font-weight: 600; font-size: 1.3rem; letter-spacing: -0.025em; line-height: 1.25; transition: color 0.22s var(--ease); }
.writing-item__date { flex: 0 0 auto; font-size: 0.9rem; color: var(--text-faint); font-variant-numeric: tabular-nums; padding-top: 4px; }
@media (max-width: 600px) {
  .writing-item { flex-direction: column; gap: 6px; }
}

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
  height: 100%;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.card__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.card__title { font-weight: 600; font-size: 1.3rem; letter-spacing: -0.02em; margin-bottom: 10px; }
.card__desc { color: var(--text-soft); font-size: 1rem; line-height: 1.55; }
.card__arrow {
  margin-top: auto;
  padding-top: 22px;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
a.card:hover .card__arrow span { transform: translateX(4px); }
.card__arrow span { transition: transform 0.22s var(--ease); display: inline-block; }

/* ---------- Project cards ---------- */
.project-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.project-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.project-card__media { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.project-card__body { padding: 26px 28px 30px; display: flex; flex-direction: column; gap: 12px; }
.project-card__meta { display: flex; align-items: center; gap: 12px; }
.project-card__name { font-weight: 600; font-size: 1.4rem; letter-spacing: -0.02em; }
.project-card__status {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid color-mix(in srgb, var(--accent-2) 45%, transparent);
  padding: 3px 8px;
}
.project-card__desc { color: var(--text-soft); font-size: 1rem; line-height: 1.55; }
.project-card__link { font-family: var(--mono); font-size: 0.85rem; color: var(--accent); display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; }
.project-card__link span { display: inline-block; transition: transform 0.22s var(--ease); }
.project-card:hover .project-card__link span { transform: translateX(4px); }

/* ---------- Post list (blogs / links) ---------- */
.post-list { border-top: 1px solid var(--border); }
.post-item {
  display: block;
  padding: 34px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: padding-left 0.28s var(--ease);
}
.post-item:hover { padding-left: 10px; }
.post-item:hover .post-item__title { color: var(--accent); }
.post-item__meta {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.post-item__source { color: var(--accent); }
.post-item__title { font-weight: 600; font-size: 1.5rem; letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 10px; transition: color 0.22s var(--ease); }
.post-item__desc { color: var(--text-soft); font-size: 1.05rem; line-height: 1.55; max-width: 760px; }

/* ---------- Page header (sub-pages) ---------- */
.page-head { padding-top: calc(var(--nav-h) + 96px); padding-bottom: 24px; }
.page-head .h2 { margin-bottom: 16px; }

/* ---------- Contact ---------- */
.contact { background: var(--cta); color: var(--cta-on); text-align: center; padding: 84px 0; transition: background-color 0.4s var(--ease); }
.contact .eyebrow { color: var(--cta-on); }  /* full ink so the CONTACT label pops on gold, matching the number + button */
.contact .eyebrow__index { color: var(--cta-on); }  /* full ink so the number pops on gold (red can't — too low-contrast) */
.contact .h2 { color: var(--cta-on); font-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 600; font-size: clamp(3.8rem, 10vw, 6.6rem); line-height: 1.05; letter-spacing: -0.02em; }
.contact .reveal { transform: translateY(44px); transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease-soft); }

/* "Let's chat!" reveals one letter at a time (lightweight: per-letter opacity + transform) */
/* CTA: per-letter "typed out" reveal — each letter fades in, staggered left to right. */
.contact .h2.reveal { opacity: 1; transform: none; }
.contact .h2 .char {
  color: var(--cta-on);
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft);
  transition-delay: calc(var(--i, 0) * 0.05s);
}
.contact .h2.in .char { opacity: 1; }
.contact__links { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 36px; }
.contact .contact__row { color: var(--cta-on); }
.contact .contact__row:hover { color: var(--cta-on); opacity: 0.72; }
.contact .contact__row svg { color: color-mix(in srgb, var(--cta-on) 65%, transparent); }
.contact .contact__row:hover svg { color: var(--cta-on); }
.contact__row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  width: fit-content;
  transition: color 0.2s var(--ease);
}
.contact__row:hover { color: var(--accent); }
.contact__row svg { width: 22px; height: 22px; color: var(--text-faint); transition: color 0.2s var(--ease); }
.contact__row:hover svg { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 44px 0;
  color: var(--text-faint);
  font-size: 0.9rem;
}
.footer__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.footer__inner > :first-child { justify-self: start; }
.footer a { color: var(--text-soft); }
.footer a:hover { color: var(--text); }
.footer__nav { display: flex; gap: 24px; justify-self: end; }

/* Palette stamp — the five colors of Kutani (九谷五彩) */
.palette-stamp { display: flex; align-items: center; gap: 6px; }
.palette-stamp .sw { width: 11px; height: 11px; border: 1px solid color-mix(in srgb, var(--text-faint) 45%, transparent); transition: transform 0.2s var(--ease); }
.palette-stamp:hover .sw { transform: translateY(-2px); }
.sw-porc { background: #faf7f0; } .sw-jade { background: #1a7a6a; } .sw-gold { background: #d9a441; } .sw-verm { background: #c0432a; } .sw-navy { background: #16243c; }
.palette-stamp__label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--text-faint); margin-left: 5px; }

/* ---------- Article (blog post) ---------- */
.article { padding-top: calc(var(--nav-h) + 80px); }
/* Gutter-aware column: 720 max on desktop, always 24px gutters on mobile, edges aligned */
.article > .container { width: min(720px, 100% - 48px); max-width: none; margin-inline: auto; padding: 0; }
.article__head { width: min(720px, 100% - 48px); margin: 0 auto 48px; }
.article__date { font-size: 0.9rem; color: var(--text-faint); margin-bottom: 18px; }
.article__title { font-weight: 700; font-size: clamp(2.2rem, 5.5vw, 3.4rem); line-height: 1.08; letter-spacing: -0.035em; margin-bottom: 20px; }
.article__subtitle { font-size: 1.3rem; line-height: 1.45; color: var(--text-soft); font-weight: 400; letter-spacing: -0.02em; }

.article__body { width: min(720px, 100% - 48px); margin: 0 auto; }
.article__body p { font-size: 1.19rem; line-height: 1.7; color: var(--text); margin-bottom: 1.5rem; letter-spacing: -0.014em; }
.article__body h2 { font-weight: 700; font-size: 1.9rem; letter-spacing: -0.025em; margin: 2.6rem 0 1.1rem; line-height: 1.15; }
.article__body h3 { font-weight: 600; font-size: 1.4rem; letter-spacing: -0.02em; margin: 2rem 0 0.9rem; }
.article__body a, .prose a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;        /* touch/no-hover: static underline */
  transition: background-size 0.3s var(--ease);
}
@media (hover: hover) {
  .article__body a, .prose a { background-size: 0% 1px; }   /* grows in on hover */
  .article__body a:hover, .prose a:hover { background-size: 100% 1px; }
}
.article__body strong { font-weight: 600; }
.article__body ul, .article__body ol { margin: 0 0 1.5rem 1.3rem; }
.article__body li { font-size: 1.19rem; line-height: 1.7; margin-bottom: 0.5rem; color: var(--text); }
.article__body img { border-radius: var(--radius-sm); border: 1px solid var(--border); margin: 2.2rem auto; box-shadow: var(--shadow); }
.article__body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 22px;
  margin: 1.8rem 0;
  color: var(--text-soft);
  font-size: 1.22rem;
  font-style: normal;
}
.article__body hr { border: none; border-top: 1px solid var(--border); margin: 2.6rem 0; }
.image-caption { text-align: center; font-size: 0.9rem; color: var(--text-faint); margin: -1.4rem 0 2.2rem; }
.article__footnote { text-align: center; font-size: 0.95rem; color: var(--text-faint); margin-top: 2.4rem; }
.article__footnote a { color: var(--accent); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.back-link:hover { color: var(--accent); }

/* related posts */
.related { width: min(720px, 100% - 48px); margin: 72px auto 0; padding-top: 48px; border-top: 1px solid var(--border); }
.related > .container { padding: 0 !important; }
.related__heading { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 24px; }
.related__item { display: block; padding: 16px 0; text-decoration: none; border-bottom: 1px solid var(--border); transition: padding-left 0.24s var(--ease); }
.related__item:last-child { border-bottom: none; }
.related__item:hover { padding-left: 8px; }
.related__item:hover .related__title { color: var(--accent); }
.related__title { font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text); margin-bottom: 4px; transition: color 0.22s var(--ease); }
.related__date { font-size: 0.85rem; color: var(--text-faint); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
/* Mobile nav: hamburger + dropdown */
@media (max-width: 640px) {
  .nav__toggle { display: flex; }
  .nav__actions { gap: 8px; }
  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s var(--ease), transform 0.24s var(--ease), visibility 0.24s var(--ease);
  }
  .nav__links.open { transform: none; opacity: 1; visibility: visible; }
  .nav__link {
    display: block;
    padding: 15px 24px;
    font-size: 1.05rem;
    min-height: 48px;
  }
  .nav__link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
}

@media (max-width: 820px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .section { padding: 88px 0; }
  .nav__links { gap: 20px; }
  .nav__brand { font-size: 0.95rem; }
}
@media (max-width: 560px) {
  .container { padding: 0 20px; }
  .nav__inner { padding: 0 20px; }
  .hero { min-height: 88vh; }
  .card { padding: 26px; }
  .footer__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
  .footer__nav { justify-self: auto; flex-wrap: wrap; justify-content: center; }
}
