:root {
  --bg: #061116;
  --bg-soft: #0e1c22;
  --panel: rgba(9, 19, 25, 0.62);
  --panel-strong: rgba(10, 22, 29, 0.88);
  --line: rgba(165, 205, 214, 0.16);
  --text: #f1efe7;
  --muted: #9fb2b7;
  --accent: #b7fff1;
  --accent-strong: #7ee1cf;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

body[data-theme="light"] {
  --bg: #eef1ec;
  --bg-soft: #dde5df;
  --panel: rgba(255, 255, 255, 0.7);
  --panel-strong: rgba(255, 255, 255, 0.88);
  --line: rgba(21, 49, 57, 0.12);
  --text: #152128;
  --muted: #55666b;
  --accent: #1b8576;
  --accent-strong: #0f685c;
  --shadow: 0 26px 70px rgba(60, 79, 84, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(76, 137, 126, 0.22), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(173, 127, 92, 0.18), transparent 25%),
    linear-gradient(180deg, #041015 0%, #07151b 48%, #051015 100%);
  color: var(--text);
  overflow-x: hidden;
  transition:
    background-color 220ms ease,
    color 220ms ease;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  background-image:
    linear-gradient(rgba(183, 255, 241, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(183, 255, 241, 0.04) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 82%);
}

body[data-theme="light"]::before {
  background-image:
    linear-gradient(rgba(21, 49, 57, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 49, 57, 0.035) 1px, transparent 1px);
}

body::after {
  background:
    radial-gradient(circle at center, transparent 50%, rgba(0, 0, 0, 0.44) 100%);
  z-index: -1;
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at top left, rgba(41, 132, 118, 0.12), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(181, 140, 103, 0.12), transparent 25%),
    linear-gradient(180deg, #f7f8f4 0%, #eef2ee 48%, #e8ede8 100%);
}

body[data-theme="light"]::after {
  background:
    radial-gradient(circle at center, transparent 58%, rgba(255, 255, 255, 0.1) 100%);
}

.petrol-page-shell {
  width: min(1340px, calc(100% - 28px));
}

.petrol-page {
  padding: 40px 0 28px;
}

.petrol-hero {
  padding: 0 0 28px;
}

.petrol-hero h1 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: 0.94;
  max-width: 10ch;
}

.petrol-hero-text,
.petrol-info-copy {
  color: var(--muted);
  line-height: 1.75;
}

.petrol-hero-text {
  max-width: 46rem;
  margin: 18px 0 0;
  font-size: 1.04rem;
}

.petrol-price-box {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 18, 24, 0.56);
  box-shadow: var(--shadow);
}

body[data-theme="light"] .petrol-price-box {
  background: rgba(255, 255, 255, 0.72);
}

.petrol-info-kicker,
.petrol-landmark span,
.petrol-road-label,
.petrol-coast-label {
  font-family: "Press Start 2P", monospace;
  font-size: 0.56rem;
  line-height: 1.6;
  text-transform: uppercase;
}

.petrol-map-section {
  padding: 0;
}

.petrol-map-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(310px, 0.58fr);
  gap: 22px;
  margin-top: 18px;
  align-items: start;
}

