:root {
  --bg: #050912;
  --bg-2: #0b1020;
  --panel: rgba(10, 18, 34, 0.9);
  --panel-strong: rgba(16, 29, 52, 0.94);
  --text: #f3f7ff;
  --muted: #94a6bd;
  --line: rgba(255, 255, 255, 0.12);
  --cyan: #45d7ff;
  --mint: #70f6bf;
  --gold: #ffd36b;
  --rose: #ff6f9b;
  --violet: #a98cff;
  --accent: var(--cyan);
  --accent-2: var(--mint);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
  --font-body: "Sora", "Segoe UI", sans-serif;
  --font-display: "Orbitron", "Sora", sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
  --font-pixel: "Press Start 2P", var(--font-mono);
  --pointer-x: 50vw;
  --pointer-y: 18vh;
  --scroll-progress: 0%;
}

body[data-page="publications"] {
  --accent: var(--gold);
  --accent-2: var(--rose);
  --font-display: "Fraunces", Georgia, serif;
}

body[data-page="news"] {
  --accent: var(--rose);
  --accent-2: var(--violet);
  --font-display: "JetBrains Mono", "Consolas", monospace;
}

body[data-page="contact"] {
  --accent: var(--mint);
  --accent-2: var(--cyan);
  --font-display: "Sora", "Segoe UI", sans-serif;
}

body[data-page="project"] {
  --accent: var(--mint);
  --accent-2: var(--gold);
  --font-display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    linear-gradient(130deg, rgba(69, 215, 255, 0.15), transparent 32%),
    linear-gradient(230deg, rgba(169, 140, 255, 0.12), transparent 28%),
    linear-gradient(320deg, rgba(255, 211, 107, 0.1), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 52%, #05070e 100%);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(69, 215, 255, 0.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 111, 155, 0.07) 2px, transparent 2px);
  background-size: 48px 48px, 48px 48px, 192px 192px, 192px 192px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 84%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(69, 215, 255, 0.07), transparent),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 255, 255, 0.018) 8px);
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: scan-drift 18s linear infinite;
}

.site-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(460px circle at var(--pointer-x) var(--pointer-y), color-mix(in srgb, var(--accent) 24%, transparent), transparent 58%),
    radial-gradient(620px circle at calc(var(--pointer-x) + 12vw) calc(var(--pointer-y) + 10vh), color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 62%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 9, 18, 0.78);
  backdrop-filter: blur(18px);
}

.site-header::after {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: var(--scroll-progress);
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--rose));
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 65%, transparent);
}

.site-header .page-shell,
.site-footer .page-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 8px;
  color: #041018;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a,
.button-primary,
.button-secondary,
.paper-links a,
.inline-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.button-secondary:hover,
.paper-links a:hover,
.inline-links a:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, transparent);
  color: var(--accent);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 16%, transparent);
  transform: translateY(-2px);
}

.button-primary {
  border-color: transparent;
  color: #041018;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px color-mix(in srgb, var(--accent) 25%, transparent);
}

.hero,
.page-hero {
  padding: 72px 0 38px;
}

.home-hero {
  min-height: 620px;
  display: grid;
  align-items: center;
}

.hero-grid,
.project-hero,
.project-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
}

.hero-copy,
.robot-panel,
.project-hero,
.project-frame,
.section-panel,
.featured-paper,
.publication-record,
.signal-card,
.timeline-item,
.metric-card,
.control-lab,
.news-item,
.contact-card,
.contact-terminal,
.portal-card,
.paper-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 54%),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy,
.robot-panel,
.project-hero {
  padding: 28px;
}

.tilt-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --glow-x: 50%;
  --glow-y: 0%;
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.tilt-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(280px circle at var(--glow-x) var(--glow-y), rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(135deg, transparent, color-mix(in srgb, var(--accent) 10%, transparent), transparent);
  opacity: 0;
  transition: opacity 220ms ease;
}

.tilt-card > * {
  position: relative;
  z-index: 1;
}

