/* icestreams.systems: one stage, one loop. Tokens from the Ice Streams Systems brand kit. */

@font-face {
  font-family: "Orbitron";
  font-weight: 900;
  font-style: normal;
  font-display: block;
  src: url("fonts/orbitron-latin-900-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Orbitron";
  font-weight: 700;
  font-style: normal;
  font-display: block;
  src: url("fonts/orbitron-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 600;
  font-style: normal;
  font-display: block;
  src: url("fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2");
}

:root {
  --ice: #A8D8EA;
  --frost: #F0F4F8;
  --rime: #EAF6FB;
  --slate: #6B7B8D;
  --deep-ice: #4A7B95;
  --water: #2E86AB;
  --signal: #25B8D8;
  --bracket: #1A8AA8;
  --page: #080808;
  --card: #0C1018;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--page);
  overflow: hidden;
}

body {
  /* Deep water tone under everything, so the first paint already matches the loop. */
  background:
    radial-gradient(120% 90% at 30% 40%, #0E1A24 0%, #0A1118 45%, var(--page) 100%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.stage {
  position: fixed;
  inset: 0;
  display: block;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Keyboard focus: a thin inset waterline frame, invisible to mouse users. */
.stage:focus-visible::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(37, 184, 216, 0.55);
  border-radius: 14px;
  box-shadow: inset 0 0 24px rgba(37, 184, 216, 0.12), 0 0 18px rgba(37, 184, 216, 0.18);
  pointer-events: none;
  z-index: 5;
}

.gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(.4, 0, .2, 1);
}
.gl.is-live { opacity: 1; }

/* Static lockup fallback on the icestreams.io ice still. */
.still {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.15), rgba(8, 8, 8, 0.55)),
    url("img/hero-ice-v3.webp") center / cover no-repeat;
  opacity: 0;
  animation: still-in 1.2s ease 2.6s forwards;
}
.still-logo {
  width: min(82vw, 1180px);
  height: auto;
  overflow: visible;
  transform: translateX(1.5%);
}
.st-word { font-family: "Orbitron", sans-serif; }

@media (orientation: portrait) {
  .still { background-image: linear-gradient(180deg, rgba(8, 8, 8, 0.15), rgba(8, 8, 8, 0.55)), url("img/hero-ice-portrait-v3.webp"); }
  .still-logo { width: 90vw; }
}

@keyframes still-in { to { opacity: 1; } }

/* With script running, the still waits backstage unless WebGL fails. */
.js .still { display: none; }
.js.nogl .still { display: grid; animation-delay: 0s; }

/* Pre-pulse: the resting waterline breathes while assets load. */
.prepulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72vw, 1030px);
  height: 2px;
  transform: translate(-50%, 0);
  display: none;
  pointer-events: none;
}
.js .prepulse { display: block; }
.prepulse span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(46, 134, 171, 0) 0%, rgba(46, 134, 171, 0.55) 30%, rgba(168, 216, 234, 0.6) 50%, rgba(46, 134, 171, 0.55) 70%, rgba(46, 134, 171, 0) 100%);
  opacity: 0.15;
  filter: blur(0.6px);
  animation: breathe 2.4s ease-in-out infinite;
}
.prepulse.is-done { transition: opacity 0.8s ease; opacity: 0; }
.nogl .prepulse { display: none; }

@keyframes breathe {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.42; }
}
