/* ==========================================================================
   speedsharma.com — design system
   Tokens mirror the Pencil source of truth. Change them here and everywhere
   downstream follows.
   ========================================================================== */

:root {
  --ink:          #14100C;
  --raise:        #1B1611;
  --card:         #201A13;
  --inset:        #0F0C08;

  --text:         #F2EADC;
  --dim:          #A99B84;
  --faint:        #74695A;

  --amber:        #E8A13C;
  --amber-deep:   #C77F1B;
  --amber-soft:   rgba(232, 161, 60, 0.12);
  --sage:         #8FB08A;
  --danger:       #E06C5A;

  --line:         rgba(242, 234, 220, 0.12);
  --line-strong:  rgba(242, 234, 220, 0.24);

  --display:      "Fraunces", Georgia, serif;
  --body:         "Inter", system-ui, -apple-system, sans-serif;
  --mono:         "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --wrap:         1120px;
  --gutter:       24px;
  --radius:       12px;
  --radius-sm:    8px;
  --section-y:    96px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
svg { flex: none; }

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* --------------------------------------------------------- utilities ---- */

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--amber); color: var(--ink); padding: 12px 20px;
  font-family: var(--mono); font-size: 14px; text-decoration: none;
}
.skip:focus { left: 12px; top: 12px; }

.rule { border: 0; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------- typography */

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  color: var(--amber); margin-bottom: 18px;
}
.eyebrow-rule { width: 24px; height: 1px; background: var(--amber-deep); flex: none; }

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 100px;
  font-family: var(--mono); font-size: 12px; color: var(--dim);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); flex: none; }

.tag {
  display: inline-block; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 100px;
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.mono { font-family: var(--mono); }
.muted { color: var(--dim); }
.faint { color: var(--faint); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-family: var(--body); font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: var(--amber-deep); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); font-weight: 500; }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn:disabled { opacity: .7; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-full { width: 100%; justify-content: center; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 13px; color: var(--amber); text-decoration: none;
}
.link-arrow:hover { gap: 11px; }
.link-arrow svg { transition: transform .15s; }

/* -------------------------------------------------------------------- nav */

.nav { border-bottom: 1px solid var(--line); background: rgba(20, 16, 12, 0.9); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; }

.brand { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--text); text-decoration: none; }
.brand b { color: var(--amber); font-weight: 500; }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-family: var(--mono); font-size: 13px; color: var(--dim); text-decoration: none;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--amber); }
.nav-cta { margin-left: 2px; padding: 10px 18px; font-size: 14px; color: var(--ink) !important; }
.nav-cta:hover { color: var(--ink) !important; }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 11px; }
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: var(--text); }
.nav-toggle span + span { margin-top: 5px; }

/* --------------------------------------------------------------- sections */

.section { padding: var(--section-y) 0; }
.section + .section { border-top: 1px solid var(--line); }
.band { padding: 72px 0; background: var(--inset); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); max-width: 20ch; }
.section-head.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.section-head.split > div { max-width: 40ch; }

.page-header { padding: 88px 0 56px; border-bottom: 1px solid var(--line); }
.page-header h1 { font-size: clamp(2.1rem, 5vw, 3.25rem); letter-spacing: -0.02em; max-width: 17ch; }
.page-header .lede { margin-top: 22px; max-width: 60ch; font-size: 17px; color: var(--dim); line-height: 1.7; }

/* ------------------------------------------------------------------- hero */

