:root {
  color-scheme: dark;
  --ink: #f7f1e8;
  --ink-2: rgba(247, 241, 232, 0.76);
  --ink-3: rgba(247, 241, 232, 0.52);
  --ink-4: rgba(247, 241, 232, 0.34);
  --line: rgba(247, 241, 232, 0.1);
  --line-2: rgba(247, 241, 232, 0.2);
  --panel: linear-gradient(180deg, rgba(27, 32, 72, 0.95), rgba(14, 18, 44, 0.97));
  --gold: #f3d29b;
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --radius-xl: 30px;
  --page: 1320px;
  --gutter: clamp(18px, 4vw, 48px);
  --nav-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --accent: var(--gold);
  --accent-deep: #b3843d;
  --accent-glow: rgba(243, 210, 155, 0.35);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--ink);
  background: #060a1c;
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(255, 179, 201, 0.35); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #0b1029;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: none; }
.wrap { width: min(var(--page), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* Sky: fixed atmosphere behind every section. */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(140% 60% at 50% 115%, rgba(255, 168, 140, 0.3), rgba(255, 140, 150, 0.1) 40%, transparent 70%),
    radial-gradient(80% 50% at 50% 100%, rgba(179, 120, 220, 0.22), transparent 70%),
    linear-gradient(180deg, #050816 0%, #0a0f29 30%, #131a43 58%, #24204d 80%, #3a2652 100%);
}
.sky__stars {
  position: absolute;
  inset: 0 0 30% 0;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 12%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 23% 34%, rgba(255, 255, 255, 0.85) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 41% 8%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 57% 27%, rgba(255, 255, 255, 0.7) 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 72% 15%, #fff7e8 50%, transparent 52%),
    radial-gradient(1px 1px at 86% 41%, rgba(255, 255, 255, 0.8) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 94% 6%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 15% 58%, rgba(255, 255, 255, 0.6) 50%, transparent 52%),
    radial-gradient(1.3px 1.3px at 33% 74%, rgba(255, 255, 255, 0.75) 50%, transparent 52%),
    radial-gradient(1px 1px at 64% 63%, rgba(255, 255, 255, 0.65) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 79% 82%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 50% 92%, rgba(255, 255, 255, 0.6) 50%, transparent 52%);
  background-size: 520px 520px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%);
  animation: twinkle 7s ease-in-out infinite;
}
.sky__stars--far {
  background-size: 290px 290px;
  background-position: 97px 41px;
  opacity: 0.55;
  animation-duration: 11s;
  animation-delay: -4s;
}
.sky__glow { position: absolute; width: 80vmax; height: 80vmax; border-radius: 50%; will-change: transform; }
.sky__glow--jade {
  top: -42vmax;
  left: -30vmax;
  background: radial-gradient(closest-side, rgba(143, 227, 197, 0.16), transparent 72%);
  animation: drift-jade 42s ease-in-out infinite alternate;
}
.sky__glow--rose {
  top: -36vmax;
  right: -34vmax;
  background: radial-gradient(closest-side, rgba(255, 179, 201, 0.15), transparent 72%);
  animation: drift-rose 50s ease-in-out infinite alternate;
}
.sky__petals i {
  position: absolute;
  top: -3vh;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 2px;
  background: linear-gradient(135deg, #ffe1ea, #ff9dbb 70%);
  box-shadow: 0 0 10px rgba(255, 157, 187, 0.45);
  opacity: 0;
  animation: petal var(--d) linear var(--delay) infinite;
  will-change: transform, opacity;
}

@keyframes twinkle { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.45; } }
@keyframes drift-jade { to { transform: translate3d(10vmax, 8vmax, 0) scale(1.1); } }
@keyframes drift-rose { to { transform: translate3d(-12vmax, 10vmax, 0) scale(1.15); } }
@keyframes petal {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0turn); }
  10% { opacity: 0.85; }
  25% { transform: translate3d(calc(var(--sway) * 0.7), 27vh, 0) rotate(calc(var(--spin) * 0.25)); }
  50% { transform: translate3d(calc(var(--sway) * -0.3), 54vh, 0) rotate(calc(var(--spin) * 0.5)); }
  75% { opacity: 0.7; transform: translate3d(var(--sway), 81vh, 0) rotate(calc(var(--spin) * 0.75)); }
  100% { opacity: 0; transform: translate3d(calc(var(--sway) * 0.4), 108vh, 0) rotate(var(--spin)); }
}