.petrol-map-board,
.petrol-info-panel {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.petrol-map-board {
  aspect-ratio: 1.38 / 1;
  background: linear-gradient(180deg, #78d0ff 0%, #88d5ff 28%, #c4ecff 45%, #5fbd64 45%, #419847 100%);
}

.petrol-map-board::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.petrol-overworld {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.petrol-sky-fill {
  fill: #82d3ff;
}

.petrol-river {
  fill: #6cb8ff;
}

.petrol-sea {
  fill: #49a8ff;
}

.petrol-land-mass {
  fill: #57b74f;
}

.petrol-cliff-line {
  fill: none;
  stroke: rgba(244, 248, 255, 0.7);
  stroke-width: 7;
  stroke-linecap: round;
}

.petrol-road {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.petrol-road-primary {
  stroke: #f2d95b;
  stroke-width: 18;
}

.petrol-road-secondary {
  stroke: #f2d95b;
  stroke-width: 13;
}

.build-notes-shell {
  width: min(1280px, calc(100% - 28px));
}

.build-notes-page {
  padding: 36px 0 44px;
}

.build-notes-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.build-notes-hero-copy,
.build-notes-summary,
.build-notes-status-card,
.build-note-card,
.build-notes-empty {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.build-notes-hero-copy {
  padding: 34px;
}

.build-notes-hero-copy h1,
.build-notes-status-card h2,
.build-notes-empty h2,
.build-note-card h2 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  letter-spacing: -0.04em;
}

.build-notes-hero-copy h1 {
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 0.95;
  max-width: 10ch;
}

.build-notes-summary {
  padding: 24px;
  display: grid;
  gap: 14px;
  background:
    radial-gradient(circle at top left, rgba(183, 255, 241, 0.16), transparent 42%),
    var(--panel-strong);
}

.build-notes-stat {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 18, 24, 0.42);
}

body[data-theme="light"] .build-notes-stat {
  background: rgba(255, 255, 255, 0.7);
}

.build-notes-stat-label,
.build-note-meta,
.build-note-body p,
.build-notes-status-card p,
.build-notes-empty p {
  color: var(--muted);
}

.build-notes-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 1.25rem;
  line-height: 1.35;
}

.build-notes-status {
  margin-top: 24px;
}

.build-notes-status-card,
.build-notes-empty {
  padding: 28px 30px;
}

.build-notes-status-warning {
  background:
    radial-gradient(circle at top right, rgba(232, 178, 102, 0.18), transparent 36%),
    var(--panel);
}

.build-notes-list {
  margin-top: 28px;
}

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

.build-note-card {
  padding: 24px;
}

.build-note-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.build-note-card h2 {
  margin-top: 14px;
  font-size: 1.8rem;
  line-height: 1.02;
}

.build-note-excerpt {
  margin: 14px 0 0;
  font-size: 1rem;
  line-height: 1.7;
}

.build-note-body {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.build-note-body p {
  margin: 0;
  line-height: 1.75;
}

.project-tile-scoreboard {
  background:
    linear-gradient(145deg, rgba(13, 28, 33, 0.88), rgba(8, 19, 24, 0.78)),
    radial-gradient(circle at top left, rgba(255, 120, 96, 0.18), transparent 35%);
}

body[data-theme="light"] .project-tile-scoreboard {
  background:
    linear-gradient(145deg, rgba(250, 253, 252, 0.95), rgba(239, 246, 243, 0.92)),
    radial-gradient(circle at top left, rgba(199, 88, 58, 0.14), transparent 35%);
}

.scoreboard-shell {
  width: min(1360px, calc(100% - 28px));
}

.scoreboard-page {
  padding: 38px 0 44px;
}

.scoreboard-page-hero {
  padding-bottom: 24px;
}

.scoreboard-flash {
  margin-bottom: 18px;
}

.scoreboard-flash-banner {
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.scoreboard-flash-success {
  background:
    radial-gradient(circle at top left, rgba(110, 221, 197, 0.16), transparent 40%),
    var(--panel);
}

.scoreboard-flash-error {
  background:
    radial-gradient(circle at top left, rgba(255, 122, 104, 0.18), transparent 42%),
    var(--panel);
}

.scoreboard-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.scoreboard-game-panel,
.scoreboard-chart-panel {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.scoreboard-game-panel {
  padding: 32px;
  background:
    radial-gradient(circle at top left, rgba(255, 125, 90, 0.2), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(255, 219, 117, 0.18), transparent 22%),
    linear-gradient(180deg, rgba(10, 20, 25, 0.96), rgba(9, 17, 21, 0.84));
}

body[data-theme="light"] .scoreboard-game-panel {
  background:
    radial-gradient(circle at top left, rgba(212, 108, 73, 0.14), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(217, 171, 79, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(255, 251, 247, 0.98), rgba(247, 241, 236, 0.96));
}

.scoreboard-game-copy h2,
.scoreboard-chart-header h2,
.scoreboard-empty-state h3 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  letter-spacing: -0.04em;
}

.scoreboard-game-copy h2,
.scoreboard-chart-header h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.96;
}

.scoreboard-game-copy p:last-child {
  margin: 14px 0 0;
  max-width: 36rem;
  color: var(--muted);
  line-height: 1.7;
}

.scoreboard-generator {
  position: relative;
  margin-top: 28px;
  padding: 28px;
  min-height: 520px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(6, 12, 15, 0.48);
}

body[data-theme="light"] .scoreboard-generator {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.48)),
    rgba(250, 247, 244, 0.6);
}

.scoreboard-orbit {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.scoreboard-orbit-a {
  width: 320px;
  height: 320px;
  top: -110px;
  right: -120px;
  transform: rotate(24deg);
}

.scoreboard-orbit-b {
  width: 220px;
  height: 220px;
  left: -50px;
  bottom: -30px;
  transform: rotate(-18deg);
}

.scoreboard-digits-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: 100%;
  justify-items: center;
  text-align: center;
}

.scoreboard-digits-label,
.scoreboard-row-label,
.scoreboard-chart-stats,
.scoreboard-topline,
.scoreboard-submit-note {
  color: var(--muted);
}

.scoreboard-digits-label,
.scoreboard-chart-stats span,
.scoreboard-topline span,
.scoreboard-row-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scoreboard-digits {
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(5.2rem, 13vw, 10.2rem);
  line-height: 0.86;
  letter-spacing: -0.05em;
  width: 100%;
  text-align: center;
}

.scoreboard-digits-note {
  margin: 0;
  max-width: 100%;
  font-size: 1.02rem;
  line-height: 1.7;
  text-align: center;
}

.scoreboard-generator-actions {
  position: relative;
  z-index: 1;
  margin-top: 28px;
}

.scoreboard-spin-button,
.scoreboard-submit-button {
  min-width: 180px;
}

.scoreboard-spin-button {
  width: 100%;
  min-height: 104px;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 224, 224, 0.92), rgba(255, 224, 224, 0) 34%),
    linear-gradient(180deg, #ff8b8b 0%, #ff4747 35%, #dc1414 65%, #890707 100%);
  color: #fff6f4;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(102, 0, 0, 0.35);
  box-shadow:
    inset 0 4px 10px rgba(255, 240, 240, 0.72),
    inset 0 -10px 18px rgba(79, 0, 0, 0.55),
    0 18px 0 #4f0606,
    0 26px 32px rgba(0, 0, 0, 0.45);
  transform: translateY(0);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    filter 180ms ease;
  animation: scoreboardEmergencyPulse 1.8s ease-in-out infinite;
}

.scoreboard-spin-button:hover {
  filter: brightness(1.05) saturate(1.08);
}

.scoreboard-spin-button:active,
.scoreboard-spin-button:disabled {
  transform: translateY(10px);
  box-shadow:
    inset 0 3px 8px rgba(255, 240, 240, 0.42),
    inset 0 -6px 14px rgba(79, 0, 0, 0.52),
    0 8px 0 #4f0606,
    0 14px 18px rgba(0, 0, 0, 0.32);
}

.scoreboard-spin-button:focus-visible {
  outline: 3px solid rgba(255, 225, 225, 0.8);
  outline-offset: 4px;
}

@keyframes scoreboardEmergencyPulse {
  0%,
  100% {
    box-shadow:
      inset 0 4px 10px rgba(255, 240, 240, 0.72),
      inset 0 -10px 18px rgba(79, 0, 0, 0.55),
      0 18px 0 #4f0606,
      0 26px 32px rgba(0, 0, 0, 0.45);
  }

  50% {
    box-shadow:
      inset 0 4px 10px rgba(255, 240, 240, 0.72),
      inset 0 -10px 18px rgba(79, 0, 0, 0.55),
      0 18px 0 #4f0606,
      0 26px 32px rgba(0, 0, 0, 0.45),
      0 0 0 10px rgba(255, 77, 77, 0.12),
      0 0 32px rgba(255, 66, 66, 0.36);
  }
}

.scoreboard-submit-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.scoreboard-submit-form.is-hidden,
.scoreboard-submit-form[hidden] {
  display: none !important;
}

.scoreboard-submit-inline {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: nowrap;
  width: min(100%, 430px);
}

.scoreboard-field {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  max-width: 312px;
  min-width: 0;
}

.scoreboard-field span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.scoreboard-field input {
  width: 100%;
  min-height: 60px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body[data-theme="light"] .scoreboard-field input {
  background: rgba(255, 255, 255, 0.84);
}

.scoreboard-field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.scoreboard-submit-note {
  margin: 0;
  max-width: 430px;
  line-height: 1.6;
}

.scoreboard-submit-button-icon {
  flex: 0 0 108px;
  min-width: 108px;
  width: 108px;
  height: 60px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scoreboard-submit-button-icon span {
  transform: translateY(1px);
}

.scoreboard-chart-panel {
  padding: 24px;
}

.scoreboard-chart-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.scoreboard-chart-stats {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.scoreboard-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0 18px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.scoreboard-chart-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  max-height: 940px;
  overflow: auto;
  padding-right: 6px;
}

.scoreboard-row {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.scoreboard-row-toggle {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: 78px 74px minmax(0, 1fr) 110px;
  gap: 12px;
  align-items: center;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.scoreboard-row-score,
.scoreboard-row-rank,
.scoreboard-row-move {
  display: grid;
  justify-items: center;
  gap: 4px;
}

body[data-theme="light"] .scoreboard-row {
  background: rgba(255, 255, 255, 0.68);
}

.scoreboard-row-score strong,
.scoreboard-row-rank strong {
  font-size: 1.35rem;
}

.scoreboard-row-score strong {
  font-size: 2.2rem;
}

.scoreboard-row-move {
  padding: 10px 8px;
  border-radius: 14px;
  font-weight: 800;
}

.scoreboard-row-move-up {
  background: rgba(96, 224, 176, 0.12);
  color: #8fffd2;
}

.scoreboard-row-move-down {
  background: rgba(255, 128, 111, 0.12);
  color: #ffae9d;
}

.scoreboard-row-move-same {
  background: rgba(255, 255, 255, 0.07);
}

.scoreboard-row-move-new,
.scoreboard-row-move-re {
  background: rgba(255, 221, 123, 0.14);
  color: #ffd96f;
}

body[data-theme="light"] .scoreboard-row-move-up {
  color: #11815d;
}

body[data-theme="light"] .scoreboard-row-move-down {
  color: #b34d3b;
}

body[data-theme="light"] .scoreboard-row-move-new,
body[data-theme="light"] .scoreboard-row-move-re {
  color: #8d6210;
}

.scoreboard-row-move-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.scoreboard-row-move-copy {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.scoreboard-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.scoreboard-row-main strong {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scoreboard-row-main span {
  color: var(--muted);
}

.scoreboard-row-detail {
  display: none;
}

.scoreboard-row-detail[hidden] {
  display: none !important;
}

.scoreboard-empty-state {
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.scoreboard-empty-state p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 1080px) {
  .scoreboard-stage {
    grid-template-columns: 1fr;
  }

  .scoreboard-chart-panel {
    order: 2;
  }
}

@media (max-width: 720px) {
  .scoreboard-game-panel,
  .scoreboard-chart-panel {
    padding: 22px;
    border-radius: 26px;
  }

  .scoreboard-generator {
    padding: 22px;
    min-height: auto;
  }

  .scoreboard-topline,
  .scoreboard-chart-header {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .scoreboard-chart-stats {
    justify-items: start;
  }

  .scoreboard-row {
    padding: 12px 12px;
  }

  .scoreboard-row-toggle {
    grid-template-columns: 62px minmax(0, 1fr) 88px;
    gap: 10px;
  }

  .scoreboard-row-move {
    display: none;
  }

  .scoreboard-row-rank strong {
    font-size: 1.1rem;
  }

  .scoreboard-row-main {
    gap: 2px;
  }

  .scoreboard-row-main strong {
    font-size: 0.98rem;
  }

  .scoreboard-row-main span {
    display: none;
  }

  .scoreboard-row-score {
    justify-items: end;
  }

  .scoreboard-row-score strong {
    font-size: 1.22rem;
  }

  .scoreboard-row.is-expanded {
    background: rgba(255, 255, 255, 0.07);
  }

  .scoreboard-row-detail {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .scoreboard-row-detail[hidden] {
    display: none !important;
  }

  .scoreboard-row-detail-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .scoreboard-row-detail-line strong {
    color: var(--text);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .scoreboard-row-detail-movement {
    display: inline-grid;
    grid-auto-flow: column;
    align-items: center;
    justify-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1;
  }

  .scoreboard-row-detail-movement .scoreboard-row-move-copy {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
  }

  .scoreboard-submit-inline {
    width: 100%;
    align-items: stretch;
    gap: 12px;
  }

  .scoreboard-field {
    max-width: none;
  }

  .scoreboard-submit-button-icon {
    flex: 0 0 92px;
    min-width: 92px;
    width: 92px;
    height: 60px;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
  }

  .scoreboard-submit-note {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .scoreboard-row-toggle {
    grid-template-columns: 56px minmax(0, 1fr) 76px;
    gap: 8px;
  }

  .scoreboard-row-rank strong {
    font-size: 1rem;
  }

  .scoreboard-row-main strong {
    font-size: 0.92rem;
  }

  .scoreboard-row-score strong {
    font-size: 1.08rem;
  }

  .scoreboard-row-detail-line {
    display: grid;
    gap: 2px;
  }

  .scoreboard-submit-inline {
    display: grid;
    grid-template-columns: 1fr;
  }

  .scoreboard-submit-button-icon {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }
}

@media (max-width: 980px) {
  .build-notes-hero,
  .build-notes-grid {
    grid-template-columns: 1fr;
  }
}

.petrol-route-dots {
  fill: none;
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 1 24;
}

.petrol-hills path {
  fill: rgba(45, 125, 56, 0.9);
}

.petrol-pixels rect {
  fill: #d1d8e8;
}

.petrol-landmark-dots circle {
  fill: #f04f4f;
  stroke: #ffffff;
  stroke-width: 7;
}

.petrol-landmark-layer,
.petrol-marker-layer {
  position: absolute;
  inset: 0;
}

.petrol-marker-layer {
  z-index: 2;
}

.petrol-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.petrol-marker:focus-visible {
  outline: none;
}

.petrol-marker-sprite {
  width: 46px;
  height: 54px;
  position: relative;
  filter: drop-shadow(0 10px 12px rgba(10, 18, 20, 0.24));
}

.petrol-marker-roof,
.petrol-marker-body {
  position: absolute;
  left: 0;
  right: 0;
}

.petrol-marker-roof {
  top: 0;
  height: 20px;
  background: #f05454;
  clip-path: polygon(8% 100%, 20% 0, 80% 0, 92% 100%);
}

.petrol-marker-body {
  top: 16px;
  margin: 0 auto;
  width: 30px;
  height: 34px;
  background: linear-gradient(180deg, #fff8db 0 54%, #3c4b58 54% 100%);
  box-shadow:
    0 0 0 4px #102128,
    inset 0 0 0 4px #ffe973;
}

.petrol-marker-label {
  min-width: 70px;
  padding: 8px 10px 7px;
  border-radius: 999px;
  background: rgba(10, 27, 34, 0.88);
  color: #fffce8;
  font-family: "Press Start 2P", monospace;
  font-size: 0.48rem;
  line-height: 1.4;
  text-align: center;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

body[data-theme="light"] .petrol-marker-label {
  background: rgba(255, 255, 255, 0.9);
  color: #112029;
}

.petrol-marker.is-active .petrol-marker-sprite,
.petrol-marker:hover .petrol-marker-sprite {
  transform: translateY(-4px);
}

.petrol-marker.is-active .petrol-marker-label,
.petrol-marker:hover .petrol-marker-label {
  background: #fcdf62;
  color: #1e2a34;
}

.petrol-landmark,
.petrol-road-label,
.petrol-coast-label {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.petrol-landmark span,
.petrol-road-label,
.petrol-coast-label {
  padding: 10px 12px 8px;
  border-radius: 999px;
  background: rgba(9, 31, 39, 0.7);
  color: #f8fff3;
}

body[data-theme="light"] .petrol-landmark span,
body[data-theme="light"] .petrol-road-label,
body[data-theme="light"] .petrol-coast-label {
  background: rgba(255, 255, 255, 0.8);
  color: #152128;
}

.petrol-landmark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  width: 12px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #ff6161;
  box-shadow: 0 0 0 4px #ffffff;
}

.petrol-info-panel {
  padding: 28px 24px 24px;
  background:
    linear-gradient(180deg, rgba(5, 18, 24, 0.9) 0%, rgba(8, 28, 35, 0.95) 100%);
}

body[data-theme="light"] .petrol-info-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(238, 245, 243, 0.95) 100%);
}

.petrol-info-panel > strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px 8px;
  border-radius: 999px;
  background: rgba(255, 223, 98, 0.16);
  color: var(--accent);
  font-family: "Press Start 2P", monospace;
  font-size: 0.62rem;
  line-height: 1.4;
}

.petrol-info-panel h2 {
  margin: 18px 0 10px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.02;
}

.petrol-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 18px;
}

.petrol-price-box {
  padding: 18px 16px;
  border-radius: 22px;
}

.petrol-price-box span,
.petrol-price-box small {
  font-family: "Press Start 2P", monospace;
}

.petrol-price-box span {
  display: block;
  font-size: 0.58rem;
  line-height: 1.6;
  color: var(--accent);
}

.petrol-price-box strong {
  display: block;
  margin: 14px 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1;
}

.petrol-price-box small {
  display: block;
  color: var(--muted);
  font-size: 0.54rem;
  line-height: 1.7;
}

@media (max-width: 1080px) {
  .petrol-map-stage {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .petrol-page-shell {
    width: min(1380px, calc(100% - 22px));
  }

  .petrol-hero {
    padding-bottom: 22px;
  }

  .petrol-price-grid {
    grid-template-columns: 1fr;
  }

  .petrol-map-board {
    aspect-ratio: 1 / 1.04;
  }

  .petrol-marker-label,
  .petrol-landmark span,
  .petrol-road-label,
  .petrol-coast-label {
    font-size: 0.44rem;
  }

  .petrol-landmark span,
  .petrol-road-label,
  .petrol-coast-label {
    padding: 7px 9px 6px;
  }

  .petrol-landmark-marsden,
  .petrol-road-label:nth-of-type(2),
  .petrol-road-label:nth-of-type(5) {
    display: none;
  }
}

.page-shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding-bottom: 56px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ffffff);
  box-shadow: 0 0 30px rgba(183, 255, 241, 0.7);
}

.brand-text {
  display: grid;
  gap: 3px;
}

.brand-text strong {
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-text span {
  color: var(--muted);
  font-size: 0.8rem;
}

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

.site-nav a,
.contact-rail a {
  color: var(--muted);
  text-decoration: none;
  transition: color 180ms ease;
}

.site-nav a:hover,
.contact-rail a:hover {
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.theme-toggle-text {
  font-size: 0.84rem;
}

.hero,
.positioning,
.projects,
.closing {
  border-top: 1px solid var(--line);
}

.hero {
  min-height: calc(100svh - 104px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  align-items: center;
  gap: 48px;
  padding: 42px 0 54px;
}

.eyebrow,
.section-label {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

.hero h1,
.positioning h2,
.projects h2,
.closing h2 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero h1 {
  font-size: clamp(3.7rem, 8vw, 7.8rem);
  max-width: 10ch;
  margin-top: 10px;
}

.hero-text,
.section-copy p,
.projects-heading p,
.closing p,
.project-body p,
.metrics p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.02rem;
}

.hero-text {
  max-width: 36rem;
  margin: 24px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 30px 0 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
  padding: 14px 20px;
  border-radius: 999px;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--accent);
  color: #051015;
  font-weight: 800;
}

.button-secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.hero-signals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.hero-signals li {
  position: relative;
  padding-left: 22px;
  color: #d2dbdd;
}

body[data-theme="light"] .hero-signals li,
body[data-theme="light"] .timeline-body ul {
  color: #324248;
}

.hero-signals li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 10px;
  height: 1px;
  background: var(--accent);
}

.hero-media {
  position: relative;
  min-height: 720px;
  display: grid;
  align-items: center;
}

.media-frame {
  position: relative;
  width: min(100%, 560px);
  margin-left: auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  background: linear-gradient(180deg, transparent, rgba(4, 16, 21, 0.64));
}

body[data-theme="light"] .media-frame::after {
  background: linear-gradient(180deg, transparent, rgba(237, 243, 238, 0.5));
}

.media-frame img {
  width: 100%;
  height: 720px;
  display: block;
  object-fit: cover;
}

.media-panel {
  position: absolute;
  backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid rgba(183, 255, 241, 0.14);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

body[data-theme="light"] .button-secondary,
body[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.66);
}

.media-panel span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.media-panel strong {
  display: block;
  max-width: 18ch;
  line-height: 1.4;
}

.panel-top {
  top: 56px;
  left: 12px;
}

.panel-bottom {
  right: -10px;
  bottom: 56px;
}

.positioning,
.projects,
.closing {
  padding: 80px 0;
}

.section-grid,
.projects-heading,
.closing {
  display: grid;
  gap: 32px;
}

.section-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: start;
  margin-top: 20px;
}

.positioning h2,
.projects h2,
.closing h2 {
  font-size: clamp(2.2rem, 4.2vw, 4.1rem);
  max-width: 11ch;
  margin-bottom: 22px;
}

.metrics {
  display: grid;
  gap: 18px;
}

.metrics div {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.metrics span {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-family: "Fraunces", "Iowan Old Style", serif;
  color: var(--accent);
}

.metrics p {
  margin: 0;
}

.projects-heading {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  align-items: end;
  margin: 20px 0 30px;
}

.project-list {
  border-top: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 180px;
  gap: 24px;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  transition:
    transform 180ms ease,
    background-color 180ms ease;
}

.project-row:hover {
  transform: translateX(6px);
  background: linear-gradient(90deg, rgba(183, 255, 241, 0.03), transparent 70%);
}

.project-meta,
.project-status {
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.project-body h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.project-body p {
  margin: 0;
  max-width: 52ch;
}

.closing {
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: end;
}

.contact-rail {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
}

.contact-rail span {
  color: var(--muted);
}

.page-shell-resume {
  width: min(1320px, calc(100% - 48px));
}

.resume-page {
  display: grid;
  gap: 36px;
}

.resume-hero,
.resume-section {
  border-top: 1px solid var(--line);
}

.resume-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.72fr);
  gap: 42px;
  align-items: start;
  padding: 40px 0 28px;
}

.resume-intro h1,
.resume-card h2,
.timeline-body h2 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.resume-intro h1 {
  font-size: clamp(3.4rem, 8vw, 6rem);
  line-height: 0.95;
  margin-top: 10px;
}

.resume-subtitle {
  margin: 18px 0 0;
  color: #d5dfdf;
  font-size: 1.12rem;
  max-width: 36rem;
}

.resume-aside {
  display: grid;
  gap: 18px;
}

.resume-portrait {
  width: min(100%, 420px);
}

.resume-portrait img {
  width: 100%;
  height: 520px;
  display: block;
  object-fit: cover;
}

.resume-contact {
  width: min(100%, 420px);
  margin-left: auto;
}

.resume-section {
  padding: 34px 0 10px;
}

.resume-card,
.timeline-item {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.resume-card {
  padding: 28px;
}

.resume-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.75;
}

.resume-card p:last-child {
  margin-bottom: 0;
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: 20px;
  padding: 26px;
}

.timeline-meta p,
.timeline-meta span,
.resume-card span {
  margin: 0;
  color: var(--muted);
}

.timeline-meta p {
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.timeline-meta span {
  display: block;
  line-height: 1.5;
}

.timeline-body h2,
.resume-card h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.05;
  margin-bottom: 14px;
}

.timeline-body p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.timeline-body ul {
  margin: 0;
  padding-left: 20px;
  color: #d2dbdd;
  display: grid;
  gap: 10px;
  line-height: 1.6;
}

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

.projects-page {
  display: grid;
  gap: 40px;
}

.projects-hero,
.projects-grid-section {
  border-top: 1px solid var(--line);
}

.projects-hero {
  padding: 48px 0 12px;
}

.projects-hero-copy h1 {
  margin: 10px 0 0;
  max-width: 10ch;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(3.2rem, 8vw, 6.2rem);
  font-weight: 600;
  line-height: 0.97;
  letter-spacing: -0.04em;
}

.projects-grid-section {
  padding: 24px 0 56px;
}

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

.project-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "meta arrow"
    "title arrow"
    "copy arrow";
  align-content: start;
  gap: 10px 14px;
  min-height: 220px;
  padding: 24px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.project-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(183, 255, 241, 0.28);
}

.project-tile-meta {
  grid-area: meta;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.project-tile strong {
  grid-area: title;
  font-size: 1.38rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.project-tile p {
  grid-area: copy;
  margin: 0;
  color: var(--muted);
  max-width: 28ch;
  line-height: 1.62;
}

.project-tile-arrow {
  grid-area: arrow;
  align-self: start;
  justify-self: end;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.03);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.project-tile:hover .project-tile-arrow {
  transform: translate(2px, -2px);
  border-color: rgba(183, 255, 241, 0.3);
  background: rgba(183, 255, 241, 0.08);
}

.project-tile-featured {
  background:
    radial-gradient(circle at top right, rgba(183, 255, 241, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--panel-strong);
}

.breakout-project-page {
  display: grid;
  gap: 28px;
}

.project-intro,
.project-lab {
  border-top: 1px solid var(--line);
}

.project-intro {
  padding: 42px 0 8px;
}

.project-intro h1 {
  margin: 10px 0 0;
  max-width: 10ch;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.project-description {
  max-width: 40rem;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.02rem;
}

.project-lab {
  padding: 20px 0 56px;
}

.gameboy-page {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top, rgba(155, 188, 15, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(15, 56, 15, 0.16), rgba(15, 56, 15, 0.06));
}

.gameboy-shell {
  width: min(100%, 760px);
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.gameboy-canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #9bbc0f;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.project-tile-scan {
  background:
    radial-gradient(circle at 82% 20%, rgba(126, 225, 207, 0.16), transparent 28%),
    radial-gradient(circle at 16% 100%, rgba(243, 214, 192, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--panel-strong);
}

.project-tile-bones {
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 210, 168, 0.16), transparent 26%),
    radial-gradient(circle at 22% 84%, rgba(182, 206, 255, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--panel-strong);
}

.project-tile-bird {
  background:
    radial-gradient(circle at 80% 18%, rgba(213, 184, 117, 0.16), transparent 28%),
    radial-gradient(circle at 18% 86%, rgba(132, 173, 126, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--panel-strong);
}

.project-tile-reset {
  background:
    radial-gradient(circle at 78% 18%, rgba(112, 197, 255, 0.18), transparent 28%),
    radial-gradient(circle at 18% 86%, rgba(255, 186, 121, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--panel-strong);
}

.scan-page {
  display: grid;
  gap: 28px;
}

.scan-intro,
.scan-lab {
  border-top: 1px solid var(--line);
}

.scan-intro {
  padding: 42px 0 8px;
}

.scan-intro h1 {
  margin: 10px 0 0;
  max-width: 8ch;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 5.2rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.scan-control-block {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.scan-control-block > span,
.scan-callout span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.scan-callout strong {
  display: block;
  line-height: 1.5;
}

.scan-description {
  max-width: 42rem;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.02rem;
}

.scan-lab {
  padding: 20px 0 56px;
}

.scan-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.52fr);
  gap: 22px;
  align-items: stretch;
}

.scan-canvas-shell {
  position: relative;
  overflow: hidden;
  min-height: 720px;
  border: 1px solid rgba(183, 255, 241, 0.2);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 12%, rgba(126, 225, 207, 0.18), transparent 24%),
    radial-gradient(circle at 18% 100%, rgba(243, 214, 192, 0.16), transparent 20%),
    linear-gradient(180deg, rgba(5, 15, 19, 0.98) 0%, rgba(6, 17, 22, 0.92) 100%);
  box-shadow: var(--shadow);
}

.scan-canvas-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(183, 255, 241, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(183, 255, 241, 0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), transparent 86%);
  pointer-events: none;
}

.scan-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.scan-callout {
  position: absolute;
  left: 24px;
  bottom: 24px;
  max-width: min(68%, 360px);
  padding: 16px 18px;
  border: 1px solid rgba(183, 255, 241, 0.18);
  border-radius: 20px;
  background: rgba(7, 16, 20, 0.72);
  backdrop-filter: blur(18px);
}

.scan-controls {
  display: grid;
  gap: 16px;
  align-content: start;
}

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

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

.animation-button-wide {
  grid-column: 1 / -1;
}

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

.rotation-control {
  display: grid;
  gap: 14px;
}

.rotate-pad {
  display: grid;
  gap: 10px;
}

.rotate-pad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.rotate-icon {
  font-size: 1.3rem;
  line-height: 1;
  font-weight: 700;
}

.rotate-pad-empty {
  display: block;
  min-height: 48px;
}

.rotate-pad .control-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  transform: none;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.rotate-pad .control-button:hover,
.rotate-pad .control-button:focus-visible,
.rotate-pad .control-button:active,
.rotate-pad .control-button.is-active {
  transform: none !important;
}

.light-color-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px;
}

.light-color-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.04),
    0 0 26px rgba(255, 255, 255, 0.16);
}

.light-color-icon-neutral {
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.98), rgba(235, 244, 255, 0.92) 58%, rgba(180, 214, 255, 0.78));
}

.light-color-icon-warm {
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 247, 214, 0.98), rgba(255, 205, 112, 0.94) 56%, rgba(255, 133, 72, 0.86));
}

.light-color-icon-cool {
  background:
    radial-gradient(circle at 35% 35%, rgba(223, 248, 255, 0.98), rgba(126, 223, 255, 0.94) 54%, rgba(77, 139, 255, 0.84));
}

.scale-slider-wrap {
  display: grid;
  gap: 12px;
}

.scale-slider-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.scale-slider-label span {
  color: var(--muted);
  font-size: 0.92rem;
}

.scale-slider-label strong {
  font-size: 0.98rem;
}

.scale-slider {
  width: 100%;
  margin: 0;
  appearance: none;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(183, 255, 241, 0.58), rgba(255, 255, 255, 0.14));
  outline: none;
}

.scale-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(183, 255, 241, 0.5);
  border-radius: 999px;
  background: #f1efe7;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.scale-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(183, 255, 241, 0.5);
  border-radius: 999px;
  background: #f1efe7;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.scale-slider::-moz-range-track {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(183, 255, 241, 0.58), rgba(255, 255, 255, 0.14));
}

.control-button {
  padding: 14px 16px;
  border: 1px solid rgba(183, 255, 241, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.control-button:hover,
.control-button:focus-visible,
.control-button.is-active {
  transform: translateY(-2px);
  border-color: rgba(183, 255, 241, 0.34);
  background: rgba(183, 255, 241, 0.1);
  outline: none;
}

.project-detail-page {
  display: grid;
  gap: 24px;
}

.bird-page {
  gap: 28px;
}

.project-hero,
.wave-lab-section {
  border-top: 1px solid var(--line);
}

.project-hero {
  padding: 42px 0 12px;
}

.project-hero-copy h1,
.wave-lab-head h2 {
  margin: 10px 0 0;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.project-hero-copy h1 {
  font-size: clamp(3.4rem, 8vw, 6.5rem);
  line-height: 0.94;
}

.project-controls,
.reward-draft-header span {
  color: var(--muted);
  line-height: 1.7;
  max-width: 64rem;
  margin: 18px 0 0;
}

.reward-draft-header span {
  display: block;
  margin: 0 0 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.wave-lab-section {
  padding: 18px 0 10px;
}

.bird-stream-section {
  border-top: 1px solid var(--line);
  padding: 18px 0 18px;
}

.bird-stream-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
  margin-top: 22px;
}

.bird-stream-frame,
.bird-stream-note {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.bird-stream-frame {
  overflow: hidden;
}

.bird-stream-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 420px;
  border: 0;
  background: #000;
}

.bird-stream-note {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.bird-stream-note span {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

.bird-stream-note strong {
  font-size: 1.3rem;
}

.bird-stream-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reset-page {
  gap: 28px;
}

.reset-dashboard-section {
  display: grid;
  border-top: 1px solid var(--line);
  padding: 18px 0 56px;
}

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

.reset-card,
.reset-note {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.reset-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  padding: 34px 26px 24px;
  border: 1px solid rgba(255, 248, 233, 0.22);
  border-radius: 30px;
  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -10px 24px rgba(0, 0, 0, 0.1);
}

.reset-progress {
  position: absolute;
  top: 18px;
  left: 26px;
  right: 26px;
  height: 12px;
  border-radius: 999px;
  background: rgba(32, 18, 10, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
}

.reset-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f4d792, #d3844b);
  box-shadow: 0 0 18px rgba(244, 215, 146, 0.3);
  transition: width 600ms linear;
}

.reset-card-codex {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.32), transparent 24%),
    linear-gradient(180deg, #ded4bf 0%, #b3a48d 100%);
}

.reset-card-claude {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.3), transparent 24%),
    linear-gradient(180deg, #d7cfbd 0%, #ab9c86 100%);
}

.reset-clock-shell {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px 18px 16px;
  border-radius: 28px;
  border: 1px solid rgba(25, 18, 13, 0.58);
  background:
    linear-gradient(180deg, rgba(11, 8, 6, 0.96), rgba(23, 16, 12, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -14px 24px rgba(0, 0, 0, 0.45),
    0 16px 34px rgba(24, 16, 10, 0.28);
}

.reset-clock-shell::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.reset-clock-brand {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(244, 231, 212, 0.7);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
}

.reset-countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.reset-unit {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px 10px 10px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #2f241c 0%, #120d0a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -12px 20px rgba(0, 0, 0, 0.35),
    0 8px 16px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.reset-unit::before,
.reset-unit::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #080605;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06);
  transform: translateY(-50%);
}

.reset-unit::before {
  left: -3px;
}

.reset-unit::after {
  right: -3px;
}

.reset-unit-value {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 112px;
  border-radius: 12px;
  color: #f3ead7;
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.9rem, 7vw, 4.9rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.08em;
  font-variant-numeric: tabular-nums;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 18%),
    linear-gradient(180deg, #36281f 0 49.2%, #120d0a 49.2% 50.8%, #201712 50.8% 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -12px 18px rgba(0, 0, 0, 0.28);
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.26);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.reset-unit-value::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(50% - 1px);
  height: 2px;
  background: rgba(0, 0, 0, 0.18);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.02),
    0 1px 0 rgba(255, 255, 255, 0.02);
  z-index: 0;
}

.reset-unit-value::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.12));
  pointer-events: none;
}

.reset-unit small {
  color: rgba(233, 221, 203, 0.56);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.58rem;
  font-weight: 800;
}

.reset-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  justify-items: center;
}

.reset-meta div {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
}

.reset-meta dt {
  color: rgba(52, 33, 21, 0.56);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.66rem;
  white-space: nowrap;
  font-weight: 800;
}

.reset-meta dd {
  margin: 0;
  color: #1c1510;
  font-size: 0.95rem;
  font-weight: 700;
}

.reset-card[data-reset-compact="true"] .reset-countdown {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reset-card[data-reset-compact="true"] .reset-unit-days {
  display: none;
}

.wave-lab {
  --wave-bg: #120d2a;
  --wave-glow: #ff6f59;
  --wave-accent: #ffd166;
  --wave-accent-soft: #7bdff2;
  --wave-brick-a: #ff6f59;
  --wave-brick-b: #ffd166;
  --wave-orb: #f7fff7;
  --wave-paddle: #7bdff2;
  margin-top: 22px;
  padding: 28px;
  border: 1px solid rgba(183, 255, 241, 0.16);
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--wave-glow) 22%, transparent), transparent 36%),
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--wave-accent) 20%, transparent), transparent 30%),
    linear-gradient(180deg, color-mix(in srgb, var(--wave-bg) 88%, #04070b) 0%, #060d12 100%);
  box-shadow: var(--shadow);
  transition:
    background 320ms ease,
    border-color 320ms ease;
}

.wave-lab-head,
.wave-lab-controls,
.wave-lab-stage {
  display: grid;
  gap: 20px;
}

.wave-lab-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 16px;
}

