/* ==========================================================================
   qaddodi.github.io — "the lobule"

   The palette is the portal triad: portal-vein blue (simulators), hepatic-
   artery red (cases), bile-duct green (research), and bilirubin amber
   (calculators), on a warm porcelain ground. Type: Fraunces for display,
   Geist for text, Geist Mono for data.
   ========================================================================== */

@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-italic-var.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ---------------------------------------------------------------- tokens */

:root {
  --bg:        #f5f1ea;
  --bg-2:      #ede7dd;
  --surface:   #fffdf9;
  --surface-2: #f9f5ee;
  --ink:       #18141c;
  --ink-2:     #413b47;
  --muted:     #655e6b;
  --line:      #e4ddd2;
  --line-2:    #d0c7b9;
  --art-line:  #d8cfc2;
  --art-ink:   #6a6370;
  --focus:     #2449a8;

  --amber:        #d98a1b;  --amber-ink:   #8a4f00;  --amber-bg:   #fbf0dc;  --amber-wash:   #f3d9ab;  --amber-on:   #2a1700;
  --crimson:      #cc3d52;  --crimson-ink: #a4243a;  --crimson-bg: #fbe8e9;  --crimson-wash: #f4c7cd;  --crimson-on: #ffffff;
  --blue:         #3a6bdf;  --blue-ink:    #2449a8;  --blue-bg:    #e7edfb;  --blue-wash:    #c9d6f7;  --blue-on:    #ffffff;
  --green:        #1e9a77;  --green-ink:   #0e6b51;  --green-bg:   #dff3eb;  --green-wash:   #bce6d6;  --green-on:   #03261b;

  --shadow-1: 0 1px 2px rgb(24 20 28 / .05), 0 2px 8px -2px rgb(24 20 28 / .06);
  --shadow-2: 0 2px 4px rgb(24 20 28 / .04), 0 24px 48px -20px rgb(24 20 28 / .28);
  --shadow-3: 0 30px 80px -24px rgb(24 20 28 / .45);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:    "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wide:  1320px;
  --pad:   clamp(16px, 4vw, 40px);
  --head-h: 64px;
  --r-lg:  24px;
  --r-md:  16px;
  --r-sm:  10px;
  --ease:  cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0d11; --bg-2: #141217; --surface: #18161c; --surface-2: #1e1b22;
    --ink: #f2eee8; --ink-2: #cfc8c1; --muted: #a39ca7; --line: #29252e; --line-2: #3a3541;
    --art-line: #3b3642; --art-ink: #a59ea9; --focus: #a5befa;
    --amber: #f2a93b;  --amber-ink: #f7c37a;  --amber-bg: #1f1810;  --amber-wash: #3d2c12;  --amber-on: #241300;
    --crimson: #f2677b; --crimson-ink: #f79aa7; --crimson-bg: #23131a; --crimson-wash: #48202c; --crimson-on: #2a0610;
    --blue: #7098f7;   --blue-ink: #a5befa;   --blue-bg: #121a2e;   --blue-wash: #203058;   --blue-on: #081433;
    --green: #3fc79e;  --green-ink: #86dfc1;  --green-bg: #0f211c;  --green-wash: #184331;  --green-on: #03241a;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-2: 0 2px 4px rgb(0 0 0 / .3), 0 24px 48px -20px rgb(0 0 0 / .8);
    --shadow-3: 0 30px 80px -24px rgb(0 0 0 / .9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0d11; --bg-2: #141217; --surface: #18161c; --surface-2: #1e1b22;
  --ink: #f2eee8; --ink-2: #cfc8c1; --muted: #a39ca7; --line: #29252e; --line-2: #3a3541;
  --art-line: #3b3642; --art-ink: #a59ea9; --focus: #a5befa;
  --amber: #f2a93b;  --amber-ink: #f7c37a;  --amber-bg: #1f1810;  --amber-wash: #3d2c12;  --amber-on: #241300;
  --crimson: #f2677b; --crimson-ink: #f79aa7; --crimson-bg: #23131a; --crimson-wash: #48202c; --crimson-on: #2a0610;
  --blue: #7098f7;   --blue-ink: #a5befa;   --blue-bg: #121a2e;   --blue-wash: #203058;   --blue-on: #081433;
  --green: #3fc79e;  --green-ink: #86dfc1;  --green-bg: #0f211c;  --green-wash: #184331;  --green-on: #03241a;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-2: 0 2px 4px rgb(0 0 0 / .3), 0 24px 48px -20px rgb(0 0 0 / .8);
  --shadow-3: 0 30px 80px -24px rgb(0 0 0 / .9);
  color-scheme: dark;
}

/* hue families: set on any element and everything inside follows */
.hue-amber   { --c: var(--amber);   --c-ink: var(--amber-ink);   --c-bg: var(--amber-bg);   --c-wash: var(--amber-wash);   --c-on: var(--amber-on); }
.hue-crimson { --c: var(--crimson); --c-ink: var(--crimson-ink); --c-bg: var(--crimson-bg); --c-wash: var(--crimson-wash); --c-on: var(--crimson-on); }
.hue-blue    { --c: var(--blue);    --c-ink: var(--blue-ink);    --c-bg: var(--blue-bg);    --c-wash: var(--blue-wash);    --c-on: var(--blue-on); }
.hue-green   { --c: var(--green);   --c-ink: var(--green-ink);   --c-bg: var(--green-bg);   --c-wash: var(--green-wash);   --c-on: var(--green-on); }
.hue-ink     { --c: var(--ink);     --c-ink: var(--ink);         --c-bg: var(--surface-2);  --c-wash: var(--line);         --c-on: var(--bg); }

/* ------------------------------------------------------------------ base */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 84px);
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; }
svg { display: block; }
::selection { background: var(--blue-wash); color: var(--ink); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  left: 12px; top: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 160ms var(--ease);
}
.skip:focus { transform: none; }

html:not(.js) [data-focus-search],
html:not(.js) [data-theme-toggle],
html:not(.js) .plate-actions,
html:not(.js) .toolbar,
html:not(.js) [data-copy-cite],
html:not(.js) .js-only { display: none !important; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.arrow { display: inline-block; transition: transform 240ms var(--spring); }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  transition: opacity 160ms var(--ease);
}

.live {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--crimson);
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .live { animation: live 2.2s ease-out infinite; }
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--crimson) 50%, transparent); }
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}

/* buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 200ms var(--spring), background-color 180ms var(--ease), border-color 180ms var(--ease), box-shadow 200ms var(--ease);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.btn.sm { min-height: 38px; padding: 0 16px; font-size: .86rem; }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-1); }
.btn-primary:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn-primary:hover .arrow { transform: translateY(3px); }
.btn-ghost { border-color: var(--line-2); background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn-color { background: var(--c); color: var(--c-on); }
.btn-color:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn-color:hover .arrow { transform: translateX(4px); }
.btn-light { background: #f2eee8; color: #18141c; }
.btn-ghost-dark { border-color: rgb(255 255 255 / .22); color: #f2eee8; background: transparent; }

.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: .84rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.text-btn:hover { color: var(--ink); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease), transform 200ms var(--spring);
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.sm svg { width: 17px; height: 17px; }

/* ------------------------------------------------------------------ mark */
.mark { width: 30px; height: 30px; flex: none; }
.mark .m-hex { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.mark .m-sin { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 1.5 1.5; }
.mark .m-pv { fill: var(--blue); }
.mark .m-ha { fill: var(--crimson); }
.mark .m-bd { fill: var(--green); }
.mark .m-cv { fill: var(--amber); }
@media (prefers-reduced-motion: no-preference) {
  .brand:hover .mark { animation: spin-hex 900ms var(--spring); }
}
@keyframes spin-hex { from { transform: rotate(-60deg); } to { transform: rotate(0); } }

/* glyphs (small icons) */
.glyph { display: block; width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }

/* ================================================================ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-inline: var(--pad);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(100%, var(--wide));
  height: var(--head-h);
  margin-inline: auto;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-name {
  font-family: var(--display);
  font-size: 1.28rem;
  font-weight: 500;
  font-variation-settings: "opsz" 36, "SOFT" 50;
  letter-spacing: -.02em;
}
.brand-md {
  margin-left: 7px;
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .06em;
  vertical-align: 3px;
}
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: .92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.topnav a:hover { background: var(--surface); color: var(--ink); }
.nav-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--crimson); }
.topbar-tools { display: flex; align-items: center; gap: 2px; }
[data-theme-toggle] .i-light,
[data-theme-toggle] .i-dark { display: none; }
[data-theme-mode="light"] .i-auto, [data-theme-mode="dark"] .i-auto { display: none; }
[data-theme-mode="light"] .i-light { display: block; }
[data-theme-mode="dark"] .i-dark { display: block; }

/* ================================================================== hero */

.hero {
  position: relative;
  padding: clamp(40px, 7vw, 96px) var(--pad) clamp(36px, 5vw, 64px);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 140%;
  z-index: -1;
  background:
    radial-gradient(40% 45% at 72% 38%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 70%),
    radial-gradient(30% 35% at 88% 70%, color-mix(in srgb, var(--crimson) 10%, transparent), transparent 70%),
    radial-gradient(28% 32% at 58% 78%, color-mix(in srgb, var(--green) 10%, transparent), transparent 70%),
    radial-gradient(30% 30% at 10% 10%, color-mix(in srgb, var(--amber) 10%, transparent), transparent 70%);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 88%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 88%);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  width: min(100%, var(--wide));
  margin-inline: auto;
}

.triad-dots { display: inline-flex; gap: 4px; }
.triad-dots i { width: 8px; height: 8px; border-radius: 50%; }
.h-blue { background: var(--blue); }
.h-crimson { background: var(--crimson); }
.h-green { background: var(--green); }
.h-amber { background: var(--amber); }

.hero h1 {
  margin-top: 22px;
  font-family: var(--display);
  font-size: clamp(3.1rem, 7.4vw, 7.2rem);
  font-weight: 380;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: .9;
  letter-spacing: -.045em;
}
.hero h1 em {
  display: inline-block;
  padding-right: .06em;
  font-style: italic;
  font-weight: 340;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  background: linear-gradient(100deg, var(--blue-ink) 5%, var(--crimson-ink) 45%, var(--amber-ink) 75%, var(--green-ink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  max-width: 33em;
  margin: 26px 0 0;
  color: var(--ink-2);
  font-size: clamp(1.08rem, 1.35vw, 1.24rem);
  line-height: 1.55;
}
.lede strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  margin: 40px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.stats li { display: grid; gap: 2px; }
.stats b {
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 400;
  font-variation-settings: "opsz" 72;
  line-height: 1;
  letter-spacing: -.03em;
}
.stats span { color: var(--muted); font-size: .84rem; }

/* the lobule ---------------------------------------------------------------- */
.lobule { margin: 0; justify-self: center; width: min(100%, 580px); }
.lobule-art {
  transform: perspective(900px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg));
  transition: transform 600ms var(--ease);
}
.lobule .art { width: 100%; height: auto; overflow: visible; }
.lobule figcaption {
  max-width: 34em;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.5;
  text-align: center;
}
.fig-label { color: var(--ink); font-family: var(--mono); font-size: .76rem; font-weight: 500; margin-right: 4px; }

:is(.lobule, .zone-art) .lob-edge { fill: none; stroke: var(--line-2); stroke-width: 1.4; }
:is(.lobule, .zone-art) .lob-far { stroke-dasharray: 3 5; }
:is(.lobule, .zone-art) .cord { stroke: var(--art-line); stroke-width: 5; stroke-linecap: round; stroke-dasharray: .1 9; }
:is(.lobule, .zone-art) .blood { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 3 13; }
:is(.lobule, .zone-art) .blood.b1 { stroke: var(--blue); }
:is(.lobule, .zone-art) .blood.b2 { stroke: color-mix(in srgb, var(--blue) 55%, var(--crimson)); }
:is(.lobule, .zone-art) .blood.b3 { stroke: var(--crimson); }
:is(.lobule, .zone-art) .bile { fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 6 10; opacity: .9; }
:is(.lobule, .zone-art) .pv { fill: var(--blue); }
:is(.lobule, .zone-art) .ha { fill: var(--crimson); }
:is(.lobule, .zone-art) .bd { fill: var(--green); }
:is(.lobule, .zone-art) .triad { transform-box: fill-box; transform-origin: center; }
:is(.lobule, .zone-art) .cv { fill: var(--ink); }
:is(.lobule, .zone-art) .cv-ring { fill: none; stroke: var(--line-2); stroke-width: 1.4; stroke-dasharray: 3 3; transform-box: fill-box; transform-origin: center; }
:is(.lobule, .zone-art) .callout path { fill: none; stroke: var(--muted); stroke-width: 1; }
:is(.lobule, .zone-art) .callout text { fill: var(--muted); font-family: var(--mono); font-size: 13px; paint-order: stroke; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; }

@media (prefers-reduced-motion: no-preference) {
  :is(.lobule, .zone-art) .blood { animation: flow-in 2.6s linear infinite; }
  :is(.lobule, .zone-art) .blood.b2 { animation-duration: 3.1s; }
  :is(.lobule, .zone-art) .blood.b3 { animation-duration: 2.2s; }
  :is(.lobule, .zone-art) .bile { animation: flow-in 3.4s linear infinite; /* outward: bile drains toward the triads */ }
  :is(.lobule, .zone-art) .triad { animation: breathe 5s ease-in-out infinite; }
  :is(.lobule, .zone-art) .tr2 { animation-delay: -.8s; } :is(.lobule, .zone-art) .tr3 { animation-delay: -1.6s; }
  :is(.lobule, .zone-art) .tr4 { animation-delay: -2.4s; } :is(.lobule, .zone-art) .tr5 { animation-delay: -3.2s; } :is(.lobule, .zone-art) .tr6 { animation-delay: -4s; }
  :is(.lobule, .zone-art) .cv-ring { animation: turn 40s linear infinite; }
}
@keyframes flow-in { to { stroke-dashoffset: -32; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes turn { to { transform: rotate(360deg); } }

/* ================================================================= tools */

.tools { padding: 0 0 clamp(56px, 7vw, 96px); }

.toolbar {
  position: sticky;
  top: var(--head-h);
  z-index: 40;
  padding: 12px var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  transition: box-shadow 200ms var(--ease);
}
.toolbar.is-stuck { box-shadow: 0 1px 0 var(--line), 0 12px 24px -20px rgb(0 0 0 / .3); }
.toolbar-inner {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  width: min(100%, var(--wide));
  margin-inline: auto;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 400px;
  min-width: 0;
  height: 48px;
  padding: 0 12px 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: border-color 160ms var(--ease), box-shadow 200ms var(--ease);
  cursor: text;
}
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.search svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .98rem;
  outline: none;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search:focus-within kbd { opacity: 0; }

.filters {
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease), transform 200ms var(--spring);
}
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter:active { transform: scale(.96); }
.filter .dot, .plate-type .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.filter .count { color: var(--muted); font-family: var(--mono); font-size: .76rem; }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter[aria-pressed="true"] .count { color: inherit; opacity: .75; }
.filter[class*="hue-"][aria-pressed="true"] { background: var(--c); border-color: var(--c); color: var(--c-on); }
.filter[class*="hue-"][aria-pressed="true"] .dot { background: var(--c-on); }

.tools-inner {
  width: min(100% - 2 * var(--pad), var(--wide));
  margin: 0 auto;
  padding-top: 14px;
}

.since {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 18px;
  padding: 12px 14px 12px 16px;
  border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line));
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--blue-bg) 70%, var(--surface));
  font-size: .94rem;
}
.since-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; }
.since a { color: var(--blue-ink); font-weight: 600; text-underline-offset: 3px; }
.since-x { margin-left: auto; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; flex: none; }
.since-x:hover { background: var(--surface); color: var(--ink); }

