@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #020f3c;
  --mint: #e0f2f1;
  --mint-rgb: 224, 242, 241;
  --accent: #7ab8ff;
  --g: 56px;               /* grid cell; main.js reads this */
  --mx: -999px;
  --my: -999px;
  --pad: clamp(20px, 3vw, 40px);
  --sans: "Montserrat", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (max-width: 640px) {
  :root { --g: 40px; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }

html {
  height: 100%;
  background: #010722;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow-x: hidden;
  font-family: var(--sans);
  color: var(--mint);
  background:
    radial-gradient(120% 70% at 50% 118%, rgba(58, 120, 255, .34) 0%, rgba(58, 120, 255, 0) 62%),
    radial-gradient(110% 100% at 50% 38%, #04164f 0%, #020d37 55%, #010722 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- background layers ---------- */

.grid, .stage, .grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* "The rules": a fine grid whose lines pass through the page centre. */
.grid {
  background-image:
    linear-gradient(to right, rgba(var(--mint-rgb), .06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--mint-rgb), .06) 1px, transparent 1px);
  background-size: var(--g) var(--g);
  background-position: calc(50% + var(--g) / 2) calc(50% + var(--g) / 2);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 25%, transparent 100%);
          mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 25%, transparent 100%);
}

/* Same grid, brighter, only visible in a pool of light around the pointer. */
.grid--lit {
  background-image:
    linear-gradient(to right, rgba(122, 184, 255, .32) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(122, 184, 255, .32) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(circle 230px at var(--mx) var(--my), #000 0%, transparent 100%);
          mask-image: radial-gradient(circle 230px at var(--mx) var(--my), #000 0%, transparent 100%);
  opacity: 0;
  transition: opacity .6s ease;
}
.has-pointer .grid--lit { opacity: 1; }

.grain {
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%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");
}

/* ---------- top and bottom bars ---------- */

.bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: var(--pad);
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}
.bar--foot {
  font: 400 .72rem/1.4 var(--mono);
  letter-spacing: .04em;
  color: rgba(var(--mint-rgb), .5);
  padding-bottom: max(var(--pad), env(safe-area-inset-bottom));
}
.foot-links { display: flex; gap: .5rem 1.5rem; flex-wrap: wrap; }

.brand {
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--mint);
  text-decoration: none;
}
.brand b { font-weight: 800; }

.link {
  font: 400 .72rem/1.4 var(--mono);
  letter-spacing: .04em;
  color: rgba(var(--mint-rgb), .62);
  text-decoration: none;
  transition: color .25s ease;
}
header .link { text-transform: uppercase; letter-spacing: .12em; }
.link:hover { color: var(--mint); }

a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}

/* ---------- hero ---------- */

main {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem 1.25rem 3rem;
}
/* Sits a little above centre and leaves room below for the line. */
.hero { margin-bottom: calc(var(--g) * 2); }

.wordmark {
  font-size: clamp(3.1rem, 16.5vw, 11rem);
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
}
.w-type { font-weight: 800; }
/* When the canvas draws the wordmark as dots, the real text stays for
   layout, search engines and screen readers but is not painted. */
.is-dots .wordmark { color: transparent; }
.is-dots .wordmark::selection,
.is-dots .wordmark ::selection { color: transparent; background: rgba(122, 184, 255, .25); }

/* fit-content so main.js can measure where the text really ends */
.tagline, .desc { width: fit-content; }
.tagline {
  margin: clamp(1rem, 2.4vw, 1.75rem) auto 0;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: .005em;
}

.desc {
  margin: .85rem auto 0;
  max-width: 30ch;
  font-size: clamp(.95rem, 1.15vw, 1.05rem);
  line-height: 1.6;
  color: rgba(var(--mint-rgb), .62);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-top: 1.9rem;
  padding: .55rem 1rem .55rem .9rem;
  font: 400 .76rem/1.3 var(--mono);
  letter-spacing: .02em;
  color: rgba(var(--mint-rgb), .85);
  border: 1px solid rgba(var(--mint-rgb), .14);
  border-radius: 999px;
  background: rgba(2, 13, 55, .55);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
/* The hidden sizer holds the pill at the width of the longest phrase. */
.status-text { display: grid; text-align: left; }
.status-text > * { grid-area: 1 / 1; white-space: nowrap; }
.sizer { visibility: hidden; }

.pulse {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(122, 184, 255, .6);
  animation: pulse 2.4s ease-out infinite;
}
.caret {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.18em;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}

/* ---------- motion ---------- */

.reveal { animation: reveal 1.3s cubic-bezier(.2, .7, .2, 1) both; }
.d1 { animation-delay: 1.2s; }
.d2 { animation-delay: 1.45s; }
.d3 { animation-delay: 1.75s; }
.bar { animation: fade 1.6s ease .3s both; }

@keyframes reveal {
  from { opacity: 0; filter: blur(14px); transform: translateY(10px); }
  to   { opacity: 1; filter: blur(0);    transform: none; }
}
@keyframes fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse {
  70%, 100% { box-shadow: 0 0 0 9px rgba(122, 184, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .bar, .pulse, .caret { animation: none; }
  .grid--lit { display: none; }
}
