/* ==========================================================================
   BASE / RESET / GLOBAL ELEMENTS
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

@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;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: var(--lh-normal);
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--dur-base) var(--ease-out-soft), color var(--dur-base) var(--ease-out-soft);
}

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

/* Defensive: long unbroken strings (emails, urls) must never force
   horizontal overflow on narrow viewports. */
h1, h2, h3, h4, p, a, span, .footer-email {
  overflow-wrap: break-word;
}

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

ul,
ol {
  list-style: none;
}

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

button {
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* Focus ring — accessible & visible, but only for keyboard users */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: 600; }

p {
  color: var(--text-secondary);
  text-wrap: pretty;
}

.lead {
  font-size: var(--fs-body-lg);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Highlighter-mark style accent, not a soft AI gradient — a hard-edged
   marker swipe behind the text, like it was underlined with a highlighter. */
.gradient-text {
  position: relative;
  color: var(--text-primary);
  white-space: nowrap;
}
.gradient-text::before {
  content: "";
  position: absolute;
  left: -0.06em;
  right: -0.06em;
  bottom: 0.04em;
  height: 0.34em;
  background: var(--accent);
  z-index: -1;
  transform: skewX(-8deg) scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--ease-out-expo);
}
[data-reveal].is-visible .gradient-text::before,
.gradient-text.is-marked::before {
  transform: skewX(-8deg) scaleX(1);
}
.hero-title .gradient-text::before { transform: skewX(-8deg) scaleX(1); }

/* Print-misregistration "glitch" text — used sparingly for big hero/CTA type */
.glitch-text {
  position: relative;
  color: var(--text-primary);
  display: inline-block;
}
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  opacity: 0.75;
  mix-blend-mode: screen;
}
[data-theme="light"] .glitch-text::before,
[data-theme="light"] .glitch-text::after { mix-blend-mode: multiply; opacity: 0.55; }
.glitch-text::before { color: var(--accent); transform: translate(3px, 0); }
.glitch-text::after { color: var(--accent-2); transform: translate(-3px, 0); }

.mono {
  font-family: var(--font-mono);
}

.text-muted { color: var(--text-secondary); }
.text-faint { color: var(--text-tertiary); }
.text-center { text-align: center; }

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

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

.section-header {
  max-width: 640px;
  margin-bottom: var(--space-2xl);
}

.section-header.center {
  margin-inline: auto;
  text-align: center;
}

.section-header h2 {
  margin-top: var(--space-sm);
}

.section-header p {
  margin-top: var(--space-sm);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

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

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-md);
  z-index: 9999;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: var(--space-2xs) var(--space-md);
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease-out-soft);
}
.skip-link:focus {
  top: var(--space-md);
}

/* divider */
.divider {
  height: 1px;
  width: 100%;
  background: var(--border);
  border: none;
}

/* noise texture overlay for premium depth */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--noise-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
