/* The Hearth Isn't on Earth — cockpit theme. Mobile first. */

@font-face { font-family: "Chakra Petch"; src: url("../fonts/chakra-petch-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("../fonts/chakra-petch-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("../fonts/chakra-petch-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #05090d;
  --bg-2: #08121a;
  --panel: rgba(12, 26, 36, 0.86);
  --panel-solid: #0c1a24;
  --line: #1f3d4d;
  --line-soft: #16303d;
  --cyan: #3fd0e8;
  --cyan-dim: #2a8fa1;
  --text: #dbe9ef;
  --text-dim: #93adb9;
  --amber: #ffb547;
  --red: #ff6464;
  --green: #5ff2a5;
  --glow: 0 0 0 1px rgba(63, 208, 232, 0.15), 0 0 18px rgba(63, 208, 232, 0.08);
  --font-head: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font-title: "Orbitron", var(--font-head);
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 4px;
  --gutter: 16px;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(219, 233, 239, 0.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 8%, rgba(219, 233, 239, 0.4) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 64% 42%, rgba(219, 233, 239, 0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 66%, rgba(219, 233, 239, 0.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 78%, rgba(219, 233, 239, 0.45) 50%, transparent 51%),
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(63, 208, 232, 0.12), transparent 70%),
    linear-gradient(rgba(63, 208, 232, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 208, 232, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Faint CRT scanlines over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.12) 2px 3px);
  z-index: 100;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3 { font-weight: 600; line-height: 1.2; letter-spacing: 0.01em; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.7rem, 6vw, 2.6rem); }
h2 { font-size: clamp(1.25rem, 4.2vw, 1.6rem); }
p { margin: 0 0 1em; }

a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #8be7f5; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); }
.dim { color: var(--text-dim); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.lead { font-size: 1.15rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--amber); color: #000; padding: 8px 14px; border-radius: var(--radius); font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* ---------- LEDs ---------- */
.led {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 6px var(--cyan); margin-right: 8px; vertical-align: middle; flex: none;
}
.led-green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.led-red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.led-amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.led-blink { animation: blink 1.6s steps(2, start) infinite; }
@keyframes blink { to { opacity: 0.25; } }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 9, 13, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-logo { width: 36px; height: 36px; flex: none; }
.brand-title {
  font-weight: 600; font-size: 0.8rem; line-height: 1.15; letter-spacing: 0.04em; text-transform: uppercase;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.topbar-tools { display: flex; align-items: center; gap: 8px; flex: none; }

/* Language switcher (works without JavaScript) */
.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--text);
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch[open] summary, .lang-switch summary:hover { border-color: var(--cyan); }
.flag { display: inline-flex; width: 22px; line-height: 0; }
.flag svg { width: 22px; height: auto; border-radius: 2px; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; min-width: 170px;
  background: var(--panel-solid); border: 1px solid var(--cyan-dim); border-radius: var(--radius); box-shadow: var(--glow);
}
.lang-menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px; min-height: 44px;
  color: var(--text); text-decoration: none; border-radius: var(--radius);
}
.lang-menu a:hover { background: rgba(63, 208, 232, 0.1); }
.lang-menu a[aria-current] { color: var(--cyan); }
.lang-menu .lang-code { font-family: var(--font-mono); font-size: 0.85rem; }

/* Menu toggle (mobile) */
.menu-toggle {
  display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  font: 600 0.85rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer;
}
.menu-toggle:hover { border-color: var(--cyan); }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 16px; height: 2px; background: currentColor; position: relative; transition: transform 0.2s;
}
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-5px) rotate(-45deg); }
.js .menu-toggle { display: inline-flex; }

