/* Fixpoint Studio — shared design system for all demo pages */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  /* Ink scale */
  --ground: #F7F8FC;
  --surface: #FFFFFF;
  --surface-2: #F1F2F7;
  --surface-raised: #FFFFFF;
  --ink: #171725;
  --ink-2: #414255;
  --muted: #707183;
  --faint: #9A9BA8;
  --rule: #E3E4EC;
  --rule-soft: #EDEEF3;

  /* Brand — single consistent accent across the whole site */
  --brand: #4D49C9;
  --brand-2: #6965DD;
  --brand-ink: #FFFFFF;
  --brand-soft: #ECECFC;
  --brand-glow: rgba(77, 73, 201, 0.16);

  /* Semantic (severity / status) — used sparingly, only where meaning requires color */
  --good: #1F7A4D;
  --good-bg: #E9F5EE;
  --warn: #A05A00;
  --warn-bg: #FBF0DE;
  --hot: #B23B1E;
  --hot-bg: #FBE9E3;

  --shadow-sm: 0 1px 2px rgba(20, 20, 38, 0.04), 0 4px 12px rgba(20, 20, 38, 0.025);
  --shadow-md: 0 10px 30px rgba(20, 20, 38, 0.07), 0 2px 5px rgba(20, 20, 38, 0.04);
  --shadow-lg: 0 24px 60px rgba(32, 30, 77, 0.12), 0 5px 14px rgba(20, 20, 38, 0.06);
  --shadow-inset: inset 0 0 0 1px rgba(20, 20, 26, 0.06);

  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, "Iowan Old Style", serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0B0B0F;
    --surface: #131318;
    --surface-2: #1B1B22;
    --surface-raised: #191921;
    --ink: #F3F3F6;
    --ink-2: #C7C7D1;
    --muted: #91919E;
    --faint: #64646F;
    --rule: #26262F;
    --rule-soft: #1E1E26;
    --brand: #8B90E8;
    --brand-2: #A5A9F2;
    --brand-ink: #101018;
    --brand-soft: #1B1C33;
    --brand-glow: rgba(139, 144, 232, 0.18);
    --good: #5FC98A;
    --good-bg: #16281F;
    --warn: #E3A64B;
    --warn-bg: #2E2415;
    --hot: #E88568;
    --hot-bg: #301C16;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-inset: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}
:root[data-theme="dark"] {
  --ground: #0B0B0F; --surface: #131318; --surface-2: #1B1B22; --surface-raised: #191921;
  --ink: #F3F3F6; --ink-2: #C7C7D1; --muted: #91919E; --faint: #64646F;
  --rule: #26262F; --rule-soft: #1E1E26;
  --brand: #8B90E8; --brand-2: #A5A9F2; --brand-ink: #101018; --brand-soft: #1B1C33; --brand-glow: rgba(139, 144, 232, 0.18);
  --good: #5FC98A; --good-bg: #16281F; --warn: #E3A64B; --warn-bg: #2E2415; --hot: #E88568; --hot-bg: #301C16;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-inset: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
:root[data-theme="light"] {
  --ground: #FAFAF9; --surface: #FFFFFF; --surface-2: #F4F3F1; --surface-raised: #FFFFFF;
  --ink: #14141A; --ink-2: #40404C; --muted: #6B6B78; --faint: #9797A3;
  --rule: #E8E7E3; --rule-soft: #F0EFEC;
  --brand: #2A2E6B; --brand-2: #4B4FA6; --brand-ink: #FFFFFF; --brand-soft: #EEEEF9; --brand-glow: rgba(42, 46, 107, 0.14);
  --good: #1F7A4D; --good-bg: #E9F5EE; --warn: #A05A00; --warn-bg: #FBF0DE; --hot: #B23B1E; --hot-bg: #FBE9E3;
  --shadow-sm: 0 1px 2px rgba(20, 20, 26, 0.04), 0 1px 1px rgba(20, 20, 26, 0.03);
  --shadow-md: 0 4px 16px rgba(20, 20, 26, 0.06), 0 1px 3px rgba(20, 20, 26, 0.05);
  --shadow-lg: 0 16px 48px rgba(20, 20, 26, 0.10), 0 4px 12px rgba(20, 20, 26, 0.06);
  --shadow-inset: inset 0 0 0 1px rgba(20, 20, 26, 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .35; background-image: radial-gradient(rgba(77,73,201,.13) .7px, transparent .7px); background-size: 20px 20px; mask-image: linear-gradient(to bottom, black, transparent 50%); }
a, button, input { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 3px; }
::selection { background: var(--brand-glow); }

.fx-shell { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }

/* ---- Top nav ---- */
.fx-nav {
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  position: sticky;
  top: 0;
  z-index: 20;
}
.fx-nav-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; padding: .85rem var(--pad); max-width: 1180px; margin: 0 auto; }
.fx-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.fx-mark { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.13); border-radius: 11px; background: #171725; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 400; font-size: 1.25rem; font-family: var(--serif); flex-shrink: 0; box-shadow: var(--shadow-sm); transform: rotate(-3deg); }
.fx-brand-name { font-weight: 700; font-size: 1rem; letter-spacing: -0.025em; }
.fx-nav-links { display: flex; align-items: center; gap: 1.7rem; font-size: 0.84rem; font-weight: 600; }
.fx-nav-links a { color: var(--muted); text-decoration: none; }
.fx-nav-links a:hover { color: var(--ink); }
.fx-nav-links .fx-nav-cta { color: var(--brand-ink); background: var(--brand); border-radius: 999px; padding: .62rem 1rem; box-shadow: var(--shadow-sm); }
.fx-nav-links .fx-nav-cta:hover { color: var(--brand-ink); background: var(--brand-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.fx-crumb { font-size: 0.82rem; color: var(--muted); }
.fx-crumb a { color: var(--muted); text-decoration: none; }
.fx-crumb a:hover { color: var(--ink); }

/* ---- Hero / header ---- */
.fx-hero { padding: clamp(3.5rem, 8vw, 6.5rem) var(--pad) clamp(2rem, 5vw, 3.5rem); max-width: 1120px; margin: 0 auto; }
.fx-kicker { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.095em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 12%, transparent); border-radius: 999px; padding: 0.42rem 0.9rem 0.42rem 0.72rem; }
.fx-kicker::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--brand); }
h1.fx-h1 { font-family: var(--serif); font-size: clamp(2.75rem, 6vw, 4.75rem); line-height: .98; letter-spacing: -0.045em; font-weight: 400; margin: 1.25rem 0 0; max-width: 16ch; color: var(--ink); }
p.fx-lede { font-family: var(--sans); font-size: clamp(1.05rem, 2vw, 1.2rem); line-height: 1.55; color: var(--ink-2); margin-top: 1.2rem; max-width: 62ch; font-weight: 400; }

