/* ============================================================
   GenesisChain — Base: reset, aurora, type, layout
   ============================================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scrollbar-color: var(--border-3) transparent;
}

body {
  font-family: var(--font-body);
  font-size: var(--t-md);
  line-height: 1.65;
  color: var(--text-2);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ============================================================
   Aurora — soft tinted light wash on the paper surface.
   Very low-contrast on the light theme: it gives the page a gentle
   blue/warm depth without ever competing with text.
   ============================================================ */
.aurora {
  position: fixed;
  inset: 0;
  z-index: var(--z-aurora);
  pointer-events: none;
  overflow: hidden;
}
.aurora::before,
.aurora::after,
.aurora > span {
  content: "";
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: multiply;   /* darken-toward-tint on a light bg */
  will-change: transform;
  filter: blur(90px);
}
.aurora::before {
  width: 55vmax; height: 55vmax;
  left: -15vmax; top: -20vmax;
  background: radial-gradient(circle, rgba(39, 84, 186, 0.10) 0%, transparent 70%);
  animation: aurora-a 28s ease-in-out infinite alternate;
}
.aurora::after {
  width: 45vmax; height: 45vmax;
  right: -10vmax; top: 0;
  background: radial-gradient(circle, rgba(0, 174, 230, 0.07) 0%, transparent 70%);
  animation: aurora-b 36s ease-in-out infinite alternate;
}
.aurora > span {
  width: 50vmax; height: 50vmax;
  left: 20%; bottom: -20vmax;
  /* a faint warm note, balancing the blues so the paper reads "warm-blue" */
  background: radial-gradient(circle, rgba(196, 158, 110, 0.10) 0%, transparent 70%);
  animation: aurora-c 42s ease-in-out infinite alternate;
}

@keyframes aurora-a { to { transform: translate3d(12vmax, 14vmax, 0) scale(1.1); } }
@keyframes aurora-b { to { transform: translate3d(-14vmax, 12vmax, 0) scale(1.08); } }
@keyframes aurora-c { to { transform: translate3d(-10vmax, -12vmax, 0) scale(1.15); } }

/* Light veil — lifts the very top/bottom toward the paper base so the
   aurora never darkens content edges. */
.aurora-veil {
  position: fixed; inset: 0;
  z-index: calc(var(--z-aurora) + 0);
  pointer-events: none;
  background: linear-gradient(180deg,
    oklch(0.974 0.008 255 / 0.55) 0%,
    oklch(0.974 0.008 255 / 0.15) 35%,
    oklch(0.974 0.008 255 / 0.55) 100%
  );
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
  font-weight: 600;
}
h1 { font-size: var(--t-3xl); letter-spacing: -0.04em; }
h2 { font-size: var(--t-2xl); letter-spacing: -0.03em; }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }

p { text-wrap: pretty; line-height: 1.7; }
a { color: inherit; text-decoration: none; }

.mono { font-family: var(--font-mono); }
.label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ============================================================
   Layout
   ============================================================ */
.wrap {
  width: min(100% - 2.5rem, var(--maxw));
  margin-inline: auto;
  position: relative;
  z-index: var(--z-base);
}
.section {
  padding-block: clamp(4rem, 9vw, 8rem);
  position: relative;
  z-index: var(--z-base);
}

/* ============================================================
   Reveal animations — content visible by default, JS adds lift
   ============================================================ */
.reveal { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity var(--t-slow) var(--ease-out),
      transform var(--t-slow) var(--ease-out);
  }
  .js .reveal.in {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   Utility
   ============================================================ */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: var(--z-toast);
  background: var(--card); color: var(--text);
  padding: 0.6rem 1rem; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

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

::selection {
  background: oklch(0.58 0.142 240 / 0.20);
  color: var(--text);
}
