/* AntJanus — "Keyframes": a site built around View Transitions.
   Every repeated object (card, portrait, stat, playhead) has a stable identity
   and morphs between pages instead of being redrawn. */

@view-transition { navigation: auto; }

:root {
  --ground: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #ebe6db;
  --ink: #16181d;
  --text: #2b2f37;
  --muted: #565c67;
  --line: #d6cfc0;
  --line-strong: #b9b0a0;
  --brand: #364f6a;
  --brand-soft: #dbe3ec;
  --accent: #b83c0b;
  --accent-soft: #f6dccd;
  --on-ink: #f7f3ec;
  --code-bg: #15181e;
  --code-text: #e8e3da;
  --ok: #1c6e52;
  --warn: #7e610f;
  --bad: #a03227;
  --shadow: 0 1px 0 rgba(22, 24, 29, .04), 0 12px 30px -18px rgba(22, 24, 29, .35);

  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --radius-lg: 22px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;

  --vt-dur: 460ms;
  --vt-ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0e1116;
    --surface: #161a21;
    --surface-2: #1f242d;
    --ink: #f2ede4;
    --text: #d8d3c9;
    --muted: #a0a7b2;
    --line: #2b313b;
    --line-strong: #414957;
    --brand: #93b3d6;
    --brand-soft: #1c2837;
    --accent: #ff8a5c;
    --accent-soft: #3a2118;
    --on-ink: #0e1116;
    --code-bg: #0a0c10;
    --ok: #4fbe93;
    --warn: #ddb44a;
    --bad: #ee8579;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 34px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0e1116;
  --surface: #161a21;
  --surface-2: #1f242d;
  --ink: #f2ede4;
  --text: #d8d3c9;
  --muted: #a0a7b2;
  --line: #2b313b;
  --line-strong: #414957;
  --brand: #93b3d6;
  --brand-soft: #1c2837;
  --accent: #ff8a5c;
  --accent-soft: #3a2118;
  --on-ink: #0e1116;
  --code-bg: #0a0c10;
  --ok: #4fbe93;
  --warn: #ddb44a;
  --bad: #ee8579;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 34px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
:root[data-motion="slow"] { --vt-dur: 1800ms; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p a, .prose a, .inline-link { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
p a:hover, .prose a:hover, .inline-link:hover { color: var(--accent); }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 400; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: 8px; z-index: 100; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); display: inline-flex; gap: .6em; align-items: center;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- header / scrubber nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 28px;
  padding-top: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
  padding-bottom: 14px; min-height: 44px;
}
.brand svg { width: 38px; height: 38px; flex: none; }
.brand-word { display: grid; line-height: 1; }
.brand-word b { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; letter-spacing: -.01em; }
.brand-word small { font-family: var(--font-mono); font-size: .8125rem; color: var(--muted); letter-spacing: .06em; margin-top: 3px; }

.scrubber { min-width: 0; }
.scrubber ol {
  list-style: none; margin: 0; padding: 0 4px; display: flex; gap: 0;
  position: relative; overflow-x: auto; scrollbar-width: none;
  /* the timeline ruler: minor ticks every 10px, major ticks per frame */
  background:
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 10px) left bottom / 100% 6px no-repeat;
}
.scrubber ol::-webkit-scrollbar { display: none; }
.scrubber li { flex: 1 0 auto; }
.scrubber a {
  position: relative; display: grid; gap: 2px; text-decoration: none; color: var(--muted);
  padding: 6px 14px 18px; min-height: 44px; min-width: 84px;
  border-left: 1px solid var(--line-strong);
  transition: color 150ms ease;
}
.scrubber a .num { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .06em; }
.scrubber a .lbl { font-size: 1rem; font-weight: 500; color: var(--text); }
.scrubber a:hover .lbl, .scrubber a:hover { color: var(--ink); }
.scrubber a[aria-current="page"] .lbl { color: var(--ink); font-weight: 600; }
.scrubber a[aria-current="page"] .num { color: var(--accent); }
.playhead {
  position: absolute; left: -1px; bottom: 0; width: calc(100% + 1px); height: 6px;
  background: var(--accent); border-radius: 2px 2px 0 0;
}
.playhead::before {
  content: ""; position: absolute; left: -5px; bottom: 6px; width: 11px; height: 11px;
  background: var(--accent); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.scrubber .ai-tag {
  font-family: var(--font-mono); font-size: .8125rem; font-weight: 600; color: var(--accent);
  border: 1px solid currentColor; border-radius: 99px; padding: 0 6px; margin-left: 4px;
}
.tools { display: flex; gap: 8px; align-items: center; padding-bottom: 12px; }
.icon-btn, .chip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 500 .9375rem/1 var(--font-body); cursor: pointer; text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease;
}
.icon-btn:hover, .chip-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.motion-btn .state { font-family: var(--font-mono); font-size: .8125rem; color: var(--accent); }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}

