/* =============================================================================
   Roona — shared design system
   -----------------------------------------------------------------------------
   One stylesheet behind the homepage, the blog and the legal documents, so the
   tokens can't drift between them (they had, in three places).

   Two typefaces, both self-hosted — the privacy policy leans hard on "we don't
   leak you", so the site makes zero third-party requests and this is part of
   keeping that true.

     Fraunces           display only: page-level headings, pull quotes.
                        A soft, low-contrast old-style with a real optical-size
                        axis, so the 84px hero is a genuinely different cut from
                        the 24px article heading rather than the same drawing
                        scaled up. Warm and hand-set rather than luxury-serif.
     Plus Jakarta Sans  everything else: body, UI, and the small caps labels.

   The structural device throughout is the JOURNAL RAIL — a narrow margin column
   holding a label, a hairline, then the content. Roona is a journal; a page of
   dated entries with a margin is what one looks like. It replaces the centred
   eyebrow-over-heading pattern that every section used to repeat.
   ========================================================================== */

/* --- Faces ---------------------------------------------------------------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, 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: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/fraunces-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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens --------------------------------------------------------------- */
:root {
  --r50: #fff5f8;
  --r100: #fce8ee;
  --r200: #f7cbd7;
  --r300: #efa6b8;
  --r400: #e07b98;
  --r500: #c84f76;
  --r600: #a83b61;
  --r700: #8f294f;
  --r800: #71203e;
  --r900: #54172e;
  --r950: #35101e;

  --rose: #d96c87;
  --peach: #f3a18f;
  --plum: #2b1e24;
  --mauve: #6f5c65;
  --success: #4f9075;
  --warning: #d79045;
  --danger: #c94e5e;
  --ai: #7375b8;
  --hydration: #5595ae;

  --text: var(--plum);
  --muted: var(--mauve);
  --background: #fff7f6;
  --surface: #fffbfa;
  /* Opaque, not translucent-with-blur. Frosted glass is the stock SaaS card;
     Roona's cards are meant to read as paper. Only the floating nav, which
     genuinely sits over moving content, stays translucent. */
  --card: #fffbfa;
  --card-solid: #fffbfa;
  --border: #f0e2e6;
  --line: #e8d7dc;
  --soft: rgba(143, 41, 79, 0.06);
  --nav: rgba(255, 251, 250, 0.82);

  --gradient: linear-gradient(135deg, #8f294f 0%, #d96c87 54%, #f3a18f 100%);
  --gradient-deep: linear-gradient(145deg, #54172e 0%, #8f294f 58%, #d96c87 100%);

  --shadow-sm: 0 2px 4px rgba(83, 29, 51, 0.03), 0 10px 30px rgba(83, 29, 51, 0.05);
  --shadow-md: 0 4px 10px rgba(83, 29, 51, 0.04), 0 22px 60px rgba(83, 29, 51, 0.09);
  --shadow-lg: 0 8px 20px rgba(83, 29, 51, 0.06), 0 40px 100px rgba(83, 29, 51, 0.16);

  --container: 1180px;
  --measure: 39rem; /* ~68 characters — the reading column */
  --gutter: 40px;
  --rail: 150px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-press: 160ms;
  --dur-hover: 200ms;
  --dur-menu: 240ms;
  --dur-reveal: 560ms;

  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
}

body.dark {
  --text: #fdf2f5;
  --muted: #c3a7b2;
  --background: #171014;
  --surface: #21161b;
  --card: #21161b;
  --card-solid: #21161b;
  --border: #3d2932;
  --line: #46303a;
  --soft: rgba(239, 166, 184, 0.08);
  --nav: rgba(33, 22, 27, 0.78);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2), 0 10px 30px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.24), 0 22px 60px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.3), 0 40px 100px rgba(0, 0, 0, 0.46);
}