.wave-lab-head h2 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 0.98;
}

.wave-lab-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
  text-align: right;
}

.wave-lab-meta span {
  color: var(--muted);
}

.wave-lab-meta strong {
  color: var(--text);
  max-width: 28ch;
}

.wave-lab-stage {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.56fr);
  align-items: stretch;
}

.playfield-column {
  display: grid;
  gap: 16px;
}

.stage-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.hud-chip {
  min-width: 132px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--wave-accent-soft) 22%, transparent);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.hud-chip span {
  display: block;
  margin-bottom: 6px;
  color: rgba(241, 239, 231, 0.72);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.71rem;
}

.hud-chip strong {
  display: block;
  font-size: 1.02rem;
}

.arena-shell {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  border: 1px solid color-mix(in srgb, var(--wave-glow) 26%, transparent);
  border-radius: 28px;
  background:
    radial-gradient(circle at top center, color-mix(in srgb, var(--wave-glow) 24%, transparent), transparent 32%),
    linear-gradient(180deg, color-mix(in srgb, var(--wave-bg) 76%, #020508) 0%, rgba(5, 11, 17, 0.98) 100%);
}

.arena-backdrop {
  position: absolute;
  inset: 0;
}

.backdrop-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--wave-accent-soft) 10%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--wave-accent-soft) 8%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 86%);
}

