/* ==========================================================================
   Snowdaddy front door -- the one stylesheet.
   - Colour lives in tokens on :root (light). Dark theme = prefers-color-scheme
     (unless the visitor chose light) and data-theme="dark" (visitor choice).
   - No external resources: system fonts, no @import, no url(), no data: URIs.
   - ASCII only. CSP: style-src 'self' (no inline styles anywhere).
   - Every text/background token pair meets WCAG AA in both themes (lowest 4.79:1).
   ========================================================================== */

/* ---------- tokens: light (default) ---------- */
:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --bg-tint: #ebeff4;
  --surface: #ffffff;
  --line: #dbe1e9;
  --line-strong: #c2cbd7;
  --text: #0a1120;
  --text-2: #344155;
  --text-3: #526073;
  --ice: #0a659d;
  --ice-soft: rgba(10, 101, 157, 0.08);
  --ice-line: rgba(10, 101, 157, 0.28);
  --brass: #815400;
  --brass-soft: rgba(129, 84, 0, 0.08);
  --brass-line: rgba(129, 84, 0, 0.30);
  --btn-bg: #0a1120;
  --btn-fg: #ffffff;
  --btn-bg-hover: #1d2a42;
  --focus: #0a659d;
  --header-bg: rgba(244, 246, 249, 0.82);
  --glow-1: rgba(10, 101, 157, 0.13);
  --glow-2: rgba(170, 115, 10, 0.11);
  --grid-line: rgba(10, 17, 32, 0.06);
  --shadow-1: 0 1px 2px rgba(10, 17, 32, 0.05), 0 6px 20px rgba(10, 17, 32, 0.05);
  --shadow-2: 0 2px 8px rgba(10, 17, 32, 0.06), 0 30px 70px rgba(10, 17, 32, 0.11);
  --em-ring-a: #1b86c7;
  --em-ring-b: #c38a28;
  --em-glass-a: #1d5378;
  --em-glass-b: #050d16;
  --em-pupil: #02060b;
  --em-iris: rgba(160, 215, 255, 0.30);
  --em-blade-a: #dcaa4e;
  --em-blade-b: #9a6812;
  --em-groove: rgba(60, 38, 0, 0.38);
  --em-trace: #eef8ff;
  --em-tick: #b4bfcc;
  --em-scan: rgba(255, 255, 255, 0.92);
  --em-spec: rgba(255, 255, 255, 0.55);
  --em-bracket: #8fd6ff;
  --show-sun: none;
  --show-moon: block;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 16px;
  --radius-l: 24px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- tokens: dark (system preference, unless the visitor chose light) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #05070b;
    --bg-tint: #090d13;
    --surface: #0c1119;
    --line: #1b2431;
    --line-strong: #2b3749;
    --text: #e8edf4;
    --text-2: #aeb9c7;
    --text-3: #8b99ac;
    --ice: #8ad0fb;
    --ice-soft: rgba(138, 208, 251, 0.08);
    --ice-line: rgba(138, 208, 251, 0.26);
    --brass: #e8b866;
    --brass-soft: rgba(232, 184, 102, 0.08);
    --brass-line: rgba(232, 184, 102, 0.28);
    --btn-bg: #eef2f7;
    --btn-fg: #05070b;
    --btn-bg-hover: #ffffff;
    --focus: #8ad0fb;
    --header-bg: rgba(5, 7, 11, 0.74);
    --glow-1: rgba(80, 165, 235, 0.17);
    --glow-2: rgba(230, 168, 70, 0.10);
    --grid-line: rgba(160, 190, 230, 0.055);
    --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 80px rgba(0, 0, 0, 0.55);
    --em-ring-a: #8ad0fb;
    --em-ring-b: #e8b866;
    --em-glass-a: #18405f;
    --em-glass-b: #03070c;
    --em-pupil: #000204;
    --em-iris: rgba(138, 208, 251, 0.24);
    --em-blade-a: #f0c978;
    --em-blade-b: #a4701a;
    --em-groove: rgba(40, 25, 0, 0.45);
    --em-trace: #d5efff;
    --em-tick: #2c394b;
    --em-scan: rgba(255, 255, 255, 0.85);
    --em-spec: rgba(255, 255, 255, 0.35);
    --em-bracket: #8ad0fb;
    --show-sun: block;
    --show-moon: none;
  }
}