/* --- Base ----------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 8% -10%, color-mix(in srgb, var(--rose) 14%, transparent), transparent 36rem),
    radial-gradient(circle at 96% 2%, color-mix(in srgb, var(--peach) 16%, transparent), transparent 32rem),
    var(--background);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* The theme flip swaps every token at once; without this the cards and borders
   snap while the page background fades. Added for the length of the fade only,
   so it never puts lag on hover or press. */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition:
    background-color 260ms ease, border-color 260ms ease,
    color 260ms ease, fill 260ms ease, box-shadow 260ms ease;
}

a { color: inherit; }
img, svg { display: block; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

::selection { color: var(--r900); background: var(--r200); }
body.dark ::selection { color: var(--r50); background: var(--r700); }

/* Zero-specificity, so any component that styles its own focus still wins. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--r500);
  outline-offset: 3px;
}

.container {
  width: min(var(--container), calc(100% - var(--gutter)));
  margin-inline: auto;
}

.visually-hidden, .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* --- Type ----------------------------------------------------------------- */
h1, h2, h3, h4, p { margin-top: 0; }

/* Display face, set optically — `opsz` is the axis doing the work, giving the
   hero a genuinely different cut from a 24px heading rather than the same
   drawing scaled up. Fraunces also has SOFT and WONK axes; both were tried and
   dropped, because at these sizes the difference was invisible in a
   side-by-side and the four-axis build costs 52KB more. */
.display, h1.display, .doc-header h1, .blog-lead-title, .blog-card-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h1.display {
  font-size: clamp(3rem, 7.2vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

h2.display {
  font-size: clamp(2rem, 3.8vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.028em;
}

/* The utility face: small caps labels for dates, topics, and rail headings. */
.kicker {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--r600);
  line-height: 1.4;
}
body.dark .kicker { color: var(--r300); }
.kicker-muted { color: var(--muted); }
/* Browsers underline bare <a> by default, which reads as an accident at this
   size and tracking. Hover restores it. */
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; text-underline-offset: 3px; }

p { text-wrap: pretty; }

/* --- The journal rail ----------------------------------------------------- */
/* A margin column with a label, a hairline, then the content. */
.rail {
  display: grid;
  grid-template-columns: minmax(0, var(--rail)) minmax(0, 1fr);
  gap: clamp(22px, 3.5vw, 54px);
  align-items: start;
}

.rail-margin {
  position: relative;
  padding-top: 6px;
}

.rail-margin::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: -4px;
  right: calc(clamp(22px, 3.5vw, 54px) / -2);
  width: 1px;
  background: linear-gradient(180deg, var(--line), transparent);
}

@media (max-width: 860px) {
  .rail { grid-template-columns: 1fr; gap: 14px; }
  .rail-margin::after { display: none; }
}

/* --- Buttons -------------------------------------------------------------- */
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  transition:
    transform var(--dur-press) var(--ease-out),
    box-shadow var(--dur-hover) ease,
    background-color var(--dur-hover) ease,
    border-color var(--dur-hover) ease;
}

.button svg { transition: transform var(--dur-hover) var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .button:hover { transform: translateY(-2px); }
  .button:hover svg { transform: translateX(2px); }
}

/* After :hover so a press always wins, and faster — the system's answer should
   outrun the question. */
.button:active { transform: scale(0.97); transition-duration: 100ms; }

.button-primary {
  color: #fff;
  background: var(--r700);
  box-shadow: 0 10px 24px rgba(143, 41, 79, 0.22);
}
@media (hover: hover) and (pointer: fine) {
  .button-primary:hover {
    background: var(--r800);
    box-shadow: 0 16px 32px rgba(143, 41, 79, 0.28);
  }
}

.button-secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}
@media (hover: hover) and (pointer: fine) {
  .button-secondary:hover { border-color: var(--rose); background: var(--soft); }
}

.button-small { min-height: 42px; padding-inline: 17px; font-size: 13px; }