.backdrop-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--wave-accent) 24%, transparent);
}

.ring-one {
  width: 380px;
  height: 380px;
  top: -110px;
  right: -60px;
}

.ring-two {
  width: 280px;
  height: 280px;
  bottom: 60px;
  left: -40px;
}

.arena-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.reward-draft {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--wave-accent-soft) 18%, transparent);
  border-radius: 28px;
  background: rgba(8, 16, 21, 0.8);
}

.reward-options {
  display: grid;
  gap: 12px;
}

.reward-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.reward-card:disabled {
  cursor: default;
  opacity: 0.72;
}

.reward-card.is-active {
  transform: translateX(4px);
  border-color: color-mix(in srgb, var(--wave-accent) 38%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--wave-glow) 20%, transparent), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.05);
}

.reward-card.is-selectable:not(:disabled):hover,
.reward-card.is-selectable:not(:disabled):focus-visible {
  transform: translateX(4px);
  border-color: color-mix(in srgb, var(--wave-accent) 46%, transparent);
  outline: none;
}

.reward-card span {
  color: var(--wave-accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.reward-card strong {
  font-size: 1.08rem;
}

.reward-card p,
.wave-lab-controls p {
  margin: 0;
  color: #c7d0d3;
  line-height: 1.7;
}

.wave-lab-controls {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-top: 18px;
}

.wave-lab-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.wave-button {
  min-width: 174px;
}

body[data-theme="light"] .project-tile:hover {
  border-color: rgba(27, 133, 118, 0.25);
}

body[data-theme="light"] .project-tile-arrow {
  border-color: rgba(23, 66, 73, 0.14);
  background: rgba(23, 66, 73, 0.04);
}

body[data-theme="light"] .project-tile:hover .project-tile-arrow {
  border-color: rgba(27, 133, 118, 0.24);
  background: rgba(27, 133, 118, 0.08);
}

body[data-theme="light"] .project-tile-featured {
  background:
    radial-gradient(circle at top right, rgba(27, 133, 118, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.22)),
    var(--panel-strong);
}

body[data-theme="light"] .project-tile-scan {
  background:
    radial-gradient(circle at 82% 20%, rgba(27, 133, 118, 0.12), transparent 28%),
    radial-gradient(circle at 16% 100%, rgba(174, 126, 92, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.22)),
    var(--panel-strong);
}

body[data-theme="light"] .project-tile-bones {
  background:
    radial-gradient(circle at 80% 20%, rgba(198, 141, 91, 0.12), transparent 26%),
    radial-gradient(circle at 18% 86%, rgba(133, 160, 218, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.22)),
    var(--panel-strong);
}

body[data-theme="light"] .project-tile-bird {
  background:
    radial-gradient(circle at 80% 18%, rgba(168, 132, 56, 0.12), transparent 28%),
    radial-gradient(circle at 18% 86%, rgba(88, 130, 81, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.22)),
    var(--panel-strong);
}

body[data-theme="light"] .scan-canvas-shell {
  background:
    radial-gradient(circle at 50% 12%, rgba(27, 133, 118, 0.14), transparent 24%),
    radial-gradient(circle at 18% 100%, rgba(174, 126, 92, 0.14), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(234, 240, 235, 0.94) 100%);
}

body[data-theme="light"] .scan-callout,
body[data-theme="light"] .scan-control-block {
  color: #162128;
}

body[data-theme="light"] .scan-callout {
  background: rgba(255, 255, 255, 0.76);
}

body[data-theme="light"] .wave-lab {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--wave-glow) 18%, transparent), transparent 36%),
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--wave-accent) 16%, transparent), transparent 30%),
    linear-gradient(180deg, #f6f8f4 0%, #eaf0eb 100%);
}

