@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}
/* System mono scaled to Martian Mono's width at 112.5% (0.75em vs 0.6em per glyph),
   so the headline wraps the same way before the real font arrives: no layout shift. */
@font-face {
  font-family: "Martian Fallback";
  src: local("Menlo"), local("Courier New"), local("DejaVu Sans Mono"), local("Roboto Mono");
  size-adjust: 125%;
}

/* Radius rule: 12px on everything. */
:root {
  --bg: #fafafa;
  --text: #18181b;
  --muted: #52525b;
  --line: #dcdce1;
  --accent: #0066ff;
  --on-accent: #fafafa;
  --radius: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0c;
    --text: #f2f2f4;
    --muted: #a1a1aa;
    --line: #2a2a30;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; }
body {
  /* One screen: header, headline, footer. */
  display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 400 .95rem/1.6 "JetBrains Mono", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
p { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(100% - 2rem, 1320px); margin-inline: auto; }

/* Full-viewport bit field behind everything (fade toward the footer is done in main.js). */
.bits { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; text-decoration: none; font: inherit; font-weight: 500; cursor: pointer;
  padding: .8rem 1.3rem; border-radius: var(--radius);
  border: 1px solid transparent; background: none; color: inherit;
  transition: transform .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 85%, #0a0a0c); }
.btn-ghost { border-color: var(--line); background: var(--bg); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { padding: .45rem .9rem; font-size: .9rem; }
.btn-lg { padding: 1rem 1.75rem; font-size: 1.05rem; }

.top { display: flex; align-items: center; height: 72px; }
.brand img { display: block; height: 32px; width: auto; }

/* Poster headline anchored to the bottom of the screen */
.hero { display: grid; align-content: end; padding-block: 2rem clamp(1.5rem, 4vh, 3rem); }
.hero h1 {
  font-size: clamp(3.25rem, 10vw, 9.5rem); font-weight: 800;
  letter-spacing: -0.04em; line-height: 1;
}
/* Desktop: wide poster face. Too wide for phones, so they keep JetBrains Mono. */
@media (min-width: 768px) {
  .hero h1 { font-family: "Martian Mono", "Martian Fallback", monospace; font-stretch: 112.5%; font-size: clamp(3rem, 7.4vw, 7.25rem); letter-spacing: -0.05em; }
}
.ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: clamp(1.5rem, 4vh, 2.5rem); }
@media (max-width: 767px) {
  .ctas { display: grid; gap: .5rem; }
  .ctas .btn-lg { padding: .8rem 1.25rem; font-size: 1rem; }
}

/* Decode effect: the real letter keeps its slot (transparent), a bit sits on top until resolved.
   Monospace means the bit and the letter are the same width. */
.decode .w { white-space: nowrap; }
.decode .ch { position: relative; }
.decode .ch[data-g] { color: transparent; }
.decode .ch[data-g]::after {
  content: attr(data-g); content: attr(data-g) / ""; position: absolute; inset: 0;
  display: grid; place-items: center; color: var(--accent);
}

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .75rem 2rem;
  padding-block: 1.25rem; font-size: .8rem; line-height: 1.5;
}
.footer p:last-child { text-align: right; }
@media (max-width: 767px) { .footer p:last-child { text-align: left; } }

/* Call dialog */
.call {
  width: min(100% - 2rem, 420px); margin: auto; padding: 1.75rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 80px color-mix(in oklab, var(--text) 14%, transparent);
}
.call::backdrop { background: color-mix(in oklab, var(--bg) 55%, transparent); backdrop-filter: blur(6px); }
.call h2 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 1.25rem; }
.call-options { display: grid; gap: .5rem; margin-bottom: .75rem; }
.call form { display: flex; justify-content: end; }
.call form .btn { color: var(--muted); }

/* CTAs arrive after the headline has decoded. */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .ctas { animation: rise .8s var(--ease) .9s both; }
}
