/* SWG Phoenix website. One stylesheet for the landing page, account pages and
   the admin panel. Palette and type follow the in-game Phoenix UI. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/Barlow-Regular.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/Barlow-Medium.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/Barlow-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/BarlowCondensed-Medium.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/BarlowCondensed-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/BarlowCondensed-Bold.woff2") format("woff2"); }

:root {
  --ink: #03060a;
  --base: #060a10;
  --base-2: #0a0f16;
  --panel: #0b121b;
  --panel-2: #0f1822;
  --raised: #142030;
  --line: #1b2938;
  --line-2: #2b4055;
  --text: #edf3f7;
  --text-2: #c9d4dc;
  --muted: #9eafbd;
  --dim: #687783;
  --cyan: #55c7f3;
  --cyan-2: #9be2fb;
  --cyan-deep: #1d6c8f;
  --amber: #e0ae58;
  --amber-2: #f6cf7c;
  --ember: #ff8f3f;
  --red: #e4665d;
  --green: #66c58a;
  --font: "Barlow", "Segoe UI", system-ui, sans-serif;
  --display: "Barlow Condensed", "Barlow", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --gutter: clamp(16px, 4.5vw, 64px);
  --maxw: 1240px;
  --cut: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 17px/1.6 var(--font);
  color: var(--text);
  background: var(--base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-2); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1; letter-spacing: .01em; margin: 0 0 .4em; text-wrap: balance; }
::selection { background: rgba(85, 199, 243, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--cyan); color: var(--ink); padding: 8px 14px; font-weight: 600; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Film grain over everything: an SVG noise tile, very faint. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  background-image: url("../img/grain.png");
  opacity: .05;
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Shared atoms ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font: 600 13px/1 var(--display);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--amber);
}
.eyebrow .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(224, 174, 88, .6);
  animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 174, 88, .55); }
  70% { box-shadow: 0 0 0 12px rgba(224, 174, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 174, 88, 0); }
}
.index { color: var(--cyan); margin-right: 2px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; }

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-line: var(--line-2);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  font: 600 15px/1 var(--display);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--btn-fg);
  background: var(--btn-bg);
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: transform .4s var(--ease), color .3s, background .3s, box-shadow .3s;
}
.btn::before {
  /* Hairline border that follows the chamfer. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-line);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut), var(--cut) 0, calc(var(--cut) + .7px) 1px, 1px calc(var(--cut) + .7px), 1px calc(100% - 1px), calc(100% - var(--cut) - .7px) calc(100% - 1px), calc(100% - 1px) calc(100% - var(--cut) - .7px), calc(100% - 1px) 1px, calc(var(--cut) + .7px) 1px);
}
.btn::after {
  /* Light sweep on hover. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .28) 48%, transparent 66%);
  transform: translateX(-120%);
  transition: transform .9s var(--ease);
}
.btn:hover { color: var(--btn-fg); transform: translateY(-2px); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0); }
.btn .arrow { transition: transform .4s var(--ease); }
.btn:hover .arrow { transform: translateX(5px); }
.btn-primary {
  --btn-bg: linear-gradient(180deg, #f8d58c, #e3a64b 55%, #d98a35);
  --btn-fg: #1a0f02;
  --btn-line: transparent;
  box-shadow: 0 10px 40px -10px rgba(255, 143, 63, .65);
}
.btn-primary:hover { box-shadow: 0 16px 50px -10px rgba(255, 143, 63, .9); }
.btn-cyan {
  --btn-bg: linear-gradient(180deg, #8fe0fb, #49b9e8);
  --btn-fg: #021018;
  --btn-line: transparent;
  box-shadow: 0 10px 40px -12px rgba(85, 199, 243, .7);
}
.btn-ghost { --btn-bg: rgba(10, 18, 27, .45); --btn-line: rgba(155, 226, 251, .35); backdrop-filter: blur(6px); }
.btn-ghost:hover { --btn-line: var(--cyan); }
.btn-danger { --btn-bg: rgba(228, 102, 93, .12); --btn-fg: #ffb0a9; --btn-line: rgba(228, 102, 93, .6); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 13px; letter-spacing: .16em; --cut: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy .label { opacity: 0; }
.btn.is-busy::after {
  transform: none;
  inset: auto;
  left: 50%; top: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  background: none;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
.link-button:hover { color: var(--text); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  background: rgba(15, 24, 34, .6);
  font: 600 12px/1 var(--display);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-2);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 9px;
  font: 600 12px/1 var(--display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-2);
  background: rgba(20, 32, 48, .6);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.approved, .badge.active { color: var(--green); border-color: rgba(102, 197, 138, .45); }
.badge.pending { color: var(--amber); border-color: rgba(224, 174, 88, .45); }
.badge.rejected, .badge.suspended, .badge.revoked { color: var(--red); border-color: rgba(228, 102, 93, .45); }
.badge.used, .badge.expired { color: var(--dim); }

/* ---------- Emblem ---------- */
.emblem { width: 100%; height: auto; overflow: visible; }
.emblem .wing { fill: var(--cyan); }
.emblem .flame { fill: var(--amber); }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 76px;
  padding: 0 var(--gutter);
  transition: background .5s, height .5s var(--ease), backdrop-filter .5s, border-color .5s;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled, body:not(.landing) .topbar {
  height: 64px;
  background: rgba(5, 9, 14, .72);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom-color: rgba(43, 64, 85, .55);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand .emblem { width: 34px; filter: drop-shadow(0 0 10px rgba(85, 199, 243, .35)); transition: transform .6s var(--ease); }
.brand:hover .emblem { transform: translateY(-2px) scale(1.06); }
.brand-word { font: 600 19px/1 var(--display); letter-spacing: .26em; }
.brand-word b { font-weight: 700; color: var(--cyan); }
.nav { display: flex; gap: 30px; margin-left: 18px; }
.nav a {
  position: relative;
  font: 500 14px/1 var(--display);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 8px 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav a:hover, .nav a.current { color: #fff; }
.nav a:hover::after, .nav a.current::after { transform: scaleX(1); transform-origin: left; }
.nav-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.nav-actions form { margin: 0; }
.nav-link { font: 500 14px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); }
.nav-link:hover { color: #fff; }

@media (max-width: 960px) {
  .nav { display: none; }
}
@media (max-width: 640px) {
  .topbar { gap: 12px; height: 64px; }
  .brand-word { display: none; }
  .nav-actions { gap: 12px; }
  .nav-actions .nav-link { font-size: 13px; letter-spacing: .14em; }
  .nav-actions .btn-sm { padding: 0 14px; letter-spacing: .12em; }
  .nav-actions .hide-sm { display: none; }
}

/* ---------- Warp (hyperspace) overlay ---------- */
.warp {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
}
.warp.on { opacity: 1; pointer-events: auto; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(36px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal-stagger > * { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal-stagger.in > * { opacity: 1; transform: none; }
.js .reveal-stagger.in > *:nth-child(2) { transition-delay: .08s; }
.js .reveal-stagger.in > *:nth-child(3) { transition-delay: .16s; }
.js .reveal-stagger.in > *:nth-child(4) { transition-delay: .24s; }
.js .reveal-stagger.in > *:nth-child(5) { transition-delay: .32s; }
.js .reveal-stagger.in > *:nth-child(6) { transition-delay: .40s; }
.js .reveal-stagger.in > *:nth-child(7) { transition-delay: .48s; }
.js .reveal-stagger.in > *:nth-child(8) { transition-delay: .56s; }

/* =====================================================================
   LANDING
   ===================================================================== */
.landing main { position: relative; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: #02060c;
}
.hero-scene {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max(102vw, 175svh);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
}
/* The painted suns sit low in the sky image; lifting the sky 20% sets them
   just behind the distant mesas, and the overhang covers the top of tall screens. */
.sky-frame { position: absolute; left: 0; right: 0; top: -20%; height: 100%; }
.plx { position: absolute; inset: 0; will-change: transform; }
.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  user-select: none;
  pointer-events: none;
}
.layer-sky { transform-origin: 60% 85%; }
.js .layer-sky { animation: sky-in 2.6s var(--ease) both; }
@keyframes sky-in { from { transform: scale(1.12); filter: brightness(.3) saturate(.6); } }
.js .layer-mid { animation: rise-in 2.4s .25s var(--ease) both; }
.js .layer-fore { animation: rise-in 2.2s .4s var(--ease) both; }
@keyframes rise-in { from { opacity: 0; translate: 0 6%; } }
.sun-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 60.6% 82%, rgba(255, 190, 110, .55) 0, rgba(255, 140, 60, .22) 4%, transparent 14%),
    radial-gradient(circle at 75% 84.5%, rgba(255, 236, 190, .5) 0, rgba(255, 200, 120, .16) 2.5%, transparent 9%);
  mix-blend-mode: screen;
  animation: sun-breathe 7s ease-in-out infinite;
}
@keyframes sun-breathe { 50% { opacity: .72; } }
.hero-stars, .hero-dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.layer-ship {
  inset: auto;
  left: 0;
  top: 16%;
  width: 11%;
  height: auto;
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(85, 199, 243, .5));
}
.js .layer-ship { animation: ship-pass 19s 2.5s linear infinite; }
@keyframes ship-pass {
  0% { opacity: 0; transform: translate(-30%, 140%) scale(.55) rotate(-5deg); }
  3% { opacity: 1; }
  24% { opacity: 1; }
  28% { opacity: 0; transform: translate(880%, -60%) scale(.32) rotate(-9deg); }
  100% { opacity: 0; transform: translate(880%, -60%) scale(.32) rotate(-9deg); }
}
.haze {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 58%, rgba(255, 170, 90, .12) 76%, rgba(40, 18, 10, .25) 100%);
}
.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 50%, rgba(2, 5, 9, .7) 100%),
    linear-gradient(90deg, rgba(2, 6, 12, .78) 0%, rgba(2, 6, 12, .35) 38%, transparent 60%);
}
.hero-fade {
  position: absolute;
  inset: auto 0 0;
  height: 32%;
  background: linear-gradient(180deg, transparent, var(--base) 92%);
  pointer-events: none;
}
.hero-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 90px var(--gutter) 18vh;
  will-change: transform, opacity;
}
.hero-title {
  font-size: clamp(56px, 10.5vw, 168px);
  font-weight: 700;
  line-height: .86;
  letter-spacing: -.005em;
  text-transform: uppercase;
  margin: 0 0 28px;
  text-shadow: 0 6px 40px rgba(0, 0, 0, .45);
}
.hero-title .line { display: block; }
.hero-title .accent {
  background: linear-gradient(100deg, #fff1cf 0%, var(--amber-2) 28%, var(--ember) 62%, #ffcf8a 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 4px 30px rgba(255, 143, 63, .35));
  animation: ember-shift 8s ease-in-out infinite alternate;
}
@keyframes ember-shift { to { background-position: 100% 0; } }
.hero-title .char { display: inline-block; white-space: pre; }
.js .hero-title .char { animation: char-in 1.3s var(--ease) both; }
@keyframes char-in {
  from { opacity: 0; transform: translateY(.55em) rotateX(-70deg); filter: blur(10px); }
}
.hero-title .accent .char {
  background: inherit;
  background-size: inherit;
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-lede {
  max-width: 560px;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: 36px;
}
.js .hero-lede, .js .hero-cta, .js .hero-copy .eyebrow, .js .hero-notice { animation: fade-up 1.4s var(--ease) both; }
.js .hero-copy .eyebrow { animation-delay: .5s; }
.js .hero-lede { animation-delay: 1.15s; }
.js .hero-cta { animation-delay: 1.3s; }
.js .hero-notice { animation-delay: 1.5s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-notice {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  margin-top: 30px;
  padding: 10px 16px;
  border-left: 2px solid var(--amber);
  background: linear-gradient(90deg, rgba(224, 174, 88, .14), transparent);
  font-weight: 500;
  color: var(--text);
}

.hero-hud { position: absolute; inset: 92px var(--gutter) 28px; z-index: 2; pointer-events: none; }
.hero-hud i { position: absolute; width: 22px; height: 22px; border: 1px solid rgba(155, 226, 251, .45); }
.hero-hud i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.hero-hud i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.hero-hud i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.hero-hud i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.hud-readout {
  position: absolute;
  right: 36px;
  bottom: 2px;
  text-align: right;
  font: 500 12px/1.7 var(--display);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(201, 212, 220, .62);
}
.hud-readout b { color: var(--cyan); font-weight: 600; }
.js .hero-hud { animation: hud-in 1.6s 1.6s var(--ease) both; }
@keyframes hud-in { from { opacity: 0; inset: 70px calc(var(--gutter) - 14px) 10px; } }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
  font: 600 11px/1 var(--display);
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--text-2);
}
.scroll-cue i { position: relative; width: 1px; height: 54px; background: rgba(237, 243, 247, .18); overflow: hidden; }
.scroll-cue i::after {
  content: "";
  position: absolute;
  left: 0; top: -40%;
  width: 1px; height: 40%;
  background: linear-gradient(transparent, var(--amber));
  animation: cue 2.2s var(--ease-io) infinite;
}
@keyframes cue { to { top: 110%; } }

@media (max-width: 760px) {
  .hero-scene { left: 0; transform: translateX(-56%); }
  .hero-copy { justify-content: flex-start; padding-top: 112px; }
  .hero-vignette { background: linear-gradient(180deg, rgba(2, 6, 12, .86) 0%, rgba(2, 6, 12, .7) 45%, rgba(2, 6, 12, .3) 68%, transparent 82%); }
  .hud-readout, .hero-hud { display: none; }
}

/* ---------- Story (scroll-scrubbed words) ---------- */
.story {
  position: relative;
  height: 230vh;
  background: var(--base);
}
.story-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 0 var(--gutter);
}
.story-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.story-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .46;
  transform: scale(1.15);
  filter: saturate(.9) blur(1px);
  will-change: transform;
}
.story-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--base) 0%, rgba(6, 10, 16, .55) 26%, rgba(6, 10, 16, .6) 70%, var(--base) 100%),
    radial-gradient(80% 70% at 50% 50%, transparent 30%, rgba(6, 10, 16, .85) 100%);
}
.story-inner { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; }
.story-years {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 34px;
  font: 600 14px/1 var(--display);
  letter-spacing: .32em;
  color: var(--muted);
}
.story-years span:last-child { color: var(--amber); }
.story-years i { width: 48px; height: 1px; background: var(--line-2); }
.story-text {
  font: 600 clamp(30px, 4.6vw, 64px)/1.12 var(--display);
  letter-spacing: .005em;
  margin: 0;
  color: var(--text);
}
.story-text .w { display: inline-block; opacity: .14; transition: opacity .35s linear, color .35s linear, text-shadow .35s; }
.story-text .w.lit { opacity: 1; }
.story-text .w.hot { color: var(--amber-2); text-shadow: 0 0 30px rgba(255, 143, 63, .45); }
.no-js .story-text .w { opacity: 1; }