body[data-theme="light"] .wave-lab,
body[data-theme="light"] .arena-shell,
body[data-theme="light"] .reward-draft,
body[data-theme="light"] .hud-chip {
  color: #162128;
}

body[data-theme="light"] .arena-shell,
body[data-theme="light"] .reward-draft {
  background:
    radial-gradient(circle at top center, color-mix(in srgb, var(--wave-glow) 14%, transparent), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(238, 243, 239, 0.96) 100%);
}

body[data-theme="light"] .hud-chip {
  background: rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .hud-chip span,
body[data-theme="light"] .reward-card p,
body[data-theme="light"] .wave-lab-controls p {
  color: #506066;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* South Shields Petrol Stations refresh */
.petrol-page-shell {
  width: min(1340px, calc(100% - 28px));
}

.petrol-page {
  border-top: 1px solid var(--line);
  padding: 34px 0 28px;
}

.petrol-hero {
  padding: 0 0 28px;
}

.petrol-hero h1 {
  max-width: 10ch;
}

.petrol-hero-text {
  max-width: 48rem;
}

.petrol-map-stage {
  padding: 18px;
  border-radius: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 19, 24, 0.34);
}

body[data-theme="light"] .petrol-map-stage {
  background: rgba(255, 255, 255, 0.72);
}

.petrol-map-board {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.6), transparent 32%),
    linear-gradient(180deg, #f6f0e1 0%, #efe3c2 100%);
}

