/*
 * nival.app's cover: "Coming soon" over the Frosted Alpine Ridges (Renjume picked A on Nival Picks'
 * nival-app-cover-nival-1, Final · Real Nival, 2026-11-30; tracker/e67). Served at / by app/routers/site.py.
 * Its colours, type, blur, times and curves are nival-design's (tokens.css and motion.css beside it, written by
 * nival-design's sync); what is the page's own art is said in admin/scripts/values-allowed.json with why. Its type is
 * the download page's fonts (app/static, at /download/assets), so nothing is fetched from anywhere else.
 */
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400; font-display: block; src: url(/download/assets/inter-tight-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 500; font-display: block; src: url(/download/assets/inter-tight-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 600; font-display: block; src: url(/download/assets/inter-tight-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: block; src: url(/download/assets/jetbrains-mono-latin-500-normal.woff2) format('woff2'); }

:root {
  --rail-x: clamp(24px, 3.2vw, 48px);
  /* 48..52px top & bottom Swiss architectural rail bands */
  --rail-y: clamp(48px, 5.4vh, 52px);

  /* The cover's own names, each made of nival-design's tokens (dark; light below, as the visitor's system has it) */
  --cover-rail: var(--n-whisper);
  --cover-rail-node: color-mix(in srgb, var(--n-logo-top) 54%, transparent);
  --cover-ink-top: var(--n-ink);
  --cover-ink-bot: var(--n-logo-top);
  --cover-star: var(--n-logo-star);
  --cover-star-glow: color-mix(in srgb, var(--n-event-blue) 58%, transparent);
  --cover-reticle-ring: color-mix(in srgb, var(--n-logo-top) 24%, transparent);
  --cover-reticle-faint: color-mix(in srgb, var(--n-logo-top) 12%, transparent);
  --cover-reticle-tick: color-mix(in srgb, var(--n-logo-top) 44%, transparent);
  --cover-live-ring: color-mix(in srgb, var(--n-event-blue) 38%, transparent);
  --cover-headline-shadow: 0 10px 44px color-mix(in srgb, var(--n-bg) 56%, transparent);
}

@media (prefers-color-scheme: light) {
  :root {
    --cover-rail: var(--n-line);
    --cover-rail-node: color-mix(in srgb, var(--n-event-blue) 46%, transparent);
    --cover-ink-bot: var(--n-logo-bottom);
    --cover-star-glow: color-mix(in srgb, var(--n-event-blue) 26%, transparent);
    --cover-reticle-ring: color-mix(in srgb, var(--n-logo-bottom) 24%, transparent);
    --cover-reticle-faint: color-mix(in srgb, var(--n-logo-bottom) 12%, transparent);
    --cover-reticle-tick: color-mix(in srgb, var(--n-logo-bottom) 44%, transparent);
    --cover-live-ring: color-mix(in srgb, var(--n-event-blue) 30%, transparent);
    --cover-headline-shadow: 0 6px 28px color-mix(in srgb, var(--n-raised) 72%, transparent);
  }
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--n-bg);
  color: var(--n-ink);
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color var(--t-background) var(--ease-io), color var(--t-background) var(--ease-io);
}

::selection {
  background: var(--n-selection);
}

/* Full-viewport atmospheric starlight, snowfall & frosted alpine ridge canvas (cover.js) */
#sky-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

/* ---------- Swiss architectural edge-to-edge frame (0 px flush, no floating ends) ---------- */
.arch-frame {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.rail {
  position: fixed;
  background-color: var(--cover-rail);
  transition: background-color var(--t-background) var(--ease-io);
  will-change: transform, opacity;
}

.rail-h {
  left: 0;
  right: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
}

.rail-v {
  top: 0;
  bottom: 0;
  width: 1px;
  transform: scaleY(0);
  transform-origin: center;
  opacity: 0;
}

.rail-top    { top: var(--rail-y); }
.rail-bottom { bottom: var(--rail-y); }
.rail-left   { left: var(--rail-x); }
.rail-right  { right: var(--rail-x); }

/* Precision nodes on the rails' crossings */
.rail-node {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--cover-rail-node);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: background-color var(--t-background) var(--ease-io);
}

.rail-node-tl { left: calc(var(--rail-x) + 0.5px); top: calc(var(--rail-y) + 0.5px); }
.rail-node-tr { right: calc(var(--rail-x) - 0.5px); top: calc(var(--rail-y) + 0.5px); transform: translate(50%, -50%) scale(0); }
.rail-node-bl { left: calc(var(--rail-x) + 0.5px); bottom: calc(var(--rail-y) - 0.5px); transform: translate(-50%, 50%) scale(0); }
.rail-node-br { right: calc(var(--rail-x) - 0.5px); bottom: calc(var(--rail-y) - 0.5px); transform: translate(50%, 50%) scale(0); }

.is-ready .rail-h { animation: cover-rail-x var(--t-turn) var(--ease) var(--t-micro) forwards; }
.is-ready .rail-v { animation: cover-rail-y var(--t-turn) var(--ease) var(--t-exit-card) forwards; }

.is-ready .rail-node-tl { animation: cover-node-tl var(--t-nudge) var(--ease) var(--t-background) forwards; }
.is-ready .rail-node-tr { animation: cover-node-tr var(--t-nudge) var(--ease) var(--t-background) forwards; }
.is-ready .rail-node-bl { animation: cover-node-bl var(--t-nudge) var(--ease) var(--t-pulse) forwards; }
.is-ready .rail-node-br { animation: cover-node-br var(--t-nudge) var(--ease) var(--t-pulse) forwards; }

@keyframes cover-rail-x {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}
@keyframes cover-rail-y {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}
@keyframes cover-node-tl {
  from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes cover-node-tr {
  from { transform: translate(50%, -50%) scale(0); opacity: 0; }
  to   { transform: translate(50%, -50%) scale(1); opacity: 1; }
}
@keyframes cover-node-bl {
  from { transform: translate(-50%, 50%) scale(0); opacity: 0; }
  to   { transform: translate(-50%, 50%) scale(1); opacity: 1; }
}
@keyframes cover-node-br {
  from { transform: translate(50%, 50%) scale(0); opacity: 0; }
  to   { transform: translate(50%, 50%) scale(1); opacity: 1; }
}

/* ---------- The top and bottom bands: telemetry, status and the legal links ---------- */
.meta-bar {
  position: fixed;
  left: var(--rail-x);
  right: var(--rail-x);
  height: var(--rail-y);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(calc(var(--space-unit) * 3.5), 1.4vw, var(--space-5));
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--n-ink3);
  pointer-events: none;
  transition: color var(--t-background) var(--ease-io);
}

.meta-top    { top: 0; }
.meta-bottom { bottom: 0; }

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  opacity: 0;
  --rise-y: 4px;
}