.tilt-card:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
}

.tilt-card:hover::before {
  opacity: 1;
}

.pixel-label,
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.8;
  text-transform: uppercase;
}

.pixel-label::before,
.page-kicker::before {
  width: 8px;
  height: 8px;
  content: "";
  background: currentColor;
  box-shadow: 12px 0 0 var(--accent-2);
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.hero h1,
.page-hero h1,
.project-hero h1 {
  margin: 14px 0;
  font-family: var(--font-display);
  font-size: 78px;
  font-weight: 700;
  line-height: 0.96;
}

.page-hero h1 {
  font-size: 64px;
}

.hero-copy p,
.page-hero p,
.project-hero p,
.project-spotlight p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-actions,
.project-actions,
.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.terminal-window {
  margin-top: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.terminal-bar {
  display: flex;
  gap: 7px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.terminal-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.terminal-bar span:nth-child(2) {
  background: var(--gold);
}

.terminal-bar span:nth-child(3) {
  background: var(--rose);
}

.terminal-lines {
  padding: 12px 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.terminal-lines p {
  margin: 8px 0;
  color: var(--muted);
}

.prompt,
.terminal-lines strong {
  color: var(--accent);
}

.robot-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.portrait-console {
  display: grid;
  grid-template-columns: minmax(116px, 0.7fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 56%),
    rgba(0, 0, 0, 0.2);
}

.portrait-console img {
  width: 100%;
  height: 100%;
  min-height: 176px;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 8px;
  filter: saturate(1.08) contrast(1.04);
}

.portrait-hud {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.portrait-hud strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.1;
}

.portrait-hud p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.robot-screen {
  min-height: 230px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    rgba(0, 0, 0, 0.18);
  background-size: 20px 20px;
}

.robot-antenna {
  width: 4px;
  height: 38px;
  background: var(--accent);
  box-shadow: 0 -10px 0 4px var(--accent-2);
}

.robot-head {
  width: 190px;
  height: 150px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(69, 215, 255, 0.18), rgba(112, 246, 191, 0.08));
  box-shadow: inset 0 0 28px rgba(69, 215, 255, 0.18);
}

.robot-eye {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 70%, transparent);
}

.robot-mouth {
  grid-column: 1 / -1;
  width: 86px;
  height: 16px;
  background:
    linear-gradient(90deg, var(--accent) 10px, transparent 10px 16px) 0 0 / 16px 16px;
}

.robot-body {
  width: 148px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: -8px;
}

.robot-body span {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.system-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.system-card strong,
.meta-item strong,
.project-metric strong {
  display: block;
  margin: 4px 0;
  color: var(--text);
}

.system-card p,
.meta-item,
.project-metric {
  color: var(--muted);
}

.gamepad-row {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--accent);
}

.dpad {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-pixel);
  background: rgba(0, 0, 0, 0.18);
}

.pixel-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent);
}

section {
  padding: 34px 0;
  scroll-margin-top: 96px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-head h2,
.control-copy h2,
.project-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
}

.section-head p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}

.portal-grid,
.signal-grid,
.experience-grid,
.metric-grid,
.contact-links {
  display: grid;
  gap: 18px;
}

.portal-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.signal-grid,
.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.experience-grid,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(0, 1.14fr);
  gap: 18px;
}

.portal-card,
.signal-card,
.timeline-item,
.metric-card,
.contact-card,
.paper-card {
  padding: 22px;
}

.portal-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portal-card h3,
.signal-card h3,
.timeline-item h3,
.metric-card h3,
.contact-card h2,
.news-item h2 {
  margin: 14px 0 10px;
  font-size: 22px;
  line-height: 1.15;
}

.portal-card p,
.signal-card p,
.timeline-item p,
.metric-card p,
.contact-card p,
.news-item p,
.publication-record p {
  margin: 0;
  color: var(--muted);
}

.portal-research {
  --accent: var(--cyan);
}

.portal-pubs {
  --accent: var(--gold);
}

.portal-news {
  --accent: var(--rose);
}