@media (max-width: 980px) {
  .header-inner { grid-template-columns: 1fr auto; gap: 0 12px; }
  .scrubber { grid-column: 1 / -1; order: 3; margin-inline: calc(var(--gutter) * -1); }
  .scrubber ol { padding-inline: var(--gutter); }
  .tools { padding-bottom: 10px; }
  .brand { padding-bottom: 10px; }
  .motion-btn .word { display: none; }
}
@media (max-width: 480px) {
  .brand-word small { display: none; }
  .scrubber a { min-width: 76px; padding-inline: 10px; }
  .search-btn { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 99px; background: var(--ink); color: var(--ground); text-decoration: none;
  font-weight: 600; font-size: 1rem; border: 1px solid var(--ink); cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn:hover { color: #16181d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:hover { color: #16181d; } }
.btn:active { transform: translateY(1px); }
.btn-line {
  display: inline-flex; align-items: center; min-height: 48px; color: var(--ink); font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--accent);
}
.btn-quiet { display: inline-flex; align-items: center; min-height: 48px; color: var(--muted); text-decoration: none; }
.btn-quiet:hover, .btn-line:hover { color: var(--accent); }
.arrow { display: inline-block; transition: transform 150ms ease; }
a:hover .arrow { transform: translateX(3px); }

/* ---------- page head ---------- */
.page-head { padding: clamp(40px, 7vw, 96px) 0 clamp(28px, 4vw, 48px); }
.page-head h1, .display {
  font-family: var(--font-display); font-size: clamp(3.2rem, 8vw, 7rem); line-height: .95;
  letter-spacing: -.02em; margin-top: 14px;
}
.display em, .page-head h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.5; max-width: 60ch; color: var(--text); margin-top: 20px; }
.head-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
@media (max-width: 860px) { .head-split { grid-template-columns: 1fr; } }
.head-art { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 10; background: var(--brand); position: relative; }
.head-art img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- sections ---------- */
.section { padding: clamp(40px, 6vw, 88px) 0; border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 20px; align-items: baseline; margin-bottom: clamp(24px, 3vw, 40px); }
.section-head .idx { font-family: var(--font-mono); font-size: .875rem; color: var(--accent); }
.section-head h2 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; letter-spacing: -.01em; }
.section-head p { grid-column: 2; margin: 0; color: var(--muted); }
.section-head .more { grid-row: 1; grid-column: 3; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.section-head .more:hover { color: var(--accent); }
@media (max-width: 640px) {
  .section-head { grid-template-columns: auto 1fr; }
  .section-head .more { grid-column: 2; grid-row: 3; justify-self: start; }
}

/* ---------- frame card (the morphing unit) ---------- */
.grid { display: grid; gap: clamp(20px, 2.4vw, 32px); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }

.frame { position: relative; display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
.frame-media {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--accent)));
  box-shadow: var(--shadow);
}
.frame-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--vt-ease); }
.frame:hover .frame-media img { transform: scale(1.035); }
.frame-media .fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 20px;
  font-family: var(--font-display); font-size: 2rem; line-height: 1.05; color: #f7f3ec; text-align: center;
}
.frame-media .fallback::after {
  content: ""; position: absolute; inset: 12px; border: 1px dashed rgba(247, 243, 236, .4); border-radius: 8px;
}
/* crop marks: the frame's registration corners */
.frame::before, .frame::after {
  content: ""; position: absolute; width: 16px; height: 16px; border: 0 solid var(--accent);
  opacity: 0; transition: opacity 150ms ease, transform 150ms ease; pointer-events: none;
}
.frame::before { left: -8px; top: -8px; border-left-width: 2px; border-top-width: 2px; transform: translate(4px, 4px); }
.frame::after { right: -8px; top: calc((100% - 0px) * 0 + 0px); border-right-width: 2px; border-top-width: 2px; transform: translate(-4px, 4px); top: -8px; }
.frame:hover::before, .frame:hover::after, .frame:focus-visible::before, .frame:focus-visible::after { opacity: 1; transform: none; }
.frame-label { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.frame-label .fr { color: var(--accent); }
.frame h3 { font-family: var(--font-display); font-size: clamp(1.6rem, 2.2vw, 2rem); line-height: 1.08; letter-spacing: -.005em; }
.frame:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: var(--accent); }
.frame p { margin: 0; color: var(--text); font-size: 1.0625rem; line-height: 1.55; }
.frame .go { font-weight: 600; color: var(--ink); font-size: 1rem; }
.frame.lg h3 { font-size: clamp(2rem, 3vw, 2.6rem); }