.hero { padding: 88px 0 84px; }
.hero-inner { display: grid; grid-template-columns: 1fr 400px; gap: 80px; align-items: start; }
.hero h1 {
  margin-top: 24px;
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  line-height: 1.06; letter-spacing: -0.02em;
}
.hero .sub { margin-top: 24px; max-width: 52ch; font-size: 18px; color: var(--dim); line-height: 1.65; }
.hero .btn-row { margin-top: 28px; }
.hero .reply { margin-top: 20px; font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.hero .reply a { color: var(--faint); }
.hero .reply a:hover { color: var(--amber); }

/* terminal card */
.terminal { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.terminal-bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots i { width: 8px; height: 8px; border-radius: 50%; background: #5A4A3A; }
.terminal-title { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.terminal-body { padding: 18px 16px 20px; display: flex; flex-direction: column; gap: 9px; }
.terminal-body span { font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre; color: var(--dim); }
.terminal-body .t-cmd  { color: var(--faint); }
.terminal-body .t-ok   { color: var(--sage); }
.terminal-body .t-warn { color: var(--amber); }
.terminal-body .t-sum  { color: var(--text); }

/* ------------------------------------------------------------ proof strip */

.proof { background: var(--raise); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 36px 0; }
.proof-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.stat .value { font-family: var(--display); font-weight: 600; font-size: 38px; line-height: 1.05; }
.stat .label { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 6px; }
.stat.accent .value { color: var(--amber); }

/* ------------------------------------------------------------------ grids */

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

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; display: flex; flex-direction: column; gap: 16px;
}
.card-sm { padding: 26px; gap: 12px; }
.card h3 { font-size: 23px; line-height: 1.25; }
.card p { color: var(--dim); font-size: 15.5px; line-height: 1.65; }
.card .num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--amber); }
a.card { text-decoration: none; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }

/* -------------------------------------------------------------- work rows */

.work-row {
  display: flex; gap: 32px; align-items: flex-start;
  padding: 28px 0 30px; border-bottom: 1px solid var(--line);
  text-decoration: none; transition: opacity .15s;
}
.work-row:hover { opacity: .82; }
.work-row .idx { font-family: var(--mono); font-size: 13px; color: var(--amber); width: 40px; flex: none; padding-top: 8px; }
.work-row .body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.work-row h3 { font-size: 28px; line-height: 1.2; }
.work-row p { color: var(--dim); font-size: 16px; line-height: 1.6; max-width: 66ch; }
.work-row .meta { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.work-row .arrow { color: var(--faint); padding-top: 8px; }

/* case study entries (work index) */
.case-entry { padding: 44px 0 48px; border-bottom: 1px solid var(--line); text-decoration: none; display: block; }
.case-entry:hover h2 { color: var(--amber); }
.case-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.case-meta { display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.case-meta .n { color: var(--amber); font-size: 13px; }
.case-entry h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.18; max-width: 24ch; transition: color .15s; }
.case-entry .desc { margin-top: 16px; color: var(--dim); font-size: 16.5px; line-height: 1.75; max-width: 64ch; }
.metrics { display: flex; flex-wrap: wrap; gap: 56px; margin: 28px 0 24px; }
.metrics .value { font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.1; color: var(--amber); }
.metrics .label { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 4px; }

/* --------------------------------------------------------- open source ---- */

.featured-pkg { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; padding: 44px; }
.featured-pkg h2 { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.05; }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 6px 0; }
.feature-grid span { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.feature-grid svg { color: var(--sage); }

.install {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--inset); font-family: var(--mono); font-size: 13.5px; color: var(--sage);
  width: 100%; cursor: pointer; text-align: left;
}
.install:hover { border-color: var(--line-strong); }
.install svg { color: var(--faint); }

.snippet { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--inset); }
.snippet pre { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--dim); white-space: pre-wrap; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; }
.kv dt { color: var(--faint); }
.kv dd { color: var(--dim); text-align: right; }