.icon-button, .icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--card-solid);
  cursor: pointer;
  transition:
    transform var(--dur-press) var(--ease-out),
    background-color var(--dur-hover) ease,
    border-color var(--dur-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .icon-button:hover, .icon-btn:hover { background: var(--soft); border-color: var(--rose); }
}
.icon-button:active, .icon-btn:active { transform: scale(0.94); transition-duration: 100ms; }

/* Sun and moon cross-rotate, so the control shows the mode you're about to get
   rather than the one you're already in. Never from scale(0). */
.theme-icon { position: relative; width: 18px; height: 18px; }
.theme-icon svg {
  position: absolute; inset: 0;
  transition: opacity var(--dur-menu) var(--ease-out), transform var(--dur-menu) var(--ease-out);
}
.theme-icon .sun { opacity: 0; transform: rotate(-70deg) scale(0.6); }
body.dark .theme-icon .sun { opacity: 1; transform: none; }
body.dark .theme-icon .moon { opacity: 0; transform: rotate(70deg) scale(0.6); }

/* --- Brand ---------------------------------------------------------------- */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-weight: 800; letter-spacing: -0.035em;
  transition: transform var(--dur-press) var(--ease-out);
}
.brand:active { transform: scale(0.97); }
.brand-mark {
  position: relative; width: 38px; aspect-ratio: 1;
  overflow: hidden; border-radius: 12px;
  background: url("/icon-192.png") center / cover no-repeat;
  box-shadow: 0 6px 16px rgba(143, 41, 79, 0.2);
}
.brand-name { font-size: 19px; }
.brand-dot { color: var(--rose); }

/* --- Document navigation (blog + legal) ----------------------------------- */
.doc-nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--nav);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.doc-nav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-link {
  text-decoration: none; color: var(--muted);
  font-weight: 650; font-size: 13.5px;
  padding: 9px 13px; border-radius: 999px;
  transition: color var(--dur-hover) ease, background-color var(--dur-hover) ease;
}
.nav-link:hover { color: var(--r700); background: var(--soft); }
body.dark .nav-link:hover { color: var(--r300); }

/* --- Footer --------------------------------------------------------------- */
.doc-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 44px;
  margin-top: 56px;
}
.doc-footer .container {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: space-between; align-items: center;
}
.doc-footer a {
  color: var(--muted); text-decoration: none;
  font-weight: 600; font-size: 13.5px;
  transition: color var(--dur-hover) ease;
}
.doc-footer a:hover { color: var(--text); }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-copy { color: var(--muted); font-size: 13.5px; }
.foot-social { display: flex; gap: 15px; align-items: center; }
.foot-social a {
  display: inline-flex; color: var(--muted);
  transition: color var(--dur-hover) ease, transform var(--dur-press) var(--ease-out);
}
.foot-social a:hover { color: var(--r700); }
@media (hover: hover) and (pointer: fine) {
  .foot-social a:hover { transform: translateY(-2px); }
}
.foot-social a:active { transform: scale(0.9); transition-duration: 100ms; }
.foot-social svg { width: 18px; height: 18px; display: block; fill: currentColor; }

/* =============================================================================
   Documents — legal pages, FAQ, 404
   ========================================================================== */
body.doc { --container: 860px; }

.doc-header { padding: 64px 0 8px; }
.doc-header h1 {
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}
.doc-meta { color: var(--muted); font-size: 14.5px; margin: 0; }
.doc-lead {
  font-size: 19px; line-height: 1.7; color: var(--muted);
  margin: 18px 0 0; max-width: var(--measure);
}

/* Legacy pill eyebrow, kept for the legal pages' fixed markup. */
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.15em;
  font-size: 11px; font-weight: 800; color: var(--r600);
  padding: 6px 13px; border-radius: 999px; background: var(--soft); margin-bottom: 18px;
}
body.dark .eyebrow { color: var(--r300); }
.eyebrow a { color: inherit; text-decoration: none; }

.doc-body { padding: 30px 0 40px; }
.doc-body section { scroll-margin-top: 92px; }
.doc-body h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 27px;
  letter-spacing: -0.02em;
  margin: 44px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.doc-body section:first-of-type h2 { border-top: 0; padding-top: 0; margin-top: 8px; }