/* list rows */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) auto; gap: 8px 28px; padding: 22px 4px;
  text-decoration: none; color: inherit; align-items: baseline;
  transition: background 150ms ease;
}
.row:hover { background: var(--surface); }
.row .when { font-family: var(--font-mono); font-size: .875rem; color: var(--muted); }
.row h3 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.2vw, 1.9rem); line-height: 1.1; }
.row p { margin: 6px 0 0; color: var(--text); font-size: 1.0625rem; }
.row .tag { font-family: var(--font-mono); font-size: .8125rem; color: var(--brand); white-space: nowrap; }
@media (max-width: 700px) { .row { grid-template-columns: 1fr; gap: 4px; } }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chip {
  font-family: var(--font-mono); font-size: .8125rem; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; background: var(--surface);
}
a.chip:hover { border-color: var(--accent); color: var(--accent); }
.badge { font-family: var(--font-mono); font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.badge.updated { background: var(--brand-soft); color: var(--brand); }

/* filter bar (segmented) */
.filterbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--text); font: 500 1rem var(--font-body); cursor: pointer;
}
.seg button:hover { border-color: var(--ink); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.count { font-family: var(--font-mono); font-size: .875rem; color: var(--muted); }

/* ---------- home ---------- */
.hero { padding: clamp(32px, 5vw, 72px) 0 clamp(40px, 6vw, 80px); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.hero h1 { font-family: var(--font-display); font-size: clamp(3.2rem, 7.4vw, 7.4rem); line-height: .92; letter-spacing: -.025em; margin-top: 18px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { margin-top: 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center; margin-top: 32px; }
.portrait {
  position: relative; border-radius: 200px 200px var(--radius-lg) var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 5;
  background: var(--brand); box-shadow: var(--shadow);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 30%; }
.portrait figcaption {
  position: absolute; left: 14px; bottom: 14px; background: rgba(14, 17, 22, .78); color: #f2ede4;
  font-family: var(--font-mono); font-size: .8125rem; padding: 6px 10px; border-radius: 8px; letter-spacing: .04em;
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero .portrait { max-width: 420px; aspect-ratio: 5 / 4; border-radius: var(--radius-lg); }
}

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 32px; max-width: 560px; }
.stat { background: var(--surface); padding: 16px 18px; }
.stat b { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-family: var(--font-mono); font-size: .8125rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.shelf { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(20px, 2.4vw, 32px); }
.shelf .stack { display: grid; gap: clamp(20px, 2.4vw, 32px); }
@media (max-width: 900px) { .shelf { grid-template-columns: 1fr; } }

.icon-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.icon-card {
  display: grid; gap: 10px; align-content: start; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; color: inherit; min-height: 100%;
  transition: border-color 150ms ease, transform 150ms ease;
}
.icon-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.icon-card h3 { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1; }
.icon-card p { margin: 0; font-size: 1.0625rem; }
.icon-card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.icon-card .ic svg { width: 22px; height: 22px; }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
@media (max-width: 900px) { .trio { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-lg); padding: 28px; }
.panel h3 { font-family: var(--font-display); font-size: 1.9rem; margin-bottom: 14px; }
.panel.ink { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.panel.ink h3 { color: var(--ground); }
.panel.ink .btn { background: var(--ground); color: var(--ink); border-color: var(--ground); }
.panel.ink .btn:hover { background: var(--accent); border-color: var(--accent); color: #16181d; }
.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li + li { border-top: 1px solid var(--line); }
.linklist a { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; min-height: 48px; text-decoration: none; color: var(--ink); font-weight: 500; }
.linklist a:hover { color: var(--accent); }
.linklist small { font-family: var(--font-mono); font-size: .8125rem; color: var(--muted); }

/* ---------- writing ---------- */
.two-lists { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
@media (max-width: 800px) { .two-lists { grid-template-columns: 1fr; } }
.two-lists h3 { font-family: var(--font-display); font-size: 1.9rem; }
.two-lists .sub { color: var(--muted); margin: 4px 0 12px; }
.index-list[data-view="grid"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 32px 28px; border: 0; }
.index-list[data-view="grid"] li { border: 0; }
.index-list[data-view="grid"] .row { grid-template-columns: 1fr; padding: 0; gap: 10px; }
.index-list[data-view="grid"] .row:hover { background: none; }
.index-list .row .thumb { display: none; }
.index-list[data-view="grid"] .row .thumb { display: block; order: -1; }
.index-list[data-view="grid"] .row .tag { justify-self: start; }
.empty { padding: 40px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; }
.empty h3 { font-family: var(--font-display); font-size: 1.8rem; }
.series-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); border-radius: var(--radius-lg); overflow: hidden; background: var(--ink); color: var(--ground); text-decoration: none; }
.series-card img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.series-card .body { padding: clamp(24px, 4vw, 48px); display: grid; gap: 12px; align-content: center; }
.series-card h3 { color: var(--ground); font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1; }
.series-card .eyebrow { color: color-mix(in srgb, var(--ground) 70%, var(--ink)); }
.series-card p { margin: 0; color: color-mix(in srgb, var(--ground) 86%, var(--ink)); }
@media (max-width: 760px) { .series-card { grid-template-columns: 1fr; } .series-card img { min-height: 200px; aspect-ratio: 16 / 9; } }

/* ---------- projects ---------- */
.jump { position: sticky; top: 132px; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; background: var(--ground); scrollbar-width: none; }
@media (max-width: 980px) { .jump { top: 150px; } }
.jump a { flex: none; }
.feature {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit;
}
.feature .media { min-height: 360px; background: #0c1f33; }
.feature .media img { width: 100%; height: 100%; object-fit: cover; }
.feature .body { padding: clamp(24px, 4vw, 48px); display: grid; gap: 16px; align-content: center; }
.feature h3 { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature .media { min-height: 0; aspect-ratio: 16 / 10; } }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat-row div { background: var(--surface-2); padding: 12px 14px; }
.stat-row b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 2rem; line-height: 1; color: var(--ink); }
.stat-row span { font-family: var(--font-mono); font-size: .8125rem; color: var(--muted); text-transform: uppercase; }
.alt { display: grid; gap: clamp(28px, 4vw, 56px); }
.alt-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 48px); align-items: center; text-decoration: none; color: inherit; }
.alt-item:nth-child(even) .frame-media { order: 2; }
.alt-item h3 { font-family: var(--font-display); font-size: clamp(2rem, 3vw, 2.6rem); line-height: 1.05; margin: 8px 0 12px; }
.alt-item:hover h3 { color: var(--accent); }
@media (max-width: 760px) { .alt-item { grid-template-columns: 1fr; } .alt-item:nth-child(even) .frame-media { order: 0; } }
.mini { display: grid; gap: 8px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; transition: border-color 150ms ease; }
.mini:hover { border-color: var(--accent); }
.mini h3 { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; }
.mini p { margin: 0; font-size: 1.0625rem; }
.mini .meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .8125rem; color: var(--muted); }

/* ---------- ai ---------- */
.strip { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 22px 26px; border-radius: var(--radius-lg); background: var(--brand-soft); color: var(--ink); }
.strip p { margin: 0; font-size: 1.15rem; }
.notice { border-left: 3px solid var(--accent); background: var(--surface); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; }
.notice strong { color: var(--ink); }
.soon { opacity: 1; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; display: grid; gap: 8px; align-content: start; }
.soon h3 { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; color: var(--muted); }
.soon p { margin: 0; font-size: 1.0625rem; }

/* ---------- about ---------- */
.about-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(24px, 5vw, 72px); align-items: end; padding: clamp(32px, 5vw, 72px) 0; }
.about-hero .portrait { aspect-ratio: 4 / 5; }
@media (max-width: 860px) { .about-hero { grid-template-columns: 1fr; } .about-hero .portrait { max-width: 420px; aspect-ratio: 1; border-radius: var(--radius-lg); } }
.timeline-bar { display: flex; gap: 4px; flex-wrap: wrap; margin: 20px 0 32px; }
.timeline-bar span { flex: 1 1 110px; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: .9375rem; }
.timeline-bar span small { display: block; font-family: var(--font-mono); font-size: .8125rem; color: var(--muted); }
.timeline-bar span:first-child { border-color: var(--accent); }
.phases { display: grid; gap: 0; border-left: 2px solid var(--line-strong); margin-left: 8px; }
.phase { position: relative; padding: 0 0 32px 28px; }
.phase::before { content: ""; position: absolute; left: -8px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--ground); border: 3px solid var(--accent); }
.phase h3 { font-family: var(--font-display); font-size: 1.9rem; }
.phase .when { font-family: var(--font-mono); font-size: .875rem; color: var(--accent); }
.phase ul { margin: 10px 0 0; padding-left: 1.2em; }
.phase li { margin-bottom: 4px; }
.history[hidden] { display: none; }
.principles { background: var(--ink); color: var(--ground); border-radius: var(--radius-lg); padding: clamp(24px, 5vw, 56px); }
.principles h2 { color: var(--ground); font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); }
.principles ol { list-style: none; padding: 0; margin: 24px 0; counter-reset: p; display: grid; gap: 0; }
.principles li { counter-increment: p; display: grid; grid-template-columns: 3rem 1fr; padding: 16px 0; border-top: 1px solid color-mix(in srgb, var(--ground) 20%, var(--ink)); font-family: var(--font-display); font-style: italic; font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.25; }
.principles li::before { content: "0" counter(p); font-family: var(--font-mono); font-style: normal; font-size: .875rem; color: var(--accent); padding-top: 8px; }
.principles a { color: var(--ground); font-weight: 600; }
.beyond { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.beyond img { border-radius: var(--radius-lg); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
@media (max-width: 800px) { .beyond { grid-template-columns: 1fr; } }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.cap { background: var(--surface); padding: 26px; }
.cap h3 { font-family: var(--font-display); font-size: 1.8rem; }
.cap p { color: var(--muted); font-size: 1.0625rem; margin: 6px 0 14px; }
.dl { display: grid; gap: 18px; }
.dl div { display: grid; grid-template-columns: 11rem 1fr; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.dl dt { font-weight: 600; color: var(--ink); }
.dl dd { margin: 0; }
@media (max-width: 640px) { .dl div { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- article ---------- */
.progress { position: fixed; top: 0; left: 0; height: 4px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--accent); z-index: 60; }
.art-hero { position: relative; margin-top: clamp(20px, 3vw, 36px); }
.art-hero .frame-media { aspect-ratio: 21 / 9; border-radius: var(--radius-lg); }
.art-hero .frame-media { aspect-ratio: 1000 / 420; }
.art-head { max-width: 980px; padding: clamp(24px, 4vw, 48px) 0 8px; }
.art-head h1 { font-family: var(--font-display); font-size: clamp(2.8rem, 6.4vw, 5.6rem); line-height: .98; letter-spacing: -.02em; margin: 14px 0 18px; }
.art-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--font-mono); font-size: .875rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 18px; }
.art-meta a { color: var(--brand); }
.crumb { font-family: var(--font-mono); font-size: .875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.crumb:hover { color: var(--accent); }
.art-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; padding-top: 28px; }
@media (max-width: 1180px) { .art-layout { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.toc { position: sticky; top: 150px; align-self: start; }
.toc h2 { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-strong); }
.toc a { display: block; padding: 8px 0 8px 16px; margin-left: -1px; border-left: 3px solid transparent; color: var(--muted); text-decoration: none; font-size: 1rem; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.toc-mobile { display: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 28px; }
.toc-mobile summary { padding: 14px 18px; cursor: pointer; font-family: var(--font-mono); font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; min-height: 48px; }
.toc-mobile ol { margin: 0; padding: 0 18px 14px 36px; }
.toc-mobile a { display: block; padding: 6px 0; color: var(--text); }
@media (max-width: 1180px) { .toc { display: none; } .toc-mobile { display: block; } }

.prose { max-width: 700px; font-size: 1.1875rem; line-height: 1.7; }
.prose h2 { font-family: var(--font-display); font-size: clamp(2rem, 3.4vw, 2.7rem); line-height: 1.05; margin: 2.2em 0 .6em; letter-spacing: -.01em; }
.prose ol, .prose ul { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .35em; }
.prose code:not(pre code) { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; color: var(--ink); }
.prose blockquote { margin: 1.6em 0; padding: 18px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.prose blockquote p:last-child { margin: 0; }
.prose blockquote.why { border-left: 4px solid var(--brand); }
.prose blockquote.ask { border: 1px dashed var(--accent); background: transparent; }
.prose blockquote .kind { display: block; font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.prose blockquote.ask .kind { color: var(--accent); }
.prose blockquote.skill { background: var(--brand-soft); border-color: transparent; }
.code { margin: 1.6em 0; border-radius: var(--radius); overflow: hidden; background: var(--code-bg); color: var(--code-text); width: min(100%, 820px); }
@media (min-width: 1181px) { .code { width: calc(100% + 120px); } }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 16px; border-bottom: 1px solid #2a2f38; font-family: var(--font-mono); font-size: .8125rem; color: #a8b0bc; }
.code-bar button { min-height: 40px; min-width: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid #3a414c; background: transparent; color: #e8e3da; font: 500 .8125rem var(--font-mono); cursor: pointer; }
.code-bar button:hover { border-color: #ff8a5c; color: #ff8a5c; }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-family: var(--font-mono); font-size: .9375rem; line-height: 1.6; tab-size: 2; }
.tok-k { color: #ff9e7a; } .tok-s { color: #b5d78a; } .tok-c { color: #8d96a3; font-style: italic; } .tok-t { color: #8fc0f0; }
.after { max-width: 700px; display: grid; gap: 28px; margin-top: 48px; }
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.newsletter { border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 40px); background: var(--ink); color: var(--ground); }
.newsletter h2, .newsletter h3 { color: var(--ground); font-family: var(--font-display); font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1.05; }
.newsletter p { color: color-mix(in srgb, var(--ground) 86%, var(--ink)); }
.nl-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.nl-form input[type="email"] { flex: 1 1 220px; min-height: 48px; padding: 0 16px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--ground) 40%, var(--ink)); background: transparent; color: var(--ground); font: 1rem var(--font-body); }
.nl-form input::placeholder { color: color-mix(in srgb, var(--ground) 65%, var(--ink)); }
.nl-form .btn { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .nl-form .btn { color: #16181d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nl-form .btn { color: #16181d; } }
.nl-form label.agree { flex-basis: 100%; font-size: 1rem; display: flex; gap: 10px; align-items: flex-start; }
.nl-form label.agree input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); }
.nl-status { flex-basis: 100%; margin: 0; font-weight: 600; }
.nl-status:empty { display: none; }

/* ---------- patterns ---------- */
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.ways > div { background: var(--surface); padding: 24px; }
.ways h3 { font-family: var(--font-display); font-size: 1.8rem; }
.ways p { margin: 6px 0 0; font-size: 1.0625rem; }
.ways-foot { grid-column: 1 / -1; background: var(--surface-2) !important; }
@media (max-width: 800px) { .ways { grid-template-columns: 1fr; } }
.search-field { display: flex; align-items: center; gap: 10px; flex: 1 1 360px; min-height: 52px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); }
.search-field:focus-within { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.search-field input { flex: 1; min-width: 0; border: 0; background: transparent; font: 1.0625rem var(--font-body); color: var(--ink); min-height: 48px; }
.search-field input:focus { outline: none; }
.search-field svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 1rem var(--font-body); }
.pcard { display: grid; gap: 12px; text-decoration: none; color: inherit; align-content: start; }
.pcard .thumb {
  aspect-ratio: 16 / 10; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; padding: 18px; overflow: hidden; position: relative;
}
.pcard:hover .thumb { border-color: var(--accent); }
.pcard h3 { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.05; }
.pcard:hover h3 { color: var(--accent); }
.pcard p { margin: 0; font-size: 1.0625rem; }
.pcard .top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pcard .good { font-size: 1rem; color: var(--muted); }
.pcard .good b { color: var(--ink); }
/* category thumbnails, drawn in CSS */
.th { width: 100%; height: 100%; display: grid; gap: 6px; }
.th-data { grid-template-columns: repeat(12, 1fr); align-items: end; }
.th-data i { background: var(--brand); border-radius: 3px 3px 0 0; opacity: .85; }
.th-layout { grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; }
.th-layout i { border-radius: 8px; background: var(--surface); border: 1px solid var(--line-strong); }
.th-layout i:first-child { grid-row: span 2; background: color-mix(in srgb, var(--brand) 25%, var(--surface)); }
.th-inter { place-items: center; }
.th-inter i { width: 70%; height: 40%; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 6px 0 var(--line-strong); display: grid; place-items: center; font-family: var(--font-mono); font-size: .875rem; font-style: normal; color: var(--ink); }
.th-forms { align-content: center; }
.th-forms i { height: 22px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-strong); }
.th-forms i:last-child { width: 40%; background: var(--ink); border-color: var(--ink); }
.th-color { grid-template-columns: repeat(5, 1fr); }
.th-color i { border-radius: 8px; }
.th-hss { grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; height: auto; align-self: center; }
.th-hss i { background: var(--surface); padding: 12px 8px; font-style: normal; font-family: var(--font-mono); font-size: .8125rem; color: var(--muted); display: grid; }
.th-hss i b { font-family: var(--font-body); font-size: 1.1rem; color: var(--ink); }

/* pattern detail */
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--ink); text-decoration: none; }
.back:hover { color: var(--accent); }
.usecases { columns: 2 240px; margin: 12px 0 0; padding-left: 1.2em; }
.panes { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); margin-top: 32px; }
.panes-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs button { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font: 500 1rem var(--font-body); cursor: pointer; position: relative; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 -3px 0 var(--accent); }
.pane { padding: clamp(18px, 3vw, 32px); }
.pane pre { margin: 0; font-family: var(--font-mono); font-size: .9375rem; line-height: 1.6; overflow-x: auto; white-space: pre; color: var(--ink); }
.pane .note { margin-top: 18px; padding: 12px 16px; border-radius: 10px; background: var(--brand-soft); color: var(--ink); font-size: 1rem; }
.prompt-text { max-width: 70ch; }
.prompt-text p { font-size: 1.0625rem; }
/* live hairline stat strip */
.hss-caption { color: var(--muted); font-size: 1rem; margin: 0 0 10px; }
.hss-strip { display: grid; gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; grid-template-columns: 1fr; margin-bottom: 28px; }
@media (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 52rem) { .hss-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hss-tile { background: var(--surface); padding: 14px 16px; display: grid; gap: 2px; text-align: left; border: 0; font: inherit; color: inherit; min-width: 0; }
.hss-tile .l { font-family: var(--font-mono); font-size: .8125rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hss-tile .v { font-size: 1.6rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.hss-tile .v.none { color: var(--muted); font-weight: 400; }
.hss-tile .s { font-size: .9375rem; color: var(--muted); overflow-wrap: anywhere; }
button.hss-tile { cursor: pointer; min-height: 44px; }
button.hss-tile:hover { background: var(--surface-2); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--brand) 16%, var(--surface)); box-shadow: inset 0 3px 0 var(--accent); }
.dl-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dl-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.status { font-family: var(--font-mono); font-size: .875rem; display: inline-flex; gap: 6px; align-items: center; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-done { color: var(--ok); } .st-dl { color: var(--brand); } .st-q { color: var(--warn); } .st-fail { color: var(--bad); }
.status-line { margin: 12px 0 0; font-size: 1rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { margin-top: clamp(48px, 8vw, 120px); background: var(--ink); color: var(--ground); padding: clamp(40px, 6vw, 72px) 0 28px; }
.site-footer a { color: var(--ground); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.4fr; gap: 32px; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--ground) 72%, var(--ink)); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.site-footer li a { display: inline-flex; min-height: 40px; align-items: center; }
.site-footer p { color: color-mix(in srgb, var(--ground) 86%, var(--ink)); }
.foot-brand { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; color: var(--ground); display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.foot-brand svg { width: 40px; height: 40px; }
.motion-note { margin-top: 40px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--ground) 22%, var(--ink)); border-radius: var(--radius); font-size: 1rem; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; }
.motion-note p { margin: 0; max-width: 80ch; }
.foot-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--ground) 18%, var(--ink)); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 1rem; color: color-mix(in srgb, var(--ground) 78%, var(--ink)); }
.site-footer .nl-form input[type="email"] { color: var(--ground); }