.portal-contact {
  --accent: var(--mint);
}

.signal-card {
  border-left: 3px solid var(--cyan);
}

.signal-card .index,
.metric-card .index,
.record-index {
  color: var(--accent);
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.8;
}

.publication-record {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 22px;
  padding: 24px;
  border-color: color-mix(in srgb, var(--gold) 32%, transparent);
}

.publication-section {
  display: grid;
  gap: 18px;
}

.publication-record h2,
.featured-paper h3 {
  max-width: 920px;
  margin: 12px 0;
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.08;
}

.paper-venue {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.paper-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.paper-meta-grid span {
  min-height: 78px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.14);
}

.paper-meta-grid strong {
  display: block;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
}

.news-board {
  display: grid;
  gap: 16px;
}

.news-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 22px;
  border-left: 3px solid var(--rose);
}

.news-item time {
  color: var(--rose);
  font-family: var(--font-pixel);
  font-size: 11px;
}

.contact-terminal {
  padding: 18px;
}

.contact-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-card {
  min-height: 170px;
}

.contact-card:nth-child(5) {
  grid-column: 1 / -1;
}

.hero-side img {
  width: 160px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 48%, transparent);
  border-radius: 8px;
}

.hero-side .meta-list,
.project-metrics {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.meta-item,
.project-metric {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.project-frame {
  padding: 16px;
}

.project-frame img,
.project-spotlight img {
  border-radius: 8px;
}

.project-tagline {
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.control-lab {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(300px, 1.08fr);
  gap: 24px;
  padding: 24px;
}

.control-copy p {
  margin: 10px 0 0;
  color: var(--muted);
}

.control-stage {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 170px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.flow-node {
  min-width: 84px;
  min-height: 84px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 220ms ease, border-color 220ms ease, color 220ms ease, background 220ms ease;
}

.flow-node.active {
  color: #041018;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transform: translateY(-4px);
}

.flow-line {
  height: 2px;
  min-width: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.flow-line::after {
  display: block;
  width: 46%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: flow-pulse 1.6s linear infinite;
}

.control-tabs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.control-tab,
.copy-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  cursor: pointer;
}

.control-tab:hover,
.control-tab.is-active {
  border-color: color-mix(in srgb, var(--accent) 52%, transparent);
  color: var(--accent);
}

.citation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

pre.mono {
  margin: 0;
  overflow-x: auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

.mono {
  font-family: var(--font-mono);
}

[data-reveal] {
  opacity: 0;
  translate: 0 22px;
}

[data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
  transition: opacity 560ms ease, translate 560ms ease;
}

@keyframes scan-drift {
  from {
    transform: translateY(-8%);
  }

  to {
    transform: translateY(8%);
  }
}

@keyframes flow-pulse {
  from {
    transform: translateX(-110%);
  }

  to {
    transform: translateX(230%);
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .project-hero,
  .project-spotlight,
  .control-lab,
  .publication-record,
  .experience-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .portal-grid,
  .signal-grid,
  .metric-grid,
  .contact-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-header .page-shell,
  .site-footer .page-shell,
  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .hero h1 {
    font-size: 58px;
  }

  .page-hero h1,
  .project-hero h1 {
    font-size: 48px;
  }

  .paper-meta-grid {
    grid-template-columns: 1fr;
  }

  .control-stage {
    grid-template-columns: 1fr;
  }

  .flow-line {
    width: 2px;
    height: 24px;
    min-width: 2px;
    margin: 0 auto;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .site-nav,
  .site-nav a,
  .button-primary,
  .button-secondary {
    width: 100%;
  }

  .hero,
  .page-hero {
    padding-top: 42px;
  }

  .hero h1,
  .page-hero h1,
  .project-hero h1 {
    font-size: 38px;
  }

  .section-head h2,
  .control-copy h2,
  .project-copy h2 {
    font-size: 30px;
  }

  .portal-grid,
  .signal-grid,
  .metric-grid,
  .contact-links,
  .news-item,
  .portrait-console {
    grid-template-columns: 1fr;
  }

  .portal-card {
    min-height: 210px;
  }
}

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

  .tilt-card,
  [data-reveal] {
    transform: none !important;
    translate: 0 0 !important;
    opacity: 1 !important;
  }
}

body[data-page="home"] {
  overflow: hidden;
}

body[data-page="home"] .site-header {
  position: fixed;
  left: 0;
  right: 0;
  border-bottom-color: rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(3, 7, 14, 0.88), rgba(3, 7, 14, 0.22));
}

body[data-page="home"] .site-footer {
  display: none;
}

.world-main {
  min-height: 100vh;
}

.world-stage {
  position: relative;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, rgba(69, 215, 255, 0.22), transparent 30%),
    radial-gradient(circle at 70% 54%, rgba(255, 111, 155, 0.16), transparent 28%),
    linear-gradient(180deg, #04070f, #091426 56%, #03050a);
}

#world-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.world-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4, 7, 15, 0.72), transparent 22%, transparent 74%, rgba(4, 7, 15, 0.62)),
    linear-gradient(180deg, rgba(4, 7, 15, 0.46), transparent 30%, rgba(4, 7, 15, 0.88)),
    radial-gradient(circle at center, transparent 44%, rgba(0, 0, 0, 0.22));
}

.world-hud {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 0.5fr) minmax(320px, 0.36fr);
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  align-items: start;
  padding-top: 110px;
  padding-bottom: 30px;
  pointer-events: none;
}

.world-title-panel,
.world-id-panel,
.world-card-carousel,
.world-dock {
  min-width: 0;
  pointer-events: auto;
}

.world-title-panel {
  max-width: 360px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(69, 215, 255, 0.16), transparent 80%),
    transparent;
  box-shadow: none;
}

.world-title-panel h1 {
  margin: 10px 0 4px;
  font-family: var(--font-serif);
  font-size: 62px;
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(69, 215, 255, 0.22);
}

.world-title-panel p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.beat-meter {
  height: 30px;
  display: flex;
  align-items: end;
  gap: 6px;
  margin-top: 18px;
}

.beat-meter span {
  width: 10px;
  border: 1px solid color-mix(in srgb, var(--cyan) 48%, transparent);
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--rose), var(--cyan));
  animation: meter-bounce 1.15s ease-in-out infinite;
}