/* ---------- Section scaffolding ---------- */
.section { position: relative; padding: clamp(96px, 14vw, 180px) var(--gutter); }
.section-head { max-width: var(--maxw); margin: 0 auto clamp(48px, 7vw, 84px); }
.section-head h2 {
  font-size: clamp(44px, 7vw, 104px);
  font-weight: 700;
  text-transform: uppercase;
  line-height: .9;
  margin: 0 0 26px;
}
.section-head h2 em { font-style: normal; color: var(--cyan); }
.section-head p { max-width: 640px; font-size: clamp(17px, 1.4vw, 19px); color: var(--text-2); }
.wrap { max-width: var(--maxw); margin: 0 auto; }

/* ---------- Engine ---------- */
.engine { background: radial-gradient(70% 50% at 80% 0%, rgba(29, 108, 143, .18), transparent 70%), var(--base); padding-bottom: 60px; }
.specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  max-width: var(--maxw);
  margin: 0 auto;
}
.spec {
  position: relative;
  padding: 34px 30px 30px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  overflow: hidden;
}
.spec::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s .2s var(--ease);
}
.in .spec::before, .spec.in::before { transform: scaleX(1); }
.spec-value { display: flex; align-items: baseline; gap: 6px; margin-bottom: 14px; }
.spec-num { font: 700 clamp(56px, 6vw, 84px)/.9 var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.spec-unit { font: 600 22px/1 var(--display); letter-spacing: .08em; color: var(--cyan); text-transform: uppercase; }
.spec h3 { font-size: 20px; letter-spacing: .12em; text-transform: uppercase; color: var(--text); margin-bottom: 10px; }
.spec p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
@media (max-width: 980px) { .specs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .specs { grid-template-columns: 1fr; } }

/* ---------- In-engine gallery (horizontal pin) ---------- */
.gallery { position: relative; height: 420vh; }
.gallery-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.gallery-label {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  max-width: var(--maxw);
  width: calc(100% - 2 * var(--gutter));
  margin: 0 auto 28px;
  gap: 24px;
}
.gallery-label h3 { font-size: clamp(26px, 3vw, 40px); text-transform: uppercase; margin: 0; }
.gallery-label p { margin: 0; color: var(--muted); max-width: 420px; font-size: 15px; }
.gallery-track {
  display: flex;
  gap: clamp(16px, 2.5vw, 36px);
  padding: 0 var(--gutter);
  will-change: transform;
}
.shot {
  position: relative;
  flex: 0 0 auto;
  width: min(72vw, 1180px);
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  background: var(--panel);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
  cursor: zoom-in;
}
.shot img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 1.6s var(--ease), filter .6s; will-change: transform; }
.shot:hover img { transform: scale(1.04) !important; }
.shot figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 60px 28px 22px;
  background: linear-gradient(transparent, rgba(3, 6, 10, .85));
}
.shot figcaption strong { display: block; font: 600 clamp(20px, 2vw, 28px)/1 var(--display); text-transform: uppercase; letter-spacing: .06em; }
.shot figcaption span { font: 500 12px/1 var(--display); letter-spacing: .26em; text-transform: uppercase; color: var(--cyan); }
.shot .shot-index { position: absolute; top: 18px; right: 26px; font: 600 13px/1 var(--display); letter-spacing: .3em; color: rgba(255, 255, 255, .7); }
.gallery-progress { max-width: var(--maxw); width: calc(100% - 2 * var(--gutter)); margin: 30px auto 0; height: 1px; background: var(--line-2); }
.gallery-progress i { display: block; height: 100%; width: 100%; background: var(--amber); transform: scaleX(0); transform-origin: left; }
@media (max-width: 760px), (prefers-reduced-motion: reduce) {
  .gallery { height: auto; padding: 40px 0 80px; }
  .gallery-pin { position: static; height: auto; overflow: visible; }
  .gallery-track { flex-direction: column; transform: none !important; }
  .shot { width: 100%; }
  .shot img { transform: none; }
  .gallery-progress { display: none; }
  .gallery-label { flex-direction: column; align-items: flex-start; }
}

