:root {
  --navy: #080d25;
  --navy-deep: #06152e;
  --paper: #f3f5f8;
  --surface: #ffffff;
  --ink: #10182b;
  --ink-soft: #4c5566;
  --ink-faint: #7b8496;
  --line: rgba(16, 24, 43, 0.16);
  --line-strong: rgba(16, 24, 43, 0.34);
  --accent: #9a6519;
  --cream: #ffd9a3;
  --ridge: #9bb8f0;
  --horizon: linear-gradient(90deg, var(--cream), var(--ridge));
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --max: 1180px;
  --reading: 720px;
  --gutter: clamp(22px, 5vw, 64px);
  --ease: cubic-bezier(.22, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { color: inherit; }
::selection { background: var(--cream); color: #10182b; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 76px;
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-shell {
  width: min(100%, 1920px);
  height: 76px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}
.desktop-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 34px);
}
.desktop-nav .nav-divider {
  width: 1px;
  height: 18px;
  flex: 0 0 1px;
  background: rgba(255,255,255,.2);
}
.desktop-nav a {
  color: rgba(255,255,255,.68);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease;
}
.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] { color: #fff; }
.desktop-nav .nav-cta {
  padding: 9px 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-weight: 650;
}
.desktop-nav .nav-cta:hover { color: var(--navy); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 20px;
  height: 1.5px;
  border-radius: 2px;
  background: #fff;
  transition: transform .28s var(--ease), opacity .2s ease;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: none;
  background: var(--navy);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}
.mobile-nav.open { opacity: 1; visibility: visible; pointer-events: auto; }
.mobile-nav-inner {
  min-height: 100%;
  padding: calc(116px + env(safe-area-inset-top)) var(--gutter) calc(44px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}
.mobile-nav a {
  display: block;
  color: rgba(255,255,255,.72);
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 600;
  line-height: 1.16;
  text-decoration: none;
  padding: 7px 0;
}
.mobile-nav a:hover,
.mobile-nav a:focus-visible,
.mobile-nav a[aria-current="page"] { color: #fff; }
.mobile-nav .nav-divider {
  width: 100%;
  height: 1px;
  flex: none;
  margin: 12px 0;
  background: rgba(255,255,255,.16);
}
.mobile-nav .mobile-cta {
  margin-top: 26px;
  padding: 13px 19px;
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 17px;
  font-weight: 700;
}

/* ========== FIELD LOG PRIMITIVES ========== */
.mono,
.eyebrow,
.entry-meta,
.fig-label,
.article-caption,
.article-byline,
.story-meta,
.related-title,
.callout-label,
.article-toc p {
  font-family: var(--mono);
  letter-spacing: .02em;
}
.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.entry-meta {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.fig-label {
  margin-right: 10px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}
.horizon-rule {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--horizon);
}
/* ========== HOMEPAGE ========== */
.index-line {
  margin: 0 0 22px;
  font-family: var(--mono);
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.latest-section { border-top: 0; padding-top: clamp(64px, 9vh, 110px); }

.section {
  padding: clamp(72px, 9vw, 120px) var(--gutter);
  border-top: 1px solid var(--line);
}
.section-inner { width: min(100%, var(--max)); margin: 0 auto; }
.section-head {
  margin-bottom: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  text-align: left;
}
.section-head h1,
.section-head h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.014em;
}
.section-note { max-width: 360px; margin: 0 0 6px; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }

.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 2.5vw, 34px);
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}
.category-filter {
  min-height: 40px;
  padding: 8px 2px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 0;
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.category-filter:hover { color: var(--ink); }
.category-filter.active { color: var(--ink); border-bottom-color: var(--accent); }

.story-list { border-top: 0; }
.story-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 270px;
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: color .2s ease;
}
.story-row[hidden] { display: none; }
.story-meta {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.7;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.story-meta .story-no { color: var(--accent); font-weight: 600; }
.story-copy h3 { margin: 0 0 9px; font-size: clamp(22px, 2.6vw, 32px); font-weight: 640; line-height: 1.12; letter-spacing: -0.01em; }
.story-copy p { max-width: 620px; margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.story-thumb { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: 2px; background: var(--navy-deep); }
.story-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.story-row:hover .story-thumb img { transform: scale(1.025); }
.story-row:hover h3 { color: var(--accent); }

.site-footer { padding: 58px var(--gutter); background: var(--navy); color: #fff; }
.footer-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: end;
}
.footer-title { margin: 0 0 6px; font-size: 19px; font-weight: 650; }
.footer-copy { margin: 0; color: rgba(255,255,255,.46); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 22px; }
.footer-links a { color: rgba(255,255,255,.6); font-size: 13px; text-decoration: none; }
.footer-links a:hover { color: #fff; }

/* ========== ARTICLE ========== */
.reading-progress {
  position: fixed;
  top: 75px;
  left: 0;
  z-index: 205;
  width: 0;
  height: 2px;
  background: var(--horizon);
}
.article-header {
  padding: clamp(64px, 9vw, 118px) var(--gutter) clamp(44px, 6vw, 72px);
}
.article-head-inner {
  width: min(100%, 1220px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--reading)) minmax(0, 1fr);
  text-align: left;
}
.article-head-inner > * { grid-column: 2; min-width: 0; }
.article-header h1 {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.016em;
}
.article-deck {
  max-width: 640px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: clamp(18px, 1.9vw, 22px);
  line-height: 1.5;
}
.article-byline {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 9px 18px;
  margin-top: 30px;
  color: var(--ink-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.article-byline span + span::before { content: "·"; margin-right: 18px; }
.article-head-inner .horizon-rule { margin-top: 26px; }
.article-hero {
  width: min(calc(100% - (2 * var(--gutter))), 1220px);
  margin: 0 auto;
}
.article-hero.wide img { width: 100%; border: 1px solid var(--line); border-radius: 2px; }
.article-hero.phone {
  max-width: 1220px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}
.article-hero.phone img { width: min(100%, 420px); margin: 0 auto; }
.article-caption { margin-top: 12px; color: var(--ink-faint); font-size: 12px; line-height: 1.5; text-align: left; }
p.article-caption.article-hero { margin-top: 12px; }

.article-layout {
  width: min(calc(100% - (2 * var(--gutter))), 1220px);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 110px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--reading)) minmax(0, 1fr);
  gap: 0;
  justify-content: center;
}
.article-toc {
  grid-column: 1;
  position: sticky;
  top: 112px;
  width: min(180px, calc(100% - 24px));
  align-self: start;
  justify-self: start;
}
.article-toc p { margin: 0 0 14px; color: var(--accent); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.article-toc a {
  display: block;
  padding: 6px 0;
  color: var(--ink-faint);
  font-size: 12.5px;
  line-height: 1.35;
  text-decoration: none;
  transition: color .2s ease;
}
.article-toc a:hover { color: var(--ink); }
.article-body { grid-column: 2; min-width: 0; }
.article-body > p:first-child { margin-top: 0; font-size: 21px; line-height: 1.58; }
.article-body p { margin: 0 0 28px; }
.article-body h2 {
  margin: 76px 0 22px;
  scroll-margin-top: 118px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.012em;
}
.article-body h3 { margin: 44px 0 16px; font-size: 22px; font-weight: 640; line-height: 1.2; }
.article-body ul,
.article-body ol { margin: 0 0 30px; padding-left: 1.25em; }
.article-body li { margin: 10px 0; padding-left: 7px; }
.article-body blockquote {
  margin: 58px 0;
  padding: 4px 0 4px 26px;
  border: 0;
  border-left: 2px solid var(--accent);
  font-size: clamp(22px, 2.6vw, 29px);
  font-weight: 560;
  line-height: 1.3;
  letter-spacing: -0.008em;
}
.article-body .callout {
  margin: 54px 0;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
  background: var(--surface);
}
.callout-label { margin: 0 0 10px !important; color: var(--accent); font-size: 11px !important; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.article-body .callout p:last-child { margin-bottom: 0; }
.article-body code { padding: .15em .35em; border-radius: 3px; background: rgba(16,24,43,.08); font-family: var(--mono); font-size: .86em; }
.article-media {
  position: relative;
  left: 50%;
  width: min(calc(100vw - (2 * var(--gutter))), 1120px);
  margin: 68px 0;
  transform: translateX(-50%);
}
.article-media img { width: 100%; border: 1px solid var(--line); border-radius: 2px; }
.article-media.phone-pair {
  padding: 0;
  background: transparent;
  overflow: visible;
}
.article-media.phone-pair img { width: min(100%, 420px); margin: 0 auto; border: 0; border-radius: 0; }
.article-media figcaption { margin-top: 12px; color: var(--ink-faint); font-family: var(--mono); font-size: 12px; line-height: 1.5; }

.article-end {
  padding: 72px var(--gutter) 104px;
  border-top: 1px solid var(--line);
}
.article-end-inner { width: min(100%, var(--max)); margin: 0 auto; }
.back-blog {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
}
.back-blog:hover { text-decoration: underline; text-underline-offset: 4px; }
.related-title { margin: 56px 0 0; padding-bottom: 14px; font-size: 11.5px; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.related-link { padding: 26px 30px 28px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.related-link + .related-link { padding-left: 30px; border-left: 1px solid var(--line); }
.related-link span { display: block; margin-bottom: 10px; color: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.related-link strong { font-size: clamp(20px, 2.4vw, 27px); font-weight: 640; line-height: 1.18; letter-spacing: -0.01em; }
.related-link:hover strong { color: var(--accent); }

@media (max-width: 1180px) {
  .article-layout { grid-template-columns: minmax(0, var(--reading)); }
  .article-toc { display: none; }
  .article-body { grid-column: 1; }
  .article-head-inner { grid-template-columns: minmax(0, var(--reading)); justify-content: center; }
  .article-head-inner > * { grid-column: 1; }
}

@media (max-width: 960px) {
  .desktop-nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { display: block; }
  .mobile-nav.open { opacity: 1; visibility: visible; pointer-events: auto; }
  .story-row { grid-template-columns: 110px minmax(0, 1fr) 220px; }
  .article-layout { grid-template-columns: minmax(0, var(--reading)); }
  .article-toc { display: none; }
}

@media (max-width: 720px) {
  :root { --gutter: 22px; }
  body { font-size: 16px; }
  .site-nav,
  .nav-shell { height: calc(76px + env(safe-area-inset-top)); }
  .nav-shell { padding-top: env(safe-area-inset-top); }
  .desktop-nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { display: block; }
  .section { padding-top: 66px; padding-bottom: 66px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 28px; }
  .section-head h1,
  .section-head h2 { font-size: 34px; }
  .category-bar { gap: 18px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .category-filter { flex: 0 0 auto; }
  .story-row { grid-template-columns: 1fr; gap: 16px; padding: 28px 0; }
  .story-meta { order: 1; }
  .story-copy { order: 2; }
  .story-thumb { order: 3; aspect-ratio: 16 / 10; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; gap: 14px 20px; }
  .reading-progress { top: calc(75px + env(safe-area-inset-top)); }
  .article-header { padding-top: 60px; }
  .article-header h1 { font-size: clamp(32px, 9vw, 44px); }
  .article-deck { font-size: 18px; }
  .article-hero { width: 100%; padding: 0 var(--gutter); }
  .article-hero.wide { padding: 0; }
  .article-hero.wide img { border-left: 0; border-right: 0; border-radius: 0; }
  .article-hero.phone { padding: 0 var(--gutter); }
  .article-caption { padding: 0 var(--gutter); }
  .article-hero .article-caption { padding: 0; }
  .article-layout { width: 100%; padding: 64px var(--gutter); }
  .article-body > p:first-child { font-size: 19px; }
  .article-body h2 { margin-top: 60px; font-size: 28px; }
  .article-body blockquote { margin: 48px 0; padding-left: 20px; font-size: 22px; }
  .article-body .callout { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); border-left: 0; border-right: 0; border-radius: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .article-media { width: calc(100% + (2 * var(--gutter))); margin-top: 52px; margin-bottom: 52px; }
  .article-media img { border-left: 0; border-right: 0; border-radius: 0; }
  .article-media.phone-pair img { border: 0; }
  .article-media figcaption { padding: 0 var(--gutter); }
  .related-grid { grid-template-columns: 1fr; }
  .related-link + .related-link { padding-left: 0; border-left: 0; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #06152e;
    --surface: #0b1c3c;
    --ink: #f2f4f8;
    --ink-soft: #b3bccd;
    --ink-faint: #7f8aa1;
    --line: rgba(255,255,255,.16);
    --line-strong: rgba(255,255,255,.34);
    --accent: #ffd9a3;
  }
  .story-thumb { background: #031017; }
  .article-body code { background: rgba(255,255,255,.1); }
  ::selection { background: var(--cream); color: #10182b; }
}

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