.beat-meter span:nth-child(1) {
  height: 18px;
}

.beat-meter span:nth-child(2) {
  height: 30px;
  animation-delay: 80ms;
}

.beat-meter span:nth-child(3) {
  height: 22px;
  animation-delay: 150ms;
}

.beat-meter span:nth-child(4) {
  height: 34px;
  animation-delay: 220ms;
}

.beat-meter span:nth-child(5) {
  height: 20px;
  animation-delay: 300ms;
}

.beat-meter span:nth-child(6) {
  height: 28px;
  animation-delay: 380ms;
}

.world-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.world-id-panel {
  align-self: start;
  justify-self: end;
  width: min(360px, 100%);
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--mint) 38%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(112, 246, 191, 0.16), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent),
    rgba(5, 9, 18, 0.48);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.world-id-panel img {
  width: 104px;
  height: 122px;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--mint) 54%, transparent);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.world-id-panel strong {
  display: block;
  margin: 6px 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.1;
}

.world-id-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.world-card-carousel {
  grid-column: 1 / -1;
  align-self: end;
  width: 100%;
  pointer-events: auto;
  perspective: 1200px;
}

.world-card-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.world-card-controls button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(5, 9, 18, 0.5);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(16px);
}

.world-card-controls button:hover {
  border-color: color-mix(in srgb, var(--cyan) 45%, transparent);
  color: var(--cyan);
}

.world-dock {
  max-width: 100%;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 20px 12vw 12px 3px;
  cursor: grab;
  user-select: none;
}

.world-dock::-webkit-scrollbar {
  display: none;
}

