:root {
  --bg: #f4f1ea;
  --fg: #111111;
  --fg-dim: rgba(17, 17, 17, 0.74);
  --fg-faint: rgba(17, 17, 17, 0.56);
  --line: rgba(17, 17, 17, 0.16);
  --line-soft: rgba(17, 17, 17, 0.08);
  --underline: rgba(17, 17, 17, 0.35);
  --track: rgba(17, 17, 17, 0.15);
  --surface: rgba(255, 255, 255, 0.6);
  --glass: rgba(255, 255, 255, 0.55);
  --nav-bg: rgba(244, 241, 234, 0.86);
  --on-fill: #f4f1ea;
  --fill-hover: #2b2b2b;
  --accent: #2f5bff;
  --accent-hover: #1f47eb;
  --on-accent: #ffffff;
  --accent-ink: #2448e0;
  --hard: #111111;
  --card-bg: #e7e2d7;
  --card-ring: rgba(17, 17, 17, 0.1);
  --frame-shadow: 10px 10px 0 #111111, 0 0 0 2px #111111;
  --stage-shadow: 0 24px 60px rgba(40, 36, 28, 0.22);
  --wash-filter: blur(56px) saturate(1.3) brightness(1.08);
  --wash-shade: linear-gradient(90deg, rgba(244, 241, 234, 0.96) 0%, rgba(244, 241, 234, 0.74) 55%, rgba(244, 241, 234, 0.42) 100%);
  color-scheme: light;
  --font: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --nav: 72px;
}

/* Dark theme. Also used for the phone splash, where text sits on the photo. */
:root[data-theme="dark"] {
  --bg: #0f0f11;
  --fg: #f4f1ea;
  --fg-dim: rgba(244, 241, 234, 0.72);
  --fg-faint: rgba(244, 241, 234, 0.5);
  --line: rgba(244, 241, 234, 0.16);
  --line-soft: rgba(244, 241, 234, 0.08);
  --underline: rgba(244, 241, 234, 0.4);
  --track: rgba(244, 241, 234, 0.2);
  --surface: rgba(244, 241, 234, 0.04);
  --glass: rgba(15, 15, 17, 0.4);
  --nav-bg: rgba(15, 15, 17, 0.84);
  --on-fill: #111111;
  --fill-hover: #ffffff;
  --accent: #3d66ff;
  --accent-hover: #557aff;
  --on-accent: #ffffff;
  --accent-ink: #8ea4ff;
  --hard: #f4f1ea;
  --card-bg: #1a1a1e;
  --card-ring: rgba(255, 255, 255, 0.08);
  --frame-shadow: 10px 10px 0 #3d66ff, 0 0 0 2px #f4f1ea;
  --stage-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --wash-filter: blur(46px) saturate(1.1) brightness(0.42);
  --wash-shade: linear-gradient(90deg, rgba(15, 15, 17, 0.92) 0%, rgba(15, 15, 17, 0.55) 55%, rgba(15, 15, 17, 0.3) 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  transition: background-color 0.35s ease, color 0.35s ease;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

body.locked { overflow: hidden; }

img { max-width: 100%; }

button, a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

.display,
.splash-title,
h1,
.realm h2,
.panel h2 {
  font-family: var(--font);
  font-weight: 800;
  font-stretch: 78%;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.splash-title em,
h1 em {
  display: block;
  font-style: normal;
  color: var(--accent);
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  background: var(--fg);
  color: var(--on-fill);
  padding: 8px 12px;
  z-index: 50;
}

.skip:focus { top: 12px; }

.wrap { width: min(1320px, calc(100% - 48px)); margin: 0 auto; }

.nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  min-height: var(--nav);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
}

.mark {
  font-family: var(--font);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--fg);
  text-decoration: none;
  line-height: 1;
}

.mark::after {
  content: "";
  display: inline-block;
  width: 0.3em;
  height: 0.3em;
  margin-left: 0.1em;
  border-radius: 50%;
  background: var(--accent);
}

.mark em { font-style: normal; }

.nav nav {
  display: flex;
  gap: 22px;
  align-items: center;
}

.nav a[data-realm] {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 15px;
}

.nav a[data-realm] { font-weight: 500; }

.nav a[data-realm]:hover { color: var(--fg); }

.nav a[data-realm][aria-current="true"] {
  color: var(--fg);
  box-shadow: 0 2px 0 var(--accent);
}

.count {
  margin: 0 0 0 auto;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  font-size: 13px;
  color: var(--fg-dim);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  color: var(--fg);
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  background: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 22px;
  border: 2px solid var(--hard);
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 4px 4px 0 var(--hard);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.btn:hover,
.save-original:hover,
.x-card:hover {
  background: var(--accent-hover);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--hard);
}

.btn:active,
.save-original:active,
.x-card:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--hard);
}