.meta-brand {
  color: var(--n-ink);
  letter-spacing: 0.2em;
}

.meta-status-prefix {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.meta-sep {
  color: var(--n-ink4);
  margin: 0 var(--space-half);
  user-select: none;
}

/* Quiet legal links in Nival's secondary feel (--n-ink4 to --n-ink, with --n-hover-shade) */
.meta-legal {
  gap: var(--space-half);
  pointer-events: auto;
}

.meta-year {
  color: var(--n-ink4);
  padding: 0 var(--space-1);
  transition: color var(--t-fast) linear;
}

.meta-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--h-control-mini);
  padding: 0 var(--space-2);
  border-radius: var(--r-pill);
  color: var(--n-ink4);
  background: transparent;
  box-shadow: var(--n-hover-shade-rest);
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  transition-property: color, box-shadow, translate;
  transition-duration: var(--t-fast), var(--t-fast), var(--t-mid);
  transition-timing-function: linear, linear, var(--ease);
}

.meta-link:hover {
  color: var(--n-ink);
  box-shadow: var(--n-hover-shade);
  translate: 0 -0.5px;
}

.meta-link:active {
  color: var(--n-ink);
  box-shadow: var(--n-press-shade);
  translate: 0;
}

.meta-link:focus-visible {
  color: var(--n-ink);
  outline: var(--line-hair) solid var(--n-accent);
  outline-offset: 2px;
}

.live-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--n-event-blue);
  transition: background-color var(--t-background) var(--ease-io);
  flex-shrink: 0;
}

/* Breathes as nival-design's n-breathe (motion.css), there and back */
.live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: var(--line-hair) solid var(--cover-live-ring);
  --breathe-from-o: 0.25;
  --breathe-from-s: 0.82;
  --breathe-o: 0.85;
  --breathe-s: 1.22;
  opacity: var(--breathe-from-o);
  scale: var(--breathe-from-s);
  animation: n-breathe var(--t-curtain-bloom) var(--ease-io) infinite alternate;
}