.petrol-map-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.petrol-marker {
  gap: 10px;
}

.petrol-marker-sprite {
  width: 92px;
  transform: rotate(-4deg);
  transition: transform 180ms ease;
}

.petrol-marker-sprite img {
  display: block;
  width: 100%;
  height: auto;
  clip-path: polygon(50% 0%, 79% 6%, 94% 21%, 100% 39%, 96% 60%, 84% 80%, 67% 95%, 50% 100%, 33% 95%, 16% 80%, 4% 60%, 0 39%, 6% 21%, 21% 6%);
  filter: drop-shadow(0 14px 20px rgba(17, 28, 35, 0.2));
}

.petrol-marker-label {
  min-width: 74px;
  padding: 7px 10px 6px;
  background: #17303c;
  color: #fffbe5;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 0;
  box-shadow: 0 8px 16px rgba(17, 28, 35, 0.18);
}

body[data-theme="light"] .petrol-marker-label {
  background: #ffffff;
  color: #17303c;
}

.petrol-marker.is-active .petrol-marker-sprite,
.petrol-marker:hover .petrol-marker-sprite {
  transform: rotate(0deg) translateY(-6px) scale(1.04);
}

.petrol-marker.is-active .petrol-marker-label,
.petrol-marker:hover .petrol-marker-label {
  background: #ffcf59;
  color: #1e2a34;
}

@media (max-width: 720px) {
  .petrol-map-stage {
    padding: 12px;
  }

  .petrol-marker-sprite {
    width: 74px;
  }
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
    padding-top: 24px;
  }

  .hero-media {
    min-height: auto;
  }

  .media-frame {
    margin-left: 0;
  }

  .media-frame img {
    height: min(78vh, 720px);
  }

  .panel-top {
    left: 14px;
  }

  .panel-bottom {
    right: 14px;
  }

  .section-grid,
  .projects-heading,
  .closing,
  .project-row,
  .resume-hero,
  .timeline-item,
  .resume-grid-two,
  .project-grid,
  .bird-stream-shell,
  .scan-stage,
  .wave-lab-head,
  .wave-lab-stage,
  .wave-lab-controls {
    grid-template-columns: 1fr;
  }

  .project-row {
    gap: 10px;
  }

  .project-status {
    margin-top: 4px;
  }

  .resume-contact,
  .resume-portrait {
    width: 100%;
    margin-left: 0;
  }

  .wave-lab-meta {
    justify-items: start;
    text-align: left;
  }

  .wave-lab-buttons {
    justify-content: flex-start;
  }

  .scan-canvas-shell {
    min-height: 620px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 32px, 1280px);
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .hero h1 {
    font-size: clamp(2.9rem, 16vw, 4.8rem);
  }

  .media-frame {
    width: 100%;
    border-radius: 20px;
  }

  .media-frame img {
    height: 520px;
  }

  .media-panel {
    position: static;
    margin-top: 12px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .project-grid,
  .reset-grid,
  .reset-meta {
    grid-template-columns: 1fr;
  }

  .project-grid {
    gap: 12px;
  }

  .project-tile {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "meta title arrow";
    align-items: center;
    min-height: 0;
    padding: 16px 18px;
    border-radius: 18px;
    gap: 12px;
  }

  .project-tile strong {
    font-size: 1.02rem;
    line-height: 1.2;
  }

  .project-tile p {
    display: none;
  }

  .project-tile-arrow {
    width: 34px;
    height: 34px;
    font-size: 0.92rem;
  }

  .reset-card {
    padding: 24px 20px 20px;
    border-radius: 24px;
  }

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

  .reset-unit-value {
    min-height: 92px;
    font-size: clamp(2.5rem, 15vw, 4rem);
  }

  .reset-meta div {
    flex-wrap: wrap;
  }

  .timeline-item,
  .resume-card {
    padding: 22px;
  }

  .resume-portrait img {
    height: 420px;
  }

  .project-hero-copy h1 {
    font-size: clamp(2.8rem, 16vw, 4.5rem);
  }

  .scan-intro h1 {
    font-size: clamp(2.8rem, 16vw, 4.5rem);
  }

  .wave-lab {
    padding: 20px;
    border-radius: 24px;
  }

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

  .arena-shell {
    min-height: 460px;
  }

  .scan-canvas-shell {
    min-height: 520px;
  }

  .scan-callout {
    left: 18px;
    right: 18px;
    bottom: 18px;
    max-width: none;
  }

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

  .wave-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* South Shields dashboard */
.petrol-dashboard-section,
.petrol-trends-section,
.petrol-fill-section {
  padding-top: 30px;
}

.petrol-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.petrol-section-heading h2,
.petrol-chart-head h3 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.petrol-section-heading h2 {
  font-size: clamp(1.8rem, 3.4vw, 3rem);
}

.petrol-section-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.petrol-dashboard-section-top .petrol-dashboard-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.petrol-dashboard-card,
.petrol-chart-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 18, 24, 0.56);
  box-shadow: var(--shadow);
}