.pkg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pkg-head .name { font-family: var(--mono); font-weight: 500; font-size: 16px; }
.pkg-head .lang { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ------------------------------------------------------------------ books */

.book-block { display: grid; grid-template-columns: 320px 1fr; gap: 64px; align-items: start; padding: 72px 0; }
.book-block.reverse { grid-template-columns: 1fr 320px; }
.book-block.reverse .book-cover { order: 2; }

.book-cover {
  width: 320px; aspect-ratio: 5 / 8; padding: 22px; border-radius: 8px;
  border: 1px solid var(--line-strong);
  display: flex; flex-direction: column; justify-content: space-between;
  background-image: linear-gradient(140deg, var(--c-from), var(--c-to));
}
.book-cover .bc-press { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.2em; color: #9A8C82; }
.book-cover .bc-series { font-family: var(--mono); font-size: 8px; letter-spacing: 0.18em; color: #6E635C; margin-top: 9px; }
.book-cover .bc-hr { height: 1px; background: rgba(255,255,255,.1); margin-top: 9px; }
.book-cover .bc-title { font-family: var(--body); font-weight: 700; font-size: 34px; line-height: 1.06; letter-spacing: -0.03em; color: #F5EFE7; margin-top: 16px; }
.book-cover .bc-title b { display: block; font-weight: 700; color: var(--c-accent); }
.book-cover .bc-sub { font-family: var(--body); font-size: 10.5px; line-height: 1.45; color: #C4BAB2; margin-top: 10px; }
.book-cover .bc-art { display: flex; align-items: center; justify-content: center; flex: 1; }
.book-cover .bc-ring { width: 130px; height: 130px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; }
.book-cover .bc-disc { width: 92px; height: 92px; border-radius: 50%; background: linear-gradient(90deg, var(--c-accent) 0 50%, #FFC93C 50% 100%); }
.book-cover .bc-code { color: var(--c-accent); }
.book-cover .bc-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.book-cover .bc-tags span { padding: 4px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 100px; font-family: var(--mono); font-size: 7.5px; letter-spacing: 0.1em; color: #B5AAA2; }
.book-cover .bc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; }
.book-cover .bc-foot .a { font-family: var(--body); font-weight: 600; font-size: 11px; color: #F5EFE7; }
.book-cover .bc-foot .p { font-family: var(--mono); font-size: 7.5px; letter-spacing: 0.15em; color: #8A7E76; }

.book-info h2 { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.08; }
.book-info .sub { font-family: var(--display); font-style: italic; font-size: 20px; line-height: 1.5; color: var(--dim); margin-top: 12px; }
.book-info .desc { margin-top: 18px; color: var(--dim); font-size: 16.5px; line-height: 1.8; max-width: 62ch; }
.book-info .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--amber); }
.inside { margin: 22px 0; display: flex; flex-direction: column; gap: 10px; }
.inside .label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; color: var(--faint); }
.inside li { display: flex; gap: 10px; align-items: flex-start; list-style: none; color: var(--dim); font-size: 15px; line-height: 1.6; }
.inside li svg { color: var(--amber-deep); margin-top: 3px; }

/* -------------------------------------------------------------- blog list */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 26px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 100px;
  font-family: var(--mono); font-size: 12.5px; color: var(--dim);
  background: none; cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--amber-soft); border-color: var(--amber-deep); color: var(--amber); }

.search { display: flex; align-items: center; gap: 9px; width: 230px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raise); }
.search svg { color: var(--faint); }
.search input { flex: 1; background: none; border: 0; color: var(--text); font-family: var(--mono); font-size: 13px; outline: none; }
.search input::placeholder { color: var(--faint); }

.featured-post { display: grid; grid-template-columns: 420px 1fr; gap: 44px; align-items: start; padding: 36px 0 56px; text-decoration: none; }
.post-visual {
  aspect-ratio: 3 / 2; border-radius: var(--radius); border: 1px solid var(--line);
  background-image: linear-gradient(130deg, #37291A, #110E0A);
  display: flex; align-items: flex-end; padding: 24px;
  font-family: var(--mono); font-size: 15px; color: var(--amber-deep);
}
.featured-post h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); line-height: 1.18; margin: 16px 0; }
.featured-post:hover h2 { color: var(--amber); }
.featured-post .excerpt { color: var(--dim); font-size: 17px; line-height: 1.75; max-width: 62ch; }
.post-meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--amber); }

.post-card { text-decoration: none; }
.post-card h3 { font-size: 20px; line-height: 1.3; }
.post-card p { font-size: 14.5px; line-height: 1.6; color: var(--dim); }
.post-card .date { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: auto; }
.post-card .post-meta { font-size: 11.5px; }

/* ----------------------------------------------------------- article page */

.article-layout { display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 96px; align-items: start; padding: 64px 0 80px; }
.article-layout.sidebar-right { grid-template-columns: minmax(0, 680px) 300px; gap: 80px; }