/* ---------- Feature cards ---------- */
.features { background: linear-gradient(180deg, var(--base), #070c13 50%, var(--base)); }
.cards {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  max-width: var(--maxw);
  margin: 0 auto;
  perspective: 1400px;
}
.card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  grid-column: span 4;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
  background: radial-gradient(120% 80% at 50% 0%, #0d2231 0%, #08111a 55%, #060b11 100%);
  border: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  transition: border-color .5s, transform .6s var(--ease), box-shadow .6s;
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
}
.card.wide { grid-column: span 8; }
.card.tall { grid-row: span 2; }
.card:hover { border-color: rgba(85, 199, 243, .5); box-shadow: 0 30px 80px -30px rgba(85, 199, 243, .35); }
.card-art {
  position: absolute;
  inset: 0 0 auto;
  height: 74%;
  z-index: -1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;
}
.card-art img {
  width: auto;
  height: 112%;
  max-width: none;
  object-fit: contain;
  mix-blend-mode: screen;
  opacity: .92;
  transform: translateY(-4%) scale(1);
  transition: transform 1.2s var(--ease), filter .6s;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 96%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 96%);
}
.card:hover .card-art img { transform: translateY(-6%) scale(1.06); filter: brightness(1.15) saturate(1.15); }
.card.wide .card-art { height: 100%; inset: 0 0 0 auto; width: 60%; align-items: center; }
.card.wide .card-art img { height: 100%; width: 100%; object-fit: cover; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 40%); mask-image: linear-gradient(90deg, transparent 0%, #000 40%); mix-blend-mode: normal; opacity: .85; }
.card::before {
  /* Pointer-following light. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(85, 199, 243, .14), transparent 60%);
  opacity: 0;
  transition: opacity .4s;
}
.card:hover::before { opacity: 1; }
.card::after {
  /* Scanline sweep. */
  content: "";
  position: absolute;
  left: 0; right: 0; top: -30%;
  height: 30%;
  z-index: -1;
  background: linear-gradient(180deg, transparent, rgba(155, 226, 251, .07) 60%, rgba(155, 226, 251, .16) 98%, transparent);
  pointer-events: none;
  animation: sweep 6.5s linear infinite;
  animation-play-state: paused;
}
.card:hover::after { animation-play-state: running; }
@keyframes sweep { to { top: 130%; } }
.card-kicker { font: 600 12px/1 var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--cyan); margin-bottom: 14px; }
.card h3 { font-size: clamp(28px, 2.4vw, 36px); text-transform: uppercase; margin: 0 0 12px; }
.card p { margin: 0; color: var(--text-2); font-size: 16px; line-height: 1.55; }
.card ul { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.card li { font: 600 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--amber-2); border: 1px solid rgba(224, 174, 88, .35); padding: 6px 10px; background: rgba(224, 174, 88, .06); }
.card.wide .card-body { max-width: 50%; }
@media (max-width: 1080px) {
  .card { grid-column: span 6; }
  .card.wide { grid-column: span 12; }
}
@media (max-width: 700px) {
  .card, .card.wide { grid-column: span 12; min-height: 560px; padding: 26px; }
  .card-art { height: 58%; }
  .card.wide { min-height: 600px; justify-content: flex-end; }
  .card.wide .card-art { width: 100%; height: 46%; inset: 0 0 auto; }
  .card.wide .card-art img { -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent 100%); mask-image: linear-gradient(180deg, #000 50%, transparent 100%); }
  .card.wide .card-body { max-width: none; }
}
.also {
  max-width: var(--maxw);
  margin: 46px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.also > span { font: 600 13px/1 var(--display); letter-spacing: .28em; text-transform: uppercase; color: var(--dim); margin-right: 8px; }

/* ---------- Space ---------- */
.space {
  position: relative;
  min-height: 125vh;
  overflow: hidden;
  background: #01040a;
  display: flex;
  align-items: center;
}
.space-bg { position: absolute; inset: 0; }
.space-bg img.planet { width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; will-change: transform; }
.space-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--base) 0%, transparent 18%, transparent 78%, var(--base) 100%),
    linear-gradient(90deg, rgba(1, 4, 10, .85) 0%, rgba(1, 4, 10, .25) 50%, transparent 70%);
}
.space-craft {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 46%;
  opacity: 0;
  width: clamp(260px, 34vw, 560px);
  will-change: transform;
  pointer-events: none;
}
.space-craft img { width: 100%; filter: drop-shadow(0 0 22px rgba(85, 199, 243, .45)); }
.space-trail {
  position: absolute;
  right: 93%;
  top: 47%;
  width: 70vw;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, rgba(85, 199, 243, .25) 55%, rgba(190, 236, 255, .95));
  filter: blur(1.2px);
  opacity: 0;
}
.space .wrap { position: relative; z-index: 2; width: 100%; }
.space-copy { max-width: 560px; }
.space-copy h2 { font-size: clamp(52px, 8vw, 120px); font-weight: 700; text-transform: uppercase; line-height: .86; margin-bottom: 24px; }
.space-copy h2 span { display: block; color: var(--cyan); }
.space-copy > p { color: var(--text-2); font-size: 18px; }
.space-list { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 2px; }
.space-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: start;
  gap: 18px;
  padding: 18px 20px 18px 0;
  border-top: 1px solid rgba(43, 64, 85, .6);
}
.space-list b { font: 700 32px/1 var(--display); color: var(--amber-2); }
.space-list strong { display: block; font: 600 19px/1.2 var(--display); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.space-list span { color: var(--muted); font-size: 15px; }

/* ---------- Join ---------- */
.join { background: radial-gradient(70% 60% at 50% 100%, rgba(255, 143, 63, .13), transparent 70%), var(--base); text-align: center; }
.join .section-head { text-align: center; }
.join .section-head p { margin-left: auto; margin-right: auto; }
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: var(--maxw);
  margin: 0 auto 64px;
  counter-reset: step;
  text-align: left;
  list-style: none;
  padding: 0;
}
.steps::before {
  content: "";
  position: absolute;
  left: 30px; right: 30px; top: 30px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 2s .2s var(--ease);
}
.steps.in::before { transform: scaleX(1); }
.step { position: relative; padding-top: 86px; }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 60px; height: 60px;
  display: grid;
  place-items: center;
  font: 700 20px/1 var(--display);
  letter-spacing: .06em;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.step:last-child::before { color: #1a0f02; background: linear-gradient(180deg, var(--amber-2), var(--ember)); border-color: transparent; }
.step h3 { font-size: 24px; text-transform: uppercase; letter-spacing: .06em; }
.step p { color: var(--muted); font-size: 15px; margin: 0; }
.join-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .steps::before { display: none; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 4vw;
  background: rgba(2, 4, 8, .92);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: auto; cursor: zoom-out; }
.lightbox img { max-height: 90vh; width: auto; box-shadow: 0 30px 120px rgba(0, 0, 0, .8); transform: scale(.96); transition: transform .6s var(--ease); }
.lightbox.open img { transform: none; }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 2;
  padding: 64px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: var(--dim);
  font-size: 14px;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: start; }
