/* ==========================================================================
   Microduck site — light theme, responsive, no frameworks.
   ========================================================================== */

:root {
  --cream: #fffdf7;
  --cream-2: #fff8ea;
  --paper: #ffffff;
  --ink: #17191d;
  --ink-2: #3c424b;
  --ink-3: #6b7380;
  --line: #e7e2d6;
  --line-2: #efeade;

  --duck: #f5a623;
  --duck-dark: #d98410;
  --duck-soft: #fff1d4;
  --sky: #4fa8e8;
  --sky-soft: #e6f3fd;
  --lav: #9b8ce0;
  --lav-soft: #f0ecfd;
  --graphite: #4a4f57;
  --teal: #24a58c;
  --teal-soft: #e4f6f2;
  --red: #d9534f;
  --red-soft: #fdeceb;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(23, 25, 29, .05), 0 1px 3px rgba(23, 25, 29, .04);
  --shadow: 0 2px 4px rgba(23, 25, 29, .04), 0 8px 24px rgba(23, 25, 29, .06);
  --shadow-lg: 0 4px 12px rgba(23, 25, 29, .06), 0 24px 60px rgba(23, 25, 29, .10);

  --maxw: 1180px;
  --nav-h: 64px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue",
    Arial, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.78;
  color: var(--ink-2);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }
a { color: var(--duck-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 .6em;
  letter-spacing: -.01em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 5vw, 3.4rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.45rem, 3.2vw, 2.3rem); letter-spacing: -.02em; }
h3 { font-size: clamp(1.12rem, 2.1vw, 1.35rem); }
p { margin: 0 0 1.1em; overflow-wrap: break-word; }
li { overflow-wrap: break-word; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--lav-soft);
  color: #5a4bb5;
  padding: .12em .4em;
  border-radius: 5px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

::selection { background: var(--duck-soft); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ── Nav ─────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(255, 253, 247, .82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.nav.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 20px rgba(23, 25, 29, .05);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink);
  font-size: 1.1rem;
  letter-spacing: -.02em;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 4px 6px 4px 2px;
  border-radius: 10px;
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }

.nav__links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
}
.nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--ink-3);
  font-size: .9rem;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color .18s, background .18s;
}
.nav__links a:hover {
  color: var(--ink);
  background: var(--cream-2);
  text-decoration: none;
}

.lang {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--paper);
  flex: 0 0 auto;
}
.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 32px;
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--ink-3);
}
.lang a:hover { text-decoration: none; color: var(--ink); }
.lang a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 12px;
  font: inherit;
  font-size: .85rem;
  color: var(--ink);
  cursor: pointer;
  min-height: 40px;
}
.nav__toggle:hover { background: var(--cream-2); }

.nav__toc {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 12px;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  min-height: 40px;
  white-space: nowrap;
}
.nav__toc:hover { background: var(--cream-2); }

.toc-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(88vw, 340px);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  z-index: 110;
  transform: translateX(110%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.toc-drawer.is-open { transform: translateX(0); }
.toc-drawer__overlay {
  position: fixed;
  inset: 0;
  background: rgba(23,25,29,.35);
  z-index: 109;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.toc-drawer__overlay.is-open { opacity: 1; visibility: visible; }
.toc-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink);
}
.toc-drawer__head button {
  background: none;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
}
.toc-drawer__head button:hover { background: var(--cream-2); }
.toc-drawer ol {
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  overflow-y: auto;
}
.toc-drawer li a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: .95rem;
  line-height: 1.45;
}
.toc-drawer li a:hover,
.toc-drawer li a.is-active { background: var(--cream-2); color: var(--ink); text-decoration: none; }

@media (max-width: 1080px) {
  .nav__toc { display: inline-flex; }
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px);
  background:
    radial-gradient(1000px 520px at 82% -12%, rgba(79, 168, 232, .16), transparent 62%),
    radial-gradient(760px 420px at 8% 4%, rgba(245, 166, 35, .18), transparent 60%),
    radial-gradient(620px 380px at 62% 46%, rgba(155, 140, 224, .12), transparent 66%),
    var(--cream);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--duck-dark);
  background: var(--duck-soft);
  border: 1px solid #f7e0b0;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 { margin-bottom: 20px; }
