@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/dm-mono-latin-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/dm-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Special Gothic Condensed One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/special-gothic-condensed-one-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
}

:root {
  --ink: #07080a;
  --pearl: #ece9e2;
  --pearl-2: rgba(236, 233, 226, 0.62);
  --pearl-3: rgba(236, 233, 226, 0.38);
  --line: rgba(236, 233, 226, 0.16);
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad-x: max(22px, env(safe-area-inset-left), env(safe-area-inset-right));
  --pad-top: max(20px, env(safe-area-inset-top));
  --pad-bot: max(20px, env(safe-area-inset-bottom));
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--pearl);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--mono);
  font-weight: 300;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
  outline: none;
}

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

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--pearl); outline-offset: 4px; }

/* ------------------------------------------------------------------ Loader (only shows if loading is slow) */
.loader {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 30px;
  margin: -15px 0 0 -17px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  animation: loader-in 0.8s var(--ease) 0.6s forwards;
  transition: opacity 0.6s var(--ease);
}
.loader svg { width: 100%; height: 100%; overflow: visible; }
.loader path {
  fill: none;
  stroke: var(--pearl);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  animation: loader-spin 1.6s linear infinite;
  transform-origin: 0 0;
}
.started .loader { animation: none; opacity: 0; }
@keyframes loader-in { to { opacity: 0.5; } }
@keyframes loader-spin { to { transform: rotate(60deg); } }

/* ------------------------------------------------------------------ Sound gate
   Browsers keep a page silent until the visitor taps, clicks or presses a key, so the intro waits
   here for that first touch and then plays with its sound from the very first moment. */
.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding-bottom: 4vh;
  cursor: pointer;
}
.gate[hidden] { display: none; }
.gate::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70vmin;
  height: 70vmin;
  transform: translate(-50%, -56%);
  background: radial-gradient(closest-side, rgba(110, 150, 160, 0.075), rgba(110, 150, 160, 0) 72%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.8s var(--ease);
}
.gate-go {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 12px 28px;
}
.gate-hex {
  width: clamp(92px, 9vw, 122px);
  height: auto;
  overflow: visible;
  transition: transform 0.7s var(--ease), opacity 0.6s var(--ease);
}
.gh-track {
  fill: rgba(236, 233, 226, 0);
  stroke: rgba(236, 233, 226, 0.1);
  stroke-width: 1.1;
  transition: fill 0.6s var(--ease), stroke 0.6s var(--ease);
}
.gh-line {
  fill: none;
  stroke: rgba(236, 233, 226, 0.72);
  stroke-width: 1.1;
  stroke-linejoin: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.6s var(--ease), stroke 0.5s var(--ease);
}
.gh-sheen { opacity: 0; transform: translateX(-96px) skewX(-18deg); }
.gh-eq rect {
  fill: rgba(236, 233, 226, 0.55);
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleY(0.12);
  opacity: 0.4;
  transition: opacity 0.8s var(--ease), fill 0.4s var(--ease);
}
.gate-label, .gate-quiet {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), color 0.3s, background-size 0.5s var(--ease);
  pointer-events: none;
}
.gate-label {
  font-family: "Special Gothic Condensed One", "Arial Narrow", var(--sans);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.26em;
  padding-left: 0.26em;
  text-transform: uppercase;
  color: var(--pearl);
}
.gate-quiet {
  font-family: var(--mono);
  font-weight: 300;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(236, 233, 226, 0.48);
  padding: 8px 2px;
  background: linear-gradient(currentColor, currentColor) left bottom / 0% 1px no-repeat;
}