/* =========================================================
   VIEW TRANSITIONS
   ========================================================= */
::view-transition-group(*) { animation-duration: var(--vt-dur); animation-timing-function: var(--vt-ease); }
::view-transition-old(*), ::view-transition-new(*) { animation-duration: var(--vt-dur); }

/* Images keep their crop while the frame changes aspect ratio (16:10 card -> 21:9 hero). */
::view-transition-old(*.media), ::view-transition-new(*.media) { height: 100%; width: 100%; object-fit: cover; overflow: clip; }
::view-transition-group(*.media) { border-radius: var(--radius); overflow: clip; }
/* Titles scale with the frame: a card title grows into the article H1. */
::view-transition-group(*.title) { animation-timing-function: cubic-bezier(.3, .9, .2, 1); }
/* Labels that change text crossfade at natural size instead of stretching. */
::view-transition-old(*.label), ::view-transition-new(*.label) { height: 100%; width: auto; object-fit: none; object-position: left top; }
/* The playhead glides with a little overshoot. */
::view-transition-group(playhead) { animation-timing-function: cubic-bezier(.34, 1.4, .5, 1); z-index: 3; }
::view-transition-group(site-header) { z-index: 2; }
::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; }
/* In-page reflows (filters, grid/list toggle) */
::view-transition-group(*.card) { animation-duration: calc(var(--vt-dur) * .8); }
::view-transition-new(*.card):only-child { animation: vt-pop-in calc(var(--vt-dur) * .8) var(--vt-ease) both; }
::view-transition-old(*.card):only-child { animation: vt-pop-out calc(var(--vt-dur) * .6) ease both; }

