:root {
  --paper: #F3F6FC;
  --ink: #101A3D;
  --ink-soft: #4A5578;
  --navy-950: #060A1E;
  --navy-900: #0A1130;
  --navy-800: #111A3E;
  --navy-700: #1C2A5E;
  --hairline: #D9DFEF;
  --card: #FFFFFF;
  --card-wash: #F7F9FE;
  --accent: #4C63E8;
  --accent-2: #6B85FF;
  --accent-ink: #FFFFFF;
  --good: #1F8A4C;
  --good-bg: #E4F3E8;
  --warn: #B5650F;
  --warn-bg: #FBEEDC;
  --shadow: 0 1px 2px rgba(16, 26, 61, 0.06), 0 14px 32px rgba(16, 26, 61, 0.10);
  --shadow-cta: 0 10px 30px rgba(76, 99, 232, 0.35);
  --display: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0A0F26; --ink: #E7ECFB; --ink-soft: #A6B0D6; --navy-950: #030512; --navy-900: #05081C;
    --navy-800: #0C1330; --navy-700: #212F63; --hairline: #29335F; --card: #101733; --card-wash: #0C1330;
    --accent: #7C90FF; --accent-2: #93A6FF; --accent-ink: #0A0F26; --good: #4CC172; --good-bg: #123023;
    --warn: #E0A73D; --warn-bg: #33260F; --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 14px 32px rgba(0,0,0,0.4);
    --shadow-cta: 0 10px 30px rgba(124, 144, 255, 0.35);
  }
}
:root[data-theme="dark"] {
  --paper: #0A0F26; --ink: #E7ECFB; --ink-soft: #A6B0D6; --navy-950: #030512; --navy-900: #05081C;
  --navy-800: #0C1330; --navy-700: #212F63; --hairline: #29335F; --card: #101733; --card-wash: #0C1330;
  --accent: #7C90FF; --accent-2: #93A6FF; --accent-ink: #0A0F26; --good: #4CC172; --good-bg: #123023;
  --warn: #E0A73D; --warn-bg: #33260F; --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 14px 32px rgba(0,0,0,0.4);
  --shadow-cta: 0 10px 30px rgba(124, 144, 255, 0.35);
}
:root[data-theme="light"] {
  --paper: #F3F6FC; --ink: #101A3D; --ink-soft: #4A5578; --navy-950: #060A1E; --navy-900: #0A1130;
  --navy-800: #111A3E; --navy-700: #1C2A5E; --hairline: #D9DFEF; --card: #FFFFFF; --card-wash: #F7F9FE;
  --accent: #4C63E8; --accent-2: #6B85FF; --accent-ink: #FFFFFF; --good: #1F8A4C; --good-bg: #E4F3E8;
  --warn: #B5650F; --warn-bg: #FBEEDC; --shadow: 0 1px 2px rgba(16,26,61,0.06), 0 14px 32px rgba(16,26,61,0.10);
  --shadow-cta: 0 10px 30px rgba(76, 99, 232, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise 0.4s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .cta-glow { animation: pulseGlow 3.2s ease-in-out infinite; }
  @keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 0 14px rgba(255,255,255,0.3), inset 0 0 10px rgba(255,255,255,0.1); }
    50% { box-shadow: 0 0 0 1px rgba(255,255,255,0.28), 0 0 26px rgba(255,255,255,0.5), inset 0 0 10px rgba(255,255,255,0.18); }
  }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 56px);
  background: var(--navy-950);
  border-bottom: 1px solid var(--navy-700);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(160deg, #16225C, #0A1130);
  display: flex; align-items: center; justify-content: center; padding: 6px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.35), 0 0 16px rgba(255,255,255,0.45), 0 0 4px rgba(255,255,255,0.5);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { color: #fff; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.ghost-cta {
  font-family: var(--body); font-weight: 700; color: #fff;
  text-decoration: none; border-radius: 999px;
  background: linear-gradient(180deg, #141C46, #0B1130);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 0 14px rgba(255,255,255,0.3), inset 0 0 10px rgba(255,255,255,0.1);
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.ghost-cta:hover { filter: brightness(1.15); box-shadow: 0 0 0 1px rgba(255,255,255,0.25), 0 0 20px rgba(255,255,255,0.45), inset 0 0 10px rgba(255,255,255,0.15); }
.ghost-cta:active { transform: translateY(1px); }
.topbar-cta {
  font-size: 13.5px; padding: 9px 18px;
}

.hero {
  position: relative;
  background-color: var(--navy-900);
  background-image:
    linear-gradient(180deg, rgba(6,10,30,0.55) 0%, rgba(6,10,30,0.88) 100%),
    url("../assets/hero-gradient.jpg");
  background-size: cover;
  background-position: center;
  padding: 60px clamp(20px, 5vw, 56px) 92px;
  color: #fff;
  overflow: hidden;
}
.hero-inner { max-width: 720px; margin: 0 auto; text-align: center; position: relative; z-index: 1; }
.eyebrow-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #DCE3FF; background: rgba(124, 144, 255, 0.16); border: 1px solid rgba(124, 144, 255, 0.35);
  border-radius: 999px; padding: 6px 14px 6px 10px; margin: 0 0 22px;
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4.6vw, 45px);
  line-height: 1.14; margin: 0 0 18px; letter-spacing: -0.02em; text-wrap: balance;
}
.hero-sub { font-size: 16.5px; color: #C6CEEE; max-width: 560px; margin: 0 auto; line-height: 1.6; }

.workspace {
  max-width: 1000px; margin: -48px auto 0; padding: 0 clamp(16px, 4vw, 40px) 60px;
  position: relative; z-index: 2;
}
.panel {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 18px;
  box-shadow: var(--shadow); padding: clamp(22px, 3vw, 32px);
}
.panel + .panel { margin-top: 18px; }

.intake-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.intake-head h2 { font-family: var(--display); font-size: 15.5px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.samples { display: flex; gap: 16px; }
.samples button {
  background: var(--card-wash); border: 1px solid var(--hairline); color: var(--ink);
  font-family: var(--body); font-size: 12.5px; font-weight: 600;
  cursor: pointer; padding: 6px 12px; border-radius: 999px;
}
.samples button:hover { border-color: var(--accent); color: var(--accent); }

textarea {
  width: 100%; min-height: 140px; resize: vertical;
  background: var(--card-wash); color: var(--ink); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 14px 16px; font-family: var(--body); font-size: 14.5px; line-height: 1.6;
}
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.intake-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 12px; flex-wrap: wrap; }
.char-count { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); }