/* ready: the outline is complete, the sound inside starts to move */
.gate-ready::before { opacity: 1; }
.gate-ready .gh-line { stroke-dasharray: none; vector-effect: non-scaling-stroke; }
.gate-ready .gh-track { vector-effect: non-scaling-stroke; }
.gate-ready .gh-sheen { animation: gh-sheen 5.2s cubic-bezier(0.45, 0, 0.25, 1) 0.6s infinite; }
.gate-ready .gh-eq rect { opacity: 1; animation: gh-bar 2.6s ease-in-out infinite; }
.gate-ready .gh-eq rect:nth-child(2) { animation-delay: -0.9s; animation-duration: 2.2s; }
.gate-ready .gh-eq rect:nth-child(3) { animation-delay: -1.7s; animation-duration: 3s; }
.gate-ready .gh-eq rect:nth-child(4) { animation-delay: -0.4s; animation-duration: 2.4s; }
.gate-ready .gh-eq rect:nth-child(5) { animation-delay: -1.2s; animation-duration: 2.8s; }
.gate-ready .gate-label, .gate-ready .gate-quiet { opacity: 1; transform: none; pointer-events: auto; }
.gate-ready .gate-quiet { transition-delay: 0.35s, 0.35s, 0s, 0s; }
.gate-ready:hover .gh-line, .gate-go:focus-visible .gh-line { stroke: var(--pearl); }
.gate-ready:hover .gh-track { fill: rgba(236, 233, 226, 0.035); }
.gate-ready:hover .gate-hex { transform: scale(1.045); }
.gate-ready:hover .gh-eq rect { fill: var(--pearl); }
.gate-ready .gate-go:active .gate-hex { transform: scale(0.965); transition-duration: 0.12s; }
.gate-quiet:hover, .gate-quiet:focus-visible { color: var(--pearl-2); background-size: 100% 1px; }
.gate-go:focus-visible, .gate-quiet:focus-visible { outline: none; }

/* entering: the pane opens outward into the wall as it forms */
.gate-out { pointer-events: none; cursor: default; }
.gate-out::before { opacity: 0; transition-duration: 0.8s; }
.gate-out .gate-hex { transform: scale(6); opacity: 0; transition: transform 1.5s cubic-bezier(0.55, 0, 0.2, 1), opacity 1.2s ease 0.2s; }
.gate-out .gh-eq rect, .gate-out .gh-sheen { opacity: 0; transition: opacity 0.3s ease; }
.gate-out .gate-label, .gate-out .gate-quiet { opacity: 0; transform: translateY(-4px); transition: opacity 0.35s ease, transform 0.6s var(--ease); transition-delay: 0s; }

@keyframes gh-bar { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(0.78); } }
@keyframes gh-sheen {
  0% { opacity: 0; transform: translateX(-96px) skewX(-18deg); }
  8% { opacity: 1; }
  38% { opacity: 1; }
  46% { opacity: 0; transform: translateX(96px) skewX(-18deg); }
  100% { opacity: 0; transform: translateX(96px) skewX(-18deg); }
}
.nogl .gate { display: none; }