.toc { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 14px; }
.toc .label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; color: var(--amber); }
.toc a {
  display: block; padding-left: 12px; border-left: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.5; color: var(--dim); text-decoration: none;
}
.toc a:hover, .toc a.is-active { color: var(--text); border-left-color: var(--amber); }

.byline { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 26px; flex-wrap: wrap; }
.byline-author { display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(140deg, #E8A13C, #8A5A18); flex: none; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; color: var(--ink); }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.byline .name { font-weight: 600; font-size: 14px; }
.byline .meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.share { display: flex; gap: 10px; }
.share a { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--dim); }
.share a:hover { color: var(--amber); border-color: var(--amber-deep); }

.breadcrumb { display: flex; gap: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--faint); margin-bottom: 22px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--amber); }
.breadcrumb .here { color: var(--amber); }

.standfirst { font-size: 19px; line-height: 1.7; color: var(--dim); max-width: 60ch; margin-top: 22px; }

/* prose — rendered markdown */
.prose { font-size: 17.5px; line-height: 1.9; color: var(--dim); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: 27px; line-height: 1.25; color: var(--text); margin-top: 2em; }
.prose h3 { font-size: 21px; line-height: 1.3; color: var(--text); margin-top: 1.8em; }
.prose h4 { font-size: 18px; color: var(--text); margin-top: 1.6em; }
.prose a { color: var(--amber); text-decoration: none; border-bottom: 1px solid var(--amber-deep); }
.prose a:hover { color: var(--text); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--amber-deep); }
.prose blockquote {
  border-left: 2px solid var(--amber-deep); padding: 4px 0 4px 26px;
  font-family: var(--display); font-style: italic; font-size: 22px; line-height: 1.55; color: var(--text);
}
.prose blockquote p { margin: 0; }
.prose code {
  font-family: var(--mono); font-size: .86em; color: var(--sage);
  background: var(--inset); padding: 2px 6px; border-radius: 4px;
}
.prose pre {
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 20px 22px; overflow-x: auto;
}
.prose pre code { background: none; padding: 0; font-size: 13px; line-height: 1.7; color: var(--dim); }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }

.author-card { display: flex; gap: 20px; align-items: flex-start; margin-top: 56px; }
.author-card p { font-size: 15px; line-height: 1.7; color: var(--dim); margin-top: 8px; }
.author-card .links { display: flex; gap: 16px; margin-top: 12px; font-family: var(--mono); font-size: 12.5px; }
.author-card .links a { color: var(--faint); text-decoration: none; }
.author-card .links a:first-child { color: var(--amber); }

/* -------------------------------------------------------- case study page */

.metric-band { background: var(--raise); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 36px 0; }
.metric-band .proof-inner .value { color: var(--amber); }

.sidebar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; position: sticky; top: 110px; }
.sidebar .head { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--amber); margin-bottom: 20px; }
.sidebar .row + .row { margin-top: 18px; }
.sidebar .k { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.sidebar .v { font-size: 15px; line-height: 1.5; margin-top: 4px; }

.flow { display: flex; align-items: center; gap: 10px; padding: 28px 24px; background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.flow .node { flex: 1; min-width: 130px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 14px; }
.flow .node .t { font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--text); }
.flow .node .s { font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--faint); margin-top: 6px; }
.flow svg { color: var(--amber-deep); }

.next-case { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 52px 0; text-decoration: none; }
.next-case .label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--amber); }
.next-case h2 { font-size: 28px; line-height: 1.2; margin-top: 8px; }
.next-case:hover h2 { color: var(--amber); }

/* -------------------------------------------------------------- about ---- */

