/* ============================================================
   base.css — design tokens, reset, typography, layout primitives
   Change the ~20 values in :root and the whole site reskins.
   ============================================================ */

:root {
  /* ---- surfaces ---- */
  --bg:        #0A0C0F;
  --bg-elev:   #12151A;
  --bg-elev-2: #171B21;
  --line:      #222831;
  --line-soft: #1A1E25;

  /* ---- text ---- */
  --text:   #EDEFF2;
  --text-2: #9BA4B0;
  --text-3: #6B7480;

  /* ---- category accents ----
     Muted jewel tones. Saturated enough to catch the eye,
     luminance held down so nothing reads as neon.
     All six pass WCAG AA (>=4.5:1) on both surfaces. */
  --c-blog:    #E0A33C;   /* amber  */
  --c-exp:     #3FA8A0;   /* teal   */
  --c-conn:    #7B79EE;   /* indigo */
  --c-contact: #E0685E;   /* coral  */

  /* Each accent is used at exactly three strengths:
     solid (icon + border) · 14% (glow) · 40% (focus ring). */
  --glow:  0.14;
  --ring:  0.40;

  /* ---- type ----
     No web fonts, no CDN request. Resolves to genuine SF Pro on
     Apple devices, Segoe UI on Windows, Roboto on Android. */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
             "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- geometry ---- */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --gutter: clamp(20px, 5vw, 48px);
  --maxw: 1080px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------------- reset ---------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
}

img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

/* ---------------- typography ----------------
   Apple's rule: tracking tightens as size grows. */

.t-display {
  font-size: clamp(2.6rem, 7.2vw, 4.4rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.032em;
  text-wrap: balance;
}

.t-h1 {
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.026em;
  text-wrap: balance;
}

.t-h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.018em;
}

.t-h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.012em;
}

.t-body  { font-size: 1rem;      line-height: 1.6;  color: var(--text-2); }
.t-small { font-size: 0.875rem;  line-height: 1.55; color: var(--text-2); }

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

.t-lede {
  font-size: clamp(1.0625rem, 1.9vw, 1.1875rem);
  line-height: 1.55;
  letter-spacing: -0.014em;
  color: var(--text-2);
  max-width: 62ch;
}

/* ---------------- layout primitives ---------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.stack > * + * { margin-top: var(--stack-gap, 16px); }

/* Comfortable reading measure. Used instead of inline styles so the
   Content-Security-Policy can stay free of 'unsafe-inline'. */
.measure { max-width: 62ch; }

/* The animated background canvas sits behind everything. */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Every real page region sits above it. */
.layer { position: relative; z-index: 1; }

/* ---------------- links & focus ---------------- */

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

a:not(.tile):not(.card):not(.brand) {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 160ms var(--ease);
}
a:not(.tile):not(.card):not(.brand):hover {
  text-decoration-color: currentColor;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
}
.skip:focus { left: var(--gutter); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------- motion preference ---------------- */

@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;
  }
}
