/* Reset, typography, shared components (wrap, section shell, title, buttons, icon, reveal). */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; color-scheme: dark; -webkit-text-size-adjust: 100%; overflow-x: clip; }
section[id] { scroll-margin-top: var(--nav-h); }
body {
  margin: 0;
  font: 400 var(--fs-16)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
b { font-weight: 600; color: var(--text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
/* Forced heading breaks are for wide layouts; on phones the text reflows (and balances) instead */
@media (max-width: 600px) { h2 br { display: none; } }
ul, ol { list-style: none; margin: 0; padding: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.muted, .sub { color: var(--muted); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

/* Section shell: three rhythm tiers via --sec-y / tight / alt background */
.sec { padding: var(--sec-y) 0; position: relative; }
.sec--tight { padding: var(--sec-y-tight) 0; }
.sec--alt { background: var(--bg-2); }
.sec--flush { padding-bottom: 0; }

.sub { margin-top: var(--sp-16); max-width: 40em; }
.sec-head { margin-bottom: var(--sp-48); }

.ic {
  width: 28px; height: 28px; flex: none;
  fill: none; stroke: var(--accent); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Buttons: .btn/.btn-p = primary (cyan to blue), .btn-g/.btn-ghost = outline */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font: 600 15px var(--sans);
  color: var(--on-accent); text-decoration: none; cursor: pointer;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(34, 211, 238, 0.55); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 14px; }
.btn-g, .btn-ghost {
  background: rgba(255, 255, 255, 0.03); color: var(--text);
  border-color: var(--line-2); box-shadow: none;
}
.btn-g:hover, .btn-ghost:hover { background: rgba(34, 211, 238, 0.06); border-color: var(--cyan); box-shadow: none; }

/* Decorative grid backdrop, faded toward the edges */
.gridbg {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}

/* Scroll reveal is progressive enhancement: html.reveal-on is set only when JS + IntersectionObserver
   exist and motion is allowed, so content is visible in every other case. */
.reveal-on [data-reveal]:not(.in), .reveal-on .reveal:not(.in) {
  opacity: 0; transform: translateY(18px);
  will-change: opacity, transform;
}
.reveal-on [data-reveal], .reveal-on .reveal {
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  transition-delay: calc(var(--i, 0) * 35ms);
}
.reveal-on [data-reveal].in, .reveal-on .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