/* Main navigation: console buttons */
.site-nav { border-top: 1px solid var(--line-soft); }
.site-nav ul {
  list-style: none; margin: 0 auto; padding-top: 10px; padding-bottom: 12px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.js .site-nav:not(.is-open) { display: none; }
.nav-btn {
  display: flex; align-items: center; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: rgba(12, 26, 36, 0.6);
  color: var(--text); text-decoration: none; font-family: var(--font-mono); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.25;
}
.nav-btn .led { background: var(--line); box-shadow: none; }
.nav-btn:hover { border-color: var(--cyan); color: var(--text); }
.nav-btn[aria-current="page"] { border-color: var(--cyan); color: var(--cyan); box-shadow: var(--glow); }
.nav-btn[aria-current="page"] .led { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.nav-btn-solve { border-color: rgba(255, 181, 71, 0.55); }
.nav-btn-solve .led { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.nav-btn-solve:hover, .nav-btn-solve[aria-current="page"] { border-color: var(--amber); color: var(--amber); }

.statusbar {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; color: var(--text-dim);
  border-top: 1px solid var(--line-soft); padding: 3px 0; white-space: nowrap; overflow: hidden;
}
.statusbar .wrap { display: flex; gap: 8px; }
.statusbar .sep { color: var(--line); }
.statusbar .ok { color: var(--green); font-weight: 400; }

@media (max-width: 359px) {
  .brand-title { display: none; }
}

@media (min-width: 900px) {
  .js .menu-toggle { display: none; }
  .js .site-nav:not(.is-open), .site-nav { display: block; }
  .site-nav ul { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 10px; }
  .nav-btn { min-height: 42px; }
  .brand-title { font-size: 1.05rem; -webkit-line-clamp: 1; }
}

/* ---------- Main & panels ---------- */
main { flex: 1; padding-top: 24px; padding-bottom: 48px; outline: none; }

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 20px;
  box-shadow: var(--glow);
}
/* HUD corner brackets */
.panel::before, .panel::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--cyan); border-style: solid; opacity: 0.85;
}
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.panel > :last-child { margin-bottom: 0; }

.panel-title {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--cyan); padding-bottom: 10px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.screen-label {
  display: flex; align-items: center; font-family: var(--font-mono); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-dim); margin-bottom: 10px;
}
.screen { background: linear-gradient(180deg, rgba(12, 30, 40, 0.92), rgba(6, 16, 22, 0.92)); }
.screen-title { color: var(--cyan); letter-spacing: 0.2em; font-weight: 700; }

.page-head { margin-bottom: 20px; }
.page-head .lead { color: var(--text-dim); max-width: 60ch; }

.grid-2 { display: grid; gap: 0 20px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.actions.center { justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid var(--cyan-dim); background: rgba(63, 208, 232, 0.06); color: var(--text);
  font: 700 0.9rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; text-decoration: none;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  text-align: center;
}
.btn:hover { border-color: var(--cyan); background: rgba(63, 208, 232, 0.14); color: var(--text); box-shadow: var(--glow); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #031015; }
.btn-primary:hover { background: #79e3f3; color: #031015; }
.btn-small { min-height: 40px; padding: 6px 12px; font-size: 0.78rem; }
.btn-wide { width: 100%; }
.btn-danger { border-color: var(--red); color: var(--red); background: rgba(255, 100, 100, 0.06); }
.btn-danger:hover { background: rgba(255, 100, 100, 0.16); color: var(--red); border-color: var(--red); }
@media (min-width: 600px) { .btn-wide { width: auto; min-width: 280px; } }

.link-btn {
  background: none; border: 0; padding: 4px 0; color: var(--cyan); font: inherit; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; min-height: 44px;
}

/* ---------- Forms ---------- */
.stack { display: grid; gap: 16px; }
.field label { display: block; font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 6px; }
input[type="email"], input[type="text"], input[type="password"], input[type="search"] {
  width: 100%; min-height: 50px; padding: 10px 14px;
  background: #030a0f; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  font: 400 1.05rem var(--font-mono); /* 16px+ avoids zoom on iOS */
}
input::placeholder { color: #5f7a86; }
input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(63, 208, 232, 0.2); }
input[aria-invalid="true"] { border-color: var(--red); }
.field .small { margin: 6px 0 0; }

.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--cyan); cursor: pointer; }
.check label { font-size: 0.95rem; cursor: pointer; }

.inline-field { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 600px) { .inline-field { flex-direction: row; } .inline-field input { flex: 1; } }

/* Honeypot: out of sight, out of tab order */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.ts-box:empty { display: none; }
.ts-box { min-height: 0; }

.form-error:empty, .form-status:empty { display: none; }
.form-error { color: var(--red); font-weight: 600; margin: 0; }
.form-status { margin: 10px 0 0; }
.form-status.is-ok { color: var(--green); }
.form-status.is-error { color: var(--red); }

.notice { padding: 12px 14px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; }
.notice-ok { border-color: var(--green); color: var(--green); background: rgba(95, 242, 165, 0.06); }
.notice-warn { border-color: var(--amber); color: var(--amber); background: rgba(255, 181, 71, 0.06); }
.notice-error { border-color: var(--red); color: var(--red); background: rgba(255, 100, 100, 0.06); }

/* ---------- Home ---------- */
.masthead { text-align: center; padding: 8px 0 28px; }
/* The cover as a book seen slightly from the side: front cover, page edges, back cover. */
.book-stage { position: relative; width: 64%; max-width: 270px; margin: 6px auto 30px; }
.book3d {
  perspective: 1400px;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 38px rgba(63, 208, 232, 0.16));
}
.book3d-inner { position: relative; transform-style: preserve-3d; transform: rotateY(-24deg); transition: transform 0.8s ease; }
.book3d:hover .book3d-inner { transform: rotateY(-8deg); }
.book3d img {
  position: relative; display: block; width: 100%; height: auto; transform: translateZ(11px);
  border-radius: 2px 4px 4px 2px;
}
.book3d-inner::before { /* page edges */
  content: ""; position: absolute; top: 4px; bottom: 4px; left: calc(100% - 14px); width: 22px;
  transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, #e9e4d8 0, #e9e4d8 1px, #cfc8b8 1px, #cfc8b8 2px);
}
.book3d-inner::after { /* back cover */
  content: ""; position: absolute; inset: 0; transform: translateZ(-11px);
  background: #0a0f16; border-radius: 4px 2px 2px 4px;
}