body[data-theme="light"] .petrol-dashboard-card,
body[data-theme="light"] .petrol-chart-card {
  background: rgba(255, 255, 255, 0.76);
}

.petrol-dashboard-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 24px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.petrol-dashboard-card:hover,
.petrol-dashboard-card.is-active {
  transform: translateY(-3px);
  border-color: rgba(255, 207, 89, 0.45);
}

.petrol-dashboard-brand {
  color: var(--accent);
  font-family: "Press Start 2P", monospace;
  font-size: 0.54rem;
  line-height: 1.6;
}

.petrol-dashboard-card strong {
  font-size: 1.02rem;
}

.petrol-dashboard-card > span:not(.petrol-dashboard-brand) {
  color: var(--muted);
}

.petrol-dashboard-prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.petrol-dashboard-prices div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid transparent;
}

body[data-theme="light"] .petrol-dashboard-prices div {
  background: rgba(21, 49, 57, 0.05);
}

.petrol-dashboard-price-best {
  border-color: rgba(88, 197, 103, 0.9) !important;
  box-shadow: inset 0 0 0 1px rgba(88, 197, 103, 0.18);
}

.petrol-dashboard-price-worst {
  border-color: rgba(228, 91, 91, 0.9) !important;
  box-shadow: inset 0 0 0 1px rgba(228, 91, 91, 0.18);
}

.petrol-dashboard-prices small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: "Press Start 2P", monospace;
  font-size: 0.48rem;
}

.petrol-dashboard-prices span {
  font-size: 1.3rem;
  font-weight: 800;
}

.petrol-chart-stack {
  display: grid;
  gap: 16px;
}

.petrol-chart-card {
  padding: 20px;
  border-radius: 28px;
}

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

.petrol-chart-head span {
  color: var(--muted);
  font-size: 0.92rem;
}

.petrol-chart-frame {
  overflow-x: auto;
}

.petrol-chart-frame svg {
  display: block;
  width: 100%;
  min-width: 740px;
  color: var(--text);
}

.petrol-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 16px;
}

.petrol-fill-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
  gap: 18px;
  align-items: start;
}

.petrol-fill-controls,
.petrol-fill-results {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 18, 24, 0.56);
  box-shadow: var(--shadow);
  border-radius: 28px;
}

body[data-theme="light"] .petrol-fill-controls,
body[data-theme="light"] .petrol-fill-results {
  background: rgba(255, 255, 255, 0.76);
}

.petrol-fill-controls {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.petrol-fuel-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 6px;
  gap: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] .petrol-fuel-toggle {
  background: rgba(21, 49, 57, 0.07);
}

.petrol-fuel-pill,
.petrol-reset-button,
.petrol-pump-button {
  border: 0;
  color: var(--text);
  font: inherit;
}

.petrol-fuel-pill {
  padding: 12px 16px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.petrol-fuel-pill.is-active {
  background: var(--accent);
  color: #071218;
  transform: translateY(-1px);
}

.petrol-fill-readout {
  display: grid;
  gap: 8px;
}

.petrol-fill-label {
  color: var(--muted);
  font-family: "Press Start 2P", monospace;
  font-size: 0.52rem;
  line-height: 1.7;
}

.petrol-fill-readout strong {
  font-size: clamp(2.8rem, 7vw, 4.9rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.petrol-fill-readout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.petrol-pump-zone {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.petrol-pump-button {
  width: 100%;
  min-height: 132px;
  border-radius: 28px;
  padding: 20px;
  background:
    radial-gradient(circle at top, rgba(255, 211, 104, 0.28), transparent 58%),
    linear-gradient(180deg, #ffd358 0%, #f39b3d 100%);
  color: #1b1204;
  font-family: "Press Start 2P", monospace;
  font-size: 0.72rem;
  line-height: 1.8;
  cursor: pointer;
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.14),
    0 16px 30px rgba(243, 155, 61, 0.22);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease;
  user-select: none;
  touch-action: none;
}

.petrol-pump-button.is-filling {
  animation: petrol-pump-jiggle 0.22s ease-in-out infinite alternate;
  filter: saturate(1.08);
}

.petrol-pump-button:hover,
.petrol-pump-button:focus-visible {
  transform: translateY(-2px);
  filter: saturate(1.05);
}

.petrol-pump-button:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.16),
    0 10px 18px rgba(243, 155, 61, 0.22);
}

.petrol-reset-button {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease;
}

body[data-theme="light"] .petrol-reset-button {
  border-color: rgba(21, 49, 57, 0.12);
  background:
    linear-gradient(180deg, rgba(21, 49, 57, 0.1) 0%, rgba(21, 49, 57, 0.04) 100%);
}

.petrol-reset-button:hover,
.petrol-reset-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 207, 89, 0.35);
}

.petrol-reset-button span[aria-hidden="true"] {
  font-size: 1.05rem;
}

.petrol-fill-results {
  padding: 22px;
}

.petrol-fill-compare-note {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.petrol-fill-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.petrol-fill-results-head h3 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.petrol-fill-results-head span {
  color: var(--muted);
}

.petrol-fill-rankings {
  display: grid;
  gap: 10px;
}

.petrol-fill-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background-color 160ms ease;
}

body[data-theme="light"] .petrol-fill-row {
  background: rgba(21, 49, 57, 0.05);
}

.petrol-fill-row:hover,
.petrol-fill-row:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 207, 89, 0.35);
}

.petrol-fill-row.is-reference {
  border-color: rgba(255, 207, 89, 0.6);
  background: rgba(255, 207, 89, 0.09);
}

body[data-theme="light"] .petrol-fill-row.is-reference {
  background: rgba(255, 207, 89, 0.18);
}

.petrol-fill-rank {
  min-width: 2.25rem;
  color: var(--accent);
  font-family: "Press Start 2P", monospace;
  font-size: 0.66rem;
  text-align: center;
}

.petrol-fill-station {
  display: grid;
  gap: 3px;
}

.petrol-fill-station strong {
  font-size: 1rem;
}

.petrol-fill-station a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}

.petrol-fill-station a:hover,
.petrol-fill-station a:focus-visible {
  color: var(--accent);
  border-color: currentColor;
}

.petrol-fill-station span {
  color: var(--muted);
  font-size: 0.95rem;
}

.petrol-fill-metrics {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}

.petrol-fill-metrics span {
  color: var(--muted);
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
}

.petrol-fill-metrics strong {
  font-size: 1.15rem;
}

.petrol-fill-delta {
  font-size: 0.86rem;
  font-weight: 700;
}

.petrol-fill-delta-neutral {
  color: var(--muted);
}

.petrol-fill-delta-cheaper {
  color: #58c567;
}

.petrol-fill-delta-pricier {
  color: #e45b5b;
}

@keyframes petrol-pump-jiggle {
  from {
    transform: translateY(1px) rotate(-1deg);
  }

  to {
    transform: translateY(-1px) rotate(1deg);
  }
}

.petrol-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.petrol-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

@media (max-width: 1080px) {
  .petrol-section-heading {
    grid-template-columns: 1fr;
  }

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

  .petrol-dashboard-section-top .petrol-dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .petrol-fill-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .petrol-dashboard-grid,
  .petrol-dashboard-prices {
    grid-template-columns: 1fr;
  }

  .petrol-dashboard-section-top .petrol-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .petrol-pump-zone {
    grid-template-columns: 1fr;
  }

  .petrol-reset-button {
    min-height: 52px;
    width: 100%;
  }

  .petrol-fill-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
  }

  .petrol-fill-metrics {
    justify-items: end;
    text-align: right;
    min-width: 5.5rem;
  }

  .petrol-fill-metrics span {
    font-size: 0.56rem;
  }

  .petrol-fill-metrics strong {
    font-size: 1.4rem;
    line-height: 1;
  }

  .petrol-fill-results-head {
    display: grid;
    justify-content: start;
  }
}

