/* ==================================================================
   BASE — reset, typography, background, utilities, scroll reveal
   ================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 28px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure,
blockquote {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

strong {
  font-weight: 600;
  color: var(--text);
}

::selection {
  background: rgba(129, 140, 248, 0.32);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--cyan-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-0);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border: 2px solid var(--bg-0);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

[hidden] {
  display: none !important;
}

/* ---------- Ambient background ---------- */

.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% -20%, #11152a 0%, transparent 55%),
    var(--bg-0);
}

.site-bg__aura {
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
  filter: blur(30px);
}

.site-bg__aura--indigo {
  top: -26vw;
  left: -12vw;
  width: 62vw;
  height: 62vw;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.24) 0%,
    rgba(99, 102, 241, 0.08) 38%,
    transparent 68%
  );
}

.site-bg__aura--cyan {
  top: 6vh;
  right: -24vw;
  width: 56vw;
  height: 56vw;
  background: radial-gradient(
    circle,
    rgba(6, 182, 212, 0.14) 0%,
    rgba(6, 182, 212, 0.045) 40%,
    transparent 68%
  );
}

.site-bg__aura--violet {
  bottom: -34vw;
  left: 22vw;
  width: 58vw;
  height: 58vw;
  background: radial-gradient(
    circle,
    rgba(124, 58, 237, 0.13) 0%,
    transparent 66%
  );
}

.site-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: radial-gradient(
    ellipse 85% 65% at 50% 0%,
    #000 0%,
    rgba(0, 0, 0, 0.7) 34%,
    transparent 76%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 85% 65% at 50% 0%,
    #000 0%,
    rgba(0, 0, 0, 0.7) 34%,
    transparent 76%
  );
  opacity: 0.65;
}

.site-bg__noise {
  position: absolute;
  inset: 0;
  opacity: 0.038;
  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='.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

.site-bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 90% at 50% 45%,
    transparent 55%,
    rgba(3, 4, 8, 0.55) 100%
  );
}

/* Keep the page content above the fixed backdrop. */
.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ---------- Layout primitives ---------- */

.container {
  width: min(var(--container-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.container--wide {
  width: min(var(--container-wide), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(56px, 6vw, 88px);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.72fr);
  align-items: end;
  gap: clamp(24px, 5vw, 72px);
  margin-bottom: clamp(36px, 4.4vw, 56px);
}

.section-head__lead {
  max-width: 46ch;
  padding-bottom: 6px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.05vw, 1.05rem);
  line-height: 1.75;
  text-wrap: pretty;
}

.section-head__lead strong {
  color: var(--text-soft);
  font-weight: 500;
}

.section-head__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 6px;
}

.section-head__meta .section-head__lead {
  padding-bottom: 0;
}

/* ---------- Type utilities ---------- */

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-soft {
  color: var(--text-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Scroll reveal ---------- */

html.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity 0.85s var(--ease-out),
    transform 0.85s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}

html.js [data-reveal="fade"] {
  transform: none;
}

html.js [data-reveal="left"] {
  transform: translate3d(-24px, 0, 0);
}

html.js [data-reveal="right"] {
  transform: translate3d(24px, 0, 0);
}

html.js [data-reveal].is-inview {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  html.js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