/* Green radar roaming over the cover, searching for the planet. It stays in the upper part
   (sky, title, planet) and never goes over the grid of planet names, so it is never read as a clue. */
.radar {
  position: absolute; left: 35%; top: 22%; width: 42%; aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; overflow: hidden; pointer-events: none;
  border: 1.5px solid rgba(95, 242, 165, 0.85);
  background:
    radial-gradient(circle, transparent 0 32%, rgba(95, 242, 165, 0.35) 32.5% 33.5%, transparent 34% 65.5%, rgba(95, 242, 165, 0.35) 66% 67%, transparent 67.5%),
    linear-gradient(rgba(95, 242, 165, 0.3), rgba(95, 242, 165, 0.3)) center / 100% 1px no-repeat,
    linear-gradient(rgba(95, 242, 165, 0.3), rgba(95, 242, 165, 0.3)) center / 1px 100% no-repeat,
    rgba(95, 242, 165, 0.07);
  box-shadow: 0 0 18px rgba(95, 242, 165, 0.35), inset 0 0 14px rgba(95, 242, 165, 0.2);
  animation: radar-roam 16s ease-in-out infinite;
}
.radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 280deg, rgba(95, 242, 165, 0.6) 360deg);
  animation: radar-spin 2.6s linear infinite;
}
.radar-blip {
  position: absolute; left: 66%; top: 30%; width: 5px; height: 5px; border-radius: 50%;
  background: #c9ffe3; box-shadow: 0 0 6px var(--green); opacity: 0;
  animation: radar-blip 2.6s linear 0.4s infinite;
}
.radar-blip + .radar-blip { left: 28%; top: 62%; animation-delay: 1.7s; }
@keyframes radar-spin { to { transform: rotate(1turn); } }
@keyframes radar-blip { 0%, 100% { opacity: 0; } 6% { opacity: 1; } 45% { opacity: 0; } }
@keyframes radar-roam {
  0%, 100% { left: 35%; top: 22%; }
  25% { left: 66%; top: 15%; }
  50% { left: 68%; top: 42%; }
  75% { left: 33%; top: 45%; }
}

