/* ============================================================
   Forgedown — design system: tokens + primitives
   NetSmiths studio chrome: obsidian ground, steel type, one ember accent.
   ============================================================ */

/* --- Self-hosted Geist (OFL, see fonts/Geist-OFL.txt) -------
   Self-hosted on purpose: this site claims it tracks nothing, so it
   must not hand every visitor's IP to a font CDN. No third-party
   request is made from any page. */
@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-Variable.ttf') format('truetype-variations');
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/GeistMono-Variable.ttf') format('truetype-variations');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens: dark (default) --------------------------------- */
:root {
  color-scheme: dark;

  --bg: #0C0D10;
  --panel: #14161B;
  --panel-2: #2D3138;

  --text: #EDF1F7;
  --muted: #A9AFBB;
  --faint: #7E8694;

  --ember: #FF8A3D;
  --hot: #FF5E2C;
  --ember-grad: linear-gradient(135deg, #FFE2A8, #FF9E48 50%, #FF5E2C);
  --ember-ink: #1A0E06;

  --glass: rgba(255, 255, 255, .06);
  --glass-2: rgba(255, 255, 255, .10);
  --glass-3: rgba(255, 255, 255, .14);
  --border: rgba(255, 255, 255, .12);
  --border-2: rgba(255, 255, 255, .22);
  --hi: rgba(255, 255, 255, .14);
  --code-bg: rgba(0, 0, 0, .35);

  --shadow-1: 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-2: 0 30px 80px rgba(0, 0, 0, .5);
  --glow: 0 0 24px rgba(255, 94, 44, .4);

  --r-card: 24px;
  --r-card-lg: 28px;
  --r-btn: 14px;
  --r-pill: 999px;
  --r-chip: 10px;

  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;  --s-5: 24px;
  --s-6: 32px; --s-7: 48px;  --s-8: 64px;  --s-9: 80px;  --s-10: 96px;

  --blur-1: 8px; --blur-2: 18px; --blur-3: 40px;
  --maxw: 1200px;

  --sans: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Dark only, deliberately. The app screenshots and the raw-vs-rendered
   panel are dark-pinned, and a theme switch that only appeared on the
   home page left visitors stranded in light mode on the sub-pages.
   One ground, everywhere. */

/* --- Base ---------------------------------------------------- */
* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  transition: background .3s, color .3s;
}

h1, h2, h3 { letter-spacing: -.02em; font-weight: 700; margin: 0; }
p { margin: 0; }

a { color: var(--hot); text-decoration: none; }
a:hover { color: var(--ember); }

img { max-width: 100%; height: auto; display: block; }

::selection { background: rgba(255, 138, 61, .32); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 20px;
  background: var(--panel);
  color: var(--text);
  border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

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

/* --- Type scale ---------------------------------------------- */
.display { font-size: clamp(42px, 6.5vw, 76px); line-height: 1.02; letter-spacing: -.03em; text-wrap: balance; }
.h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.08; }
.h2 { font-size: clamp(30px, 4vw, 38px); line-height: 1.15; }
.h3 { font-size: clamp(22px, 3vw, 26px); line-height: 1.25; }

.body-lg { font-size: 19px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.body { font-size: 16px; line-height: 1.65; color: var(--muted); text-wrap: pretty; }
.small { font-size: 14px; line-height: 1.6; color: var(--muted); }
.faint { color: var(--faint); }

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ember);
}

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

/* --- Aurora: one deep ember blob, plus grain. Workshop, not disco. --- */
.aurora {
  position: absolute;
  inset: 0;
  overflow: clip;
  pointer-events: none;
  z-index: 0;
}
.aurora__pop {
  position: absolute;
  left: 50%;
  top: 480px;
  width: min(1200px, 120vw);
  height: 760px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 94, 44, .26), rgba(255, 138, 61, .09) 55%, transparent 75%);
  filter: blur(var(--blur-3));
  animation: emberPulse 9s ease-in-out infinite;
}
.aurora__grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(127, 127, 127, .05) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: .4;
}

@keyframes emberPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: .8; }
}

/* --- Glass surface ------------------------------------------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  backdrop-filter: blur(var(--blur-2)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-2)) saturate(150%);
  box-shadow: inset 0 1px 0 var(--hi);
}

/* --- Buttons -------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 12px 24px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, border-color .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--ember-grad);
  color: var(--ember-ink);
  box-shadow: var(--glow);
}
.btn-primary:hover { color: var(--ember-ink); box-shadow: 0 0 32px rgba(255, 94, 44, .55); }

.btn-secondary {
  background: var(--glass);
  border-color: var(--border-2);
  color: var(--text);
  backdrop-filter: blur(var(--blur-1));
  -webkit-backdrop-filter: blur(var(--blur-1));
}
.btn-secondary:hover { border-color: var(--ember); color: var(--ember); }

.btn-sm { padding: 9px 18px; font-size: 14px; }

/* --- App Store badges ---------------------------------------- */
.badges {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: 11px 22px;
  border-radius: var(--r-btn);
  background: var(--glass);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(var(--blur-1));
  -webkit-backdrop-filter: blur(var(--blur-1));
  box-shadow: inset 0 1px 0 var(--hi);
  color: var(--text);
  transition: border-color .2s, transform .15s;
}
.badge:hover { border-color: var(--ember); color: var(--text); transform: translateY(-1px); }
.badge svg { width: 24px; height: 24px; flex-shrink: 0; fill: currentColor; }
.badge__txt { text-align: left; line-height: 1.15; }
.badge__sm { display: block; font-size: 11px; letter-spacing: .04em; color: var(--muted); }
.badge__lg { display: block; font-size: 17px; font-weight: 600; }

.badge-note {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  text-align: center;
  margin-top: var(--s-4);
}

/* --- Chips ---------------------------------------------------- */
.chips {
  display: flex;
  justify-content: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px 16px;
  border-radius: var(--r-chip);
  background: var(--glass);
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--ember);
  box-shadow: 0 0 8px rgba(255, 138, 61, .8);
  flex-shrink: 0;
}

/* --- FAQ disclosure ------------------------------------------ */
.faq { display: flex; flex-direction: column; gap: var(--s-3); }

.faq-item { border-radius: var(--r-btn); padding: 0 20px; }
.faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 16px 0;
  font-size: 16px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item .plus {
  color: var(--ember);
  font-size: 19px;
  font-weight: 400;
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item[open] .plus { transform: rotate(45deg); }
.faq-item__body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 16px;
  text-wrap: pretty;
}

/* --- Wordmark + studio seal ---------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -.01em;
}
.wordmark:hover { color: var(--text); }
.wordmark svg { width: 26px; height: 26px; flex-shrink: 0; }

.forged-seal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 7px 16px;
  transition: color .2s, border-color .2s;
}
.forged-seal strong { color: var(--text); font-weight: 600; }
.forged-seal:hover { color: var(--ember); border-color: var(--ember); }
.forged-seal:hover strong { color: var(--ember); }

/* --- Motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}