.world-dock.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.world-dock a {
  position: relative;
  flex: 0 0 min(360px, 82vw);
  min-height: 206px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  scroll-snap-align: start;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(69, 215, 255, 0.18), transparent 44%),
    linear-gradient(225deg, rgba(255, 111, 155, 0.14), transparent 48%),
    rgba(4, 8, 17, 0.76);
  backdrop-filter: blur(18px);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-family: var(--font-body);
  opacity: 0.84;
  transform: rotateY(-9deg) translateZ(0);
  transform-origin: center;
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.world-dock a:nth-child(2) {
  background:
    linear-gradient(135deg, rgba(255, 211, 107, 0.2), transparent 42%),
    linear-gradient(225deg, rgba(112, 246, 191, 0.13), transparent 46%),
    rgba(5, 9, 18, 0.78);
}

.world-dock a:nth-child(3) {
  background:
    linear-gradient(135deg, rgba(255, 111, 155, 0.2), transparent 42%),
    linear-gradient(225deg, rgba(169, 140, 255, 0.18), transparent 50%),
    rgba(5, 9, 18, 0.78);
}

.world-dock a:nth-child(4) {
  background:
    linear-gradient(135deg, rgba(112, 246, 191, 0.2), transparent 42%),
    linear-gradient(225deg, rgba(69, 215, 255, 0.16), transparent 48%),
    rgba(5, 9, 18, 0.78);
}

.world-dock a::before {
  position: absolute;
  inset: 12px;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.world-dock a::after {
  position: absolute;
  right: 22px;
  bottom: 20px;
  width: 72px;
  height: 72px;
  content: "";
  pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background:
    linear-gradient(rgba(255, 255, 255, 0.1) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 2px, transparent 2px);
  background-size: 18px 18px;
  opacity: 0.7;
}

.world-dock a.is-focused,
.world-dock a:hover {
  opacity: 1;
  transform: rotateY(0deg) translateY(-8px);
  border-color: color-mix(in srgb, var(--cyan) 45%, transparent);
  box-shadow:
    0 34px 84px rgba(0, 0, 0, 0.42),
    0 0 42px color-mix(in srgb, var(--cyan) 16%, transparent);
}

.world-dock span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.world-dock strong {
  display: block;
  max-width: 250px;
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.world-dock small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

@media (max-width: 980px) {
  body[data-page="home"] {
    overflow: auto;
  }

  .world-stage {
    min-height: 100svh;
  }

  .world-hud {
    grid-template-columns: 1fr;
    min-height: 100svh;
    padding-top: 128px;
  }

  .world-title-panel h1 {
    font-size: 54px;
  }

  .world-id-panel {
    justify-self: start;
  }

  .world-card-controls {
    justify-content: flex-start;
  }
}

@keyframes meter-bounce {
  0%,
  100% {
    transform: scaleY(0.58);
    opacity: 0.72;
  }

  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@media (max-width: 620px) {
  .world-hud {
    width: min(calc(100% - 24px), 1180px);
    padding-top: 142px;
  }

  .world-title-panel {
    padding: 18px;
  }

  .world-title-panel h1 {
    font-size: 38px;
  }

  body[data-page="home"] .site-header .page-shell {
    gap: 12px;
    padding: 12px 0;
  }

  body[data-page="home"] .site-nav {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-page="home"] .site-nav::-webkit-scrollbar {
    display: none;
  }

  body[data-page="home"] .site-nav a,
  body[data-page="home"] .button-primary,
  body[data-page="home"] .button-secondary {
    width: auto;
    min-height: 36px;
    flex: 0 0 auto;
    padding: 0 13px;
    font-size: 13px;
  }

  .world-id-panel {
    grid-template-columns: 92px minmax(0, 1fr);
    width: 100%;
  }

  .world-id-panel img {
    width: 92px;
    height: 112px;
  }

  .world-id-panel strong {
    font-size: 22px;
  }

  .world-dock a {
    flex-basis: min(360px, 84vw);
    min-height: 190px;
  }
}