.nav-x {
  flex: none;
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid var(--underline);
}

.nav-x:hover { border-bottom-color: var(--fg); }

/* Spec plate: model / weights / GPU */

.plate {
  display: grid;
  grid-template-columns: repeat(3, auto);
  width: fit-content;
  max-width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.plate div { padding: 10px 16px 11px; }

.plate div + div { border-left: 1px solid var(--line); }

.plate dt {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.plate dd {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

/* Splash */

.splash {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  overflow: hidden;
}

.splash-on body { overflow: hidden; }

.splash-on .splash,
.splash.leaving { display: block; }

.splash.leaving {
  transform: translateY(-100%);
  transition: transform 0.9s cubic-bezier(0.7, 0, 0.2, 1);
}

.splash-wash { position: absolute; inset: 0; }

.splash-wash div {
  position: absolute;
  inset: -6%;
  background-size: cover;
  background-position: center;
  filter: var(--wash-filter);
  opacity: 0;
  transition: opacity 1.6s ease;
}

.splash-wash div.on { opacity: 1; }

.splash-wash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--wash-shade);
}

.splash-grid {
  position: relative;
  height: 100%;
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 56px;
  align-items: center;
}

.splash-copy {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 0 36px;
  min-width: 0;
}

.splash-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.splash-top .eyebrow { margin: 0; }

.x-link {
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid var(--underline);
}

.x-link:hover { border-bottom-color: var(--fg); }

.splash-title {
  margin: 0;
  font-size: clamp(5.4rem, 11.5vw, 11rem);
  line-height: 0.8;
}

.splash-lede {
  max-width: 34ch;
  margin: 30px 0 28px;
  font-size: 19px;
  font-weight: 340;
}

.splash .plate { background: var(--glass); backdrop-filter: blur(10px); }

.splash-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.splash-actions .btn { height: 52px; padding: 0 26px; font-size: 16px; }

.made { margin: 0; font-size: 15px; color: var(--fg-dim); }

.made a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--underline);
}

.made a:hover { border-bottom-color: var(--fg); }

.ticks {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticks button {
  display: block;
  width: 86px;
  padding: 0 0 8px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  cursor: pointer;
}

.ticks button[aria-current="true"] { color: var(--fg); font-weight: 700; }

.ticks button::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 8px;
  background: var(--track);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 100%;
}

.ticks button.done::after { background-size: 100% 100%; }

.ticks button[aria-current="true"]::after { animation: tick var(--slide-ms, 5200ms) linear forwards; }

@keyframes tick { to { background-size: 100% 100%; } }

.splash-frame {
  position: relative;
  margin: 0;
  height: min(88dvh, 940px);
  aspect-ratio: 1536 / 2752;
  padding: 10px;
  border-radius: 38px;
  background: #050505;
  box-shadow: var(--frame-shadow);
}

.splash-slides {
  position: relative;
  height: 100%;
  border-radius: 29px;
  overflow: hidden;
}

.splash-slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.4s ease, transform 7s ease-out;
}

.splash-slides img.on { opacity: 1; transform: scale(1); }

.splash-frame figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -30px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-dim);
}

.splash-copy > *,
.splash-frame {
  animation: rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.splash-main { animation-delay: 0.12s; }
.splash .ticks { animation-delay: 0.3s; }
.splash-frame { animation-delay: 0.05s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
}

/* Intro under the nav */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 56px;
  align-items: end;
  padding-top: calc(var(--nav) + 72px);
}

h1 {
  margin: 0;
  font-size: clamp(3.8rem, 7.6vw, 7.4rem);
  line-height: 0.84;
}

