/* ============================================================
   base.css — design tokens, reset, typography
   ============================================================ */

:root {
  /* Palette — light, warm, string-instrument gold accent */
  --bg:            #fbf9f5;
  --bg-alt:        #f4f1ea;
  --bg-elev:       #ffffff;
  --surface:       #f7f4ee;
  --border:        rgba(20, 22, 30, 0.10);
  --border-strong: rgba(20, 22, 30, 0.20);

  --text:          #1c1e26;
  --text-soft:     #4a4f5c;
  --text-dim:      #8a8f9c;

  --gold:          #d98a2b;
  --gold-2:        #f0a24a;
  --violet:        #6a5bd6;
  --cyan:          #2ba3c4;

  --accent:        var(--gold);
  --accent-ink:    #ffffff;

  --grad: linear-gradient(100deg, var(--gold) 0%, var(--gold-2) 45%, var(--violet) 100%);
  --glow-gold: radial-gradient(600px 320px at 50% 0%, rgba(240, 162, 74, 0.18), transparent 70%);

  /* Type */
  --font-sans:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing / radius */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 48px);

  --shadow:    0 10px 40px rgba(40, 30, 15, 0.10);
  --shadow-lg: 0 30px 80px rgba(40, 30, 15, 0.16);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* scroll-behavior is scoped to anchor jumps in snap.css, not global,
   so it never fights native trackpad / wheel momentum. */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Orange + blue cloud glows near the top, toning down toward the bottom. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(55% 42% at 20% 4%,  rgba(247, 130, 50, 0.72), transparent 64%),
    radial-gradient(50% 40% at 82% 0%,  rgba(250, 170, 70, 0.66), transparent 66%),
    radial-gradient(60% 48% at 52% 8%,  rgba(255, 150, 80, 0.40), transparent 64%),
    radial-gradient(65% 52% at 65% 15%, rgba(70, 130, 245, 0.58), transparent 66%),
    radial-gradient(58% 46% at 6% 20%,  rgba(120, 110, 245, 0.48), transparent 68%);
  /* Fade the whole cloud field out as it goes down. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,0.5) 40%, transparent 72%);
          mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,0.5) 40%, transparent 72%);
}

/* Keep real content above the cloud layer. */
main, footer { position: relative; z-index: 1; }
.edge-tree { z-index: 2; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;              /* Instrument Serif ships a single weight */
  line-height: 1.04;
  letter-spacing: -0.01em;
}

p { margin: 0; }

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

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

em { font-style: italic; }
strong, b { font-weight: 700; color: var(--text); }

::selection {
  background: rgba(217, 138, 43, 0.24);
  color: #1c1e26;
}

/* Gradient text helper */
.text-grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Focus visibility for keyboard users */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}
