/* Foundry shares the FullStacks front-door tokens so the two read as one
   family, and moves the accent from blue to amber so an operator always knows
   which surface they are on. */
:root {
  --bg: #0a0a0b;
  --bg-elev: #18181b;
  --bg-soft: #27272a;
  --ink: #fafafa;
  --muted: #a1a1aa;
  --line: #3f3f46;
  --accent: #f59e0b;
  --accent-soft: #451a03;
  --accent-ink: #1c1917;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 6px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --max: 1100px;
  --pad: clamp(1.25rem, 4vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: #fbbf24; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Uses padding-inline so section rules can own padding-block without either
   shorthand wiping the other axis. */
.shell { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); }

/* === top bar === */
.topbar {
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; min-height: 56px;
}
.brand { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.03em; }
.brand a { color: inherit; text-decoration: none; }
.brand .dim { color: var(--muted); font-weight: 500; }
.nav { display: flex; gap: 0.1rem; align-items: center; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 0.45rem 0.75rem;
  border-radius: var(--radius); font-size: 0.9rem; font-weight: 600;
}
.nav a:hover { color: var(--ink); }

/* === hero === */
.hero { padding-block: clamp(2.75rem, 8vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem;
  font-weight: 700; color: var(--accent); margin-bottom: 0.9rem;
}
h1 { font-size: clamp(2rem, 5.5vw, 3rem); line-height: 1.1; letter-spacing: -0.035em; max-width: 20ch; }
.lead { color: var(--muted); max-width: 60ch; margin-top: 0.9rem; font-size: 1.05rem; }

.steps { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.75rem; }
.step {
  display: flex; align-items: baseline; gap: 0.5rem;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.6rem 0.9rem; font-size: 0.88rem;
}
.step b { color: var(--accent); font-variant-numeric: tabular-nums; }
.step span { color: var(--muted); }

/* === panels === */
.panel {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 10px; padding: clamp(1.1rem, 3vw, 1.6rem); margin-bottom: 1.25rem;
}
.panel > h2 {
  font-size: 1.05rem; letter-spacing: -0.01em; margin-bottom: 0.35rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.panel > h2 .num {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700;
}
.panel > .hint { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.1rem; }
.panel[hidden] { display: none; }

/* === forms === */
.field-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field.wide { grid-column: 1 / -1; }
label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
label .opt { font-weight: 400; text-transform: none; }
input, textarea, select {
  font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.6rem 0.7rem; width: 100%;
}
input::placeholder, textarea::placeholder { color: #71717a; }
textarea { resize: vertical; min-height: 74px; }

.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 1.1rem; }
button {
  font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer;
  border-radius: var(--radius); padding: 0.62rem 1.15rem;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
}
button:hover:not(:disabled) { background: #fbbf24; border-color: #fbbf24; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.ghost:hover:not(:disabled) { background: var(--bg-soft); border-color: var(--muted); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* === status messages === */
.status { font-size: 0.88rem; color: var(--muted); min-height: 1.4em; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }
.status.busy::after {
  content: ""; display: inline-block; width: 0.7em; height: 0.7em;
  margin-left: 0.5em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: baseline;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .status.busy::after { animation: none; } }

/* === audit findings === */
.findings { list-style: none; display: grid; gap: 0.5rem; margin-top: 0.4rem; }
.finding {
  display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.65rem;
  padding: 0.6rem 0.7rem; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 0.9rem; align-items: start;
}
.finding .glyph { font-weight: 700; line-height: 1.5; }
.finding.pass .glyph { color: var(--ok); }
.finding.gap .glyph { color: var(--danger); }
.finding .fix { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }
.finding.pass .fix { display: none; }
.audit-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.9rem; word-break: break-word; }
.audit-meta strong { color: var(--ink); font-weight: 600; }

/* === demo preview === */
.preview-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip {
  font-size: 0.75rem; font-weight: 600; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.22rem 0.6rem;
}
.frame-wrap {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: #fff; height: min(70vh, 620px);
}
.frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.notes { list-style: none; display: grid; gap: 0.45rem; margin-top: 1.1rem; }
.notes li {
  font-size: 0.9rem; color: var(--muted); padding-left: 1.1rem; position: relative;
}
.notes li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.notes-title { font-size: 0.82rem; font-weight: 700; color: var(--muted); margin-top: 1.25rem; }

footer {
  border-top: 1px solid var(--line); margin-top: 2.5rem; padding-block: 1.5rem 2.5rem;
  color: var(--muted); font-size: 0.85rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
main { padding-bottom: 1rem; }