.lede {
  max-width: 38ch;
  margin: 26px 0 0;
  font-size: 19px;
  font-weight: 340;
}

.spec {
  margin: 18px 0 0;
  color: var(--fg-faint);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.credit {
  padding: 22px;
  border: 2px solid var(--hard);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--hard);
}

.credit-text { margin: 0 0 18px; color: var(--fg-dim); }

.credit .plate div { padding: 9px 13px 10px; }

.x-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-top: 16px;
  padding: 14px 16px;
  border: 2px solid var(--hard);
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 4px 4px 0 var(--hard);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}


.x-card-label {
  grid-column: 1 / -1;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.8;
}

.x-card-handle { font-family: var(--font); font-size: 30px; font-weight: 800; font-stretch: 85%; line-height: 1.05; letter-spacing: -0.02em; }

.x-card-go { font-size: 14px; font-weight: 500; padding-bottom: 5px; }

.press {
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--fg-dim);
  font-size: 15px;
}

.realm { margin-top: 92px; }

.realm-head { margin: 0 0 26px; padding-top: 22px; border-top: 2px solid var(--hard); }

.realm-num {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
}

.realm h2 {
  margin: 0;
  font-size: clamp(3.2rem, 7vw, 6.2rem);
  line-height: 0.86;
}

.blurb {
  margin: 14px 0 0;
  max-width: 46ch;
  color: var(--fg-dim);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 14px;
}

.card { min-width: 0; }

.shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--card-ring);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1536 / 2752;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 0.7s ease;
}

.card:hover .shot img { transform: scale(1.045); }

.card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.card-name {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-num {
  margin-right: 7px;
  color: var(--accent-ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.save {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid var(--underline);
}

.save svg { width: 13px; height: 13px; }

.save:hover { border-bottom-color: var(--fg); }

.foot {
  margin-top: 120px;
  padding: 36px 0 56px;
  border-top: 1px solid var(--line);
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

.foot-label {
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--fg-faint);
}

.foot p { margin: 0; max-width: 48ch; color: var(--fg-dim); }

.foot a { color: var(--fg); }

.viewer[hidden] { display: none !important; }

.viewer:not([hidden]) {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 40;
  background: var(--bg);
}

.viewer-body {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: 28px;
  padding: 0 40px 0 24px;
}

/* The deck: top card in the middle, earlier cards fanned left, later cards right */

.stage {
  position: relative;
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 28px 0 22px;
}

.deck {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: none;
  --card-w: 320px;
  --card-h: 573px;
}

.vcard {
  --x: 0;
  --r: 0deg;
  --s: 1;
  --z: 10;
  --dim: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w);
  height: var(--card-h);
  margin: calc(var(--card-h) / -2) 0 0 calc(var(--card-w) / -2);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--stage-shadow);
  z-index: var(--z);
  transform: translateX(calc(var(--x) * var(--card-w))) rotate(var(--r)) scale(var(--s));
  transition: transform 0.55s cubic-bezier(0.2, 0.75, 0.2, 1), opacity 0.45s ease;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.vcard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: var(--dim);
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.vcard img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  -webkit-user-drag: none;
}

.vcard[data-o="0"] { cursor: zoom-in; }
.vcard.zoomed { cursor: zoom-out; }

.vcard[data-o="enter"] { --s: 0.94; opacity: 0; }
.vcard[data-o="1"] { --x: 0.3; --r: 3deg; --s: 0.9; --z: 9; --dim: 0.28; }
.vcard[data-o="2"] { --x: 0.47; --r: 6deg; --s: 0.8; --z: 8; --dim: 0.5; }
.vcard[data-o="3"] { --x: 0.6; --r: 9deg; --s: 0.71; --z: 7; --dim: 0.7; }
.vcard[data-o="4"] { --x: 0.7; --r: 12deg; --s: 0.63; --z: 6; --dim: 0.85; opacity: 0; }
.vcard[data-o="-1"] { --x: -0.3; --r: -3deg; --s: 0.9; --z: 9; --dim: 0.28; }
.vcard[data-o="-2"] { --x: -0.47; --r: -6deg; --s: 0.8; --z: 8; --dim: 0.5; }
.vcard[data-o="-3"] { --x: -0.6; --r: -9deg; --s: 0.71; --z: 7; --dim: 0.7; }
.vcard[data-o="-4"] { --x: -0.7; --r: -12deg; --s: 0.63; --z: 6; --dim: 0.85; opacity: 0; }

.vcard[data-o="4"],
.vcard[data-o="-4"],
.vcard.leaving { pointer-events: none; }

@media (hover: hover) {
  .vcard[data-o="1"]:hover { --x: 0.34; --dim: 0.08; }
  .vcard[data-o="-1"]:hover { --x: -0.34; --dim: 0.08; }
  .vcard[data-o="2"]:hover,
  .vcard[data-o="-2"]:hover,
  .vcard[data-o="3"]:hover,
  .vcard[data-o="-3"]:hover { --dim: 0.2; }
}

.is-zoomed .vcard:not([data-o="0"]) { opacity: 0; pointer-events: none; }

.vhint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 1;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(8px);
}

