/* ========================================================================
   Shared base + design tokens for Geoff Walker portfolio
   Loaded by index.html and appfactory.html
   ======================================================================== */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/Geist-Variable.woff2") format("woff2");
}

:root {
  --bg: #09090b;
  --bg-2: #0f172a;
  --rule: #1e293b;
  --fg: #f8fafc;
  --fg-dim: #94a3b8;
  --fg-dimmer: #64748b;
  --accent: #60a5fa;
  --gold: #fbbf24;
  --amber: #f59e0b;
  --green: #22c55e;
  --max: 1200px;
  --pad: clamp(20px, 4vw, 48px);
  --type-scale: 1;
  --anim-speed: 1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  font-size: calc(16px * var(--type-scale));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 500;
}
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.nav.scrolled { border-bottom-color: var(--rule); }
.nav-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 14px var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-mark {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px; letter-spacing: 0.04em; color: var(--fg);
}
.nav-mark span { color: var(--fg-dimmer); }
.nav-links { display: flex; gap: 28px; font-size: 13px; color: var(--fg-dim); }
.nav-links a:hover { color: var(--fg); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* Section primitives */
.section { padding: clamp(80px, 12vh, 140px) 0; border-top: 1px solid var(--rule); }
.section-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: clamp(40px, 6vh, 64px); flex-wrap: wrap;
}
.section-head .label::before {
  content: ""; display: inline-block;
  width: 28px; height: 1px; background: var(--accent);
  vertical-align: middle; margin-right: 12px;
}
.section-title {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 500; letter-spacing: -0.025em; line-height: 1.1;
}

/* Footer */
footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--rule);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px; color: var(--fg-dimmer); letter-spacing: 0.06em;
}
footer .container {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ===========================================================
   TWEAKS PANEL
   =========================================================== */
.tweaks {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  width: 280px;
  background: var(--bg-2); border: 1px solid var(--rule);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--fg);
  display: none;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.tweaks.open { display: block; }
.tweaks-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-dim);
}
.tweaks-close {
  background: transparent; border: none; color: var(--fg-dim); cursor: pointer;
  font-size: 16px; line-height: 1;
}
.tweaks-body { padding: 14px; display: flex; flex-direction: column; gap: 16px; }
.tweak-row { display: flex; flex-direction: column; gap: 6px; }
.tweak-row label { color: var(--fg-dim); letter-spacing: 0.1em; text-transform: uppercase; }
.tweak-row .row { display: flex; gap: 8px; align-items: center; }
.tweak-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.tweak-row .val { color: var(--accent); min-width: 38px; text-align: right; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; border: 1px solid var(--rule);
  transition: transform 150ms;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--fg); box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 3px var(--fg); }