.doc-body h3 { font-size: 17px; margin: 26px 0 8px; }
.doc-body p, .doc-body li { color: color-mix(in srgb, var(--text) 86%, transparent); }
.doc-body ul { padding-left: 22px; }
.doc-body li { margin: 7px 0; }
.doc-body li strong { color: var(--text); }
.doc-body a { color: var(--r600); text-decoration: underline; text-underline-offset: 2px; }
body.dark .doc-body a { color: var(--r300); }

.toc {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 26px; margin: 26px 0 8px; box-shadow: var(--shadow-sm);
}
.toc h2 {
  font-family: var(--font-body); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.15em; color: var(--muted); font-weight: 800;
  border: 0; margin: 0 0 12px; padding: 0;
}
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.toc li { margin: 5px 0; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--r600); }
body.dark .toc a:hover { color: var(--r300); }

.note {
  border: 1px solid var(--border); border-left: 3px solid var(--ai);
  background: var(--card); border-radius: var(--radius-md);
  padding: 16px 18px; margin: 20px 0;
}
.note strong { color: var(--text); }

.data-list { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin: 18px 0; }
.data-list .row { display: grid; grid-template-columns: 210px 1fr; border-top: 1px solid var(--border); }
.data-list .row:first-child { border-top: 0; }
.data-list .k { padding: 14px 18px; font-weight: 700; background: var(--soft); }
.data-list .v { padding: 14px 18px; color: color-mix(in srgb, var(--text) 86%, transparent); }

details.faq {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); margin: 12px 0; padding: 4px 20px; box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-menu) ease;
}
details.faq[open] { border-color: color-mix(in srgb, var(--r700) 24%, var(--border)); }
details.faq summary {
  cursor: pointer; list-style: none; font-weight: 700; font-size: 17px;
  padding: 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+"; font-size: 22px; color: var(--r600); font-weight: 400;
  transition: transform 260ms var(--ease-out);
}
body.dark details.faq summary::after { color: var(--r300); }
details.faq[open] summary::after { transform: rotate(135deg); }
details.faq .faq-body { padding: 0 0 18px; color: color-mix(in srgb, var(--text) 86%, transparent); }
details.faq .faq-body p:first-child { margin-top: 0; }

/* =============================================================================
   Blog
   ========================================================================== */
body.blog { --container: 1200px; }

/* Reading progress — a genuine orientation aid on a 1,200-word article, and the
   one place a scroll-linked animation earns its keep. */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 40;
  background: var(--gradient);
  transform-origin: 0 50%;
  transform: scaleX(0);
  animation: read-progress linear both;
  animation-timeline: scroll(root block);
}
@keyframes read-progress { to { transform: scaleX(1); } }

/* --- Blog masthead -------------------------------------------------------- */
.blog-masthead { padding: 68px 0 0; }
.blog-masthead h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 0.99;
  letter-spacing: -0.035em;
  margin: 10px 0 0;
  text-wrap: balance;
}
.blog-masthead .doc-lead { margin-top: 16px; }

/* --- Search + topics ------------------------------------------------------ */
.blog-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin: 34px 0 0; padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.blog-search { display: flex; flex: 1 1 280px; gap: 8px; align-items: center; }
.blog-search input[type="search"] {
  flex: 1 1 auto; min-width: 0; font-size: 15px;
  padding: 12px 16px; color: var(--text);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color var(--dur-hover) ease, box-shadow var(--dur-hover) ease;
}
.blog-search input[type="search"]:hover { border-color: var(--rose); }
.blog-search input[type="search"]:focus-visible {
  outline: none; border-color: var(--r500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--r500) 18%, transparent);
}
.blog-search button {
  font-weight: 700; font-size: 14px; padding: 12px 20px; cursor: pointer;
  color: #fff; background: var(--r700); border: 0; border-radius: 999px;
  transition: background-color var(--dur-hover) ease, transform var(--dur-press) var(--ease-out);
}
.blog-search button:hover { background: var(--r800); }
.blog-search button:active { transform: scale(0.97); transition-duration: 100ms; }
.blog-search-clear { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }

/* Topics as a single scrolling rail rather than a four-line wall of pills. */
.blog-tags {
  display: flex; gap: 7px; flex-wrap: wrap;
  margin: 0; padding: 0;
}
.blog-toolbar .blog-tags {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  flex: 1 1 100%; padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  /* Fade the right edge, so a topic clipped by the container reads as "keep
     scrolling" rather than as a broken layout. */
  mask-image: linear-gradient(90deg, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.blog-toolbar .blog-tags::-webkit-scrollbar { display: none; }
.blog-tag {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 14px; font-size: 13px; font-weight: 650;
  color: var(--muted); text-decoration: none;
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px;
  transition: color var(--dur-hover) ease, border-color var(--dur-hover) ease,
    background-color var(--dur-hover) ease;
}
.blog-tag:hover { color: var(--text); border-color: var(--rose); }
.blog-tag.is-active { color: #fff; background: var(--r700); border-color: transparent; }
.blog-tag-count { font-size: 11px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.blog-result-count { color: var(--muted); font-size: 14px; margin: 20px 0 0; }

/* --- Lead story ----------------------------------------------------------- */
/* Page one gets a front-page treatment: the newest piece at full width with its
   photograph, then everything else in the grid. A blog index with no hierarchy
   reads as an archive; this reads as an issue. */
.blog-lead { margin: 32px 0 0; }
.blog-lead-link {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(24px, 3.5vw, 48px);
  align-items: center;
  text-decoration: none; color: inherit;
  padding: 0;
}
.blog-lead-media {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--soft);
  aspect-ratio: 3 / 2;
}
.blog-lead-media img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform 600ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .blog-lead-link:hover .blog-lead-media img { transform: scale(1.03); }
}
/* These are spans (the whole card is one <a>), so they need blockifying before
   their margins and clamps mean anything. */
.blog-lead-body, .blog-lead-media, .blog-item-media, .blog-item-body { display: block; }
.blog-lead-desc, .blog-item-date { display: block; }

.blog-lead-title {
  display: block;
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  line-height: 1.08;
  margin: 12px 0 12px;
  color: var(--text);
  transition: color var(--dur-hover) ease;
}
.blog-lead-link:hover .blog-lead-title { color: var(--r700); }
body.dark .blog-lead-link:hover .blog-lead-title { color: var(--r300); }
.blog-lead-desc { color: var(--muted); font-size: 16px; margin: 0 0 16px; max-width: 46ch; }

/* --- Article grid --------------------------------------------------------- */
.blog-grid-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin: 60px 0 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.blog-list {
  list-style: none; margin: 26px 0 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: clamp(24px, 2.6vw, 38px) clamp(20px, 2.2vw, 32px);
}
.blog-item { margin: 0; min-width: 0; }
.blog-item-link {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: inherit;
}
.blog-item-thumb {
  width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius-lg); background: var(--soft);
  margin-bottom: 15px;
  transition: transform 600ms var(--ease-out);
}
/* The card lifts nothing; the photograph breathes. A grid of cards that all
   float on hover is noise — this keeps the motion inside the frame. */
.blog-item-media { overflow: hidden; border-radius: var(--radius-lg); margin-bottom: 15px; }
.blog-item-media .blog-item-thumb { margin-bottom: 0; border-radius: 0; }
.blog-item-media.is-empty {
  aspect-ratio: 3 / 2;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--rose) 16%, transparent), transparent 60%),
    radial-gradient(circle at 78% 80%, color-mix(in srgb, var(--peach) 18%, transparent), transparent 62%),
    var(--surface);
}
@media (hover: hover) and (pointer: fine) {
  .blog-item-link:hover .blog-item-thumb { transform: scale(1.04); }
}
.blog-item-body { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.blog-item-link h2 {
  font-size: 19px; line-height: 1.28; letter-spacing: -0.02em;
  margin: 0 0 8px; border: 0; padding: 0; font-weight: 750;
  color: var(--text);
  transition: color var(--dur-hover) ease;
}
.blog-item-link:hover h2 { color: var(--r700); }
body.dark .blog-item-link:hover h2 { color: var(--r300); }
.blog-item-desc {
  color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.blog-item-date {
  color: var(--muted); font-size: 11px; font-weight: 800;
  letter-spacing: 0.13em; text-transform: uppercase; margin-top: auto;
}
.blog-empty { color: var(--muted); font-size: 18px; padding: 40px 0; }

@media (max-width: 860px) {
  .blog-lead-link { grid-template-columns: 1fr; gap: 18px; }
}

/* --- Pagination ----------------------------------------------------------- */
.blog-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 56px 0 0; padding-top: 26px; border-top: 1px solid var(--border);
}
.blog-pager-link {
  font-size: 14px; font-weight: 700; color: var(--r700); text-decoration: none;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px;
  transition: border-color var(--dur-hover) ease, background-color var(--dur-hover) ease;
}
.blog-pager-link:hover { border-color: var(--rose); background: var(--soft); }
body.dark .blog-pager-link { color: var(--r300); }
.blog-pager-link.is-off { color: var(--muted); opacity: 0.45; pointer-events: none; }
.blog-pager-count {
  color: var(--muted); font-size: 11px; font-weight: 800;
  letter-spacing: 0.13em; text-transform: uppercase;
}

/* =============================================================================
   Article
   ========================================================================== */
body.article { --container: 1120px; }

.article-header { padding: 56px 0 0; }
.article-header .rail { align-items: end; }
.article-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2.3rem, 5.2vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.032em;
  margin: 0;
  max-width: 20ch;
  text-wrap: balance;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  margin: 22px 0 0; color: var(--muted);
  font-size: 11px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase;
}
.article-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }

/* The hero breaks out past the reading column — the photograph is the widest
   thing on the page, the text the narrowest. */
.blog-hero { margin: 40px 0 48px; }
/* Cropped to 2:1 rather than the source 3:2. At full container width a 3:2
   hero is 750px tall, which put the entire opening paragraph below the fold on
   a laptop — on an article page, where the reader came to read, that's too much
   ceremony. Biased upward so a centred subject keeps their head. */
.blog-hero img {
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover;
  object-position: 50% 38%;
  border-radius: var(--radius-xl); background: var(--soft);
}
.blog-hero figcaption {
  margin-top: 12px; color: var(--muted); font-size: 13px; max-width: var(--measure);
}

/* The blog index and the article carry their own main classes rather than
   .doc-body, whose prose `a` rule would outrank the card and chip links. */
.blog-body { padding: 34px 0 40px; }
.article-body { padding: 4px 0 40px; }
.article-measure { width: min(var(--measure), 100%); margin-inline: auto; }

/* Hang the prose off the same left edge as the title (which sits in the rail's
   content column), instead of centring it in the container — otherwise the two
   are ~46px apart and the page has no single left margin. The hero still spans
   the full container, so it reads as a breakout from the text. */
@media (min-width: 861px) {
  .article-body .article-measure {
    margin-left: calc(var(--rail) + clamp(22px, 3.5vw, 54px));
    margin-right: 0;
  }
}

.blog-article { color: color-mix(in srgb, var(--text) 87%, transparent); font-size: 17.5px; line-height: 1.78; }
.blog-article > :first-child { margin-top: 0; }
/* The opening paragraph carries a little more weight, the way a standfirst
   does — it's the only typographic signal that the article has started. */
.blog-article > p:first-of-type { font-size: 20px; line-height: 1.62; color: var(--text); }

.blog-article h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 28px; line-height: 1.16; letter-spacing: -0.022em;
  color: var(--text);
  margin: 52px 0 14px;
  padding: 0; border: 0;
  position: relative;
}
/* A short rose rule in the margin instead of a full-width border. The old
   treatment chopped every article into eight visually identical slabs. */