button.primary {
  font-family: var(--body); font-weight: 700; font-size: 14.5px; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; border-radius: 10px;
  padding: 12px 22px; cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
button.primary:hover { filter: brightness(1.06); }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { opacity: 0.4; cursor: not-allowed; }

.doc {
  font-family: var(--body); font-size: 14.5px; line-height: 1.85; white-space: pre-wrap;
  background: var(--card-wash); border: 1px solid var(--hairline); border-radius: 12px; padding: 18px 20px;
}
.doc mark {
  background: none; color: inherit; border-radius: 3px; padding: 0 2px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.doc mark.m-good { background: var(--good-bg); box-shadow: inset 0 -2px 0 var(--good); }
.doc mark.m-warn { background: var(--warn-bg); box-shadow: inset 0 -2px 0 var(--warn); }
.doc-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }
.doc-legend .key { display: inline-flex; align-items: center; gap: 6px; }
.doc-legend .swatch { width: 10px; height: 10px; border-radius: 3px; }

.score-head { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.gauge-wrap { position: relative; width: 88px; height: 88px; flex: none; }
.gauge-wrap svg { width: 100%; height: 100%; }
.gauge-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums;
}
.score-copy h2 { margin: 0 0 4px; font-family: var(--display); font-size: 17px; font-weight: 700; }
.score-copy p { margin: 0; font-size: 13.5px; color: var(--ink-soft); max-width: 40ch; }

.stakes { border-radius: 12px; padding: 14px 16px; margin-bottom: 22px; font-size: 14px; }
.stakes.is-warn { background: var(--warn-bg); color: var(--warn); }
.stakes.is-good { background: var(--good-bg); color: var(--good); }
.stakes strong { color: var(--ink); }

.criteria { display: grid; gap: 12px; }
.criterion {
  display: grid; grid-template-columns: 34px 1fr; gap: 14px;
  border: 1px solid var(--hairline); border-radius: 12px; padding: 15px 16px; background: var(--card-wash);
}
.criterion.is-good { border-left: 3px solid var(--good); }
.criterion.is-warn { border-left: 3px solid var(--warn); }
.crit-icon {
  width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
}
.crit-icon.good { background: var(--good-bg); color: var(--good); }
.crit-icon.warn { background: var(--warn-bg); color: var(--warn); }
.crit-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.criterion h3 { margin: 0; font-family: var(--display); font-size: 14.5px; font-weight: 700; }
.crit-state { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.crit-state.good { color: var(--good); }
.crit-state.warn { color: var(--warn); }
.criterion p.desc { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.followup {
  margin-top: 8px; font-size: 13px; color: var(--ink);
  border-top: 1px dashed var(--hairline); padding-top: 8px;
}

.cta-block { text-align: center; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.cta-block p.bridge { font-size: 13.5px; color: var(--ink-soft); max-width: 480px; margin: 0 auto 18px; }
.cta-block p.line { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 0 0 6px; text-wrap: balance; letter-spacing: -0.01em; }
.cta-block p.sub { font-size: 13.5px; color: var(--ink-soft); max-width: 480px; margin: 0 auto 22px; }
a.cta-button {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 800; font-size: 17px;
  padding: 17px 34px; border-radius: 14px;
}
a.cta-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
a.cta-button:active { transform: translateY(0px); }
a.cta-button svg { flex: none; }

.notes {
  max-width: 1000px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 50px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); line-height: 1.7;
}
.notes summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.notes ul { margin: 10px 0 0; padding-left: 18px; }

footer.site-footer {
  text-align: center; padding: 24px 20px; font-size: 12.5px; color: var(--ink-soft);
  border-top: 1px solid var(--hairline);
}
footer.site-footer a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
footer.site-footer .footer-links { display: flex; gap: 14px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .gauge-wrap { width: 72px; height: 72px; }
  .gauge-num { font-size: 21px; }
}

/* Case Study Generator additions, tool-specific, not part of the shared design system */
input.cs-name-input {
  width: 100%; background: var(--card-wash); color: var(--ink); border: 1px solid var(--hairline);
  border-radius: 12px; padding: 11px 16px; font-family: var(--body); font-size: 14px;
  margin-bottom: 10px;
}
input.cs-name-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cs-doc-title { font-family: var(--display); font-size: 20px; font-weight: 800; margin: 0 0 18px; letter-spacing: -0.01em; }
.cs-quote {
  border-left: 3px solid var(--accent); background: var(--card-wash); border-radius: 0 12px 12px 0;
  padding: 16px 20px; margin: 0 0 22px; font-size: 16px; line-height: 1.7; color: var(--ink);
}
.cs-quote cite { display: block; margin-top: 10px; font-style: normal; font-size: 13px; color: var(--ink-soft); }
.cs-section { margin-bottom: 18px; }
.cs-section h3 { font-family: var(--display); font-size: 14px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em; }
.cs-section p { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink); }
.cs-actions { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
button.secondary {
  font-family: var(--body); font-weight: 700; font-size: 13.5px; color: var(--ink);
  background: var(--card-wash); border: 1px solid var(--hairline); border-radius: 10px;
  padding: 10px 18px; cursor: pointer;
}
button.secondary:hover { border-color: var(--accent); color: var(--accent); }