@media (prefers-reduced-motion: reduce) {
  .book3d-inner { transition: none; }
  .radar, .radar-sweep { animation: none; }
  .radar-blip { animation: none; opacity: 0.8; }
}
.book-title {
  font-family: var(--font-title); font-weight: 900; text-transform: uppercase;
  font-size: clamp(1.7rem, 7vw, 3rem); line-height: 1.12; letter-spacing: 0.04em; margin: 0 0 12px;
  color: #eaf6fa; text-shadow: 0 0 22px rgba(63, 208, 232, 0.45), 0 0 2px rgba(63, 208, 232, 0.8);
}
.book-subtitle { color: var(--amber); font-size: clamp(0.85rem, 3.4vw, 1.05rem); letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 6px; }
.book-author { color: var(--text-dim); font-size: 1.05rem; letter-spacing: 0.06em; margin: 0; }

.story {
  margin-top: 18px; padding: 16px 18px; border-left: 2px solid var(--amber);
  background: rgba(255, 181, 71, 0.04); font-style: italic;
}
.story p:last-child { margin-bottom: 0; }
.what-question { font-family: var(--font-title); font-weight: 700; color: var(--amber); font-size: clamp(1.05rem, 4.5vw, 1.35rem); letter-spacing: 0.03em; margin: 18px 0 0; }
.what-closing { margin: 18px 0 0; font-weight: 600; }
.story-title { font-style: normal; color: var(--amber); letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.85rem; }

.stats { text-align: center; margin: 8px 0 28px; }
.stats-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.stat-item {
  display: flex; flex-direction: column; align-items: center; padding: 14px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: rgba(12, 26, 36, 0.6);
}
.stat-number { font-family: var(--font-title); font-weight: 700; font-size: clamp(2rem, 9vw, 3rem); letter-spacing: 0.1em; color: var(--cyan); line-height: 1.1; text-shadow: 0 0 18px rgba(63, 208, 232, 0.35); }
.stat-text { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }
.stats-question { font-family: var(--font-title); font-weight: 700; font-size: clamp(1.15rem, 5vw, 1.6rem); color: var(--amber); letter-spacing: 0.04em; margin: 0; }
@media (min-width: 700px) { .stats-list { grid-template-columns: repeat(3, 1fr); } }

.home-menu { margin: 0 0 24px; }
.home-menu ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.home-menu .nav-btn { min-height: 56px; justify-content: center; text-align: center; }
.home-menu li:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .home-menu ul { grid-template-columns: repeat(4, 1fr); }
  .home-menu li:last-child:nth-child(odd) { grid-column: auto; }
}