/* Root: direction-aware slide between sibling pages */
html[data-vt-dir="forward"]::view-transition-old(root) { animation: vt-out-left var(--vt-dur) var(--vt-ease) both; }
html[data-vt-dir="forward"]::view-transition-new(root) { animation: vt-in-right var(--vt-dur) var(--vt-ease) both; }
html[data-vt-dir="backward"]::view-transition-old(root) { animation: vt-out-right var(--vt-dur) var(--vt-ease) both; }
html[data-vt-dir="backward"]::view-transition-new(root) { animation: vt-in-left var(--vt-dur) var(--vt-ease) both; }
/* Deeper (listing -> detail): the page recedes, the clicked frame carries you in */
html[data-vt-dir="deeper"]::view-transition-old(root) { animation: vt-recede var(--vt-dur) var(--vt-ease) both; }
html[data-vt-dir="deeper"]::view-transition-new(root) { animation: vt-rise calc(var(--vt-dur) * 1.1) var(--vt-ease) both; }
html[data-vt-dir="shallower"]::view-transition-old(root) { animation: vt-sink var(--vt-dur) var(--vt-ease) both; }
html[data-vt-dir="shallower"]::view-transition-new(root) { animation: vt-return var(--vt-dur) var(--vt-ease) both; }
/* Theme: circle reveal is animated from JS; root pseudo must not also slide/fade */
html[data-vt-dir="theme"]::view-transition-old(root), html[data-vt-dir="theme"]::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html[data-vt-dir="theme"]::view-transition-old(root) { z-index: 0; }
html[data-vt-dir="theme"]::view-transition-new(root) { z-index: 1; }

