/* THE KINETIC — black everything, one accent. */
@font-face { font-family: "Inter Tight"; src: url("fonts/InterTight-VariableFont_wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-VariableFont_wght.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --black: #000000;
  --graphite: #0B0B0C;
  --ash: #2A2A2C;
  --bone: #F2F0EB;
  --mute: rgba(242, 240, 235, .38);
  --brass: #B8925A;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--black); }
body {
  color: var(--bone);
  font-family: "Inter Tight", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
::selection { background: var(--brass); color: var(--black); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#stage {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 45%, #0d0d0e 0%, #000 62%);
  isolation: isolate;
}
/* film grain, barely there */
#stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Monogram ring, slowly turning behind everything */
.ring {
  position: absolute; z-index: 0; pointer-events: none;
  width: min(96vmin, 980px, 94vw); aspect-ratio: 1;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  opacity: .1; transition: opacity 2.4s var(--ease);
}
.ring img { width: 100%; height: 100%; animation: turn 240s linear infinite; }
[data-state="unlocked"] .ring { opacity: .2; }
@keyframes turn { to { transform: rotate(360deg); } }

section { position: relative; z-index: 2; width: 100%; display: flex; flex-direction: column; align-items: center; }

/* ---------- Locked ---------- */
.mark { width: min(400px, 70vw); line-height: 0; margin-bottom: clamp(56px, 11vh, 96px); }
.mark img { width: 100%; height: auto; }

#gate {
  position: relative; width: min(300px, 76vw);
  border-bottom: 1px solid rgba(242, 240, 235, .22);
  transition: border-color .6s var(--ease);
}
#gate:focus-within { border-bottom-color: rgba(184, 146, 90, .75); }
#gate.reset { border-bottom-color: rgba(242, 240, 235, .06); }

#code {
  width: 100%; background: transparent; border: 0; outline: 0; border-radius: 0;
  color: var(--bone); caret-color: var(--brass);
  font: 400 18px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .38em; text-transform: uppercase; text-align: center;
  padding: 14px 32px 14px calc(32px + .38em);
  transition: color .5s var(--ease), opacity .5s var(--ease);
  -webkit-appearance: none; appearance: none;
}
#code::placeholder { color: rgba(242, 240, 235, .22); font-size: 11px; letter-spacing: .5em; }
#gate.reset #code { color: transparent; }

#gate button {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; background: none; border: 0; cursor: pointer;
  color: var(--brass); font: 400 16px/1 "Inter Tight", sans-serif;
  opacity: 0; transition: opacity .4s var(--ease), transform .4s var(--ease);
}
#gate.has-value button { opacity: .9; }
#gate button:hover { transform: translate(3px, -50%); }

/* ---------- Unlocked ---------- */
#locked { transition: opacity .9s var(--ease), filter .9s var(--ease); }
#locked.leaving { opacity: 0; filter: blur(6px); }

.unlocked { gap: 0; text-align: center; opacity: 0; transition: opacity 1.6s var(--ease); }
.unlocked.in { opacity: 1; }
.mark-small { width: min(240px, 58vw); height: auto; opacity: .9; margin-bottom: clamp(48px, 9vh, 80px); }

.annie {
  min-height: 1.4em;
  font: 300 clamp(20px, 3.4vw, 30px)/1.35 "Inter Tight", sans-serif;
  letter-spacing: -.005em; color: var(--bone);
  margin-bottom: clamp(48px, 9vh, 84px);
}
.annie .cursor { display: inline-block; width: .5ch; color: var(--brass); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.countdown {
  display: grid; grid-template-columns: repeat(4, auto); gap: clamp(18px, 4.5vw, 56px);
  opacity: 0; transform: translateY(8px);
  transition: opacity 1.4s var(--ease) .2s, transform 1.4s var(--ease) .2s;
}
.countdown.in { opacity: 1; transform: none; }
.countdown div { display: flex; flex-direction: column; align-items: center; }
.countdown span {
  font: 300 clamp(34px, 7.5vw, 76px)/1 "JetBrains Mono", monospace;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--bone);
}
.countdown small {
  margin-top: 14px; font: 500 9px/1 "JetBrains Mono", monospace;
  letter-spacing: .42em; text-transform: uppercase; color: var(--mute);
}

.hunt {
  margin-top: clamp(56px, 10vh, 96px);
  font: 400 10px/1 "JetBrains Mono", monospace; letter-spacing: .5em; text-transform: uppercase;
  color: var(--brass); opacity: 0; transition: opacity 2s var(--ease) 1.2s;
}
.hunt.in { opacity: .85; }

.coords {
  position: absolute; z-index: 2; left: 50%; transform: translateX(-50%);
  bottom: max(22px, env(safe-area-inset-bottom));
  font: 400 10px/1 "JetBrains Mono", monospace; letter-spacing: .4em; white-space: nowrap;
  color: var(--bone); opacity: .42; transition: opacity 2s var(--ease), color 2s var(--ease);
}
[data-state="unlocked"] .coords { color: var(--brass); opacity: .72; }

@media (max-width: 560px) {
  .countdown { grid-template-columns: repeat(4, 1fr); gap: 14px; width: 100%; max-width: 360px; }
  .countdown small { letter-spacing: .3em; font-size: 8px; }
  .hunt { letter-spacing: .36em; }
}
@media (prefers-reduced-motion: reduce) {
  .ring img { animation: none; }
  * { transition-duration: .01ms !important; }
}