/* ---------- tokens: dark (visitor choice) -- keep identical to the block above ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #05070b;
  --bg-tint: #090d13;
  --surface: #0c1119;
  --line: #1b2431;
  --line-strong: #2b3749;
  --text: #e8edf4;
  --text-2: #aeb9c7;
  --text-3: #8b99ac;
  --ice: #8ad0fb;
  --ice-soft: rgba(138, 208, 251, 0.08);
  --ice-line: rgba(138, 208, 251, 0.26);
  --brass: #e8b866;
  --brass-soft: rgba(232, 184, 102, 0.08);
  --brass-line: rgba(232, 184, 102, 0.28);
  --btn-bg: #eef2f7;
  --btn-fg: #05070b;
  --btn-bg-hover: #ffffff;
  --focus: #8ad0fb;
  --header-bg: rgba(5, 7, 11, 0.74);
  --glow-1: rgba(80, 165, 235, 0.17);
  --glow-2: rgba(230, 168, 70, 0.10);
  --grid-line: rgba(160, 190, 230, 0.055);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 80px rgba(0, 0, 0, 0.55);
  --em-ring-a: #8ad0fb;
  --em-ring-b: #e8b866;
  --em-glass-a: #18405f;
  --em-glass-b: #03070c;
  --em-pupil: #000204;
  --em-iris: rgba(138, 208, 251, 0.24);
  --em-blade-a: #f0c978;
  --em-blade-b: #a4701a;
  --em-groove: rgba(40, 25, 0, 0.45);
  --em-trace: #d5efff;
  --em-tick: #2c394b;
  --em-scan: rgba(255, 255, 255, 0.85);
  --em-spec: rgba(255, 255, 255, 0.35);
  --em-bracket: #8ad0fb;
  --show-sun: block;
  --show-moon: none;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
@supports (overflow-x: clip) {
  body { overflow-x: clip; }   /* safety net: decorative glows never cause sideways scrolling; clip keeps sticky working */
}
h1, h2 { margin: 0; font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.015em; font-weight: 650; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 16px; top: -120px; z-index: 100;
  padding: 10px 16px; border-radius: 10px; background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  display: inline-block; flex: none; width: 20px; height: 20px; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.container { width: 100%; max-width: calc(1200px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 999px;
  font-size: 0.95rem; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn .icon { width: 18px; height: 18px; transition: transform 0.2s var(--ease); }
.btn:hover .icon-arrow { transform: translateX(3px); }
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); box-shadow: var(--shadow-1); }
.btn--primary:hover { background: var(--btn-bg-hover); }
.btn--sm { min-height: 44px; padding: 8px 16px; font-size: 0.9rem; }
.btn--lg { min-height: 52px; padding: 13px 26px; font-size: 1rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line-strong); }
.icon-btn .icon-sun { display: var(--show-sun); }
.icon-btn .icon-moon { display: var(--show-moon); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow::before { content: ""; width: 20px; height: 1px; background: currentColor; opacity: 0.7; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; flex: none; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; }
.bm-ring { fill: none; stroke: var(--ice); stroke-width: 3.2; }
.bm-blade { fill: var(--brass); }
.bm-pupil { fill: var(--text); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word { font-size: 0.95rem; font-weight: 800; letter-spacing: 0.16em; }
.brand-sub { margin-top: 4px; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (max-width: 560px) {
  .brand-sub { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(40px, 7vw, 96px) clamp(32px, 5vw, 72px); }
@supports (overflow: clip) { .hero { overflow: clip; } }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 55% at 10% 6%, var(--glow-1), transparent 70%),
    radial-gradient(48% 50% at 94% 80%, var(--glow-2), transparent 70%);
  /* fade out at the bottom: the glows flow into the disciplines instead of ending on a hard edge */
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 45% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 45% 30%, #000 20%, transparent 75%);
}
.hero-inner { position: relative; display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.hero-title {
  margin-top: 20px;
  font-size: clamp(3rem, 1.2rem + 7.6vw, 6.5rem);
  font-weight: 750; line-height: 0.98; letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.hero-accent { color: var(--ice); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-accent {
    background: linear-gradient(100deg, var(--ice) 15%, var(--brass) 95%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
  }
}
@media (forced-colors: active) {
  .hero-accent { background: none; color: CanvasText; }
}
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 36px; }

.hero-art { position: relative; width: 100%; max-width: 520px; margin-inline: auto; }
.emblem { display: block; width: 100%; height: auto; overflow: visible; }
.em-s-ring-a { stop-color: var(--em-ring-a); }
.em-s-ring-b { stop-color: var(--em-ring-b); }
.em-s-glass-a { stop-color: var(--em-glass-a); }
.em-s-glass-b { stop-color: var(--em-glass-b); }
.em-s-blade-a { stop-color: var(--em-blade-a); }
.em-s-blade-b { stop-color: var(--em-blade-b); }
.em-grid-line { fill: none; stroke: var(--grid-line); stroke-width: 1; }
.em-orbit { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 7; }
.em-ticks { fill: none; stroke: var(--em-tick); stroke-width: 10; stroke-dasharray: 1.5 8.972; }
.em-ring { fill: none; stroke-width: 28; }
.em-ring-inner { fill: none; stroke: var(--em-iris); stroke-width: 1.5; }
.em-iris { fill: none; stroke: var(--em-iris); stroke-width: 1.2; }
.em-pupil { fill: var(--em-pupil); stroke: var(--em-iris); stroke-width: 1.5; }
.em-spec { fill: none; stroke: var(--em-spec); stroke-width: 6; stroke-linecap: round; }
.em-glint { fill: var(--em-spec); }
.em-bracket { fill: none; stroke: var(--em-bracket); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.em-scan { fill: none; stroke: var(--em-scan); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 110 832.48; opacity: 0.9; transform-origin: 230px 260px; }
.em-blade { stroke: var(--em-groove); stroke-width: 1; }
.em-groove { fill: none; stroke: var(--em-groove); stroke-width: 2; stroke-linecap: round; }
.em-trace { fill: none; stroke: var(--em-trace); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.em-node { fill: var(--em-trace); }
.em-collar { stroke: var(--em-groove); stroke-width: 1; }
.em-chip { fill: var(--em-pupil); stroke: var(--em-trace); stroke-width: 1.5; }
.em-dot-ice { fill: var(--ice); }
.em-dot-brass { fill: var(--brass); }
@media (prefers-reduced-motion: no-preference) {
  .em-scan { animation: em-spin 10s linear infinite; }
  .em-bracket { animation: em-breathe 3.2s var(--ease) infinite; }
}
@keyframes em-spin { to { transform: rotate(360deg); } }
@keyframes em-breathe { 50% { opacity: 0.45; } }

/* ---------- the two disciplines ---------- */
.disciplines { padding-block: 0 clamp(56px, 8vw, 112px); }
.disc-grid { display: grid; gap: 20px; }
@media (min-width: 800px) { .disc-grid { grid-template-columns: 1fr 1fr; } }
.disc-card {
  --accent-c: var(--ice); --accent-soft: var(--ice-soft); --accent-line: var(--ice-line);
  position: relative; display: flex; flex-direction: column; gap: 14px; overflow: hidden;
  padding: clamp(24px, 3.4vw, 40px); border: 1px solid var(--line); border-radius: var(--radius-l);
  background: var(--surface); box-shadow: var(--shadow-1);
}
.disc-card--veh { --accent-c: var(--brass); --accent-soft: var(--brass-soft); --accent-line: var(--brass-line); }
.disc-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-c), transparent 85%);
}
.disc-card::after {
  content: ""; position: absolute; top: -90px; right: -90px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent); pointer-events: none;
}
.disc-top { display: flex; align-items: center; gap: 12px; }
.disc-badge {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-c);
}
.disc-badge .icon { width: 22px; height: 22px; }
.disc-kicker { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-c); }
.disc-card h2 { font-size: clamp(1.4rem, 1.1rem + 0.9vw, 1.85rem); letter-spacing: -0.02em; }
.disc-by { margin-top: -6px; font-size: 0.9rem; color: var(--text-3); }
.disc-fact { max-width: 46ch; font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem); color: var(--text-2); }

/* ---------- footer ---------- */
.site-footer { padding-block: 28px; border-top: 1px solid var(--line); background: var(--bg); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 0.85rem; color: var(--text-3); }
.footer-inner a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--text-2); }   /* 44 px tap target */

/* ---------- 404 ---------- */
.notfound { display: grid; place-items: center; padding-block: clamp(64px, 12vw, 160px); text-align: center; }
.notfound-title { margin-top: 16px; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); font-weight: 700; letter-spacing: -0.03em; }
.notfound .hero-ctas { justify-content: center; }

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

/* ---------- forced colours (Windows high contrast) ---------- */
@media (forced-colors: active) {
  .btn--primary { border: 1px solid ButtonText; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .hero-art, .skip-link, .hero-bg { display: none !important; }
  body { background: #ffffff; color: #000000; }
}