.shelf { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.shelf-label { margin: 0; color: var(--muted); font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; flex: none; }
.shelf-list { display: flex; gap: 8px; flex: 1; min-width: 0; margin: 0; padding: 2px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.shelf-list::-webkit-scrollbar { display: none; }
.shelf-item a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 14px 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 160ms var(--ease), transform 200ms var(--spring);
}
.shelf-item a:hover { border-color: var(--c); transform: translateY(-1px); }
.shelf-item .glyph { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--c-bg); color: var(--c-ink); stroke-width: 1.7; }
.shelf-meta { color: var(--muted); font-family: var(--mono); font-size: .72rem; font-weight: 400; }
.shelf-item.is-pinned .shelf-meta { color: var(--c-ink); }

/* groups -------------------------------------------------------------------- */
.group { margin-top: clamp(40px, 5vw, 64px); scroll-margin-top: calc(var(--head-h) + 90px); }
.group-head { display: grid; gap: 6px; margin: 0 0 20px; }
.group-head h2 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  font-weight: 420;
  font-variation-settings: "opsz" 72, "SOFT" 40;
  line-height: 1.1;
  letter-spacing: -.025em;
}
.group-head p { margin: 0; color: var(--muted); font-size: 1rem; }

/* bento --------------------------------------------------------------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.tile {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  scroll-margin-top: calc(var(--head-h) + 90px);
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .bento > .tile {
      animation: tile-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 50%;
    }
  }
}
@keyframes tile-in { from { opacity: 0; transform: translateY(28px) scale(.98); } to { opacity: 1; transform: none; } }

/* plates -------------------------------------------------------------------- */
.plate {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  transition: transform 320ms var(--spring), box-shadow 320ms var(--ease), border-color 220ms var(--ease);
}
.plate:hover,
.plate:focus-within { transform: translateY(-5px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.plate:has(.plate-link:focus-visible) { outline: 2px solid var(--c); outline-offset: 3px; }
.legacy-anchor { position: absolute; top: 0; scroll-margin-top: calc(var(--head-h) + 90px); }

.plate-art {
  position: relative;
  padding: 44px 18px 8px;
  background:
    radial-gradient(90% 90% at 50% 100%, color-mix(in srgb, var(--c-wash) 45%, transparent), transparent),
    var(--c-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--c) 18%, var(--line));
}
.plate-art .art { width: 100%; height: auto; overflow: visible; }
.plate-glyph { width: 50% !important; height: auto !important; margin: 10px auto 20px; color: var(--c); stroke-width: .9; }
.plate-type {
  position: absolute;
  top: 14px; left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--c-ink);
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.plate-type .dot { width: 7px; height: 7px; }
.badges { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; }
.badges:empty { display: none; }
.badge {
  padding: 4px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--new { background: var(--ink); color: var(--bg); }
.badge--since { background: var(--c); color: var(--c-on); }
.badge--updated { background: var(--surface); color: var(--c-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }

.plate-body { display: grid; gap: 10px; padding: 20px 22px 8px; }
.plate-title {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 460;
  font-variation-settings: "opsz" 48, "SOFT" 40;
  line-height: 1.12;
  letter-spacing: -.02em;
}
.plate-link { text-decoration: none; }
.plate-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.plate-link:focus-visible { outline: none; }
.plate-summary { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }

.io { display: grid; gap: 8px; margin: 6px 0 0; }
.io-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: start; }
.io dt {
  padding-top: 3px;
  color: var(--c-ink);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.io dd { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; color: var(--ink-2); font-size: .86rem; line-height: 1.45; padding-top: 1px; }
.io .chip {
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .74rem;
  line-height: 1.7;
}

.plate-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding: 12px 14px 14px 22px;
  pointer-events: none;
}
.plate-updated { color: var(--muted); font-family: var(--mono); font-size: .74rem; white-space: nowrap; }
.plate-actions { display: flex; gap: 2px; margin-left: auto; pointer-events: auto; }
.pin-btn[aria-pressed="true"] { color: var(--c-ink); }
.pin-btn[aria-pressed="true"] svg { fill: currentColor; }
.plate-go {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-ink);
  font-size: .86rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
}
.plate:hover .plate-go { background: var(--c); color: var(--c-on); }
.plate:hover .plate-go .arrow { transform: translateX(4px); }
.plate.is-soon:hover { transform: none; box-shadow: none; border-color: var(--line); }
.plate.is-soon .plate-art { filter: grayscale(.6); opacity: .7; }
.plate.is-soon .badges { display: none; }
.plate-soon {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  margin-left: auto;
  border-radius: 999px;
  border: 1px dashed color-mix(in srgb, var(--c) 45%, var(--line));
  color: var(--c-ink);
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .plate.is-flash { animation: flash 1.4s var(--ease); }
}
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--c); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* plate illustrations --------------------------------------------------- */
.art .ax { fill: none; stroke: var(--art-line); stroke-width: 1.2; }
.art .ax-grid { stroke-dasharray: 2 4; }
.art .ax-thick { stroke-width: 8; stroke-linecap: round; }
.art .c { fill: none; stroke: var(--c); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.art .c2 { stroke-opacity: .62; }
.art .c3 { stroke-opacity: .38; }
.art .cf { fill: var(--c); }
.art .cs { fill: var(--c-wash); }
.art .tx { fill: var(--art-ink); font-family: var(--mono); font-size: 11px; font-weight: 500; }
.art .tx-c { fill: var(--c-ink); }
.art .tx-on { fill: var(--c-on); }
.art .tx-big { font-size: 14px; font-weight: 600; }
.art .tx-s { font-size: 9px; }
.art .dash { stroke-width: 1.5; stroke-dasharray: 3 5; }
.art .area { opacity: .7; }
.art .draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.art .pipe { fill: none; stroke: var(--c-wash); stroke-width: 16; stroke-linecap: round; }
.art .flow { stroke-width: 3; stroke-dasharray: 6 10; }
.art .resist { stroke-width: 3; }
.art .tips { fill: none; stroke: var(--c-wash); stroke-width: 12; stroke-linecap: round; stroke-opacity: 1; }
.art .gauge { stroke-dasharray: 1; stroke-dashoffset: .35; stroke-width: 8; stroke-linecap: round; }
.art .needle { stroke-width: 3; transform-box: view-box; transform-origin: 200px 214px; transform: rotate(-25deg); }
.art .cell { fill: var(--surface); stroke: var(--art-line); }
.art .bar { fill: var(--art-line); }
.art .bar-on { fill: var(--c-on); opacity: .55; }
.art .ask { stroke: var(--c); stroke-dasharray: 4 4; }
.art .stop { fill: var(--surface); stroke: var(--c); stroke-width: 2.4; }
.art .page, .art .card { fill: var(--surface); stroke: var(--art-line); }
.art-halo .tx { paint-order: stroke; stroke: var(--c-bg); stroke-width: 4px; stroke-linejoin: round; }
.art .line { fill: var(--art-line); }
.art .trace { stroke-width: 1.5; }
.art .rider { offset-distance: 62%; offset-rotate: 0deg; }
.art .walker { offset-distance: 0%; offset-rotate: 0deg; }
.art .knob, .art .dot, .art .bar-eq { transform-box: fill-box; transform-origin: center; }
.art .bar-eq { transform-origin: bottom; }

@media (prefers-reduced-motion: no-preference) {
  .art .flow { animation: flow 1.1s linear infinite; }
  .art .trace { animation: scroll-trace 6s linear infinite; }
  :is(.plate:hover, .plate:focus-within) .art .trace { animation-duration: 2.4s; }
  :is(.plate:hover, .plate:focus-within) .art .flow { animation-duration: .45s; }

  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .draw { animation: draw 1.2s var(--ease) both; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .d2 { animation-delay: 120ms; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .d3 { animation-delay: 240ms; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .d4 { animation-delay: 360ms; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .d5 { animation-delay: 480ms; }
  :is(.plate:hover, .plate:focus-within) .art .dot { animation: pop 500ms var(--spring) both 900ms; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .rider { animation: ride 2.4s var(--ease) both; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .walker { animation: walk 3.2s var(--ease) both; }
  :is(.plate:hover, .plate:focus-within) .art .knob { animation: nudge 1.2s var(--spring) both; }
  :is(.plate:hover, .plate:focus-within) .art .k2 { animation-delay: 150ms; }
  :is(.plate:hover, .plate:focus-within) .art .k3 { animation-delay: 300ms; }
  :is(.plate:hover, .plate:focus-within) .art .tell { animation: blink 1.6s var(--ease) both; }
  :is(.plate:hover, .plate:focus-within) .art .t2 { animation-delay: 180ms; }
  :is(.plate:hover, .plate:focus-within) .art .t3 { animation-delay: 360ms; }
  :is(.plate:hover, .plate:focus-within) .art .seq { animation: blink 1.2s var(--ease) both; }
  :is(.plate:hover, .plate:focus-within) .art .s2 { animation-delay: 100ms; }
  :is(.plate:hover, .plate:focus-within) .art .s3 { animation-delay: 200ms; }
  :is(.plate:hover, .plate:focus-within) .art .s4 { animation-delay: 300ms; }
  :is(.plate:hover, .plate:focus-within) .art .s5 { animation-delay: 400ms; }
  :is(.plate:hover, .plate:focus-within) .art .s6 { animation-delay: 500ms; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .needle { animation: needle 1.6s var(--spring) both; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .gauge { animation: gauge 1.6s var(--spring) both; }
  :is(.plate:hover, .plate:focus-within) .art .chip { animation: blink 1.2s var(--ease) both; }
  :is(.plate:hover, .plate:focus-within) .art .ch2 { animation-delay: 160ms; }
  :is(.plate:hover, .plate:focus-within) .art .ch3 { animation-delay: 320ms; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .bar-eq { animation: eq .9s ease-in-out infinite alternate; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .b2 { animation-delay: -.2s; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .b3 { animation-delay: -.4s; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .b4 { animation-delay: -.6s; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .b5 { animation-delay: -.3s; }
  :is(.plate:hover, .plate:focus-within, .sheet-art) .art .b6 { animation-delay: -.5s; }
}
@keyframes flow { to { stroke-dashoffset: -32; } }
@keyframes scroll-trace { to { transform: translateX(-300px); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { 0% { transform: scale(.2); } 100% { transform: scale(1); } }
@keyframes ride { from { offset-distance: 2%; } to { offset-distance: 62%; } }
@keyframes walk { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes nudge { 0% { transform: translateX(-14px); } 100% { transform: none; } }
@keyframes blink { 0% { opacity: .25; } 40% { opacity: 1; } 60% { opacity: .55; } 100% { opacity: 1; } }
@keyframes needle { from { transform: rotate(-110deg); } to { transform: rotate(-25deg); } }
@keyframes gauge { from { stroke-dashoffset: 1; } to { stroke-dashoffset: .35; } }
@keyframes eq { from { transform: scaleY(.35); } to { transform: scaleY(1); } }

/* today's panel -------------------------------------------------------------- */
.today {
  --t-bg: var(--surface);
  --t-muted: var(--muted);
  --t-line: var(--line);
  --t-cell: var(--surface-2);
  grid-column: span 2;
  padding: 26px 28px 28px;
  background: var(--t-bg);
  border-color: color-mix(in srgb, var(--crimson) 22%, var(--line));
  color: var(--ink);
  overflow: hidden;
}
.today::before {
  content: "";
  position: absolute;
  inset: auto -20% -60% 40%;
  height: 120%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--crimson) 12%, transparent), transparent);
  pointer-events: none;
}

.today-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 28px;
}
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.today-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--crimson-ink);
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.today-kicker .live { background: var(--crimson); }
.today-no { color: var(--t-muted); }
.today-no:empty { display: none; }
.today-streak { margin: 0; color: var(--green-ink); font-family: var(--mono); font-size: .76rem; white-space: nowrap; }
.today-title {
  margin: 16px 0 18px;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.1vw, 1.85rem);
  font-weight: 420;
  font-variation-settings: "opsz" 72, "SOFT" 50;
  line-height: 1.18;
  letter-spacing: -.015em;
}
.today-fallback { margin: 0; color: var(--t-muted); }
.today-fallback a { color: var(--ink); }

.labs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
.lab {
  display: grid;
  gap: 2px;
  padding: 9px 12px 10px;
  border: 1px solid var(--t-line);
  border-radius: 12px;
  background: var(--t-cell);
  transition: background-color 400ms var(--ease), border-color 400ms var(--ease), transform 400ms var(--spring);
}
.lab dt { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; color: var(--t-muted); font-size: .72rem; font-weight: 600; letter-spacing: .04em; }
.lab-unit { font-family: var(--mono); font-size: .66rem; font-weight: 400; letter-spacing: 0; }
.lab dd { margin: 0; font-family: var(--mono); font-size: 1.12rem; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.lab:last-child:nth-child(3n+2) { grid-column: span 2; }
.lab:last-child:nth-child(3n+1) { grid-column: span 3; }
.is-revealed .lab:not(.is-tell) dd { color: var(--t-muted); font-weight: 400; }
.is-revealed .lab.is-tell { border-color: var(--crimson); background: var(--crimson-bg); transform: translateY(-2px); }
.is-revealed .lab.is-tell dt { color: var(--crimson-ink); }

.today-right { display: flex; flex-direction: column; gap: 10px; }
.choices-label { margin: 0; color: var(--t-muted); font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.choices { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--t-line);
  border-radius: 14px;
  background: var(--t-cell);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .98rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), transform 200ms var(--spring);
}
.choice-key {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--t-line);
  border-radius: 8px;
  color: var(--t-muted);
  font-family: var(--mono);
  font-size: .76rem;
}
.choice:hover:not(:disabled) { border-color: var(--blue); background: var(--bg-2); transform: translateX(3px); }
.choice:disabled { cursor: default; }
.choice.is-right { border-color: var(--green); background: var(--green-bg); }
.choice.is-right .choice-key { border-color: var(--green); background: var(--green); color: var(--green-on); }
.choice.is-wrong { border-color: var(--crimson); color: var(--ink-2); }
.choice.is-wrong .choice-key { border-color: var(--crimson); background: var(--crimson); color: var(--crimson-on); }
.choices.is-done .choice:not(.is-right):not(.is-wrong) { opacity: .5; }

.reveal { display: grid; gap: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise 460ms var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.verdict { margin: 4px 0 0; font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; }
.verdict.is-right { color: var(--green-ink); }
.verdict.is-wrong { color: var(--crimson-ink); }
.answer {
  margin: 0;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 420;
  font-variation-settings: "opsz" 72, "SOFT" 60;
  line-height: 1.08;
  letter-spacing: -.02em;
}
.teach { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.reveal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.pill-btn:hover { border-color: var(--ink); }
.pill-btn.primary { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.next { margin: 4px 0 0; color: var(--t-muted); font-family: var(--mono); font-size: .72rem; }
.reveal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reveal-actions .pill-btn { justify-content: center; }
.reveal-actions .primary { grid-column: 1 / -1; }

/* flags against the reference range: a bar along the bottom of the cell */
.lab { position: relative; overflow: hidden; }
.lab dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; white-space: normal; }
.lab-flag { padding: 0 6px; border-radius: 999px; font-family: var(--mono); font-size: .64rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.lab.is-h .lab-flag { background: color-mix(in srgb, var(--crimson) 16%, transparent); color: var(--crimson-ink); }
.lab.is-l .lab-flag { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue-ink); }
.lab-bar { position: absolute; left: 0; bottom: 0; width: calc(var(--w, 0) * 100%); height: 3px; border-radius: 0 3px 3px 0; background: var(--crimson); }
.lab.is-l .lab-bar { background: var(--blue); }
.is-revealed .lab:not(.is-tell) .lab-flag { opacity: .6; }
.labs-note { margin: 8px 0 0; color: var(--t-muted); font-family: var(--mono); font-size: .66rem; }
.seen { margin: 0; padding: 9px 12px; border-radius: 12px; background: color-mix(in srgb, var(--blue) 10%, transparent); color: var(--blue-ink); font-size: .84rem; line-height: 1.4; }

.reveal-more { display: grid; gap: 10px; margin-top: 14px; }
@media (prefers-reduced-motion: no-preference) { .reveal-more { animation: rise 460ms var(--ease) both; } }
.ratios { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ratios li { display: grid; grid-template-columns: 84px 44px minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 7px 11px; border: 1px solid var(--t-line); border-radius: 10px; background: var(--t-cell); font-size: .8rem; }
.ratio-name { color: var(--t-muted); font-family: var(--mono); font-size: .72rem; }
.ratio-val { font-family: var(--mono); font-weight: 600; text-align: right; }
.ratio-hint { color: var(--ink-2); line-height: 1.35; }
.ratios li.is-hot { border-color: color-mix(in srgb, var(--crimson) 50%, transparent); }
.ratios li.is-hot .ratio-val { color: var(--crimson-ink); }

.zone-fig {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 4px 0 0;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--t-line);
  border-radius: 12px;
}
.zone-art svg { width: 100%; height: auto; overflow: visible; }
.zone-fig .cord { stroke-width: 4; }
.zone-fig figcaption { color: var(--ink-2); font-size: .84rem; line-height: 1.4; }
.zone-fig .zone { fill: transparent; }
.zone-fig[data-zone="1"] .z1, .zone-fig[data-zone="2"] .z2, .zone-fig[data-zone="3"] .z3 { fill: color-mix(in srgb, var(--crimson) 45%, transparent); }
.zone-fig[data-zone="all"] .zone { fill: color-mix(in srgb, var(--crimson) 14%, transparent); }
.zone-fig[data-zone="extrahepatic"] .zone-art { opacity: .35; filter: grayscale(1); }
@media (prefers-reduced-motion: no-preference) {
  .zone-fig .zone { animation: zone-glow 2.4s ease-in-out infinite alternate; }
}
@keyframes zone-glow { from { opacity: .55; } to { opacity: 1; } }

.tells summary { color: var(--t-muted); font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.tells summary:hover { color: var(--ink); }
.tells ul { display: grid; gap: 7px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: .84rem; line-height: 1.45; }
.tells b { color: var(--crimson-ink); font-family: var(--mono); font-size: .8rem; font-weight: 500; }
.today .term { z-index: auto; }

/* latest tile ---------------------------------------------------------------- */
.latest {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 26px 24px;
  background:
    radial-gradient(80% 70% at 100% 0%, color-mix(in srgb, var(--blue) 12%, transparent), transparent),
    radial-gradient(70% 60% at 0% 100%, color-mix(in srgb, var(--green) 12%, transparent), transparent),
    var(--surface);
  text-decoration: none;
  transition: transform 320ms var(--spring), box-shadow 320ms var(--ease);
}
.latest:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); }
.latest-kicker { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
.latest-list { display: grid; gap: 0; margin: 6px 0 0; padding: 0; list-style: none; }
.latest-list li { position: relative; display: grid; gap: 4px; padding: 14px 0 14px 16px; border-top: 1px solid var(--line); }
.latest-list li::before { content: ""; position: absolute; left: 0; top: 21px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.latest-list li:first-child { border-top: 0; padding-top: 6px; }
.latest-list li:first-child::before { top: 13px; }
.latest-list time { color: var(--muted); font-family: var(--mono); font-size: .72rem; }
.latest-title {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 460;
  font-variation-settings: "opsz" 36, "SOFT" 40;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.latest-list li:first-child .latest-title { font-size: 1.55rem; font-weight: 420; font-variation-settings: "opsz" 72, "SOFT" 50; letter-spacing: -.02em; line-height: 1.1; }
.latest-text { color: var(--ink-2); font-size: .92rem; }
.latest-go { margin-top: auto; padding-top: 12px; font-weight: 600; font-size: .92rem; }
.latest:hover .arrow { transform: translateX(4px); }

.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 56px 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  text-align: center;
}
.empty p { margin: 0; color: var(--ink-2); }
.empty .empty-title { font-family: var(--display); font-size: 1.6rem; color: var(--ink); }
.empty a { color: var(--blue-ink); }
.empty .btn { margin-top: 12px; }

/* ======================================================== news & about */

.news, .about {
  width: min(100% - 2 * var(--pad), var(--wide));
  margin: 0 auto;
  padding-block: clamp(56px, 7vw, 96px);
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}
.section-head h2, .about-lead {
  margin-top: 10px;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  font-weight: 380;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  line-height: .98;
  letter-spacing: -.035em;
}
.section-actions { margin: 0; }

.news { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.6fr); gap: 24px clamp(32px, 6vw, 96px); }
.news .section-head { display: grid; align-content: start; justify-items: start; gap: 18px; margin: 0; }
@media (min-width: 961px) { .news .section-head { position: sticky; top: calc(var(--head-h) + 32px); align-self: start; } }

/* what's new: a timeline */
.news-list { display: grid; margin: 0; padding: 0; list-style: none; }
.news-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px 38px minmax(0, 1fr);
  gap: 0 16px;
  padding-bottom: 28px;
}
.news-item::before {
  content: "";
  position: absolute;
  top: 44px; bottom: 6px;
  left: calc(64px + 16px + 18px);
  width: 2px;
  border-radius: 2px;
  background: var(--line);
}
.news-item:last-child { padding-bottom: 0; }
.news-item:last-child::before { display: none; }
.news-date { padding-top: 9px; color: var(--ink); font-family: var(--mono); font-size: .8rem; font-weight: 500; text-align: right; white-space: nowrap; }
.news-date span { display: block; color: var(--muted); font-size: .7rem; font-weight: 400; }
.news-node .glyph, .news-node .mark {
  width: 38px; height: 38px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line));
  border-radius: 50%;
  background: var(--c-bg);
  color: var(--c-ink);
  stroke-width: 1.7;
}
.news-body { display: grid; gap: 5px; padding-top: 6px; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; color: var(--muted); font-family: var(--mono); font-size: .72rem; }
.news-kind { padding: 1px 8px; border-radius: 999px; background: var(--c-bg); color: var(--c-ink); }
.news-project { color: var(--c-ink); font-family: var(--sans); font-size: .8rem; font-weight: 500; }
.news-fresh { color: var(--blue-ink); font-weight: 600; }
.news-item.is-fresh .news-node .glyph, .news-item.is-fresh .news-node .mark { box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 30%, transparent); }
.news-item h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 460;
  font-variation-settings: "opsz" 36, "SOFT" 40;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.news-item h3 a { text-decoration: none; }
.news-item h3 a:hover { text-decoration: underline; text-decoration-color: var(--c); text-underline-offset: 4px; }
.news-text { margin: 0; max-width: 60ch; color: var(--ink-2); font-size: .94rem; line-height: 1.55; }

.about { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
.about-why { margin: 28px 0 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--crimson); }
.about-why p {
  margin: 0;
  max-width: 26em;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-style: italic;
  font-weight: 360;
  font-variation-settings: "opsz" 72, "SOFT" 100;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.about-bio { max-width: 38em; margin: 26px 0 0; color: var(--ink-2); font-size: 1.08rem; line-height: 1.7; }
.about-side { display: grid; gap: 16px; align-content: start; }
.links { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.links li { border-bottom: 1px solid var(--line); }
.links a {
  display: flex;
  justify-content: space-between;
  padding: 14px 4px;
  font-size: 1.02rem;
  font-weight: 500;
  text-decoration: none;
  transition: padding 220ms var(--spring), color 160ms var(--ease);
}
.links a:hover { padding-left: 12px; color: var(--blue-ink); }
.card-cta {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 20px 22px;
  border-radius: var(--r-md);
  background: var(--c-bg);
  text-decoration: none;
  transition: transform 260ms var(--spring), box-shadow 260ms var(--ease);
}
.card-cta .eyebrow { color: var(--c-ink); }
.card-cta-line { font-family: var(--display); font-size: 1.35rem; font-weight: 440; font-variation-settings: "opsz" 48; letter-spacing: -.01em; }
.card-cta:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card-cta:hover .arrow { transform: translateX(5px); }
.cite { display: grid; gap: 10px; justify-items: start; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-md); }
.cite-text { margin: 0; color: var(--ink-2); font-size: .9rem; overflow-wrap: anywhere; }

/* =============================================================== footer */

.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 0 var(--pad); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  width: min(100%, var(--wide));
  margin-inline: auto;
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: .84rem;
}
.footer-brand { display: flex; align-items: center; gap: 14px; max-width: 64ch; }
.footer-brand p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.footer-links a { color: var(--ink); text-decoration: none; font-weight: 500; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.copyright { font-family: var(--mono); font-size: .76rem; }

/* ========================================================= details sheet */

dialog { color: var(--ink); }
dialog::backdrop { background: rgb(14 13 17 / .45); backdrop-filter: blur(4px); }

.sheet {
  width: min(520px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-3);
  overflow: auto;
  overscroll-behavior: contain;
}
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in 380ms var(--ease) both; }
  .sheet[open]::backdrop { animation: fade 300ms var(--ease) both; }
}
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.sheet-art {
  position: relative;
  padding: 56px 24px 12px;
  background: radial-gradient(90% 90% at 50% 100%, color-mix(in srgb, var(--c-wash) 45%, transparent), transparent), var(--c-bg);
}
.sheet-art .art { width: 100%; height: auto; }
.sheet-art .plate-type { top: 16px; left: 20px; }
.sheet-close { position: absolute; top: 12px; right: 12px; background: var(--surface); }
.sheet-body { display: grid; gap: 18px; padding: 24px 28px 36px; }
.sheet-title {
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 420;
  font-variation-settings: "opsz" 96, "SOFT" 50;
  line-height: 1.02;
  letter-spacing: -.03em;
}
.sheet-summary { margin: 0; color: var(--ink-2); font-size: 1.02rem; }
.sheet .btn-color { width: 100%; }
.sheet-section { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.sheet-section h3 { color: var(--muted); font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.sheet-section p, .sheet-section li { margin: 0; color: var(--ink-2); font-size: .94rem; }
.sheet-section ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sheet-section a { color: var(--c-ink); text-underline-offset: 3px; }
.sheet-section time { color: var(--muted); font-family: var(--mono); font-size: .76rem; margin-right: 6px; }
.sheet-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.sheet-facts div { padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); }
.sheet-facts dt { color: var(--muted); font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.sheet-facts dd { margin: 2px 0 0; font-weight: 600; }
.sheet-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sheet-actions .btn { width: 100%; padding: 0 12px; }
.sheet-actions .btn[aria-pressed="true"] { border-color: var(--c); color: var(--c-ink); background: var(--c-bg); }

/* ============================================================== present */

.present {
  width: 100vw; max-width: 100vw;
  height: 100dvh; max-height: 100dvh;
  margin: 0; padding: 0; border: 0;
  background: #0e0d11;
  color: #f2eee8;
}
.present[open] { display: grid; place-items: center; }
.present::backdrop { background: #0e0d11; }
.present-inner { display: grid; justify-items: center; gap: 18px; width: min(100%, 900px); padding: 32px var(--pad); text-align: center; }
.present-kicker { color: #f79aa7; }
.present-title { font-family: var(--display); font-size: clamp(2.4rem, 6vw, 5rem); font-weight: 400; font-variation-settings: "opsz" 144, "SOFT" 40; line-height: .98; letter-spacing: -.035em; }
.present-qr { display: grid; place-items: center; width: min(58vmin, 380px); aspect-ratio: 1; padding: 20px; border-radius: 22px; background: #fff; }
.present-qr svg, .present-qr img { width: 100%; height: 100%; }
.present-qr-fallback { color: #18141c; font-family: var(--mono); font-size: .84rem; }
.present-url { margin: 0; font-family: var(--mono); font-size: clamp(1rem, 2.4vw, 1.5rem); overflow-wrap: anywhere; }
.present-actions { display: flex; gap: 10px; }

/* toast ------------------------------------------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 90;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px) scale(.96);
  transition: opacity 220ms var(--ease), transform 260ms var(--spring);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ================================================================== 404 */

.lost { width: min(100% - 2 * var(--pad), var(--wide)); margin: 0 auto; padding-block: clamp(48px, 8vw, 110px); }
.lost h1 { margin-top: 16px; font-family: var(--display); font-size: clamp(2.6rem, 6vw, 5.4rem); font-weight: 380; font-variation-settings: "opsz" 144, "SOFT" 40; line-height: .95; letter-spacing: -.04em; max-width: 14em; }
.lost .lede { margin-bottom: 32px; }
.lost-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 0 0 32px; padding: 0; list-style: none; }
.lost-list a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-weight: 500;
  text-decoration: none;
  transition: transform 220ms var(--spring), border-color 160ms var(--ease);
}
.lost-list a:hover { transform: translateY(-2px); border-color: var(--c); }
.lost-list .glyph { width: 36px; height: 36px; padding: 7px; border-radius: 10px; background: var(--c-bg); color: var(--c-ink); stroke-width: 1.6; flex: none; }
.lost-actions { display: flex; flex-wrap: wrap; gap: 10px; }


/* ============================================================ the lobule key */

.vessels { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.vessel {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0 8px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), transform 200ms var(--spring);
}
.vessel .dot { grid-row: span 2; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--c-bg); }
.v-name { font-size: .84rem; font-weight: 600; line-height: 1.2; }
.v-tools { color: var(--muted); font-family: var(--mono); font-size: .68rem; line-height: 1.3; }
.vessel:hover, .vessel:focus-visible { border-color: var(--c); background: var(--c-bg); transform: translateY(-1px); }
.vessel[aria-pressed="true"] { border-color: var(--c); background: var(--c); color: var(--c-on); }
.vessel[aria-pressed="true"] .v-tools { color: inherit; opacity: .8; }
.vessel[aria-pressed="true"] .dot { background: var(--c-on); box-shadow: none; }

.lobule .triad > circle { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform 300ms var(--spring), opacity 300ms var(--ease); }
.lobule .lob-flow > *, .lobule .lob-cords { transition: opacity 300ms var(--ease); }
.lobule .cord { transition: stroke 300ms var(--ease); }
.lobule[data-vessel] .lob-flow > *, .lobule[data-vessel] .triad > circle { opacity: .16; }
.lobule[data-vessel] .lob-cords { opacity: .45; }
.lobule[data-vessel="blue"] :is(.pv, .blood.b1, .blood.b2),
.lobule[data-vessel="crimson"] :is(.ha, .blood.b3, .blood.b2),
.lobule[data-vessel="green"] :is(.bd, .bile) { opacity: 1; }
.lobule[data-vessel="blue"] .pv, .lobule[data-vessel="crimson"] .ha, .lobule[data-vessel="green"] .bd { transform: scale(1.35); }
.lobule[data-vessel="amber"] .lob-cords { opacity: 1; }
.lobule[data-vessel="amber"] .cord { stroke: var(--amber); }
.lobule .zone { fill: none; }

/* ================================================================== paths */

.paths { margin: 4px 0 22px; }
.paths-label { margin: 0 0 10px; color: var(--muted); font-family: var(--mono); font-size: .74rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.path-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 2px; list-style: none; }
.path {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: radial-gradient(90% 80% at 100% 0%, color-mix(in srgb, var(--c-bg) 90%, transparent), transparent), var(--surface);
}
.path::before { content: ""; position: absolute; top: -1px; left: 18px; width: 44px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c); }
.path-title { margin: 0; font-family: var(--display); font-size: 1.2rem; font-weight: 460; font-variation-settings: "opsz" 36, "SOFT" 40; line-height: 1.15; letter-spacing: -.01em; }
.path-blurb { margin: 0; color: var(--ink-2); font-size: .88rem; line-height: 1.45; }
.path-steps { display: flex; margin: 6px 0 0; padding: 0; list-style: none; }
.path-step { position: relative; flex: 1 1 0; min-width: 0; }
.path-step + .path-step::before {
  content: "";
  position: absolute;
  top: 12px; left: calc(-100% + 32px); right: calc(100% + 6px);
  height: 2px;
  border-radius: 2px;
  background: var(--line-2);
}
.path-step.is-done + .path-step::before { background: var(--c); }
.path-step a { display: grid; justify-items: start; gap: 5px; padding: 0 8px 0 0; color: var(--ink-2); font-size: .8rem; font-weight: 500; line-height: 1.25; text-decoration: none; }
.path-step a:hover { color: var(--ink); }
.step-no {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .74rem;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), transform 200ms var(--spring);
}
.path-step a:hover .step-no { transform: scale(1.1); border-color: var(--c); }
.path-step.is-next .step-no { border-color: var(--c); color: var(--c-ink); box-shadow: 0 0 0 4px var(--c-bg); }
.path-step.is-done .step-no { border-color: var(--c); background: var(--c); color: var(--c-on); font-size: 0; }
.path-step.is-done .step-no::after { content: "✓"; font-size: .8rem; font-weight: 700; }
.step-name { overflow-wrap: anywhere; }
.path-progress { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: auto 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: .84rem; }
.path-progress:empty { display: none; }
.path-count { color: var(--muted); font-family: var(--mono); font-size: .72rem; }
.path-next { color: var(--c-ink); font-weight: 600; text-decoration: none; }
.path-next:hover .arrow { transform: translateX(4px); }
.path-next .arrow { margin-left: 5px; }
.path-done { color: var(--c-ink); font-weight: 600; }

/* ======================================================= flagship plates */

.bento { grid-auto-flow: dense; }
.plate.is-wide {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
}
.plate.is-wide .plate-art {
  grid-row: 1 / -1;
  display: grid;
  align-content: center;
  padding: 52px 26px 26px;
  border-bottom: 0;
  border-right: 1px solid color-mix(in srgb, var(--c) 18%, var(--line));
}
.plate.is-wide .plate-body { align-content: start; padding: 26px 26px 8px; }
.plate.is-wide .plate-title { font-size: 1.85rem; font-variation-settings: "opsz" 72, "SOFT" 40; }
.plate.is-wide .plate-foot { padding-left: 26px; }
@media (min-width: 1121px) {
  .latest { grid-column: span 2; }
  .latest-list { grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; }
  .latest-list li, .latest-list li:first-child { padding: 6px 0 0 16px; border-top: 0; align-content: start; }
  .latest-list li::before, .latest-list li:first-child::before { top: 13px; }
}

/* ================================================================= try it */

.tryit {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding: 14px 16px 12px;
  border: 1px solid color-mix(in srgb, var(--c) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--c-bg) 70%, var(--surface));
  cursor: auto;
}
.plate:has(.tryit:not([hidden])) .io { display: none; }
.try-kicker { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--c-ink); font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.try-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
@media (prefers-reduced-motion: no-preference) {
  .try-dot { animation: try-pulse 2.2s ease-out infinite; }
}
@keyframes try-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.try-control { display: grid; gap: 4px; }
.try-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .84rem; font-weight: 600; }
.try-val { color: var(--c-ink); font-family: var(--mono); font-size: .8rem; font-weight: 500; }
.try-range { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer; }
.try-range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--c) var(--fill, 50%), var(--c-wash) var(--fill, 50%)); }
.try-range::-moz-range-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--c) var(--fill, 50%), var(--c-wash) var(--fill, 50%)); }
.try-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border: 2px solid var(--c); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); transition: transform 160ms var(--spring); }
.try-range::-moz-range-thumb { width: 18px; height: 18px; border: 2px solid var(--c); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); }
.try-range:active::-webkit-slider-thumb { transform: scale(1.15); }
.try-range:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: .8rem; }
.meter-label { color: var(--ink-2); }
.meter-val { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter-track { position: relative; grid-column: 1 / -1; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--c-wash) 55%, var(--surface)); }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: color-mix(in srgb, var(--c) 50%, var(--surface)); transition: width 220ms var(--ease), background-color 220ms var(--ease); }
.meter.is-hot .meter-fill { background: var(--c); }
.meter.is-hot .meter-val { color: var(--c-ink); }
.meter-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); }
.try-seg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.try-seg .try-label { margin-right: 4px; }
.try-seg label { position: relative; }
.try-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.try-seg span { display: inline-block; padding: 4px 11px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-family: var(--mono); font-size: .74rem; transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
.try-seg input:checked + span { border-color: var(--c); background: var(--c); color: var(--c-on); }
.try-seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.try-note { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.4; }

/* ============================================================= glossary */

.term { position: relative; z-index: 2; border-bottom: 1px dotted currentColor; cursor: help; }
.term:focus-visible { border-radius: 3px; }
.term-tip {
  position: fixed;
  z-index: 95;
  max-width: min(320px, calc(100vw - 16px));
  padding: 10px 13px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: .84rem;
  line-height: 1.45;
  box-shadow: var(--shadow-2);
  pointer-events: none;
}
.stats li.is-yours b { color: var(--green-ink); }

/* ========================================================== responsive */

@media (max-width: 1120px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .topnav { display: none; }
  .topbar-tools { margin-left: auto; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .lobule { width: min(100%, 520px); }
  .toolbar-inner { flex-wrap: wrap; }
  .search { flex: 1 1 100%; }
  .about, .news { grid-template-columns: minmax(0, 1fr); }
  .news .section-head { display: flex; justify-content: space-between; align-items: end; width: 100%; }
  .path-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(280px, 44%); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .path-list::-webkit-scrollbar { display: none; }
  .path { scroll-snap-align: start; }
}

@media (max-width: 720px) {
  :root { --head-h: 58px; --r-lg: 20px; }
  .brand-name { font-size: 1.16rem; }
  .hero { padding-top: 32px; }
  .hero h1 { margin-top: 16px; }
  .stats { gap: 12px 24px; margin-top: 30px; }
  .stats b { font-size: 1.7rem; }
  .lobule .callout { display: none; }
  /* the lobule becomes a watermark behind the headline, so the tools start a screen sooner */
  .hero-inner { position: relative; }
  .lobule { position: absolute; top: -24px; right: -34%; z-index: -1; width: 92%; opacity: .2; pointer-events: none; }
  .lobule figcaption, .lobule .vessels { display: none; }
  .bento { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .plate.is-wide { grid-column: auto; display: flex; flex-direction: column; }
  .plate.is-wide .plate-art { padding: 36px 14px 4px; border-right: 0; border-bottom: 1px solid color-mix(in srgb, var(--c) 18%, var(--line)); }
  .plate.is-wide .plate-body { padding: 18px 18px 6px; }
  .plate.is-wide .plate-title { font-size: 1.5rem; }
  .plate.is-wide .plate-foot { padding-left: 18px; }
  .plate-art { padding: 36px 14px 4px; }
  .plate-art .art { max-height: 150px; }
  .plate .io { display: none; }
  .path-list { grid-auto-columns: 86%; }
  .news-item { grid-template-columns: 48px 32px minmax(0, 1fr); gap: 0 10px; }
  .news-item::before { left: calc(48px + 10px + 15px); top: 40px; }
  .news-node .glyph, .news-node .mark { width: 32px; height: 32px; padding: 6px; }
  .news-date { font-size: .74rem; }
  .ratios li { grid-template-columns: 74px 40px minmax(0, 1fr); gap: 8px; }
  .today { padding: 20px 18px 22px; }
  .today-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .lab { padding: 7px 9px 8px; border-radius: 10px; }
  .lab dt { flex-direction: column; gap: 0; }
  .lab dd { font-size: .98rem; }
  .news-list { grid-template-columns: minmax(0, 1fr); }
  .plate-body { padding: 18px 18px 6px; }
  .plate-foot { padding: 10px 10px 12px 18px; }
  .sheet-body { padding: 20px 20px 32px; }
  .shelf { flex-wrap: wrap; gap: 8px 12px; }
  .shelf-list { order: 3; flex-basis: 100%; }
  .shelf .text-btn { margin-left: auto; }
  .present-actions [data-present-full] { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
  .hero-actions .btn { flex: 1 1 100%; }
  .labs { gap: 4px; }
  .lab dd { font-size: .9rem; }
  .gh { display: none; }
}

@media (hover: none) {
  .plate:hover { transform: none; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .lobule-art { transform: none !important; }
}

/* ================================================================ print */

@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --ink-2: #222; --muted: #444; --line: #bbb; }
  .topbar, .toolbar, .today, .latest, .lobule, .hero-actions, .stats, .plate-actions, .plate-go,
  .shelf, .since, .news, .about-side, dialog, .toast, .footer-links, .paths, .tryit, .term-tip { display: none !important; }
  .hero { padding: 0 0 12px; }
  .hero::before { display: none; }
  .hero h1 { font-size: 30pt; }
  .hero h1 em { color: #000; background: none; }
  .bento { display: block; }
  .plate { break-inside: avoid; margin-bottom: 10px; border: 0; border-bottom: 1px solid #bbb; border-radius: 0; }
  .plate-art { display: none; }
  .plate-link::after { content: " " attr(href); position: static; font-family: var(--mono); font-size: 8pt; }
}