/* Navigation */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(5, 8, 22, 0.82), rgba(5, 8, 22, 0.5));
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font: 400 23px/1 var(--serif); white-space: nowrap; }
.brand svg { width: 26px; height: 26px; filter: drop-shadow(0 0 10px rgba(255, 179, 201, 0.35)); }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 460;
  transition: color 0.2s, background 0.2s, filter 0.2s;
}
.nav__links a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav__links .nav__cta,
.nav__links .nav__cta:hover {
  margin-left: 8px;
  color: #10142e;
  font-weight: 580;
  background: linear-gradient(100deg, #ffc3d4, #f6d9a3 55%, #a9ecd3);
}
.nav__links .nav__cta:hover { filter: brightness(1.07); }

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(var(--nav-h) + 72px) var(--gutter) 170px;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}
.hero__inner { position: relative; display: grid; justify-items: center; max-width: 1100px; }
.hero__inner > * { animation: rise 1.2s var(--ease) both; }
.hero__inner > :nth-child(2) { animation-delay: 0.08s; }
.hero__inner > :nth-child(3) { animation-delay: 0.18s; }
.hero__inner > :nth-child(4) { animation-delay: 0.28s; }
.hero__inner > :nth-child(5) { animation-delay: 0.36s; }
.hero__inner > :nth-child(6) { animation-delay: 0.44s; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--gold);
  font: 560 11px/1.4 var(--sans);
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.eyebrow__dot { width: 5px; height: 5px; border-radius: 1px; background: currentColor; opacity: 0.6; transform: rotate(45deg); }
.hero__title {
  margin: 26px 0 0;
  font: 400 clamp(80px, 14.5vw, 216px)/0.84 var(--serif);
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero__title em {
  display: inline-block;
  padding: 0 0.08em 0.06em 0;
  font-style: italic;
  background: linear-gradient(95deg, #ffbfd1 8%, #f7d9a4 46%, #9fe9cf 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede {
  max-width: 36ch;
  margin: 30px 0 0;
  color: var(--ink-2);
  font: 400 clamp(21px, 2.3vw, 30px)/1.35 var(--serif);
  text-wrap: balance;
}
.duel {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 44px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(10, 14, 38, 0.6);
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.duel__model {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px 11px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  font-size: 14.5px;
  font-weight: 540;
}
.duel__model::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
.duel__versus { padding: 0 8px; color: var(--ink-3); font: italic 22px/1 var(--serif); }
.duel__pair { display: inline-flex; align-items: center; gap: 6px; }
.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 0;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 540;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.facts li { padding: 0 18px; }
.facts li + li { border-left: 1px solid var(--line-2); }
.hero__cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 56px;
  color: var(--ink-3);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.hero__cue:hover { color: var(--ink); }
.hero__cue svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nudge 2.4s var(--ease) infinite;
}
.hero__clouds {
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 46%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 35%, #000 70%, transparent);
}
.cloud {
  position: absolute;
  bottom: var(--y);
  left: 0;
  width: var(--w);
  aspect-ratio: 4 / 1;
  fill: rgba(236, 226, 255, var(--o));
  shape-rendering: crispEdges;
  animation: cloud var(--d) linear var(--delay) infinite;
  will-change: transform;
}

@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes nudge { 0%, 100% { opacity: 0.6; transform: translateY(0); } 50% { opacity: 1; transform: translateY(6px); } }
@keyframes cloud { from { transform: translateX(calc(-1 * var(--w))); } to { transform: translateX(100vw); } }

/* Sections */
.section { padding-top: clamp(96px, 12vw, 168px); }
.section__head { display: grid; gap: 18px; max-width: 820px; margin-bottom: clamp(36px, 5vw, 56px); }
.section__head h2 {
  margin: 0;
  font: 400 clamp(46px, 6.4vw, 92px)/0.94 var(--serif);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.section__head h2 em { color: var(--gold); font-style: italic; }
.section__lede { max-width: 60ch; margin: 0; color: var(--ink-2); font-size: 16.5px; line-height: 1.65; }
.numeral {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  margin-right: 4px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  border-radius: 999px;
  font: italic 15px/1 var(--serif);
  letter-spacing: 0;
  text-transform: none;
}
.status { margin: 0 0 20px; color: var(--ink-3); font: italic 21px/1.3 var(--serif); }
.status[hidden] { display: none; }

/* Hero model chips double as shortcuts into the matchup. */
button.duel__model { border: 0; color: var(--ink); cursor: pointer; transition: background 0.2s, box-shadow 0.2s; }
button.duel__model:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }

/* Matchup: model X vs model Y, plus a slot that adds another model */
.matchup { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin: 0 0 clamp(24px, 3vw, 34px); }
.matchup__pair { display: inline-flex; align-items: center; gap: 14px; }
.matchup__vs { color: var(--ink-3); font: italic 400 24px/1 var(--serif); }
.slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 54px;
  padding: 0 6px 0 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 5%, transparent)), rgba(12, 16, 40, 0.9);
  box-shadow: 0 18px 44px -28px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s, box-shadow 0.3s var(--ease);
}
.slot:hover { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 18px 50px -20px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.slot:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.slot__swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.slot__field { position: relative; display: flex; flex: 1; align-items: center; height: 100%; }
.slot__select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  /* Size each pill to its chosen model where supported; elsewhere the widest option sets the width. */
  field-sizing: content;
  height: 100%;
  padding: 0 40px 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 22px/1 var(--serif);
  letter-spacing: -0.01em;
  cursor: pointer;
}
.slot__select:focus { outline: none; }
.slot__select option,
.matchup__add option { background: #12173a; color: var(--ink); font: 15px var(--sans); }
.slot__field svg { position: absolute; top: 50%; right: 12px; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.slot .slot__remove { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); }
.slot .slot__remove:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.slot .slot__remove svg { width: 15px; height: 15px; }
.matchup__add {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 22px 0 18px;
  border: 1.5px dashed rgba(247, 241, 232, 0.26);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.matchup__add:hover { border-color: rgba(247, 241, 232, 0.5); background: rgba(255, 255, 255, 0.04); color: var(--ink); }
.matchup__add:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.matchup__add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* The native select covers the whole pill, so one click opens the list of models. */
.matchup__add select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }

/* World cards */
.worlds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); }
.worlds[data-count='3'],
.worlds[data-count='5'] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.worlds[data-count='3'] .world,
.worlds[data-count='5'] .world { grid-column: span 2; }
.worlds[data-count='5'] .world[data-slot='3'] { grid-column: 2 / span 2; }
.worlds[data-count='5'] .world[data-slot='4'] { grid-column: 4 / span 2; }
.world {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  container-type: inline-size;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: 0 50px 120px -70px var(--accent-glow), 0 30px 60px -40px rgba(0, 0, 0, 0.7);
  scroll-margin-top: calc(var(--nav-h) + 20px);
  transition: box-shadow 0.6s var(--ease);
}
.world::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 70%, transparent), transparent 35%, transparent 70%, color-mix(in srgb, var(--accent) 40%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.4s;
}
.world:hover { box-shadow: 0 60px 140px -60px var(--accent-glow), 0 30px 60px -40px rgba(0, 0, 0, 0.7); }
.world:hover::before { opacity: 1; }
.world__frame {
  --frame-radius: calc(var(--radius-xl) - 10px);
  position: relative;
  margin: 10px 10px 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--frame-radius);
  /* Zen/Firefox on a GPU-composited Wayland desktop drew opaque WebGL canvases past overflow and
     clip-path rounding. A mask makes it render the frame offscreen first, which keeps the corners. */
  -webkit-mask-image: linear-gradient(#000 0 0);
  mask-image: linear-gradient(#000 0 0);
  isolation: isolate;
  background: radial-gradient(120% 100% at 50% 0%, #2a3164, #161b40 70%);
}
.world__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.world__frame:fullscreen { --frame-radius: 0px; width: 100vw; height: 100vh; margin: 0; aspect-ratio: auto; -webkit-mask-image: none; mask-image: none; }
.world__frame:fullscreen::after { display: none; }
.world__canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.world__loader {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  color: var(--ink-2);
  font: italic 21px/1.25 var(--serif);
  text-align: center;
  background: radial-gradient(120% 100% at 50% 0%, #2a3164, #161b40 70%);
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}
.world__loader.is-done { opacity: 0; visibility: hidden; }
.voxel-spinner { display: flex; gap: 6px; }
.voxel-spinner i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
  animation: hop 1.1s var(--ease) infinite;
}
.voxel-spinner i:nth-child(2) { animation-delay: 0.12s; }
.voxel-spinner i:nth-child(3) { animation-delay: 0.24s; }
.world__placard { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 0 24px; }
.world__identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.world__letter {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font: italic 22px/1 var(--serif);
}
.world__names { min-width: 0; }
.world__name {
  margin: 0;
  /* Sized by card width so long names fit on one line in three-up rows; phones wrap instead of truncating. */
  font: 400 clamp(24px, 6.2cqi, 34px)/1.05 var(--serif);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.world__meta { margin: 6px 0 0; overflow: hidden; color: var(--ink-3); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.world__meta span + span::before { content: ' · '; }
.world__actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.icon-button:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.09); color: var(--ink); }
.icon-button[aria-pressed='true'] { border-color: transparent; background: var(--accent); color: #0e122b; }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.world__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 20px 24px 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.stat { display: grid; gap: 7px; min-width: 0; padding-right: 12px; }
.stat + .stat { padding-left: 16px; border-left: 1px solid var(--line); }
.stat dt { color: var(--ink-3); font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.stat dd { margin: 0; font: 400 25px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }

@keyframes hop { 0%, 100% { opacity: 0.5; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-10px); } }

/* Cost charts: one compact card per metric, every bar labelled with its model */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.metric {
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 30px 80px -60px rgba(0, 0, 0, 0.8);
}
.metric__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.metric__head h3 { margin: 0; font: 400 24px/1.1 var(--serif); letter-spacing: -0.01em; }
.metric__head p { margin: 0; color: var(--ink-3); font-size: 12px; text-align: right; }
.metric__rows { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.metric__row { display: grid; grid-template-columns: minmax(0, 9em) minmax(40px, 1fr) minmax(4.6em, auto); align-items: center; gap: 12px; }
.metric__name { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); font-size: 13px; }
.metric__name::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.metric__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric__bar { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.06); }
.metric__bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 14px var(--accent-glow);
  transform-origin: left center;
}
.metric__value { color: var(--ink); font-size: 13.5px; font-weight: 580; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.metric__value.is-muted { color: var(--ink-3); font-weight: 500; }
/* Agent sessions resend their context every turn; their totals sit beside the chart, not on its scale. */
.metric__session { overflow: hidden; color: var(--ink-3); font: italic 13px/1.2 var(--serif); text-overflow: ellipsis; white-space: nowrap; }

/* Prompt */
.quote {
  position: relative;
  margin: 0;
  padding: clamp(40px, 6vw, 80px) clamp(28px, 6vw, 96px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(143, 227, 197, 0.12), transparent 55%),
    radial-gradient(90% 120% at 100% 100%, rgba(255, 179, 201, 0.13), transparent 55%),
    var(--panel);
}
.quote blockquote::before,
.quote blockquote::after { color: var(--gold); font-style: normal; }
.quote blockquote::before { content: '“'; position: absolute; right: 100%; padding-right: 0.06em; }
.quote blockquote::after { content: '”'; }
.quote blockquote {
  position: relative;
  max-width: 26ch;
  margin: 0;
  font: italic 400 clamp(32px, 4.4vw, 62px)/1.08 var(--serif);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.quote figcaption {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  margin-top: clamp(28px, 4vw, 44px);
  color: var(--ink-3);
  font-size: 13px;
}
.fingerprint { color: var(--ink-4); font: 12px var(--mono); letter-spacing: 0.02em; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease), filter 0.2s;
}
.button:hover { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.1); }
.button:active { transform: translateY(1px); }
.button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Verdict: one ranking of every world, best first */
.verdict { display: grid; gap: 14px; max-width: 880px; }
.ranking { position: relative; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rank {
  position: relative;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 12px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 30px 80px -60px rgba(0, 0, 0, 0.8);
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 0.2s, box-shadow 0.3s var(--ease);
}
.rank:hover { border-color: var(--line-2); }
.rank.is-dragging {
  z-index: 2;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 36px 70px -34px var(--accent-glow), 0 24px 44px -24px rgba(0, 0, 0, 0.85);
  cursor: grabbing;
}
.rank__place { color: var(--accent); font: 400 42px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; text-align: center; }
.rank__body { display: grid; gap: 5px; min-width: 0; }
.rank__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rank__title::before { content: ''; flex: none; width: 9px; height: 9px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.rank__name { overflow: hidden; font: 400 26px/1.1 var(--serif); letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }
.rank__tag { flex: none; padding: 5px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.rank__tag[hidden] { display: none; }
.rank__tag--best { background: var(--accent); box-shadow: 0 0 22px var(--accent-glow); color: #0f1330; }
.rank__tag--worst { border: 1px solid var(--line-2); color: var(--ink-3); }
.rank__meta { overflow: hidden; color: var(--ink-3); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.rank__moves { display: flex; gap: 6px; }
.rank__moves .icon-button { width: 38px; height: 38px; }
.rank__moves .icon-button:disabled,
.rank__moves .icon-button:disabled:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.04); color: var(--ink-2); opacity: 0.3; cursor: default; }
/* Touch drags start here, so the rest of each row still scrolls the page. */
.rank__grip { display: grid; place-items: center; width: 30px; height: 44px; color: var(--ink-4); cursor: grab; touch-action: none; }
.rank:hover .rank__grip { color: var(--ink-2); }
.rank__grip svg { width: 10px; height: 18px; fill: currentColor; }
/* Until the visitor moves a world, the starting order is not a verdict. */
.ranking:not(.is-ranked) .rank__place { color: var(--ink-4); }
.ranking__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 28px; margin: 0; padding: 0 6px; color: var(--ink-3); font-size: 13.5px; }
.ranking__clear { padding: 2px 0; border: 0; background: none; color: var(--ink-2); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ranking__clear:hover { color: var(--ink); }
.ranking__clear[hidden] { display: none; }

/* Closing and footer */
.closing { display: grid; justify-items: center; gap: 22px; padding-top: clamp(110px, 14vw, 190px); text-align: center; }
.closing__cube { width: 46px; height: 46px; filter: drop-shadow(0 0 22px rgba(255, 179, 201, 0.4)); animation: float 6s ease-in-out infinite; }
.closing h2 { margin: 0; font: 400 clamp(44px, 6vw, 88px)/0.95 var(--serif); letter-spacing: -0.03em; }
.closing h2 em { color: var(--gold); font-style: italic; }
.closing p { max-width: 58ch; margin: 0; color: var(--ink-2); font-size: 16px; }
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  margin-top: clamp(90px, 10vw, 140px);
  padding: 28px 0 calc(36px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12.5px;
}
.footer .brand { color: var(--ink); font-size: 19px; }
.footer .brand svg { width: 20px; height: 20px; }

@keyframes float { 50% { transform: translateY(-8px); } }

/* Prompt dialog */
dialog {
  width: min(860px, 100% - 32px);
  max-height: min(86vh, 920px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 26px;
  background: linear-gradient(180deg, #161c45, #0d1130);
  color: var(--ink);
  box-shadow: 0 80px 200px -60px rgba(0, 0, 0, 0.9);
}
dialog[open] { display: flex; animation: pop 0.45s var(--ease); }
dialog::backdrop { background: rgba(3, 5, 16, 0.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.dialog { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 26px 18px 32px; border-bottom: 1px solid var(--line); }
.dialog__head h2 { margin: 0; font: 400 32px/1 var(--serif); }
.dialog__body {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 24px 32px 36px;
  overflow: auto;
  color: var(--ink-2);
  font: 13.5px/1.8 var(--mono);
  white-space: pre-wrap;
}

@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

/* Scroll-linked reveals where supported; content is always visible elsewhere. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    .metric__bar i { animation: grow linear both; animation-timeline: view(); animation-range: entry 10% cover 30%; }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@container (max-width: 520px) {
  .world__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .world__meta span { display: block; white-space: normal; }
  .world__meta span + span::before { content: none; }
}
@container (max-width: 380px) {
  .world__placard { padding: 18px 18px 0; }
  .world__stats { margin: 18px 18px 20px; }
  .stat dd { font-size: 23px; }
}

@media (max-width: 1180px) {
  .worlds[data-count='3'],
  .worlds[data-count='5'] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .worlds[data-count='3'] .world[data-slot='2'] { grid-column: 2 / span 2; }
  .worlds[data-count='5'] .world[data-slot='3'] { grid-column: span 2; }
  .worlds[data-count='5'] .world[data-slot='4'] { grid-column: 2 / span 2; }
}

@media (max-width: 900px) {
  .worlds,
  .worlds[data-count='3'],
  .worlds[data-count='5'] { grid-template-columns: minmax(0, 1fr); }
  .worlds[data-count] .world[data-slot] { grid-column: auto; }
}

@media (max-width: 640px) {
  :root { --nav-h: 60px; --radius-xl: 24px; }
  .brand { font-size: 20px; }
  .brand svg { width: 22px; height: 22px; }
  .nav__links a:not(.nav__cta) { display: none; }
  .hero { padding-bottom: 130px; }
  .facts li { padding: 0 12px; }
  .matchup { flex-direction: column; align-items: stretch; gap: 8px; }
  .matchup__pair { flex-direction: column; align-items: stretch; gap: 8px; }
  .matchup__vs { align-self: center; font-size: 20px; }
  /* Five chips always wrap here, so separators would dangle at line ends. */
  .duel__versus { display: none; }
  .slot,
  .matchup__add { width: 100%; }
  .matchup__add { justify-content: center; }
  .rank { grid-template-columns: 2.25rem minmax(0, 1fr) auto auto; gap: 10px; padding: 12px 8px 12px 12px; border-radius: 18px; }
  .rank__place { font-size: 32px; }
  /* Phones wrap names and details instead of cutting them off; the arrows stack to give them room. */
  .rank__title { flex-wrap: wrap; row-gap: 6px; }
  .rank__name { font-size: 21px; white-space: normal; overflow-wrap: anywhere; }
  .rank__meta { white-space: normal; }
  .rank__moves { flex-direction: column; gap: 4px; }
  .rank__moves .icon-button { width: 34px; height: 30px; border-radius: 10px; }
  .rank__grip { width: 22px; }
  .footer { justify-content: center; text-align: center; }
}

/* Expanded view: one world spans the full grid, at any breakpoint. */
.worlds.is-focused { grid-template-columns: minmax(0, 1fr); }
.worlds.is-focused .world:not(.is-focused) { display: none; }
.worlds.is-focused .world.is-focused { grid-column: 1 / -1; }
.worlds.is-focused .world__frame { aspect-ratio: 16 / 9; max-height: calc(100vh - var(--nav-h) - 200px); min-height: 360px; }

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