.footer .brand .emblem { width: 40px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: flex-end; }
.footer-links a { color: var(--muted); font: 500 14px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; }
.footer-links a:hover { color: #fff; }
.legal { grid-column: 1 / -1; padding-top: 28px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; max-width: 980px; }
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}

/* =====================================================================
   ACCOUNT PAGES (auth, dashboard) + ADMIN
   ===================================================================== */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: radial-gradient(90% 70% at 50% 110%, #2a1407 0%, #0b0d14 45%, #03060a 100%); }
.backdrop .starfield { position: absolute; inset: 0; width: 100%; height: 100%; }
.backdrop-sky {
  position: absolute;
  left: 50%; bottom: -2%;
  width: max(110vw, 220vh);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  background: url("../img/hero-sky-1440.webp") center bottom / cover no-repeat;
  opacity: .5;
  -webkit-mask-image: linear-gradient(180deg, transparent 40%, #000 80%);
  mask-image: linear-gradient(180deg, transparent 40%, #000 80%);
}
.backdrop-ridge {
  position: absolute;
  left: 50%; bottom: -2%;
  width: max(110vw, 220vh);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  background: url("../img/hero-mid-1440.webp") center bottom / cover no-repeat;
  opacity: .8;
  filter: brightness(.7);
}
.admin .backdrop-sky, .admin .backdrop-ridge { opacity: .14; }
.backdrop-glow { position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 30%, rgba(85, 199, 243, .08), transparent 70%); }

body:not(.landing) { display: flex; flex-direction: column; }
.shell {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 120px var(--gutter) 80px;
}
.auth .shell { display: flex; flex-direction: column; align-items: center; justify-content: center; }
body:not(.landing) .footer { background: rgba(3, 6, 10, .8); backdrop-filter: blur(8px); padding-top: 40px; }

.notice {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 20px;
  padding: 14px 18px 14px 44px;
  border: 1px solid;
  font-weight: 500;
  animation: fade-up .8s var(--ease) both;
}
.notice::before { content: ""; position: absolute; left: 18px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.notice-ok { color: #b9f0cd; border-color: rgba(102, 197, 138, .45); background: rgba(102, 197, 138, .1); }
.notice-err { color: #ffc6c0; border-color: rgba(228, 102, 93, .55); background: rgba(228, 102, 93, .12); }
.admin .notice, .dashboard .notice { max-width: none; }

/* Holo panel */
.panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: clamp(28px, 5vw, 48px);
  background: linear-gradient(180deg, rgba(16, 26, 38, .86), rgba(8, 13, 20, .9));
  backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(43, 64, 85, .8);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(155, 226, 251, .08);
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
  animation: panel-in 1s var(--ease) both;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(26px) scale(.985); } }
.panel::before {
  /* Top scan line that draws in. */
  content: "";
  position: absolute;
  left: 0; top: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--amber) 70%, transparent);
  transform-origin: left;
  animation: draw 1.4s .3s var(--ease) both;
}
@keyframes draw { from { transform: scaleX(0); } }
.panel-emblem { width: 54px; margin-bottom: 22px; filter: drop-shadow(0 0 16px rgba(85, 199, 243, .4)); }
.panel h1 { font-size: clamp(38px, 5vw, 54px); font-weight: 700; text-transform: uppercase; line-height: .95; margin-bottom: 12px; }
.panel .lede { color: var(--muted); margin-bottom: 30px; }
.panel.wide { max-width: none; }
.panel-foot { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 15px; color: var(--muted); }

/* Forms */
.form { display: grid; gap: 18px; }
.field { position: relative; display: grid; gap: 8px; }
.field > span, .field-label {
  font: 600 12px/1 var(--display);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.field > span em { font-style: normal; color: var(--dim); letter-spacing: .12em; text-transform: none; font-family: var(--font); font-weight: 400; font-size: 13px; }
.input, input[type=email], input[type=password], input[type=text], input[type=url], input[type=number], textarea, select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font: 500 17px/1.3 var(--font);
  color: var(--text);
  background: rgba(3, 7, 12, .65);
  border: 1px solid var(--line-2);
  border-radius: 0;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
textarea { min-height: 100px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #4d5c68; }
input:hover, textarea:hover { border-color: #3b5874; }
input:focus, textarea:focus { outline: none; border-color: var(--cyan); background: rgba(5, 14, 22, .8); box-shadow: 0 0 0 4px rgba(85, 199, 243, .12), 0 0 30px -6px rgba(85, 199, 243, .5); }
input:-webkit-autofill { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 100px #08131d inset; }
.invite-input {
  font: 600 24px/1 ui-monospace, "Cascadia Mono", Consolas, monospace !important;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-align: center;
  color: var(--amber-2) !important;
  border-color: rgba(224, 174, 88, .45) !important;
  background:
    repeating-linear-gradient(90deg, rgba(224, 174, 88, .05) 0 2px, transparent 2px 6px),
    rgba(18, 10, 2, .55) !important;
}
.invite-input:focus { border-color: var(--amber) !important; box-shadow: 0 0 0 4px rgba(224, 174, 88, .14), 0 0 34px -6px rgba(255, 143, 63, .6) !important; }
.invite-input.valid { text-shadow: 0 0 14px rgba(255, 143, 63, .7); }
.invite-slot { position: relative; padding: 18px; border: 1px dashed rgba(224, 174, 88, .35); background: rgba(224, 174, 88, .04); }
.invite-slot .field > span { color: var(--amber); }
.invite-slot small { display: block; margin-top: 10px; color: var(--dim); font-size: 13px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle {
  position: absolute;
  right: 6px; top: 6px; bottom: 6px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 12px/1 var(--display);
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
}
.pw-toggle:hover { color: var(--cyan); }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 2px; }
.meter i { height: 3px; background: var(--line-2); transition: background .3s, box-shadow .3s; }
.meter[data-level="1"] i:nth-child(-n+1),
.meter[data-level="2"] i:nth-child(-n+2) { background: var(--red); }
.meter[data-level="3"] i:nth-child(-n+3) { background: var(--amber); }
.meter[data-level="4"] i:nth-child(-n+4),
.meter[data-level="5"] i:nth-child(-n+5) { background: var(--green); box-shadow: 0 0 8px rgba(102, 197, 138, .6); }
.meter-hint { font-size: 13px; color: var(--dim); min-height: 1.2em; }
.meter-hint.ok { color: var(--green); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--text-2); cursor: pointer; }
.check input { appearance: none; flex: 0 0 auto; width: 20px; height: 20px; margin: 2px 0 0; border: 1px solid var(--line-2); background: rgba(3, 7, 12, .65); display: grid; place-items: center; cursor: pointer; transition: border-color .2s, background .2s; }
.check input::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .25s var(--ease); }
.check input:checked { background: var(--cyan); border-color: var(--cyan); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }

/* Toggle switch (admin settings) */
.switch { display: flex; align-items: flex-start; gap: 16px; cursor: pointer; padding: 16px 0; border-bottom: 1px solid var(--line); }
.switch input { appearance: none; flex: 0 0 auto; position: relative; width: 52px; height: 28px; margin: 0; background: var(--raised); border: 1px solid var(--line-2); cursor: pointer; transition: background .3s, border-color .3s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: var(--muted); transition: transform .4s var(--ease), background .3s; }
.switch input:checked { background: rgba(85, 199, 243, .2); border-color: var(--cyan); }
.switch input:checked::after { transform: translateX(24px); background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.switch strong { display: block; font: 600 17px/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.switch small { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.dash > .panel { max-width: none; grid-column: span 12; }
.dash-hero {
  grid-column: span 12;
  position: relative;
  isolation: isolate;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 5vw, 56px);
  overflow: hidden;
  border: 1px solid rgba(43, 64, 85, .8);
  clip-path: polygon(0 0, calc(100% - 32px) 0, 100% 32px, 100% 100%, 32px 100%, 0 calc(100% - 32px));
  animation: panel-in 1s var(--ease) both;
}
.dash-hero-art { position: absolute; inset: 0; z-index: -1; }
.dash-hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 22%; transform: scale(1.06); animation: drift 30s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.14) translate(-2%, -1%); } }
.dash-hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3, 6, 10, .92) 0%, rgba(3, 6, 10, .55) 55%, rgba(3, 6, 10, .2) 100%), linear-gradient(0deg, rgba(3, 6, 10, .8), transparent 60%); }
.dash-hero h1 { font-size: clamp(46px, 7vw, 92px); font-weight: 700; text-transform: uppercase; line-height: .88; margin: 0 0 16px; }
.dash-hero h1 span { color: var(--amber-2); }
.dash-hero h1 span.cyan { color: var(--cyan); }
.dash-hero p { max-width: 640px; color: var(--text-2); font-size: 18px; margin: 0; }
.status-line { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; }
.dash-card {
  grid-column: span 6;
  position: relative;
  padding: 30px;
  background: linear-gradient(180deg, rgba(16, 26, 38, .84), rgba(8, 13, 20, .9));
  backdrop-filter: blur(14px);
  border: 1px solid rgba(43, 64, 85, .8);
  animation: panel-in 1s .1s var(--ease) both;
}
.dash-card:nth-of-type(3) { animation-delay: .18s; }
.dash-card:nth-of-type(4) { animation-delay: .26s; }
.dash-card.full { grid-column: span 12; }
.dash-card h2 { font-size: 26px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 18px; }
.dash-card h2 .index { font-size: 16px; vertical-align: middle; margin-right: 10px; }
.creds { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 0; }
.creds div { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 14px 16px; background: rgba(6, 11, 17, .9); }
.creds dt { font: 600 12px/1.6 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }
.creds dd { margin: 0; font-weight: 500; color: var(--text); word-break: break-word; }
.launch-steps { list-style: none; margin: 0; padding: 0; counter-reset: ls; display: grid; gap: 14px; }
.launch-steps li { position: relative; padding-left: 48px; color: var(--text-2); }
.launch-steps li::before { counter-increment: ls; content: counter(ls); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; display: grid; place-items: center; font: 700 15px/1 var(--display); color: var(--cyan); border: 1px solid rgba(85, 199, 243, .45); background: rgba(85, 199, 243, .08); }
.launch-steps strong { color: var(--text); }
.download {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px;
  margin-bottom: 22px;
  border: 1px solid rgba(224, 174, 88, .4);
  background: linear-gradient(90deg, rgba(224, 174, 88, .12), rgba(224, 174, 88, .02));
}
.download .emblem { width: 52px; flex: 0 0 auto; }
.download div { flex: 1; }
.download strong { display: block; font: 600 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: .06em; }
.download div span { color: var(--muted); font-size: 14px; }
@media (max-width: 860px) { .dash-card { grid-column: span 12; } .creds div { grid-template-columns: 1fr; gap: 4px; } }
@media (max-width: 560px) { .download { flex-direction: column; align-items: flex-start; } }