@keyframes vt-out-left { to { opacity: 0; transform: translateX(-60px); } }
@keyframes vt-in-right { from { opacity: 0; transform: translateX(60px); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(60px); } }
@keyframes vt-in-left { from { opacity: 0; transform: translateX(-60px); } }
@keyframes vt-recede { to { opacity: 0; transform: scale(.96); filter: blur(2px); } }
@keyframes vt-rise { from { opacity: 0; transform: translateY(40px); } 40% { opacity: 0; } }
@keyframes vt-sink { to { opacity: 0; transform: translateY(40px); } }
@keyframes vt-return { from { opacity: 0; transform: scale(.97); } }
@keyframes vt-pop-in { from { opacity: 0; transform: scale(.92); } }
@keyframes vt-pop-out { to { opacity: 0; transform: scale(.92); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
  .frame:hover .frame-media img { transform: none; }
}

[hidden] { display: none !important; }
.th-data i:nth-child(1) { height: 30%; } .th-data i:nth-child(2) { height: 55%; } .th-data i:nth-child(3) { height: 42%; }
.th-data i:nth-child(4) { height: 70%; } .th-data i:nth-child(5) { height: 62%; } .th-data i:nth-child(6) { height: 88%; }
.th-data i:nth-child(7) { height: 50%; } .th-data i:nth-child(8) { height: 76%; } .th-data i:nth-child(9) { height: 38%; }
.th-data i:nth-child(10) { height: 64%; } .th-data i:nth-child(11) { height: 92%; background: var(--accent); } .th-data i:nth-child(12) { height: 58%; }
.th-color i:nth-child(1) { background: var(--brand); } .th-color i:nth-child(2) { background: var(--accent); }
.th-color i:nth-child(3) { background: var(--ok); } .th-color i:nth-child(4) { background: var(--warn); } .th-color i:nth-child(5) { background: var(--bad); }
.th-forms i:nth-child(1) { width: 85%; } .th-forms i:nth-child(2) { width: 65%; }

/* UI pattern library article */
.prose .prose-fig { margin: 1.8em 0; aspect-ratio: auto; height: auto; }
.prose .prose-fig img { width: 100%; height: auto; object-fit: contain; display: block; }
.prose blockquote p + p { margin-top: .8em; }
.prose .live-pattern a.btn { color: var(--ground); text-decoration: none; height: auto; padding-block: 10px; }
.prose p code { overflow-wrap: anywhere; }