.traffic-page-shell {
  width: min(1440px, calc(100% - 32px));
}

.traffic-page {
  padding: 20px 0 32px;
}

.traffic-hero,
.traffic-stage {
  border-top: 1px solid var(--line);
}

.traffic-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.62fr);
  gap: 30px;
  align-items: end;
  padding: 46px 0 32px;
}

.traffic-hero h1,
.traffic-panel h2 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.traffic-hero h1 {
  font-size: clamp(3.3rem, 7vw, 6.6rem);
  max-width: 11ch;
}

.traffic-hero-text,
.traffic-score-panel p,
.traffic-insight-card p,
.traffic-hotspot-card p,
.traffic-roadmap {
  color: var(--muted);
  line-height: 1.7;
}

.traffic-hero-text {
  max-width: 48rem;
  margin: 18px 0 0;
  font-size: 1.04rem;
}

.traffic-score-panel,
.traffic-panel,
.traffic-insight-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 19, 25, 0.72);
  box-shadow: var(--shadow);
}

body[data-theme="light"] .traffic-score-panel,
body[data-theme="light"] .traffic-panel,
body[data-theme="light"] .traffic-insight-card {
  background: rgba(255, 255, 255, 0.76);
}

.traffic-score-panel {
  padding: 24px 24px 22px;
  border-radius: 28px;
}

.traffic-score-panel > span,
.traffic-insight-card span,
.traffic-badge span,
.traffic-hotspot-card span,
.traffic-roadmap {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.traffic-score-panel > span {
  color: var(--accent);
}

.traffic-score-panel > strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(4rem, 8vw, 5.8rem);
  line-height: 0.88;
}

.traffic-score-panel p {
  margin: 12px 0 0;
}

.traffic-score-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.traffic-score-mini-grid div {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="light"] .traffic-score-mini-grid div {
  background: rgba(8, 27, 33, 0.05);
}

.traffic-score-mini-grid small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.traffic-score-mini-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 1.28rem;
}

.traffic-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.6fr);
  gap: 24px;
  padding: 26px 0 0;
  align-items: start;
}

.traffic-viewer {
  display: grid;
  gap: 18px;
}

.traffic-canvas-frame {
  position: relative;
  min-height: 700px;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    radial-gradient(circle at top, rgba(112, 209, 255, 0.26), transparent 36%),
    linear-gradient(180deg, rgba(8, 18, 24, 0.98) 0%, rgba(5, 11, 16, 0.98) 100%);
  box-shadow: var(--shadow);
}

body[data-theme="light"] .traffic-canvas-frame {
  background:
    radial-gradient(circle at top, rgba(112, 209, 255, 0.22), transparent 36%),
    linear-gradient(180deg, rgba(240, 246, 246, 0.98) 0%, rgba(230, 238, 238, 0.98) 100%);
}

#traffic-simulator-map {
  width: 100%;
  height: 100%;
  min-height: 700px;
}

.traffic-canvas-frame .leaflet-container {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at top left, rgba(78, 154, 142, 0.1), transparent 28%),
    linear-gradient(180deg, #091318 0%, #0d1d24 100%);
  font: inherit;
}

.traffic-canvas-frame .leaflet-control-attribution {
  background: rgba(8, 20, 26, 0.76);
  color: #f6faf7;
  border-radius: 10px 0 0 0;
}

.traffic-canvas-frame .leaflet-control-attribution a {
  color: #b7fff1;
}

body[data-theme="light"] .traffic-canvas-frame .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.88);
  color: #112028;
}

body[data-theme="light"] .traffic-canvas-frame .leaflet-control-attribution a {
  color: #0f685c;
}

body[data-theme="light"] .traffic-canvas-frame .leaflet-container {
  background:
    radial-gradient(circle at top left, rgba(44, 133, 120, 0.08), transparent 28%),
    linear-gradient(180deg, #f5f8f6 0%, #e8efeb 100%);
}

.traffic-canvas-overlay {
  position: absolute;
  left: 20px;
  right: 20px;
  z-index: 2;
  pointer-events: none;
}

.traffic-canvas-overlay-top {
  top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.traffic-canvas-overlay-bottom {
  bottom: 18px;
}

.traffic-canvas-overlay-bottom p {
  display: inline-flex;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(8, 20, 26, 0.68);
  color: #f6faf7;
  font-size: 0.84rem;
}

body[data-theme="light"] .traffic-canvas-overlay-bottom p {
  background: rgba(255, 255, 255, 0.78);
  color: #112028;
}

.traffic-badge {
  min-width: 128px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(8, 20, 26, 0.68);
  backdrop-filter: blur(14px);
}

body[data-theme="light"] .traffic-badge {
  background: rgba(255, 255, 255, 0.78);
}

.traffic-badge span {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
}

.traffic-badge strong {
  display: block;
  margin-top: 8px;
  font-size: 1.02rem;
}

.traffic-insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.traffic-insight-card {
  padding: 20px 20px 18px;
  border-radius: 26px;
}

.traffic-insight-card span {
  color: var(--accent);
  font-size: 0.62rem;
}

.traffic-insight-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.18rem;
}

.traffic-insight-card p {
  margin: 10px 0 0;
}

.traffic-sidebar {
  display: grid;
  gap: 16px;
}

.traffic-panel {
  padding: 24px;
  border-radius: 28px;
}

.traffic-panel-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.traffic-panel h2 {
  font-size: 2rem;
}

.traffic-control,
.traffic-toggle {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.traffic-control span,
.traffic-toggle span {
  font-weight: 700;
}

.traffic-control input[type="range"],
.traffic-control select {
  width: 100%;
}

.traffic-control input[type="range"] {
  accent-color: var(--accent-strong);
}

.traffic-control select,
.traffic-reset-button {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

body[data-theme="light"] .traffic-control select,
body[data-theme="light"] .traffic-reset-button {
  background: rgba(8, 27, 33, 0.05);
}

.traffic-control strong {
  color: var(--accent);
  font-size: 0.92rem;
}

.traffic-toggle {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.traffic-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
}

.traffic-reset-button {
  margin-top: 18px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.traffic-reset-button:hover {
  transform: translateY(-1px);
  border-color: rgba(183, 255, 241, 0.3);
}

.traffic-hotspot-list {
  display: grid;
  gap: 12px;
}

.traffic-incident-list {
  display: grid;
  gap: 12px;
}

.traffic-hotspot-card {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme="light"] .traffic-hotspot-card {
  background: rgba(8, 27, 33, 0.05);
}

.traffic-hotspot-card span {
  color: var(--accent);
  font-size: 0.56rem;
}

.traffic-hotspot-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 1rem;
}

.traffic-hotspot-card p {
  margin: 0;
}

.traffic-roadmap {
  margin: 0;
  padding-left: 18px;
}

.traffic-roadmap li + li {
  margin-top: 12px;
}

.project-tile-traffic {
  background:
    radial-gradient(circle at top right, rgba(120, 199, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(7, 19, 24, 0.9) 0%, rgba(8, 27, 35, 0.92) 100%);
}

body[data-theme="light"] .project-tile-traffic {
  background:
    radial-gradient(circle at top right, rgba(74, 155, 214, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(232, 241, 242, 0.94) 100%);
}

@media (max-width: 1160px) {
  .traffic-hero,
  .traffic-stage {
    grid-template-columns: 1fr;
  }

  .traffic-score-panel {
    max-width: 420px;
  }

  .traffic-insight-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .traffic-page-shell {
    width: min(1440px, calc(100% - 20px));
  }

  .traffic-hero {
    padding-top: 34px;
    gap: 20px;
  }

  .traffic-score-mini-grid {
    grid-template-columns: 1fr;
  }

  .traffic-canvas-frame,
  #traffic-simulator-canvas {
    min-height: 520px;
  }

  .traffic-canvas-overlay {
    left: 14px;
    right: 14px;
  }

  .traffic-canvas-overlay-top {
    top: 14px;
  }

  .traffic-canvas-overlay-bottom {
    bottom: 14px;
  }

  .traffic-badge {
    min-width: 112px;
    padding: 10px 12px;
  }

  .traffic-panel {
    padding: 20px;
  }

  .traffic-panel h2 {
    font-size: 1.7rem;
  }
}