/* ---------- Admin ---------- */
.admin .shell { max-width: calc(1400px + 2 * var(--gutter)); }
.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.admin-head h1 { font-size: clamp(40px, 5vw, 64px); font-weight: 700; text-transform: uppercase; margin: 0; }
.tabs { display: flex; gap: 4px; margin-bottom: 26px; border-bottom: 1px solid var(--line-2); }
.tabs a { padding: 14px 20px; font: 600 14px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: #fff; }
.tabs a.on { color: #fff; border-bottom-color: var(--cyan); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 24px; }
.stats a, .stats div { display: block; padding: 18px 20px; background: rgba(8, 13, 20, .92); color: var(--text); transition: background .3s; }
.stats a:hover { background: rgba(20, 32, 48, .95); color: #fff; }
.stats a.on { background: rgba(85, 199, 243, .1); box-shadow: inset 0 -2px 0 var(--cyan); }
.stats b { display: block; font: 700 36px/1 var(--display); margin-bottom: 6px; }
.stats span { font: 600 12px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.box {
  position: relative;
  margin-bottom: 24px;
  padding: clamp(22px, 3vw, 32px);
  background: linear-gradient(180deg, rgba(16, 26, 38, .9), rgba(8, 13, 20, .94));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(43, 64, 85, .8);
}
.box h2 { font-size: 26px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.box > p.muted { margin-bottom: 20px; }
.box.danger { border-color: rgba(228, 102, 93, .4); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-form { display: grid; grid-template-columns: 2fr 1fr 1fr 2fr auto; gap: 14px; align-items: end; }
@media (max-width: 1100px) { .grid-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-form { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.form.spaced { margin-top: 20px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; padding: 14px 16px; font: 600 12px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); background: rgba(6, 11, 17, .9); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); background: rgba(8, 13, 20, .7); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .2s; }
tbody tr:hover td { background: rgba(20, 32, 48, .8); }
td form { margin: 0; }
.code-cell { font: 600 15px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; color: var(--amber-2); }
.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font: 600 11px/1 var(--display);
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  vertical-align: middle;
}
.copy:hover { color: var(--cyan); border-color: var(--cyan); }
.copy.done { color: var(--green); border-color: var(--green); }
.new-invite {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px 28px;
  align-items: center;
  padding: 26px;
  margin-bottom: 24px;
  border: 1px solid rgba(224, 174, 88, .5);
  background: linear-gradient(90deg, rgba(224, 174, 88, .15), rgba(224, 174, 88, .02));
  animation: panel-in .9s var(--ease) both;
}
.new-invite .big { font: 700 clamp(30px, 4vw, 46px)/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .14em; color: var(--amber-2); text-shadow: 0 0 24px rgba(255, 143, 63, .5); }
.new-invite .link { font-family: ui-monospace, Consolas, monospace; color: var(--text-2); word-break: break-all; }
.details { display: grid; grid-template-columns: 200px 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 0 0 24px; }
.details dt, .details dd { margin: 0; padding: 12px 16px; background: rgba(8, 13, 20, .9); }
.details dt { font: 600 12px/1.7 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
@media (max-width: 640px) { .details { grid-template-columns: 1fr; } .details dd { padding-top: 0; } }
.reset-link { font-family: ui-monospace, Consolas, monospace; font-size: 14px; padding: 16px; background: rgba(3, 7, 12, .8); border: 1px solid var(--line-2); word-break: break-all; color: var(--cyan-2); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js .layer-ship { display: none; }
  body::after { display: none; }
  .story { height: auto; }
  .story-pin { position: relative; height: auto; padding-top: 120px; padding-bottom: 120px; }
  .story-text .w { opacity: 1; }
  .space-craft { display: none; }
}