@media (hover: hover) {
  .vcard[data-o="0"]:not(.zoomed):hover .vhint { opacity: 1; }
}

.zoom-badge {
  position: absolute;
  top: 36px;
  left: 50%;
  z-index: 20;
  transform: translateX(-50%);
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.zoom-badge[hidden] { display: none; }

/* Position bar: arrows with pile counts, and one tick per wallpaper */

.deck-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 20px;
  transition: opacity 0.3s ease;
}

.is-zoomed .deck-bar { opacity: 0.25; }

.deck-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.deck-arrow svg { width: 16px; height: 16px; flex: none; }

.deck-arrow:hover:not(:disabled) { border-color: var(--fg-faint); }

.deck-arrow:disabled { opacity: 0.3; cursor: default; }

.pile-n { color: var(--fg-dim); min-width: 2ch; text-align: center; }

.pile-n:empty { display: none; }

.rail { display: flex; gap: 14px; }

.rail-group { display: flex; flex-direction: column; gap: 6px; }

.rail-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.rail-group.here .rail-label { color: var(--fg); font-weight: 700; }

.rail-ticks {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.rail-ticks button {
  width: 6px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--track);
  cursor: pointer;
  transition: height 0.25s ease, background-color 0.25s ease;
}

.rail-ticks button.seen { background: var(--fg-faint); }

.rail-ticks button:hover { height: 16px; }

.rail-ticks button[aria-current="true"] { height: 20px; background: var(--accent); }

.keys-touch { display: none; }

@media (hover: none), (pointer: coarse) {
  .keys-mouse { display: none; }
  .keys-touch { display: inline; }
}

.panel {
  align-self: end;
  padding-bottom: 6vh;
  max-width: 380px;
}

.view-kicker {
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--fg-faint);
}

.panel h2 {
  margin: 0;
  font-size: clamp(2.8rem, 4.2vw, 4.4rem);
  line-height: 0.86;
}

.view-text {
  margin: 16px 0 0;
  color: var(--fg-dim);
  max-width: 36ch;
}