.buy-buttons { display: grid; gap: 10px; }
.btn-disabled { opacity: 0.6; cursor: default; flex-direction: column; gap: 2px; }
.btn-disabled:hover { background: rgba(63, 208, 232, 0.06); border-color: var(--cyan-dim); box-shadow: none; }
.btn-disabled small { font-size: 0.68rem; letter-spacing: 0.1em; color: var(--text-dim); font-weight: 400; }
.buy-other summary { list-style: none; width: 100%; }
.buy-other summary::-webkit-details-marker { display: none; }
.buy-other summary::after { content: "▾"; margin-left: 8px; }
.buy-other[open] summary::after { content: "▴"; }
.country-list { list-style: none; margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.country-list li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.country-list li:last-child { border-bottom: 0; }
@media (min-width: 760px) {
  .buy-buttons { grid-template-columns: repeat(3, 1fr); align-items: start; }
}

.newsletter-fields { display: grid; gap: 12px; }
@media (min-width: 760px) { .newsletter-fields { grid-template-columns: 1fr 1.4fr; align-items: end; } }
.newsletter-form { display: grid; gap: 14px; }
.newsletter-form .btn-primary { justify-self: start; min-width: 200px; }
.faq-line { text-align: center; color: var(--text-dim); margin: 4px 0 24px; padding: 0 8px; }

.closing-band {
  text-align: center; color: var(--amber); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: clamp(0.8rem, 3.2vw, 1rem); line-height: 1.8; margin: 32px 0 0; padding: 18px 8px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

/* ---------- Clues ---------- */
.clue-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; }
.clue-list > .panel { margin: 0; }
.clue-list-compact { gap: 10px; }
.clue-list-compact .clue {
  border-left: 2px solid var(--cyan); padding: 4px 0 4px 14px;
}
.clue-num { font-size: 0.75rem; color: var(--amber); text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: 4px; }
.clue-text { font-size: 1.08rem; font-weight: 600; margin-bottom: 0; }
.clarification { margin-top: 12px; padding: 12px 14px; border-left: 2px solid var(--cyan-dim); background: rgba(63, 208, 232, 0.05); }
.clarification-label { font-size: 0.72rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 4px; }
.clarification p:last-child { margin-bottom: 0; }
@media (min-width: 900px) { .clue-list:not(.clue-list-compact) { grid-template-columns: 1fr 1fr; } }

.bullet-list { margin: 0; padding-left: 1.2em; }
.bullet-list li { margin-bottom: 0.6em; }
.bullet-list li::marker { color: var(--cyan); }

/* ---------- Instructions ---------- */
.briefing { font-family: var(--font-mono); font-size: 0.95rem; line-height: 1.7; }
.briefing p { margin-bottom: 0.9em; }
.briefing-heading { color: var(--amber); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 1.4em; }
.briefing-bullet { padding-left: 1.4em; position: relative; }
.briefing-bullet::before { content: "▸"; position: absolute; left: 0; color: var(--cyan); }

/* ---------- FAQ ---------- */
.faq-item { padding: 0; margin-bottom: 12px; }
.faq-item summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 18px; font-weight: 600; min-height: 56px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { flex: none; width: 14px; height: 14px; position: relative; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; background: var(--cyan); left: 0; top: 6px; width: 14px; height: 2px; transition: transform 0.2s; }
.faq-icon::after { transform: rotate(90deg); }
.faq-item[open] .faq-icon::after { transform: rotate(0); }
.faq-item[open] summary { color: var(--cyan); }
.faq-a { padding: 0 18px 16px; color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0 30px; background: rgba(5, 9, 13, 0.9); font-size: 0.9rem; }
.footer-closing { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); }
.footer-links { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { display: inline-block; padding: 8px 0; color: var(--text-dim); }
.footer-links a:hover { color: var(--cyan); }
.footer-copy { color: var(--text-dim); font-size: 0.8rem; margin: 0; }

/* ---------- Submit a Solution ---------- */
.solve-head { display: flex; flex-direction: column; gap: 14px; }
.solve-tools { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.countdown {
  display: flex; flex-direction: column; justify-content: center; padding: 8px 12px;
  border: 1px solid rgba(255, 100, 100, 0.5); border-radius: var(--radius); background: rgba(255, 100, 100, 0.05);
  flex: 1 1 auto;
}
.countdown-label { font-size: 0.65rem; letter-spacing: 0.14em; color: var(--red); }
.countdown-value { font-size: 1.25rem; font-weight: 700; color: var(--text); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.sound-toggle { align-self: stretch; }
@media (min-width: 760px) {
  .solve-head { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .countdown { flex: none; }
}

.console { border-color: var(--cyan-dim); }

.solve-form { display: grid; gap: 16px; }
.answer-grid, .id-grid { display: grid; gap: 16px; }
.input-big { font-size: 1.2rem !important; letter-spacing: 0.12em; }
#f-planet { text-transform: uppercase; }
.form-subtitle {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--amber);
  margin: 8px 0 0; padding-top: 16px; border-top: 1px dashed var(--line-soft);
}
.field-error { color: var(--red); font-weight: 600; font-size: 0.92rem; margin: 6px 0 0; }
.field-error:empty { display: none; }
#err-consent { margin: -8px 0 0 38px; }
.btn-launch { min-height: 58px; font-size: 1.05rem; letter-spacing: 0.2em; width: 100%; }
@media (min-width: 760px) {
  .answer-grid { grid-template-columns: 2fr 1fr; align-items: start; }
  .id-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .btn-launch { width: auto; min-width: 320px; justify-self: start; }
}

.console-screen {
  margin-top: 18px; padding: 14px; min-height: 96px; border-radius: var(--radius);
  background: #020709; border: 1px solid var(--line-soft); font-size: 0.92rem; line-height: 1.6;
  box-shadow: inset 0 0 24px rgba(63, 208, 232, 0.06);
}
.console-line { margin: 0 0 4px; color: var(--cyan); }
.console-line.is-amber { color: var(--amber); }
.console-line.is-red { color: var(--red); font-weight: 700; }
.console-line.is-green { color: var(--green); font-weight: 700; }
.console-line.is-dim { color: var(--text-dim); }
.attempts-left { margin: 10px 0 0; }
.attempts-left:empty { display: none; }

.shake { animation: shake 0.45s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.flash-red { animation: flash-red 0.8s ease-out; }
@keyframes flash-red { 0% { box-shadow: 0 0 0 2px var(--red), 0 0 30px rgba(255, 100, 100, 0.45); } 100% { box-shadow: var(--glow); } }

.success { border-color: var(--green); text-align: center; padding: 28px 20px; scroll-margin-top: 130px; }
.success::before, .success::after { border-color: var(--green); }
.success .screen-label { justify-content: center; }
.success h2 { color: var(--green); font-size: clamp(1.6rem, 6vw, 2.3rem); text-shadow: 0 0 18px rgba(95, 242, 165, 0.35); }
.success.is-new { animation: success-in 1s ease-out; }
@keyframes success-in { from { opacity: 0; transform: scale(0.97); box-shadow: 0 0 0 2px var(--green), 0 0 60px rgba(95, 242, 165, 0.5); } }

/* Boot (loading) screen */
.boot {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #08161e 0%, #020507 75%); padding: var(--gutter);
}
.boot[hidden] { display: none; }
.boot.is-leaving { opacity: 0; transition: opacity 0.35s; }
.boot-screen { width: 100%; max-width: 520px; text-align: center; }
.boot-lines { text-align: left; min-height: 8.5em; font-size: 0.95rem; color: var(--cyan); margin-bottom: 18px; }
.boot-lines p { margin: 0 0 6px; }
.boot-lines p::before { content: "> "; color: var(--text-dim); }
.boot-lines p:last-child::after { content: "▌"; animation: blink 0.9s steps(2, start) infinite; margin-left: 4px; }
.boot-bar { height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; margin-bottom: 22px; }
.boot-bar span { display: block; height: 100%; width: 0; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.boot.is-running .boot-bar span { animation: boot-bar 3.4s linear forwards; }
@keyframes boot-bar { to { width: 100%; } }
.boot-hint { margin-top: 12px; }

/* Video dialog */
.video-dialog {
  width: min(960px, calc(100vw - 2 * var(--gutter))); max-height: calc(100vh - 32px); padding: 0;
  background: var(--panel-solid); color: var(--text); border: 1px solid var(--cyan); border-radius: var(--radius); box-shadow: var(--glow);
}
.video-dialog::backdrop { background: rgba(0, 0, 0, 0.8); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--cyan); margin: 0; }
.dialog-body video { display: block; width: 100%; max-height: calc(100vh - 120px); background: #000; }
.transmission-pending { padding: 48px 20px; text-align: center; }
.transmission-pending .signal { display: flex; justify-content: center; gap: 6px; margin-bottom: 20px; height: 40px; align-items: flex-end; }
.transmission-pending .signal span { width: 6px; background: var(--cyan); animation: signal 1.2s ease-in-out infinite; }
.transmission-pending .signal span:nth-child(2) { animation-delay: 0.15s; }
.transmission-pending .signal span:nth-child(3) { animation-delay: 0.3s; }
.transmission-pending .signal span:nth-child(4) { animation-delay: 0.45s; }
.transmission-pending .signal span:nth-child(5) { animation-delay: 0.6s; }
@keyframes signal { 0%, 100% { height: 8px; opacity: 0.4; } 50% { height: 40px; opacity: 1; } }
.transmission-pending h3 { font-family: var(--font-mono); color: var(--cyan); letter-spacing: 0.1em; }

/* 404 */
.not-found .screen-label { justify-content: center; }

/* ---------- Admin ---------- */
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.admin .topbar-inner form { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
@media (min-width: 760px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--cyan); margin: 0; }
.stat-label { margin: 0; }
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
.table .num { text-align: right; font-family: var(--font-mono); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar .inline-field { flex: 1; max-width: 520px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-bottom: 24px; }

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

/* Boot screen power button (needed by browsers before any sound can play) */
.boot-power { margin: 0 0 18px; }
.btn-power { min-height: 60px; padding: 12px 26px; font-size: 1rem; letter-spacing: 0.14em; box-shadow: 0 0 24px rgba(63, 208, 232, 0.35); }
.btn-power .led { margin-right: 4px; }
