:root {
  --ground: #0D0D0F;
  --panel: #18181B;
  --line: #2A2A30;
  --ink: #F5F5F7;
  --quiet: #A1A1AA;
  --blue: #3F69FC;
  --blue-hi: #6A8BFF;
  --green: #12FF80;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --pad: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 500 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-hi); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
.mono { font-family: var(--mono); font-weight: 400; font-size: .92em; }
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

/* Header */
.hero { padding-top: 36px; padding-bottom: 22px; }
.kicker {
  margin: 0 0 14px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue-hi);
}
.kicker span { color: var(--quiet); margin: 0 4px; }
h1 {
  margin: 0;
  font-size: clamp(30px, 8.4vw, 54px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -.015em;
  max-width: 15ch;
}
@media (min-width: 900px) { h1 { max-width: 22ch; } .hero { padding-top: 48px; } }
h1 em, .lede em { font-style: normal; color: var(--blue); }
h1 em { color: var(--blue-hi); }
.lede {
  margin: 16px 0 0;
  font-size: clamp(17px, 4.6vw, 22px);
  font-weight: 700;
  line-height: 1.35;
}
.lede em { color: var(--blue-hi); }
.credits {
  margin: 14px 0 0;
  color: var(--quiet);
  font-size: 13.5px;
  max-width: 60ch;
}

/* Tabs */
.tabs {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13, 13, 15, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tabs-inner { display: flex; gap: 4px; }
.tabs a {
  flex: 1 1 0;
  text-align: center;
  padding: 15px 8px 13px;
  color: var(--quiet);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--blue); }
@media (min-width: 640px) {
  .tabs a { flex: 0 0 auto; padding-left: 22px; padding-right: 22px; }
}

main { padding-top: 22px; padding-bottom: 40px; min-height: 60vh; }
.panel:focus { outline: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font: 700 14.5px/1.2 var(--sans);
  text-decoration: none;
  border: 1px solid var(--blue);
  white-space: nowrap;
}
.btn:hover { background: #2f58ec; color: #fff; }
.btn small { font-weight: 500; opacity: .8; font-size: 12.5px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #3a3a42; }
.btn.ghost:hover { border-color: var(--quiet); background: var(--panel); }
.btn:focus-visible, .tabs a:focus-visible, .switch button:focus-visible, .v-btn:focus-visible, .v-nav:focus-visible, .grid button:focus-visible, .pages a:focus-visible {
  outline: 2px solid var(--blue-hi); outline-offset: 2px;
}

/* Video */
.switch {
  display: inline-flex;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 14px;
  width: 100%;
}
.switch button {
  flex: 1 1 0;
  appearance: none; border: 0; cursor: pointer;
  padding: 10px 12px;
  border-radius: 9px;
  background: transparent;
  color: var(--quiet);
  font: 700 14px/1.2 var(--sans);
}
.switch button span { font-family: var(--mono); font-weight: 400; font-size: 12px; margin-left: 4px; opacity: .8; }
.switch button[aria-pressed="true"] { background: var(--blue); color: #fff; }
@media (min-width: 640px) { .switch { width: auto; } .switch button { flex: 0 0 auto; padding: 10px 18px; } }

.player { margin: 0; }
.player video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.player figcaption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px;
  color: var(--quiet);
  font-size: 13.5px;
}

.parts {
  list-style: none; margin: 26px 0 0; padding: 0;
  display: grid; gap: 10px;
}
.parts li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 14.5px;
}
.parts li:first-child { border-left-color: var(--green); }
.parts b { display: block; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--blue-hi); margin-bottom: 2px; }
.parts li:first-child b { color: var(--green); }
@media (min-width: 900px) { .parts { grid-template-columns: repeat(3, 1fr); } }

/* Shared bar */
.bar {
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 20px;
}
.bar p { margin: 0; color: var(--quiet); max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 auto; }
@media (min-width: 760px) {
  .bar { flex-direction: row; align-items: center; justify-content: space-between; }
  .actions .btn { flex: 0 0 auto; }
}

/* PDF */
.pdf-embed { display: none; }
.pdf-embed object {
  display: block;
  width: 100%;
  height: min(88vh, 1100px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
@media (min-width: 900px) and (hover: hover) {
  .pdf-embed.ok { display: block; margin-bottom: 34px; }
}
.sub { margin: 0; font-size: 18px; font-weight: 800; }
.hint { margin: 4px 0 14px; color: var(--quiet); font-size: 13.5px; }
.pages {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .pages { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .pages { grid-template-columns: repeat(5, 1fr); gap: 14px; } }
.pages a { display: block; color: var(--quiet); text-decoration: none; font-size: 13px; }
.pages img {
  display: block; width: 100%; height: auto; aspect-ratio: 909 / 1287;
  border-radius: 6px; background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color .15s, transform .15s;
}
.pages a:hover img { border-color: var(--blue); }
.pages span { display: block; margin-top: 7px; }
.pages b { color: var(--ink); font-weight: 700; }

/* Images grid */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.grid button {
  appearance: none; border: 0; padding: 0; margin: 0; background: none; cursor: zoom-in;
  display: block; width: 100%; text-align: left; color: var(--quiet);
  font: 500 12.5px/1.35 var(--sans);
}
.grid img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5;
  border-radius: 8px; background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color .15s;
}
.grid button:hover img { border-color: var(--blue); }
.grid span { display: block; margin-top: 7px; }
.grid b { color: var(--ink); font-family: var(--mono); font-weight: 500; margin-right: 4px; }

/* Wave links */
.wave {
  display: flex; align-items: center; gap: 14px;
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--quiet);
  text-decoration: none;
  font-size: 13.5px;
  transition: border-color .15s;
}
.wave:hover { border-color: var(--blue); color: var(--quiet); }
.wave span { flex: 1; }
.wave b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 1px; }
.wave svg { flex: 0 0 22px; width: 22px; height: 22px; fill: none; stroke: var(--blue-hi); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#pdf .wave { margin: 0 0 30px; }

/* Card slider */
.slider { margin: 0 calc(-1 * max(var(--pad), env(safe-area-inset-left))) 34px; }
.slides {
  display: flex; gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 8% 6px;
  scroll-padding: 0 8%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.slides::-webkit-scrollbar { display: none; }
.slides.dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.slide {
  flex: 0 0 84%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  margin: 0;
  opacity: .45;
  transform: scale(.94);
  transition: opacity .3s, transform .3s;
}
.slide.on { opacity: 1; transform: none; }
.slide button {
  appearance: none; border: 0; padding: 0; margin: 0; background: none;
  display: block; width: 100%; cursor: zoom-in;
}
.slide:not(.on) button { cursor: pointer; }
.slide img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5;
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  user-select: none; -webkit-user-drag: none;
}
.slide figcaption { margin-top: 10px; color: var(--quiet); font-size: 13.5px; text-align: center; }
.slide figcaption b { color: var(--ink); font-family: var(--mono); font-weight: 500; margin-right: 6px; }
.slides:focus-visible .slide.on img { outline: 2px solid var(--blue-hi); outline-offset: 3px; }

.slider-nav {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 12px;
  padding: 0 max(var(--pad), env(safe-area-inset-left));
}
.s-btn {
  appearance: none; cursor: pointer; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid #34343b; background: var(--panel); color: var(--ink);
}
.s-btn:hover { border-color: var(--quiet); }
.s-btn[disabled] { opacity: .3; cursor: default; }
.s-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.s-btn:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 2px; }
.dots { display: none; }
.s-count { font-family: var(--mono); font-size: 13px; color: var(--quiet); min-width: 5.5ch; text-align: center; }
@media (min-width: 640px) {
  .slider { margin-left: 0; margin-right: 0; }
  .slides { padding: 4px calc(50% - 210px) 6px; scroll-padding: 0 calc(50% - 210px); gap: 22px; }
  .slide { flex-basis: 420px; }
  .slides {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  }
  .dots { display: flex; gap: 6px; align-items: center; }
  .dots button {
    appearance: none; border: 0; padding: 0; cursor: pointer;
    width: 8px; height: 8px; border-radius: 4px; background: #3a3a42;
    transition: width .25s, background .25s;
  }
  .dots button[aria-current="true"] { width: 22px; background: var(--blue); }
  .dots button:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 2px; }
  .s-count { display: none; }
}
@media (min-width: 1000px) {
  .slides { padding: 4px calc(50% - 240px) 6px; scroll-padding: 0 calc(50% - 240px); }
  .slide { flex-basis: 480px; }
}
@media (prefers-reduced-motion: reduce) { .slides { scroll-behavior: auto; } }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-top: 22px; padding-bottom: 40px; font-size: 13.5px; color: var(--quiet); }
.foot p { margin: 0 0 8px; max-width: 70ch; }
.foot .quiet { font-size: 12.5px; opacity: .8; }