.save-original {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  min-height: 50px;
  padding: 0 22px;
  border: 2px solid var(--hard);
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 4px 4px 0 var(--hard);
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.save-original svg { width: 17px; height: 17px; }

.save-short { display: none; }


.view-meta {
  margin: 12px 0 0;
  color: var(--fg-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.view-credit {
  margin: 6px 0 0;
  color: var(--fg-faint);
  font-size: 13px;
}

.view-credit a { color: var(--fg-dim); }

.move { display: flex; gap: 18px; margin-top: 22px; }

.move button {
  background: none;
  border: 0;
  padding: 0 0 2px;
  border-bottom: 1px solid var(--underline);
  cursor: pointer;
}

.move button:hover { border-bottom-color: var(--fg); }

.keys {
  margin: 18px 0 0;
  color: var(--fg-faint);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.close {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 8px 2px;
  border-bottom: 1px solid var(--underline);
  cursor: pointer;
}

.close svg { display: none; width: 18px; height: 18px; }

.ios-tip {
  margin: 8px 0 0;
  color: var(--fg-faint);
  font-size: 12px;
  line-height: 1.4;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (min-width: 800px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 18px; }
}

@media (min-width: 1180px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 42px 16px; }
}

@media (max-width: 860px) {
  .splash {
    --bg: #0f0f11;
    --fg: #f4f1ea;
    --fg-dim: rgba(244, 241, 234, 0.72);
    --fg-faint: rgba(244, 241, 234, 0.5);
    --line: rgba(244, 241, 234, 0.16);
    --line-soft: rgba(244, 241, 234, 0.08);
    --underline: rgba(244, 241, 234, 0.4);
    --track: rgba(244, 241, 234, 0.2);
    --surface: rgba(244, 241, 234, 0.04);
    --glass: rgba(15, 15, 17, 0.4);
    --nav-bg: rgba(15, 15, 17, 0.84);
    --on-fill: #111111;
    --fill-hover: #ffffff;
    --accent: #3d66ff;
    --accent-hover: #557aff;
    --on-accent: #ffffff;
    --accent-ink: #8ea4ff;
    --hard: #f4f1ea;
    --card-bg: #1a1a1e;
    --card-ring: rgba(255, 255, 255, 0.08);
    --frame-shadow: 10px 10px 0 #3d66ff, 0 0 0 2px #f4f1ea;
    --stage-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    --wash-filter: blur(46px) saturate(1.1) brightness(0.42);
    --wash-shade: linear-gradient(90deg, rgba(15, 15, 17, 0.92) 0%, rgba(15, 15, 17, 0.55) 55%, rgba(15, 15, 17, 0.3) 100%);
    color-scheme: dark;
    color: var(--fg);
  }

  .nav {
    flex-wrap: wrap;
    align-content: center;
    height: auto;
    gap: 8px 14px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    transition: transform 0.3s ease;
  }

  .nav.tuck { transform: translateY(-100%); }

  .mark { margin-right: auto; font-size: 24px; }

  .nav nav {
    order: 3;
    width: calc(100% + 32px);
    margin: 0 -16px;
    padding: 0 16px;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav nav::-webkit-scrollbar { display: none; }

  .nav a[data-realm] {
    flex: none;
    padding: 6px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
  }

  .nav a[data-realm][aria-current="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    box-shadow: none;
  }

  .wrap { width: calc(100% - 32px); }

  .nav-x { display: none; }

  .nav .theme-toggle { order: 2; }

  .splash-top-right .x-link { display: none; }

  .splash-top { align-items: center; }

  .intro { grid-template-columns: 1fr; gap: 22px; padding-top: calc(118px + env(safe-area-inset-top)); }

  .intro .eyebrow { margin-bottom: 12px; }

  h1 { font-size: clamp(3rem, 15vw, 4.6rem); }

  .intro .lede { display: none; }

  .spec { margin-top: 14px; }

  .credit { padding: 16px; border-radius: 14px; box-shadow: 4px 4px 0 var(--hard); }

  .credit-text { font-size: 15px; margin-bottom: 14px; }

  .plate {
    width: 100%;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .plate div { min-width: 0; }

  .plate dd { white-space: normal; overflow-wrap: anywhere; }

  .x-card { margin-top: 12px; padding: 12px 14px; }

  .x-card-handle { font-size: 26px; }

  .realm { margin-top: 56px; }

  .realm-head { margin-bottom: 18px; padding-top: 18px; }

  .realm h2 { font-size: clamp(2.8rem, 14vw, 4rem); }

  .grid { gap: 22px 10px; }

  .card-meta { align-items: center; margin-top: 8px; }

  .card-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
    line-height: 1.25;
  }

  .card-num { display: block; margin: 0 0 2px; }

  .save {
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
  }

  .save span { display: none; }

  .save svg { width: 16px; height: 16px; }

  .foot { margin-top: 72px; }

  .splash-wash { display: none; }

  .splash-grid { display: block; width: auto; }

  .splash-frame {
    position: absolute;
    inset: 0;
    height: auto;
    aspect-ratio: auto;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    animation: none;
  }

  .splash-slides { border-radius: 0; }

  .splash-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 22%),
      linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.6) 48%, transparent 72%);
  }

  .splash-frame figcaption { display: none; }

  .splash-copy {
    position: relative;
    z-index: 1;
    justify-content: flex-start;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  }

  .splash-main { margin-top: auto; }

  .splash-top .eyebrow { font-size: 11px; }

  .splash-title { font-size: clamp(4.6rem, 25vw, 7rem); }

  .splash-lede { font-size: 17px; margin: 20px 0 18px; }

  .splash .plate { width: 100%; grid-template-columns: 1.4fr 1fr 1fr; }

  .plate div { padding: 8px 11px 9px; }

  .plate dd { font-size: 13.5px; }

  .splash-actions { margin-top: 20px; gap: 14px; }

  .splash-actions .btn { width: 100%; justify-content: center; }

  .ticks { gap: 6px; margin-top: 22px; }

  .ticks button { width: 100%; font-size: 11px; }

  .ticks li { flex: 1; }

  .foot-grid { grid-template-columns: 1fr; gap: 28px; }

  .viewer-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }

  .close {
    top: calc(10px + env(safe-area-inset-top));
    right: 12px;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
  }

  .close-text { display: none; }

  .close svg { display: block; }

  .stage {
    flex: 1;
    min-height: 0;
    height: auto;
    padding: calc(62px + env(safe-area-inset-top)) 0 8px;
  }

  .vcard { border-radius: 16px; }

  .zoom-badge { top: calc(20px + env(safe-area-inset-top)); }

  .deck-bar { padding: 12px 16px 0; }

  .deck-arrow { display: none; }

  .rail { width: 100%; justify-content: space-between; gap: 6px; }

  .rail-label { font-size: 9.5px; letter-spacing: 0.1em; }

  .rail-ticks { gap: 2px; }

  .rail-ticks button { width: 4px; }

  .panel {
    flex: none;
    align-self: stretch;
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 14px;
    align-items: end;
    padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
  }

  .panel > * { grid-column: 1 / -1; }

  .view-kicker { grid-column: 1; grid-row: 1; margin-bottom: 4px; font-size: 11px; }

  .panel h2 { grid-column: 1; grid-row: 2; font-size: 2.1rem; }

  .save-original {
    grid-column: 2;
    grid-row: 1 / 3;
    width: auto;
    margin: 0;
    min-height: 48px;
    padding: 0 20px;
  }

  .save-long { display: none; }

  .save-short { display: inline; }

  .view-text,
  .view-credit,
  .move { display: none; }

  .view-meta { margin-top: 8px; font-size: 12.5px; }

  .keys { margin-top: 4px; font-size: 11.5px; line-height: 1.4; }
}