.fx-main { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad) clamp(4rem, 9vw, 7rem); display: flex; flex-direction: column; gap: clamp(3rem, 7vw, 5rem); }

h2.fx-h2 { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.35rem); font-weight: 400; letter-spacing: -.025em; margin: 0 0 1.2rem; color: var(--ink); }

.fx-notice {
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.3rem;
  font-size: 0.92rem;
  color: var(--ink-2);
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.fx-notice::before { content: "◆"; color: var(--brand); font-size: 0.7rem; margin-top: 0.35rem; flex-shrink: 0; }
.fx-notice p { max-width: 74ch; margin: 0; }
.fx-notice strong { color: var(--ink); }

/* ---- Elevated card, replaces bordered boxes everywhere ---- */
.fx-card {
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

/* ---- Buttons / choices ---- */
.fx-btn {
  font: inherit;
  font-weight: 620;
  font-size: 0.95rem;
  color: var(--brand-ink);
  background: var(--brand);
  border: none;
  border-radius: 999px;
  padding: 0.86rem 1.45rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.fx-btn-link { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.fx-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.fx-btn:active { transform: translateY(0); }
.fx-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

.fx-btn-ghost {
  font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.55rem 1.1rem; cursor: pointer; transition: border-color 0.12s ease, color 0.12s ease;
}
.fx-btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.fx-opt {
  text-align: left; font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--rule); border-radius: 12px;
  padding: 0.9rem 1.1rem; cursor: pointer; font-size: 0.95rem; line-height: 1.45;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.1s ease;
}
.fx-opt:hover { border-color: color-mix(in srgb, var(--brand) 60%, var(--rule)); background: var(--surface); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.fx-opt.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--brand) inset; }
.fx-opt b { display: block; font-weight: 640; margin-bottom: 0.15rem; }
.fx-opt span.sub { color: var(--muted); font-size: 0.85rem; font-weight: 400; }

.fx-back { align-self: flex-start; font: inherit; font-size: 0.85rem; color: var(--muted); background: none; border: none; cursor: pointer; padding: 0.2rem 0; }
.fx-back:hover { color: var(--ink); }

.fx-pill {
  display: inline-flex; align-items: baseline; gap: 0.4rem;
  background: var(--brand-soft); color: var(--brand); border-radius: 999px;
  padding: 0.4rem 1rem; font-family: var(--mono); font-weight: 650; font-size: 0.95rem;
}

.fx-progress { display: flex; gap: 0.4rem; }
.fx-dot { width: 1.8rem; height: 4px; border-radius: 4px; background: var(--rule); transition: background 0.2s ease; }
.fx-dot.on { background: var(--brand); }

/* ---- Footer ---- */
.fx-footer { border-top: 1px solid var(--rule); padding: 2rem var(--pad) 3rem; font-size: 0.82rem; color: var(--muted); max-width: 1120px; margin: 0 auto; }
.fx-footer a { color: var(--muted); }
.fx-footer-home { max-width: 1180px; display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; }
.fx-footer-home p { margin: .7rem 0 0; }

@media (max-width: 640px) {
  .fx-nav-links > a:not(.fx-nav-cta) { display: none; }
  .fx-nav-links .fx-nav-cta { padding: .55rem .8rem; }
  .fx-crumb { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fx-footer-home { display: block; }
  .fx-footer-home > p { margin-top: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
