:root {
  --bg: #ffffff;
  --ink: #1d1d1f;
  --ink-dim: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --blue-dark: #0058b3;

  /* ---- Background animation parameters -------------------------------
     Every number the ambient background animation depends on lives here so
     it can be retuned in one place. These mirror the control names in
     ../debug-tuning.html — values landed on in that tool paste straight in. */

  /* Dot grid */
  --dot-rgb: 29, 29, 31;
  --dot-pan: 8s;
  --dot-size: 1.7px;
  --dot-gap: 34px;
  --dot-alpha: 0.14;

  /* Edge-fade mask on the dot grid (static) */
  --mask-rx: 96%;
  --mask-ry: 70%;
  --mask-cx: 50%;
  --mask-cy: 28%;
  --mask-solid: 30%;
}

@media (max-width: 700px) {
  :root {
    --dot-gap: 30px;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* Drifting dot grid — an "engineering graph paper" texture.
   .bg-grid is a fixed, viewport-sized CLIPPING wrapper (overflow:hidden) that
   also carries the static edge fade. It never animates.
   .bg-grid::before is the oversized tiled layer: the dot pattern is a tiling
   background (background-size = one cell), and panning is done ONLY with
   transform, never background-position — background-position repaints the whole
   layer every frame, transform is compositor-only and effectively free.
   The pan distance equals exactly one cell (--dot-gap) so the loop is seamless,
   and the timing function must be linear or the wrap would visibly stutter. */
.bg-grid {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  /* Fade the texture out away from the headline so it never competes with copy.
     Lives on the *static* parent, so the fade stays anchored to the viewport
     while the dots drift underneath it. */
  -webkit-mask-image: radial-gradient(
    ellipse var(--mask-rx) var(--mask-ry) at var(--mask-cx) var(--mask-cy),
    #000 var(--mask-solid),
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse var(--mask-rx) var(--mask-ry) at var(--mask-cx) var(--mask-cy),
    #000 var(--mask-solid),
    transparent 100%
  );
}

.bg-grid::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: radial-gradient(
    circle at var(--dot-size) var(--dot-size),
    rgba(var(--dot-rgb), var(--dot-alpha)) var(--dot-size),
    transparent 0
  );
  background-size: var(--dot-gap) var(--dot-gap);
  /* No will-change: an infinite transform animation is promoted to its own
     compositor layer on its own — the hint would only add cost. */
  animation: grid-pan var(--dot-pan) linear infinite;
}

@keyframes grid-pan {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(var(--dot-gap), var(--dot-gap), 0);
  }
}

/* nav */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.topbar.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04);
}

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px clamp(20px, 4vw, 32px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  background: var(--ink);
  display: inline-block;
}

/* hero */
.hero {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(72px, 14vw, 160px) 24px clamp(56px, 9vw, 96px);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: fade-up 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.15s; }

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-dim);
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* footer */
.footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  text-align: center;
  padding: 28px 20px;
  font-size: 0.8rem;
  color: var(--ink-dim);
  border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }

  /* Same pattern for the dot grid: hidden outright, and the pan killed
     explicitly so nothing is left running behind a display:none subtree. */
  .bg-grid {
    display: none;
  }

  .bg-grid::before {
    animation: none;
    transform: none;
  }
}