/* Viewer */
body.locked { overflow: hidden; }
.viewer {
  position: fixed; inset: 0; z-index: 50;
  background: #08080A;
  display: flex; flex-direction: column;
  touch-action: pan-y pinch-zoom;
}
.viewer-top {
  display: flex; align-items: center; gap: 6px;
  padding: max(10px, env(safe-area-inset-top)) 10px 6px 18px;
}
.count { flex: 1; font-family: var(--mono); font-size: 13px; color: var(--quiet); }
.v-btn, .v-nav {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid #34343b; background: rgba(24, 24, 27, .85); color: var(--ink);
}
.v-btn:hover, .v-nav:hover { border-color: var(--quiet); }
.v-btn svg, .v-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viewer-stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 4px 12px;
}
.viewer-stage img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  border-radius: 8px;
  user-select: none; -webkit-user-drag: none;
  transition: opacity .15s, transform .2s;
}
.viewer-stage img.fade { opacity: .25; }
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.v-nav.prev { left: 12px; }
.v-nav.next { right: 12px; }
.v-nav[disabled] { opacity: .3; cursor: default; }
.v-cap {
  margin: 0; text-align: center;
  padding: 8px 16px max(14px, env(safe-area-inset-bottom));
  color: var(--quiet); font-size: 13.5px;
}
@media (max-width: 759px) {
  /* On phones, arrows sit at the bottom so they never cover the card */
  .v-nav { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); transform: none; }
  .v-cap { padding-left: 64px; padding-right: 64px; min-height: 68px; display: flex; align-items: center; justify-content: center; }
}
@media (min-width: 760px) {
  .viewer-stage { padding: 6px 80px; }
  .v-nav { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
