/* Reset, type, page frame, header, loadout panel, mobile menu, footer. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
html, body, main, footer { overflow-x: clip; }
html.lenis, html[data-motion="calm"] { scroll-behavior: auto; }
body {
  margin: 0; min-height: 100vh;
  font: 500 var(--fs-body)/1.55 var(--font-body);
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; color: var(--ink); font-family: var(--font-display); font-weight: 700; line-height: 1.02; letter-spacing: .005em; text-wrap: balance; }
strong, b { font-weight: 700; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(var(--accent-rgb), .6); color: #fff; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.screen-reader-text, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 999px; background: #fff; color: #111; font-weight: 700; }
.skip-link:focus { top: 12px; }

/* fixed sky behind everything */
.stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .9; }
.backdrop { position: fixed; inset: -40px; z-index: 0; display: none; background: var(--plate-sm) center/cover; filter: blur(34px) saturate(1.2) brightness(.55); }

.frame { position: relative; z-index: 1; width: 100%; max-width: var(--frame); margin: 0 auto; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap-narrow { --wrap: 820px; }

[data-layout="boxed"] .backdrop { display: block; }
[data-layout="boxed"] .stars { display: none; }
@media (min-width: 1100px) {
  [data-layout="boxed"] .frame {
    margin: 26px auto; border-radius: 30px; overflow: clip;
    background: var(--bg);
    box-shadow: 0 0 0 1px var(--line), 0 0 90px rgba(var(--accent-rgb), .35), 0 40px 120px rgba(0, 0, 0, .6);
  }
  [data-layout="boxed"] .site-header { top: 0; }
}
[data-layout="boxed"] .frame { background: var(--bg); }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); margin-bottom: calc(-1 * var(--header-h)); transition: background .35s, backdrop-filter .35s, box-shadow .35s; }
.site-header.is-scrolled { background: rgba(var(--bg-rgb), .72); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 1px 0 var(--line-soft); }
.header-in { height: 100%; width: min(100% - 2 * var(--gutter), var(--wrap) + 80px); margin-inline: auto; display: flex; align-items: center; gap: 24px; }
.header-progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--sun)); opacity: 0; transition: opacity .3s; }
.is-scrolled .header-progress { opacity: 1; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 700 1.45rem/1 var(--font-display); letter-spacing: .01em; }
.sm-mark { width: 38px; height: auto; flex: none; color: #fff; filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), .7)); }
.sm-mark-visor { fill: #0b0820; }
.sm-mark-eye { stroke: var(--accent-2); transform-origin: 50% 56%; }
.brand:hover .sm-mark-eye { animation: blink .5s var(--ease); }
@keyframes blink { 40% { transform: scaleY(.1); } }

.nav { margin-inline: auto; }
.nav ul { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav a { position: relative; padding: 8px 2px; font-size: .95rem; font-weight: 500; color: var(--ink-soft); transition: color .2s; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent-2); transform: scaleX(0); transition: transform .3s var(--ease); }
.nav a:hover, .nav a.is-active { color: #fff; }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--ink); border: 1px solid var(--line-soft); background: rgba(var(--panel-rgb), .4); transition: border-color .2s, background .2s, transform .2s; }
.icon-btn:hover { border-color: var(--line); background: rgba(var(--accent-rgb), .25); }
.icon-btn[aria-expanded="true"] { background: rgba(var(--accent-rgb), .4); border-color: var(--accent-2); }
.menu-btn { display: none; }

/* loadout panel */
.loadout { position: fixed; z-index: 60; top: calc(var(--header-h) + 6px); right: max(var(--gutter), (100vw - var(--wrap) - 80px) / 2); width: min(320px, calc(100vw - 2 * var(--gutter))); padding: 18px; border-radius: var(--r-md); background: rgba(var(--panel-rgb), .88); border: 1px solid var(--line); box-shadow: var(--glow), 0 24px 60px rgba(0, 0, 0, .5); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.loadout[hidden] { display: none; }
.loadout-title { margin-bottom: 12px; font: 600 .78rem/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-2); }
.loadout-row { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 10px; }
.loadout-row + .loadout-row { margin-top: 10px; }
.loadout-label { font-size: .82rem; color: var(--muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line-soft); }
.seg button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 8px; border-radius: 999px; font-size: .84rem; font-weight: 700; color: var(--muted); transition: background .25s, color .25s; }
.seg button[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 0 16px rgba(var(--accent-rgb), .6); }
.swatch { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.swatch-violet { background: linear-gradient(135deg, #5b8cff, #b56cff); }
.swatch-red { background: linear-gradient(135deg, #ff3b2f, #ffb14a); }

/* theme wipe */
.wipe { position: fixed; inset: -10% -30%; z-index: 150; pointer-events: none; transform: translateX(-130%) skewX(-14deg); background: linear-gradient(90deg, transparent, var(--accent) 18%, var(--accent-2) 50%, var(--sun) 82%, transparent); }

/* mobile menu */
/* Covers the whole screen, header area included, so the page never shows above it.
   The scroll lock goes on <html>: on <body> it turns body into the sticky header's
   scroll box and the header scrolls away on iOS. */
html.menu-open { overflow: hidden; }
.mobile-menu { position: fixed; inset: 0; z-index: 45; padding: calc(var(--header-h) + 28px) var(--gutter) 40px; display: flex; flex-direction: column; gap: 28px; background: rgba(var(--bg-rgb), .96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); overflow-y: auto; overscroll-behavior: contain; }
.mobile-menu[hidden] { display: none; }
.mobile-menu li a { display: block; padding: 16px 0; border-bottom: 1px solid var(--line-soft); font: 700 1.9rem/1 var(--font-display); text-transform: uppercase; color: var(--ink); }

/* footer */
.site-footer { position: relative; margin-top: clamp(40px, 8vw, 110px); padding: clamp(90px, 14vw, 190px) 0 28px; isolation: isolate; }
.site-footer::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--plate) 100% 100% / max(240%, 2000px) auto no-repeat; -webkit-mask-image: linear-gradient(transparent, #000 45%); mask-image: linear-gradient(transparent, #000 45%); opacity: .8; }
.site-footer::after { content: ''; position: absolute; inset: auto 0 0 0; height: 62%; z-index: -1; background: linear-gradient(transparent, rgba(var(--bg-rgb), .9) 55%, var(--bg)); }
.footer-in { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 32px; align-items: start; }
.footer-tag { margin-top: 12px; color: var(--ink-soft); font-size: .95rem; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; padding-top: 10px; }
.footer-nav a { font-size: .95rem; color: var(--ink-soft); transition: color .2s; }
.footer-nav a:hover { color: #fff; }
.footer-h { margin-bottom: 6px; font: 600 .78rem/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-2); }
.footer-legal { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 32px; justify-content: space-between; }
.footer-legal p { margin: 0; max-width: 70ch; }

@media (max-width: 1000px) {
  .nav, .site-header .header-cta { display: none; }
  .menu-btn { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .footer-in { grid-template-columns: 1fr; }
  .footer-nav ul { justify-content: flex-start; }
}
@media (max-width: 420px) {
  .brand { font-size: 1.25rem; }
  .sm-mark { width: 32px; }
}