@media (hover: none) {
  .card:hover .shot img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shot img { transition: none; }
  .splash-copy > *, .splash-frame { animation: none; }
  .splash-slides img { transform: none; transition: opacity 0.6s ease; }
  .splash.leaving { transform: none; opacity: 0; transition: opacity 0.4s ease; }
  .vcard { transition: opacity 0.2s ease; }
}

.intro:focus,
.splash:focus,
.viewer:focus { outline: none; }

/* Theme switch */

.theme-toggle {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 60px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}

.theme-toggle svg {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  color: var(--fg-faint);
  transition: color 0.3s ease;
}

.tt-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--fg);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle .tt-sun,
[data-theme="dark"] .theme-toggle .tt-moon { color: var(--on-fill); }

[data-theme="dark"] .theme-toggle .tt-sun { color: var(--fg-faint); }

[data-theme="dark"] .tt-knob { transform: translateX(28px); }

.splash-top-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

@media (prefers-reduced-motion: reduce) {
  body, .tt-knob, .theme-toggle svg { transition: none; }
}

/* Phones held sideways: little height, so put the viewer panel beside the deck
   and shorten the splash. */
@media (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
  .viewer-body { flex-direction: row; }

  .stage { padding: 12px 0 8px; }

  .deck-bar { padding-top: 6px; }

  .rail-label { display: none; }

  .panel {
    width: min(42%, 320px);
    align-self: center;
    padding: 56px 16px 12px 0;
  }

  .keys,
  .ios-tip { display: none; }

  .splash-lede,
  .splash .ticks { display: none; }

  .splash-title { font-size: 4rem; }

  .splash .plate { margin-top: 16px; }

  .splash-actions { margin-top: 14px; }
}