/* ------------------------------------------------------------------ Overlay UI */
.ui { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.ui > * { position: absolute; }

.sound {
  top: calc(var(--pad-top) - 8px);
  right: calc(var(--pad-x) - 8px);
  width: 48px;
  height: 44px;
  display: grid;
  place-items: center;
  pointer-events: auto;
  color: var(--pearl);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.snd-in .sound { opacity: 1; transform: none; }
.sound svg { width: 32px; height: 28px; overflow: visible; }
.sx-hex {
  fill: rgba(236, 233, 226, 0);
  stroke: rgba(236, 233, 226, 0.42);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.4s var(--ease), fill 0.4s var(--ease), transform 0.6s var(--ease);
  transform-origin: 0 0;
}
.sx-eq rect {
  fill: rgba(236, 233, 226, 0.5);
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleY(0.42);
  transition: transform 0.5s var(--ease), fill 0.4s var(--ease);
}
.sx-mute {
  stroke: rgba(236, 233, 226, 0.7);
  stroke-width: 1;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 25;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s var(--ease), opacity 0.4s var(--ease);
}
.sound:hover .sx-hex { stroke: rgba(236, 233, 226, 0.85); fill: rgba(236, 233, 226, 0.05); transform: rotate(30deg); }
.sound.on .sx-hex { stroke: rgba(236, 233, 226, 0.7); }
.sound.on .sx-eq rect { fill: var(--pearl); animation: sx-bar 1.3s ease-in-out infinite; }
.sound.on .sx-eq rect:nth-child(2) { animation-delay: -0.45s; animation-duration: 1.05s; }
.sound.on .sx-eq rect:nth-child(3) { animation-delay: -0.8s; animation-duration: 1.6s; }
.sound.on .sx-eq rect:nth-child(4) { animation-delay: -0.2s; animation-duration: 1.2s; }
.sound.on .sx-mute { stroke-dashoffset: 25; opacity: 0; }
.ask-sound .sound:not(.on) .sx-hex { animation: sx-call 2.2s ease-in-out infinite; }
@keyframes sx-bar { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@keyframes sx-call { 0%, 100% { stroke: rgba(236, 233, 226, 0.42); } 50% { stroke: rgba(236, 233, 226, 0.95); } }


.hint {
  left: 50%;
  bottom: calc(var(--pad-bot) + 46px);
  transform: translate(-50%, 8px);
  margin: 0;
  font-family: "Special Gothic Condensed One", "Arial Narrow", var(--sans);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(236, 233, 226, 0.7);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.ask-break .hint-break, .look-on .hint-look { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ Break through the barrier
   A pane-shaped glass button: frosted, edged with a hairline that a spark of light keeps running
   around, and a gloss that sweeps across it on repeat. */
.barrier {
  left: 50%;
  bottom: calc(var(--pad-bot) + 9vh);
  display: block;
  padding: 0;
  transform: translate(-50%, 16px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.barrier[hidden] { display: none; }
.barrier::before {
  content: "";
  position: absolute;
  inset: -26px -44px;
  background: radial-gradient(closest-side, rgba(150, 200, 222, 0.2), rgba(150, 200, 222, 0) 75%);
  pointer-events: none;
  animation: barrier-glow 3.4s ease-in-out infinite;
}
.barrier-on .barrier { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.barrier-in {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 19px 44px 18px calc(44px + 0.2em);
  font-family: "Special Gothic Condensed One", "Arial Narrow", var(--sans);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--pearl);
  text-shadow: 0 0 14px rgba(200, 230, 245, 0.35);
  background: linear-gradient(180deg, rgba(236, 233, 226, 0.15), rgba(236, 233, 226, 0.04) 52%, rgba(236, 233, 226, 0.09));
  -webkit-backdrop-filter: blur(10px) saturate(1.35);
  backdrop-filter: blur(10px) saturate(1.35);
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%);
  transition: background 0.4s var(--ease), color 0.3s;
}
.barrier-in::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 34%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.34) 50%, rgba(255, 255, 255, 0));
  transform: translateX(-140%) skewX(-22deg);
  animation: barrier-gloss 3.2s cubic-bezier(0.45, 0, 0.3, 1) 0.4s infinite;
  pointer-events: none;
}
.barrier-edge { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.be-line { fill: none; stroke: rgba(236, 233, 226, 0.72); stroke-width: 1; transition: stroke 0.3s; }
.be-run {
  fill: none;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 0.09 0.91;
  opacity: 0.9;
  filter: drop-shadow(0 0 3px rgba(210, 240, 255, 0.9));
  animation: barrier-run 3.2s linear infinite;
}
.barrier:hover .barrier-in, .barrier:focus-visible .barrier-in { background: linear-gradient(180deg, rgba(236, 233, 226, 0.22), rgba(236, 233, 226, 0.08) 52%, rgba(236, 233, 226, 0.14)); }
.barrier:hover .be-line, .barrier:focus-visible .be-line { stroke: var(--pearl); }
.barrier:focus-visible { outline: none; }
.barrier:active { transform: translate(-50%, 0) scale(0.97); transition-duration: 0.12s; }
.barrier-go .barrier { opacity: 0; transform: translate(-50%, 0) scale(1.12); pointer-events: none; transition: opacity 0.45s ease, transform 0.6s var(--ease); }
@keyframes barrier-gloss { 0% { transform: translateX(-140%) skewX(-22deg); } 55%, 100% { transform: translateX(400%) skewX(-22deg); } }
@keyframes barrier-run { to { stroke-dashoffset: -1; } }
@keyframes barrier-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.through .hint { opacity: 0 !important; }

/* ------------------------------------------------------------------ Make (the) Unknown Feel Ordinary */
.acro { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
.acro-glyphs { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.aw {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  white-space: nowrap;
  font-family: "Special Gothic Condensed One", "Arial Narrow", var(--sans);
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(220, 216, 206, 0.58);
  opacity: 0;
  will-change: transform, opacity;
}
.aw b, .aw span { display: inline-block; opacity: 0; }
.aw b { font-weight: 400; color: #dcd8ce; text-shadow: 0 0 18px rgba(220, 216, 206, 0.28); }
.aw-the { color: rgba(220, 216, 206, 0.44); }
.acro-soon {
  position: absolute;
  left: 50%;
  top: 0;
  margin: 0;
  transform: translate(-50%, 8px);
  opacity: 0;
  font-family: var(--mono);
  font-weight: 300;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(220, 216, 206, 0.68);
  transition: opacity 1.2s ease, transform 1.2s var(--ease);
}
.acro.soon .acro-soon { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ 404 */
.lost {
  position: fixed;
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 40px);
  bottom: calc(var(--pad-bot) + 12vh);
  transform: translate(-50%, 10px);
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  opacity: 0;
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease);
  pointer-events: none;
}
.ui-on .lost { opacity: 1; transform: translate(-50%, 0); }
.lost p {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(16px, 1.5vw, 20px);
  letter-spacing: 0.01em;
  color: var(--pearl);
}
.lost a {
  pointer-events: auto;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--pearl-2);
  padding: 8px 2px;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  transition: color 0.3s, background-size 0.5s var(--ease);
}
.lost a:hover { color: var(--pearl); background-size: 30% 1px; }

/* ------------------------------------------------------------------ Fallback (no WebGL / no JS) */
.fallback {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: radial-gradient(ellipse at 50% 45%, #121a1d 0%, var(--ink) 65%);
}
.nogl .fallback { display: grid; }
.nogl .ui .hint, .nogl .ui .sound { display: none; }
.nogl .lost { opacity: 1; transform: translate(-50%, 0); }
.fallback-lock { display: flex; align-items: flex-end; gap: clamp(20px, 3vw, 40px); }
.fallback-logo { width: min(52vw, 520px); height: auto; }
.fallback-credit { display: flex; align-items: flex-end; gap: 12px; opacity: 0; animation: credit 5.2s var(--ease) 1s forwards; }
.fallback-credit img { height: calc(min(52vw, 520px) * 0.35); width: auto; }
.fallback-credit span { font-size: 13px; color: var(--pearl-2); letter-spacing: 0.08em; }
.fallback-404 { font-family: var(--sans); font-size: clamp(64px, 16vw, 180px); letter-spacing: -0.02em; margin: 0; }
@keyframes credit { 0% { opacity: 0; transform: translateY(6px); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }

@media (max-width: 640px) {
  .barrier-in { font-size: 13px; letter-spacing: 0.16em; padding: 17px 32px 16px calc(32px + 0.16em); }
  .acro-soon { font-size: 11px; letter-spacing: 0.36em; padding-left: 0.36em; }
  .gate-label { font-size: 14px; letter-spacing: 0.22em; padding-left: 0.22em; }
  .hint { font-size: 12px; letter-spacing: 0.1em; bottom: calc(var(--pad-bot) + 52px); }
  .fallback-lock { flex-direction: column; align-items: center; }
  .fallback-logo { width: 80vw; }
  .fallback-credit img { height: 70px; }
}
@media (max-height: 460px) and (orientation: landscape) {
  .hint { bottom: calc(var(--pad-bot) + 2px); }
}
@media (prefers-reduced-motion: reduce) {
  .sound.on .sx-eq rect { animation: none; transform: scaleY(0.7); }
  .gate-ready .gh-eq rect { animation: none; transform: scaleY(0.5); }
  .gate-ready .gh-sheen { animation: none; }
  .gate-out .gate-hex { transform: none; }
  .barrier-in::after, .be-run, .barrier::before { animation-duration: 8s; }
}
