/* Design tokens. Surfaces are translucent "glass" so the waves show through softly. */
:root {
  --bg: #000;
  --glass: rgba(255,255,255,.035);
  --glass-hover: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.09);
  --line-hover: rgba(255,255,255,.18);
  --text: #fafafa;
  --muted: #a3a3a3;
  --dim: #737373;
  --radius: 14px;
  --gutter: clamp(20px, 4vw, 72px);   /* side padding for header + footer, grows with the screen */
  --font: "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; }
html { color-scheme: dark; }
body {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: #fff; color: #000; }

/* drifting dot grid, layered over the wave shader */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.2px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, #000 15%, transparent 70%);
          mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, #000 15%, transparent 70%);
  animation: grid-pan 8s linear infinite;
  animation-delay: var(--grid-delay, 0s); /* set from the real clock in index.html */
}
@keyframes grid-pan { to { background-position: 32px 32px; } }
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

.nav { width: 100%; padding: clamp(18px, 2.2vw, 40px) var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: clamp(8px, .6vw, 12px); font-weight: 600; font-size: clamp(15px, 1vw, 19px); letter-spacing: -.01em; }
.brand svg { width: clamp(18px, 1.3vw, 26px); height: clamp(18px, 1.3vw, 26px); }

main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; width: 100%; padding: 0 16px; }
.hero { text-align: center; padding: 4vh 0 clamp(48px, 12vh, 140px); width: 100%; max-width: 860px; }
h1 { font-size: clamp(34px, min(8.5vw, 12vh), 96px); font-weight: 700; letter-spacing: -.055em; line-height: 1; }
h1 .hang { margin-right: -.26em; }
.lead { color: var(--muted); max-width: 400px; margin: clamp(14px, 2.4vh, 20px) auto 0; line-height: 1.65; font-size: clamp(14px, 1.1vw, 16px); text-wrap: balance; }

.glass { background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

.loader { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 480px; margin: clamp(24px, 5vh, 40px) auto 0;
  padding: 14px 18px; border-radius: var(--radius); color: inherit; font: inherit; cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s; }
.loader:hover { background: var(--glass-hover); border-color: var(--line-hover); }
.loader:active { transform: scale(.99); }
.loader:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.loader.copied { border-color: rgba(255,255,255,.4); }
.loader code { min-width: 0; font-family: var(--mono); font-size: 13px; color: #d4d4d4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loader code .s { color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; min-width: 150px; padding: 0 20px; border-radius: 12px;
  font: 600 14px var(--font); letter-spacing: -.005em; color: var(--text); cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s; }
.btn:hover { background: var(--glass-hover); border-color: var(--line-hover); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--text); border: 1px solid var(--text); color: var(--bg); }
.btn.primary:hover { background: #e5e5e5; border-color: #e5e5e5; }
.actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
/* "By getting a key you agree..." line under the buttons */
.agree { max-width: 420px; margin: 18px auto 0; font-size: 12px; line-height: 1.6; color: var(--dim); text-wrap: balance; }
.agree a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 3px; transition: color .15s; }
.agree a:hover { color: var(--text); }

/* legal pages */
.legal-main { padding: 16px 16px 64px; }
.legal { width: 100%; max-width: 720px; padding: 48px 52px; border-radius: 20px; color: var(--muted); font-size: 14.5px; line-height: 1.75; }
.legal-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); }
.legal h1 { font-size: clamp(32px, 6vw, 44px); letter-spacing: -.04em; color: var(--text); margin: 10px 0 6px; }
.legal-date { font-size: 13px; color: var(--dim); padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.legal h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--text); margin: 32px 0 8px; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 20px; display: grid; gap: 8px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-hover); text-underline-offset: 3px; }
@media (max-width: 600px) { .legal { padding: 32px 22px; } }

/* footer: brand + links on top, a hairline, then copyright + disclaimer */
footer { width: 100%; padding: 0 var(--gutter) clamp(22px, 2.2vw, 40px); font-size: clamp(12px, .75vw, 14px); color: var(--dim); }
.foot-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px;
  padding: clamp(18px, 1.6vw, 28px) 0 clamp(14px, 1.2vw, 22px); border-top: 1px solid var(--line); }