/* In as nival-design's n-rise, one after another */
.is-ready .meta-item {
  opacity: 1;
  animation: n-rise var(--t-curtain-leave) var(--ease) calc(var(--t-turn) + var(--meta-step) * var(--t-lead-sm)) backwards;
}
.meta-top .meta-item:first-child    { --meta-step: 1; }
.meta-top .meta-item:last-child     { --meta-step: 2; }
.meta-bottom .meta-item:first-child { --meta-step: 3; }
.meta-bottom .meta-item:last-child  { --meta-step: 4; }

/* ---------- The hero, above the ridges ---------- */
.hero-stage {
  position: fixed;
  top: var(--rail-y);
  left: var(--rail-x);
  right: var(--rail-x);
  height: calc(73.5vh - var(--rail-y));
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-6) clamp(calc(var(--space-unit) * 3.5), 3vh, var(--space-8));
  pointer-events: none;
}

.hero-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 820px;
  width: 100%;
}

/* 1. The counter-rotating 4-point Nival star reticle */
.reticle-wrap {
  position: relative;
  width: clamp(86px, 11.4vh, 116px);
  height: clamp(86px, 11.4vh, 116px);
  margin-bottom: clamp(var(--space-4), 2.6vh, calc(var(--space-unit) * 7));
  opacity: 0;
  will-change: transform, opacity, filter;
}

.is-ready .reticle-wrap {
  opacity: 1;
  animation: cover-reticle-in var(--t-pulse-slow) var(--ease) var(--t-exit-card) backwards;
}

@keyframes cover-reticle-in {
  from { opacity: 0; transform: scale(0.84); filter: blur(var(--blur-in)); }
}

.reticle-parallax {
  width: 100%;
  height: 100%;
  will-change: transform;
}

.reticle-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

/* Turning by nature, as nival-design's n-spin: the outer orbit one way, the inner the other, both slowly */
.reticle-outer-orbit {
  transform-origin: 0px 0px;
  animation: n-spin calc(var(--t-listen-flow) * 10) linear infinite;
}

.reticle-inner-orbit {
  transform-origin: 0px 0px;
  animation: n-spin calc(var(--t-listen-flow) * 6.5) linear infinite reverse;
}

.reticle-star-core {
  transform-origin: 0px 0px;
  --breathe-from-o: 0.94;
  --breathe-from-s: 0.68;
  --breathe-o: 1;
  --breathe-s: 0.735;
  opacity: var(--breathe-from-o);
  scale: var(--breathe-from-s);
  animation: n-breathe var(--t-loop) var(--ease-io) infinite alternate;
  filter: drop-shadow(0 0 11px var(--cover-star-glow));
  transition: fill var(--t-background) var(--ease-io), filter var(--t-background) var(--ease-io);
}

.reticle-stroke {
  stroke: var(--cover-reticle-ring);
  transition: stroke var(--t-background) var(--ease-io);
}

.reticle-stroke-faint {
  stroke: var(--cover-reticle-faint);
  transition: stroke var(--t-background) var(--ease-io);
}

.reticle-tick {
  stroke: var(--cover-reticle-tick);
  transition: stroke var(--t-background) var(--ease-io);
}

.reticle-node {
  fill: var(--cover-star);
  transition: fill var(--t-background) var(--ease-io);
}

/* 2. Nival's wordmark (app/site/wordmark.svg), in as nival-design's n-blur-in */
.wordmark-wrap {
  margin-bottom: clamp(var(--space-4), 2.7vh, calc(var(--space-unit) * 7));
  color: var(--n-ink);
  opacity: 0;
  --blur-in-y: 10px;
  will-change: transform, opacity, filter;
  transition: color var(--t-background) var(--ease-io);
}

.is-ready .wordmark-wrap {
  opacity: 1;
  animation: n-blur-in var(--t-turn) var(--ease) var(--t-nudge) backwards;
}

.wordmark-svg {
  display: block;
  height: clamp(32px, 4.6vh, 45px);
  width: auto;
  overflow: visible;
}

.wordmark-svg .wordmark-star {
  filter: drop-shadow(0 0 8px var(--cover-star-glow));
  transition: fill var(--t-background) var(--ease-io), filter var(--t-background) var(--ease-io);
}

