/* ==========================================================================
   Base: reset, typography, utilities, reveal + reduced motion
   ========================================================================== */
*, *::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) + 12px);
  background: var(--obsidian);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(33, 19, 51, 0.9), transparent 60%),
    var(--obsidian);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip; /* clip: no side scroll on iOS and keeps position: sticky working */
}

/* Fine film grain over everything — gives the obsidian surfaces some tooth. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ol, ul, figure, fieldset { margin: 0; }
ol[role="list"], ul[role="list"] { list-style: none; padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
p { text-wrap: pretty; }

::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 3px;
  border-radius: 6px;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--electric);
  color: #fff;
  border-radius: var(--radius-sm);
  transition: top var(--t-fast);
}
.skip-link:focus { top: 1rem; }

/* Typography helpers */
.label {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amethyst);
  margin-bottom: 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}
.label::before {
  content: "";
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--amethyst));
}

.h2 { font-size: var(--fs-h2); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 34em;
}

.text-shine {
  background: linear-gradient(100deg, var(--lavender) 0%, #fff 30%, var(--amethyst) 55%, var(--electric) 80%, var(--lavender) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 9s var(--ease-in-out) infinite alternate;
}
@keyframes shine { to { background-position: 100% 0; } }

/* Reveal on scroll (JS adds .is-visible; without JS everything is visible) */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  filter: blur(6px);
  transition:
    opacity var(--t-slow) var(--ease-out) var(--d, 0s),
    transform var(--t-slow) var(--ease-out) var(--d, 0s),
    filter var(--t-slow) var(--ease-out) var(--d, 0s);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Phones and tablets (iPhone Safari first): light effects only, so scrolling stays smooth.
   Blur filters, full-screen fixed grain and backdrop blur on many cards make iOS repaint
   layers mid-scroll — that shows up as blocks flickering and sliding over each other. */
@media (max-width: 760px), (hover: none) {
  .js [data-reveal] {
    filter: none;
    transform: translate3d(0, 14px, 0);
    transition-property: opacity, transform;
    transition-duration: 0.6s;
  }
  body::after { display: none; }
  /* "html" prefix: these rules sit in base.css but must win over later files */
  html .glass, html .station, html .btn--ghost, html .eyebrow {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
}