.foot-brand { font-size: clamp(14px, .9vw, 17px); color: var(--text); gap: 8px; }
.foot-brand svg { width: clamp(16px, 1vw, 20px); height: clamp(16px, 1vw, 20px); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px clamp(18px, 1.8vw, 32px); font-size: clamp(13px, .8vw, 15px); color: var(--muted); }
.foot-links a { transition: color .15s; }
.foot-links a:hover { color: var(--text); }
.foot-bottom { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 32px; flex-wrap: wrap; line-height: 1.55; }
.foot-bottom p { max-width: 640px; text-align: right; text-wrap: balance; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; transition: .2s; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* tablets and below: footer text stacks and left-aligns instead of wrapping unevenly */
@media (max-width: 900px) {
  .foot-bottom { flex-direction: column; }
  .foot-bottom p { text-align: left; max-width: none; }
}
/* narrow screens: the text shrinks just enough to stay on one line */
@media (max-width: 600px) {
  .loader { margin-top: 30px; padding: 14px 10px; }
  .loader code { font-size: min(13.5px, calc((100vw - 58px) / 28.6)); }
}
/* phones */
@media (max-width: 480px) {
  .actions { max-width: 360px; margin-left: auto; margin-right: auto; }
  .actions .btn { min-width: 0; flex: 1; }
  /* a bigger, two-line title so it holds the screen */
  h1 { font-size: clamp(40px, 13.5vw, 60px); line-height: .98; text-wrap: balance; }
  .lead { margin-top: 18px; font-size: 15px; max-width: 320px; }
  .actions { margin-top: 12px; }
  .actions .btn { height: 48px; border-radius: 14px; }
  .agree { margin-top: 20px; max-width: 300px; }
  .foot-top { flex-direction: column; align-items: flex-start; }
}
/* very small phones: stack the two buttons so labels never wrap */
@media (max-width: 359px) {
  .actions { flex-direction: column; }
  .actions .btn { flex: none; width: 100%; }
}
/* big monitors: let the content breathe a little more */
@media (min-width: 1800px) {
  .lead { max-width: 460px; }
  .loader { max-width: 540px; }
  .btn { height: 48px; min-width: 170px; font-size: 15px; }
}
@media (min-width: 2200px) {
  .hero { max-width: 1200px; }
  h1 { font-size: clamp(34px, min(5vw, 12vh), 128px); }
  .lead { max-width: 560px; font-size: 18px; }
  .loader { max-width: 640px; padding: 18px 22px; }
  .loader code { font-size: 15px; }
  .btn { height: 54px; min-width: 190px; font-size: 16px; border-radius: 14px; }
  .agree { max-width: 520px; font-size: 14px; }
}

/* ---------- Intro: logo draws itself, fills, fades out, then the hero rises in ---------- */
#intro { display: none; }
html.intro #intro {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 100;
  background: #000; transition: opacity .6s ease, visibility 0s linear .6s;
}
#intro svg { width: 84px; height: 84px; overflow: visible; transition: transform .6s cubic-bezier(.5,0,.75,0); }
#intro .draw {
  fill: none; stroke: #fff; stroke-width: .45; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: intro-draw 1.1s cubic-bezier(.65,0,.35,1) forwards, intro-fade .35s ease 1.15s forwards;
}
#intro g .draw:nth-child(1) { animation-delay: .2s, 1.15s; }
#intro g .draw:nth-child(2) { animation-delay: .3s, 1.15s; }
#intro .fill { fill: #fff; opacity: 0; animation: intro-fill .45s ease 1s forwards; }
html.intro #intro.out { opacity: 0; visibility: hidden; }
html.intro #intro.out svg { transform: scale(1.12); }
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
@keyframes intro-fade { to { opacity: 0; } }
@keyframes intro-fill { to { opacity: 1; } }

/* hero pieces wait hidden, then rise in one after another */
html.intro .hero > * { opacity: 0; }
html.intro.reveal .hero > * {
  animation: hero-rise .9s cubic-bezier(.16,1,.3,1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.hero > :nth-child(1) { --i: 0; }
.hero > :nth-child(2) { --i: 1; }
.hero > :nth-child(3) { --i: 2; }
.hero > :nth-child(4) { --i: 3; }
.hero > :nth-child(5) { --i: 4; }
.hero > :nth-child(6) { --i: 5; }
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(22px) scale(.98); filter: blur(10px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