.about-header { display: grid; grid-template-columns: 1fr 340px; gap: 72px; align-items: start; padding: 88px 0 72px; }
.about-header p { color: var(--dim); font-size: 18px; line-height: 1.8; max-width: 60ch; }
.about-header p + p { margin-top: 18px; }
.portrait {
  aspect-ratio: 17 / 20; border-radius: var(--radius); border: 1px solid var(--line);
  background-image: linear-gradient(135deg, #382A1B, #100D09);
  background-size: cover; background-position: center;
  display: flex; align-items: flex-end; padding: 24px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: var(--faint);
}

.timeline-row { display: flex; gap: 44px; align-items: flex-start; padding: 26px 0 28px; border-bottom: 1px solid var(--line); }
.timeline-row .year { font-family: var(--mono); font-size: 14px; color: var(--amber); width: 90px; flex: none; }
.timeline-row h3 { font-size: 22px; line-height: 1.25; }
.timeline-row p { color: var(--dim); font-size: 16px; line-height: 1.75; margin-top: 8px; max-width: 66ch; }

.stack-row { display: flex; gap: 36px; align-items: flex-start; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.stack-row + .stack-row { margin-top: 24px; }
.stack-row .label { font-family: var(--mono); font-size: 12.5px; color: var(--faint); width: 190px; flex: none; }

.step { padding-top: 28px; border-top: 2px solid var(--line-strong); }
.step .num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--amber); }
.step h3 { font-size: 22px; line-height: 1.25; margin-top: 14px; }
.step p { color: var(--dim); font-size: 15.5px; line-height: 1.7; margin-top: 14px; }

/* ------------------------------------------------------------- contact --- */

.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 72px; align-items: start; padding: 24px 0 88px; }

.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.field > label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--dim); }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--inset); color: var(--text); font-family: var(--body); font-size: 15px;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.submit-row .note { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }

.booking { background: var(--card); border: 1px solid var(--amber-deep); border-radius: var(--radius); padding: 26px; }
.booking .head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; }
.booking .head .l { color: var(--amber); }
.booking .head .r { color: var(--faint); font-size: 11px; letter-spacing: 0; }
.booking h2 { font-size: 21px; line-height: 1.3; margin-top: 16px; }
.booking p { color: var(--dim); font-size: 14px; line-height: 1.6; margin-top: 8px; }
.booking .slots { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.booking .slot { display: flex; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--inset); font-family: var(--mono); font-size: 12.5px; }
.booking .slot .t { color: var(--dim); }
.booking .foot { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 12px; }

.contact-card { background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.contact-card + .contact-card, .booking + .contact-card { margin-top: 20px; }
.contact-card .head { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--amber); margin-bottom: 16px; }
.contact-card.plain { background: none; }
.contact-card.plain .head { color: var(--faint); }
.direct { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; }
.direct + .direct { margin-top: 14px; }
.direct svg { color: var(--dim); margin-top: 3px; }
.direct .t { font-weight: 500; font-size: 14.5px; line-height: 1.4; }
.direct .s { font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--faint); margin-top: 3px; }
.direct:hover .t { color: var(--amber); }
.numbered { display: flex; gap: 12px; align-items: flex-start; }
.numbered + .numbered { margin-top: 16px; }
.numbered .n { font-family: var(--mono); font-size: 11.5px; color: var(--amber-deep); }
.numbered .t { font-size: 14.5px; line-height: 1.65; color: var(--dim); }

.faq-row { display: flex; gap: 48px; align-items: flex-start; padding: 26px 0 28px; border-bottom: 1px solid var(--line); }
.faq-row h3 { font-size: 20px; line-height: 1.35; width: 400px; flex: none; }
.faq-row p { color: var(--dim); font-size: 16px; line-height: 1.75; }

/* ---------------------------------------------------------- testimonials */

.quote-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; display: flex; flex-direction: column; gap: 22px; }
.quote-card blockquote { font-family: var(--display); font-size: 19px; line-height: 1.6; color: var(--text); }
.quote-card .by { display: flex; gap: 12px; align-items: center; margin-top: auto; }
.quote-card .by .name { font-weight: 600; font-size: 14.5px; }
.quote-card .by .role { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.quote-card .avatar { background: var(--amber-soft); border: 1px solid var(--amber-deep); color: var(--amber); }

/* ------------------------------------------------------------- final CTA */

.final-cta { padding: 104px 0; text-align: center; }
.final-cta h2 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.1; max-width: 18ch; margin: 0 auto; }
.final-cta p { margin: 22px auto 0; max-width: 52ch; color: var(--dim); font-size: 17px; line-height: 1.65; }
.final-cta .btn-row { justify-content: center; margin-top: 26px; }
.final-cta .note { margin-top: 22px; font-family: var(--mono); font-size: 12px; color: var(--faint); }