/* 3. The headline, its letters in one after another out of a blur (n-blur-in, a --stagger apart) */
.headline {
  font-family: var(--font-text);
  font-size: clamp(46px, 5.8vw, 84px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.036em;
  margin-bottom: clamp(var(--space-3), 1.9vh, var(--space-5));
  filter: drop-shadow(var(--cover-headline-shadow));
  white-space: nowrap;
  overflow: visible;
}

.headline .char {
  display: inline-block;
  padding: 0.08em 0.012em 0.16em;
  margin: -0.08em -0.012em -0.16em;
  opacity: 0;
  --blur-in-y: 15px;
  will-change: transform, opacity, filter;
  background: linear-gradient(180deg, var(--cover-ink-top) 20%, var(--cover-ink-bot) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.headline .char-space {
  width: 0.27em;
}

.headline .char-period {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--n-event-blue);
  -webkit-text-fill-color: var(--n-event-blue);
  transition: color var(--t-background) var(--ease-io), -webkit-text-fill-color var(--t-background) var(--ease-io);
}

.is-ready .headline .char {
  opacity: 1;
  animation: n-blur-in var(--t-turn) var(--ease) calc(var(--t-background) + var(--i) * var(--stagger)) backwards;
}

/* 4. The slogan */
.tagline {
  font-family: var(--font-text);
  font-size: clamp(var(--fs-body), 1.25vw, var(--fs-title));
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.012em;
  color: var(--n-ink2);
  max-width: 44ch;
  opacity: 0;
  --blur-in-y: 10px;
  will-change: transform, opacity, filter;
  transition: color var(--t-background) var(--ease-io);
}

.is-ready .tagline {
  opacity: 1;
  animation: n-blur-in var(--t-turn) var(--ease) calc(var(--t-pulse-slow) + var(--t-micro)) backwards;
}

/* ---------- Phones (390 x 844) and narrow windows ---------- */
@media (max-width: 639px) {
  :root {
    --rail-x: 18px;
    --rail-y: 44px;
  }

  .meta-bar {
    padding: 0 var(--space-3);
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .meta-status-prefix {
    display: none;
  }

  .meta-telemetry {
    display: none;
  }

  .meta-bottom {
    justify-content: center;
  }

  .hero-stage {
    height: calc(70vh - var(--rail-y));
    padding: 0 var(--space-4) var(--space-3);
  }

  .reticle-wrap {
    width: clamp(72px, 10.5vh, 92px);
    height: clamp(72px, 10.5vh, 92px);
    margin-bottom: clamp(calc(var(--space-unit) * 3.5), 2.2vh, calc(var(--space-unit) * 5.5));
  }

  .wordmark-wrap {
    margin-bottom: clamp(calc(var(--space-unit) * 3.5), 2.2vh, calc(var(--space-unit) * 5.5));
  }

  .wordmark-svg {
    height: clamp(28px, 4.1vh, 36px);
  }

  .headline {
    font-size: clamp(38px, 11.4vw, 50px);
    letter-spacing: -0.032em;
    margin-bottom: clamp(calc(var(--space-unit) * 2.5), 1.6vh, var(--space-4));
  }

  .tagline {
    font-size: clamp(var(--fs-body), 3.85vw, 16px);
    max-width: 28ch;
    line-height: 1.48;
  }
}

@media (max-height: 660px) and (max-width: 639px) {
  .reticle-wrap {
    width: 68px;
    height: 68px;
    margin-bottom: var(--space-3);
  }
  .wordmark-wrap {
    margin-bottom: var(--space-3);
  }
  .wordmark-svg {
    height: 27px;
  }
  .headline {
    font-size: 38px;
  }
}

/* ---------- Reduced motion: everything at rest, in place, and nothing turning or breathing ---------- */
@media (prefers-reduced-motion: reduce) {
  .rail-h, .rail-v,
  .rail-node-tl, .rail-node-tr, .rail-node-bl, .rail-node-br,
  .meta-item,
  .reticle-wrap,
  .wordmark-wrap,
  .headline .char,
  .tagline {
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
  .rail-h { transform: scaleX(1) !important; }
  .rail-v { transform: scaleY(1) !important; }
  .rail-node-tl { transform: translate(-50%, -50%) scale(1) !important; }
  .rail-node-tr { transform: translate(50%, -50%) scale(1) !important; }
  .rail-node-bl { transform: translate(-50%, 50%) scale(1) !important; }
  .rail-node-br { transform: translate(50%, 50%) scale(1) !important; }
  .meta-item, .reticle-wrap, .wordmark-wrap, .headline .char, .tagline {
    transform: none !important;
  }
  .reticle-outer-orbit,
  .reticle-inner-orbit,
  .reticle-star-core,
  .live-dot::after {
    animation: none !important;
  }
  .reticle-star-core {
    opacity: 1;
    scale: 0.7;
  }
  .meta-link {
    transition: none !important;
  }
}