.blog-article h2::before {
  content: "";
  position: absolute; top: -18px; left: 0;
  width: 34px; height: 2px; border-radius: 2px;
  background: var(--rose);
}
.blog-article h3 { font-size: 19px; margin: 34px 0 8px; color: var(--text); letter-spacing: -0.012em; }
.blog-article p, .blog-article li { color: color-mix(in srgb, var(--text) 87%, transparent); }
.blog-article ul, .blog-article ol { padding-left: 20px; }
.blog-article li { margin: 9px 0; }
.blog-article li::marker { color: var(--rose); }
.blog-article li strong, .blog-article p strong { color: var(--text); font-weight: 700; }
.blog-article a { color: var(--r600); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
body.dark .blog-article a { color: var(--r300); }
.blog-article img { max-width: 100%; height: auto; border-radius: var(--radius-md); margin: 26px 0; }

/* A real pull quote, in the display face. */
.blog-article blockquote {
  margin: 36px 0; padding: 0 0 0 26px;
  border-left: 2px solid var(--rose);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: 23px; line-height: 1.42; letter-spacing: -0.015em;
  color: var(--text);
  background: none; border-radius: 0;
}
.blog-article blockquote p:last-child { margin-bottom: 0; }

.blog-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em;
  background: var(--soft); padding: 2px 6px; border-radius: 6px;
}
.blog-article pre {
  background: var(--soft); padding: 16px 18px; border-radius: var(--radius-md);
  overflow-x: auto; border: 1px solid var(--border);
}
.blog-article pre code { background: none; padding: 0; }
.blog-article hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.blog-article table { width: 100%; border-collapse: collapse; margin: 26px 0; font-size: 15px; }
.blog-article th, .blog-article td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.blog-article th { font-weight: 800; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* --- Article furniture ---------------------------------------------------- */
.blog-tags-post { margin: 44px 0 0; padding-top: 26px; border-top: 1px solid var(--border); }
.blog-source { color: var(--muted); font-size: 14px; margin: 18px 0 0; }
.blog-source a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.blog-source a:hover { color: var(--text); }

.blog-author {
  display: flex; gap: 16px; align-items: flex-start;
  margin: 34px 0 0; padding: 22px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card);
}
.blog-author-mark {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 13px; background: var(--gradient);
  color: #fff; font-weight: 800; font-size: 18px;
  font-family: var(--font-display);
}
.blog-author-name { margin: 0 0 6px; font-weight: 700; color: var(--text); }
.blog-author-bio { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; }
.blog-author-disclaimer { margin: 0; color: var(--muted); font-size: 13px; opacity: 0.9; }

.blog-related { margin: 72px 0 0; padding-top: 30px; border-top: 1px solid var(--border); }
.blog-related h2 {
  font-family: var(--font-body); font-size: 11px; font-weight: 800;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 8px; border: 0; padding: 0;
}
.blog-related .blog-list { margin-top: 20px; }

.blog-back { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border); }
.blog-back a { color: var(--r700); text-decoration: none; font-weight: 700; font-size: 14px; }
body.dark .blog-back a { color: var(--r300); }

@media (max-width: 640px) {
  :root { --gutter: 28px; }
  .toc ol { columns: 1; }
  .data-list .row { grid-template-columns: 1fr; }
  .data-list .k { border-bottom: 1px solid var(--border); }
  .nav-link.hide-sm { display: none; }
  .blog-article { font-size: 17px; }
  .blog-article > p:first-of-type { font-size: 18.5px; }
}

/* --- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  /* Fewer and gentler, not none: colour and opacity feedback survives because
     that's what tells you a control registered. Position, scale and the
     ambient loops go. */
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-property: opacity, color, background-color, border-color, box-shadow, fill !important;
    transition-duration: 200ms !important;
  }

  .read-progress { display: none; }
}