.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 48px; padding: 72px 0; flex-wrap: wrap; }
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; }
.cta-band p { color: var(--dim); font-size: 16px; margin-top: 10px; }

/* ------------------------------------------------------------ newsletter */

.newsletter-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.newsletter-copy h2 { font-size: 32px; line-height: 1.15; }
.newsletter-copy p { color: var(--dim); font-size: 16px; line-height: 1.6; margin-top: 8px; max-width: 52ch; }
.newsletter-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: relative; }
.newsletter-form input[type="email"] {
  width: 260px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--ink); color: var(--text); font-family: var(--mono); font-size: 14px;
}
.newsletter-form input::placeholder { color: var(--faint); }
.form-msg { flex-basis: 100%; font-size: 14px; min-height: 0; }
.form-msg.ok { color: var(--amber); }
.form-msg.err { color: var(--danger); }

/* inline newsletter card used inside the home writing section */
.newsletter-card { background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; margin-top: 24px; }
.newsletter-card .newsletter-inner { gap: 32px; }

/* ------------------------------------------------------------------ ads */

.ad { display: flex; flex-direction: column; gap: 8px; margin: 40px 0; }
.ad-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--faint);
}
.ad ins { width: 100%; }

/* Inside prose the injected unit needs to sit apart from the paragraphs. */
.prose .ad { margin: 2.2em 0; }

.ad-sidebar { margin: 24px 0 0; }

/* Below 1080px the TOC stops being a sidebar and stacks above the article,
   so a unit in there would land between the header and the first paragraph.
   That reads as an interstitial. Hide it and let the in-article one work. */
@media (max-width: 1080px) {
  .ad-sidebar { display: none; }
}

/* ---------------------------------------------------------------- footer */

.footer { background: var(--inset); border-top: 1px solid var(--line); padding: 72px 0 52px; }
.footer-top { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.footer-brand { max-width: 340px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.footer-tagline { font-size: 14px; line-height: 1.6; color: var(--dim); }
.footer-contact { font-family: var(--mono); font-size: 13px; line-height: 1.9; }
.footer-contact a { color: var(--dim); text-decoration: none; }
.footer-contact a:first-child { color: var(--amber); }
.footer-contact a:hover { color: var(--text); }
.footer-cols { display: flex; gap: 72px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-head { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--amber); }
.footer-col a { font-size: 14px; color: var(--dim); text-decoration: none; }
.footer-col a:hover { color: var(--amber); }
.footer .rule { margin: 44px 0; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.footer-bottom .fin { font-family: var(--display); font-style: italic; font-size: 15px; }

/* ----------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .terminal { max-width: 460px; }
  .article-layout { grid-template-columns: 1fr; gap: 40px; }
  .article-layout.sidebar-right { grid-template-columns: 1fr; }
  .toc, .sidebar { position: static; }
  .about-header, .contact-layout, .featured-pkg, .featured-post { grid-template-columns: 1fr; gap: 40px; }
  .book-block, .book-block.reverse { grid-template-columns: 1fr; gap: 40px; }
  .book-block.reverse .book-cover { order: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-cols { gap: 48px; }
}

@media (max-width: 860px) {
  :root { --section-y: 64px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .faq-row { flex-direction: column; gap: 12px; }
  .faq-row h3 { width: auto; }
  .stack-row { flex-direction: column; gap: 14px; }
  .stack-row .label { width: auto; }
  .timeline-row { flex-direction: column; gap: 10px; }
  .metrics { gap: 32px; }
  .section-head.split { align-items: flex-start; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink); border-bottom: 1px solid var(--line); padding: 8px 0;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 14px var(--gutter); font-size: 15px; }
  .nav-cta { margin: 12px var(--gutter); justify-content: center; }
  .nav-inner { position: relative; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid-4 { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .form { padding: 24px; }
  .book-cover { width: 100%; max-width: 300px; }
  .work-row { gap: 16px; }
  .work-row .idx { width: 28px; }
  .newsletter-form input[type="email"] { width: 100%; }
  .newsletter-form .btn { width: 100%; justify-content: center; }
  .prose { font-size: 16.5px; }
}