.hero__sub {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  color: var(--ink-2);
  max-width: 62ch;
  margin-bottom: 26px;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
}
.badges li {
  font-size: .84rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: .96rem;
  padding: 13px 24px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: transform .16s, box-shadow .16s, background .16s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary {
  background: linear-gradient(180deg, #ffb733, var(--duck));
  color: #40260a;
  box-shadow: 0 2px 0 #c97c0c, 0 10px 24px rgba(245, 166, 35, .32);
}
.btn--primary:hover { box-shadow: 0 2px 0 #c97c0c, 0 14px 30px rgba(245, 166, 35, .42); }
.btn--ghost {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { border-color: var(--ink-3); }

.hero__art { position: relative; display: flex; justify-content: center; }
.hero__art svg { width: 100%; max-width: 380px; filter: drop-shadow(0 24px 40px rgba(23, 25, 29, .12)); }
.hero__art::after {
  content: "";
  position: absolute;
  inset: auto 8% -6% 8%;
  height: 26px;
  background: radial-gradient(50% 60% at 50% 50%, rgba(23, 25, 29, .16), transparent 70%);
  filter: blur(4px);
}

/* ── Layout: content column + sticky TOC rail ───────────────────────── */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(24px, 4vw, 48px);
}
.layout__main { min-width: 0; }

/* ── Sections ────────────────────────────────────────────────────────── */

.section {
  padding: clamp(32px, 4.5vw, 56px) 0;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.section + .section { border-top: 1px solid var(--line-2); }
.section--alt,
.section--tint,
.section--lav {
  padding: clamp(28px, 4vw, 48px) clamp(20px, 3vw, 40px);
  border-radius: var(--radius-lg);
  margin: clamp(20px, 3vw, 32px) 0;
}
.section + .section--alt,
.section + .section--tint,
.section + .section--lav { border-top: 0; }
.section--alt {
  background: linear-gradient(180deg, var(--paper), var(--cream-2));
  border: 1px solid var(--line-2);
}
.section--tint { background: var(--sky-soft); border: 1px solid #d9ebfa; }
.section--lav { background: var(--lav-soft); border: 1px solid #e6dffb; }

.sec-head { max-width: 74ch; margin-bottom: 40px; }
.sec-kicker {
  display: block;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--duck-dark);
  margin-bottom: 12px;
}
.sec-kicker__n { font-variant-numeric: tabular-nums; }
.sec-kicker__dot { margin: 0 .5em; opacity: .5; }
.sec-head h2 { margin-bottom: .35em; }
.sec-head p { color: var(--ink-3); font-size: 1.04rem; }

.lead {
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.72;
  border-left: 3px solid var(--duck);
  padding-left: 18px;
  margin-bottom: 1.4em;
}

/* ── Stats ───────────────────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin: 32px 0;
  padding: 0;
  list-style: none;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat__v {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.03em;
  line-height: 1.15;
}
.stat__l {
  display: block;
  font-size: .88rem;
  font-weight: 650;
  color: var(--ink);
  margin-top: 6px;
}
.stat__d {
  display: block;
  font-size: .82rem;
  color: var(--ink-3);
  line-height: 1.55;
  margin-top: 4px;
}

/* ── Cards ───────────────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.cards--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #d9d2c2;
}
.card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--duck-soft);
  color: var(--duck-dark);
  margin-bottom: 14px;
}
.card__icon svg { width: 22px; height: 22px; }
.card h3 {
  font-size: 1.06rem;
  margin-bottom: .45em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card p:last-child { margin-bottom: 0; }
.card p { font-size: .95rem; }
.tag {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
}

/* ── Tables ──────────────────────────────────────────────────────────── */

.table-wrap {
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
  min-width: 560px;
}
caption {
  text-align: left;
  padding: 14px 20px;
  font-size: .84rem;
  color: var(--ink-3);
  background: var(--cream-2);
  border-bottom: 1px solid var(--line);
}
th, td {
  text-align: left;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}
thead th {
  background: var(--cream-2);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffcf4; }
td:first-child { font-weight: 650; color: var(--ink); white-space: nowrap; }
td:first-child:not(:only-child) { min-width: 130px; }

/* ── Code ────────────────────────────────────────────────────────────── */

.code {
  margin: 26px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1f2228;
  box-shadow: var(--shadow);
}
.code__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: #17191d;
  border-bottom: 1px solid #2c3038;
}
.code__dot { width: 11px; height: 11px; border-radius: 50%; background: #3a3f47; }
.code__dot:nth-child(1) { background: #ec6a5e; }
.code__dot:nth-child(2) { background: #f4bf4f; }
.code__dot:nth-child(3) { background: #61c554; }
.code__lang {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .74rem;
  color: #8b93a0;
  letter-spacing: .06em;
}
.code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.code pre, .code pre * {
  word-break: break-all;
  overflow-wrap: anywhere;
}
.code code {
  background: none;
  color: #e6e8ec;
  font-size: .84rem;
  line-height: 1.7;
  padding: 0;
  white-space: pre;
}
.code .c-cm { color: #7d8590; font-style: italic; word-break: break-all; }
.code .c-kw { color: #ffb454; }
.code .c-str { color: #9ae28d; word-break: break-all; }

/* ── Notes ───────────────────────────────────────────────────────────── */

.note {
  display: flex;
  gap: 14px;
  margin: 24px 0;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: .96rem;
}
.note p:last-child { margin-bottom: 0; }
.note__ico { flex: 0 0 auto; margin-top: 3px; }
.note__ico svg { width: 20px; height: 20px; display: block; }
.note--info { background: var(--sky-soft); border-color: #cfe7f9; color: #17456b; }
.note--info .note__ico { color: var(--sky); }
.note--warn { background: var(--duck-soft); border-color: #f5dfb4; color: #6b4305; }
.note--warn .note__ico { color: var(--duck-dark); }

/* ── Lists ───────────────────────────────────────────────────────────── */

.prose ul, .prose ol {
  margin: 0 0 1.3em;
  padding-left: 1.35em;
}
.prose li { margin-bottom: .7em; }
.prose li::marker { color: var(--duck-dark); font-weight: 700; }
.prose h3 { margin-top: 2em; }

/* ── Diagrams ────────────────────────────────────────────────────────── */

.diagram {
  margin: 30px 0;
  padding: 26px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.diagram svg { display: block; margin: 0 auto; min-width: 560px; }
.diagram figcaption {
  margin-top: 16px;
  text-align: center;
  font-size: .85rem;
  color: var(--ink-3);
}
.dg-box { fill: #fff; stroke: var(--line); stroke-width: 1.5; rx: 10; }
.dg-box--core { fill: var(--duck-soft); stroke: #f0c479; }
.dg-box--net { fill: var(--sky-soft); stroke: #bcdcf5; }
.dg-box--safe { fill: var(--lav-soft); stroke: #d5cbf8; }
.dg-box--out { fill: var(--teal-soft); stroke: #b6e3da; }
.dg-t { font: 700 13px var(--font); fill: var(--ink); }
.dg-s { font: 400 11px var(--font); fill: var(--ink-3); }
.dg-m { font: 600 11px var(--mono); fill: var(--ink-2); }
.dg-arrow { stroke: var(--ink-3); stroke-width: 1.6; fill: none; }
.dg-line { stroke: var(--line); stroke-width: 1.5; }
.dg-band { fill: var(--cream-2); rx: 8; }
.dg-step { font: 700 12px var(--font); fill: #fff; }

/* ── Demo reels ──────────────────────────────────────────────────────── */

.videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 22px;
  margin: 28px 0;
}
.vcard { margin: 0; display: flex; flex-direction: column; }
.vcard__frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1b1e24;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  /* the poster is the aspect box: no layout shift when the video swaps in */
  aspect-ratio: 16 / 9;
}
.vcard__v {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #1b1e24;
}
.vcard__frame:has(.vcard__v[poster]) { background: transparent; }
.vcard__tag {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: .45em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(23, 25, 29, .72);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.vcard__dur {
  font-family: var(--mono);
  font-weight: 600;
  opacity: .78;
  font-variant-numeric: tabular-nums;
}
.vcard__fallback { margin: 0; padding: 12px; color: #e8e5de; font-size: .9rem; }
.vcard__cap { padding-top: 12px; }
.vcard__cap h3 { font-size: 1.04rem; margin-bottom: .3em; }
.vcard__cap p { font-size: .93rem; color: var(--ink-3); margin: 0; }

/* ── Photo grid ──────────────────────────────────────────────────────── */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.shot {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--cream-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.shot:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.shot { cursor: zoom-in; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  /* mixed portrait/landscape sources: crop to a uniform tile */
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--line-2);
}
.shot figcaption {
  padding: 8px 12px 10px;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--ink-3);
  border-top: 1px solid var(--line-2);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255, 253, 247, .96);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 48px);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  transform: scale(.96);
  transition: transform .25s;
}
.lightbox.is-open img { transform: scale(1); }
.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 1.4rem;
  box-shadow: var(--shadow);
}
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover { background: var(--cream-2); }
.lightbox__cap {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .88rem;
  max-width: min(90vw, 520px);
  text-align: center;
}

.credit {
  font-size: .84rem;
  color: var(--ink-3);
  margin: -8px 0 28px;
}
.credit a { color: var(--ink-2); }

/* ── Media wall ──────────────────────────────────────────────────────── */

.media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.mcard {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.mcard:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #d9d2c2;
}
.mcard__top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.mcard__source {
  font-size: .78rem;
  font-weight: 700;
  color: var(--duck-dark);
  background: var(--duck-soft);
  border-radius: 6px;
  padding: 3px 9px;
}
.mcard__date { font-size: .78rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mcard h3 { font-size: 1.03rem; margin-bottom: .5em; line-height: 1.45; }
.mcard h3 a { color: var(--ink); }
.mcard h3 a:hover { color: var(--duck-dark); text-decoration: none; }
.mcard__quote {
  font-size: .92rem;
  color: var(--ink-2);
  border-left: 3px solid var(--line);
  padding-left: 14px;
  margin: 0 0 14px;
  flex: 1 1 auto;
}
.mcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-2);
  padding-top: 13px;
}
.mtags { display: flex; gap: 6px; flex-wrap: wrap; }
.mtag {
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}
.mcard__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 0;
  font-size: .86rem;
  font-weight: 650;
  white-space: nowrap;
}
.mcard__link svg { width: 14px; height: 14px; }

/* ── Link list ───────────────────────────────────────────────────────── */

.links { display: grid; gap: 12px; margin: 26px 0; }
.llink {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.llink:hover {
  border-color: var(--duck);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.llink__ico {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--cream-2);
  color: var(--ink-2);
}
.llink__ico svg { width: 18px; height: 18px; }
.llink strong { display: block; color: var(--ink); font-size: .98rem; }
.llink span { display: block; font-size: .88rem; color: var(--ink-3); line-height: 1.55; }

/* ── FAQ ─────────────────────────────────────────────────────────────── */

.faq { margin: 26px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer;
  padding: 18px 22px 18px 52px;
  font-weight: 650;
  color: var(--ink);
  font-size: 1rem;
  position: relative;
  list-style: none;
  transition: background .16s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--cream-2); }
.faq summary::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -5px;
  border-right: 2px solid var(--duck-dark);
  border-bottom: 2px solid var(--duck-dark);
  transform: rotate(-45deg);
  transition: transform .2s;
}
.faq details[open] summary::before { transform: rotate(45deg); margin-top: -7px; }
.faq details[open] summary { background: var(--cream-2); }
.faq__a { padding: 0 22px 20px 52px; font-size: .96rem; }
.faq__a p:last-child { margin-bottom: 0; }

/* ── TOC rail ────────────────────────────────────────────────────────── */

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  font-size: .86rem;
  max-height: calc(100vh - var(--nav-h) - 48px);
  overflow-y: auto;
}
.toc__title {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a {
  display: block;
  padding: 7px 0 7px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--ink-3);
  line-height: 1.45;
}
.toc li a:hover { color: var(--ink); text-decoration: none; }
.toc li a.is-active {
  color: var(--duck-dark);
  border-left-color: var(--duck);
  font-weight: 650;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.footer {
  background: var(--ink);
  color: #a9b1bd;
  padding: clamp(44px, 6vw, 72px) 0 32px;
  margin-top: clamp(40px, 6vw, 72px);
}
.footer a { color: #e8ebf0; }
.footer h4 {
  color: #fff;
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #2b3038;
}
.footer__grid ul { list-style: none; margin: 0; padding: 0; }
.footer__grid li { margin-bottom: 8px; font-size: .92rem; }
.footer__brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; margin-bottom: 12px; }
.footer__note { font-size: .88rem; line-height: 1.7; max-width: 44ch; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  font-size: .84rem;
}

.totop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #2b3038;
  color: #e8ebf0;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 44px;
  font: inherit;
  font-size: .86rem;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.totop:hover { background: #3a404a; transform: translateY(-2px); }
.totop:focus-visible { outline-color: var(--sky); }

/* ── Reveal animation ────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s cubic-bezier(.22, .61, .36, 1), transform .55s cubic-bezier(.22, .61, .36, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; }
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr !important; }
  .toc { display: none; }
}

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .hero__art svg { max-width: 260px; }
  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px 18px;
    box-shadow: var(--shadow);
    overflow: visible;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 11px 12px; font-size: .98rem; border-radius: 10px; }
  .nav__toggle { display: block; margin-left: auto; }
  .nav__inner { gap: 12px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.42rem; }
  .hero { padding-top: 32px; }
  .hero__kicker { font-size: .72rem; padding: 5px 11px; margin-bottom: 18px; }
  .hero__art svg { max-width: 220px; }
  .badges li { font-size: .82rem; padding: 5px 11px; }
  .card, .mcard { padding: 20px; }
  .cards, .media, .cards--2 { grid-template-columns: 1fr; }
  .videos { grid-template-columns: 1fr; gap: 18px; }
  .shots { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .shot figcaption { font-size: .82rem; padding: 8px 10px 10px; }
  .cta-row .btn { flex: 1 1 100%; justify-content: center; }
  th, td { padding: 11px 14px; font-size: .9rem; }
  caption { padding: 12px 14px; }
  .faq summary { padding: 15px 16px 15px 40px; font-size: .96rem; }
  .faq summary::before { left: 16px; }
  .faq__a { padding: 0 16px 16px 40px; }
  .footer__grid { gap: 24px; }
  .diagram { padding: 18px 12px; border-radius: var(--radius); }
  .diagram svg { width: 100%; min-width: 0; height: auto; }
  table { min-width: 0; table-layout: fixed; width: 100%; }
  td:first-child { white-space: normal; word-break: break-word; }
  td, th { word-break: break-word; }
}

@media (max-width: 360px) {
  .brand span { display: none; }
  .brand { padding: 4px; }
  .lang a { padding: 5px 9px; min-width: 36px; }
  .nav__toggle, .nav__toc { padding: 7px 10px; font-size: .78rem; }
  .nav__toc svg + span,
  .nav__toc::after { display: none; }
  .nav__toc { padding: 7px; width: 40px; }
}

@media print {
  .nav, .toc, .totop, .hero__art, .videos, .shots { display: none; }
  body { background: #fff; color: #000; }
  .section { padding: 24px 0; page-break-inside: avoid; }
}
