/* =============================================================
   AI Readiness Assessment — vanilla static
   Visual system matches thenextmountain.ai production theme:
   - Background: warm cream
   - Foreground: near-black
   - Primary: dark navy
   - Accent: rust orange
   - Source Serif 4 for headings, Inter for body
   ============================================================= */

:root {
  /* Color tokens — The Next Mountain brand v1.0. Assessment = sage accent.
     Cream backgrounds, granite text/dark surfaces (navy retired). */
  --bg:          hsl(37 51% 91%);
  --fg:          hsl(36 6% 16%);
  --primary:     hsl(36 6% 16%);
  --primary-fg:  hsl(37 51% 91%);
  --secondary:   hsl(37 30% 88%);
  --muted:       hsl(37 26% 87%);
  --muted-fg:    hsl(37 8% 38%);
  --accent:      hsl(80 19% 46%);
  --accent-fg:   hsl(36 6% 16%);
  --border:      hsl(37 22% 82%);
  --destructive: hsl(0 70% 45%);

  /* Type */
  --font-serif:  "Source Serif 4", Georgia, serif;
  --font-sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing rhythm */
  --radius: 0.25rem;
  --container: 640px;
}

/* ─── Reset / base ─────────────────────────────────────────── */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Faint ridgeline motif anchored to the bottom of the page — the same
   geometric brand texture used on the app footer — so the cream surface
   reads as warm/branded rather than flat white on every screen. */
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38vh;
  background: url("/brand/bg_pattern.svg") center bottom / cover no-repeat;
  opacity: 0.045;
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--primary);
  margin: 0;
}

p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }

button { font: inherit; cursor: pointer; }

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

/* ─── Layout chrome ────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--primary); /* granite — matches the app's dark-hero nav */
  border-bottom: 1px solid hsl(37 51% 91% / 0.1);
  padding: 0;
}

/* Inner wrapper constrains the nav to the same width + padding as the app's
   .container-wide so the logo/links line up with every other page. */
.topbar__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
}

.topbar__logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--primary-fg); /* cream on granite */
  text-decoration: none;
}
.topbar__seal { flex-shrink: 0; }

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.navlink {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: hsl(37 51% 91% / 0.75); /* cream/75 — matches the app nav links */
  text-decoration: none;
  white-space: nowrap;
}
.navlink:hover { color: var(--primary-fg); text-decoration: none; }
.navlink svg { flex-shrink: 0; }
.navlink--active { color: var(--primary-fg); }
.navlink--active span { border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.navlink--cta {
  background: #c2622f;
  color: #f4ebdd;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius);
  font-weight: 500;
}
.navlink--cta:hover { color: #f4ebdd; opacity: 0.9; }

.topbar__toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--primary-fg);
  padding: 0.25rem;
  cursor: pointer;
}

@media (max-width: 1023px) {
  .topbar__toggle { display: inline-flex; }
  .topbar__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--primary);
    border-bottom: 1px solid hsl(37 51% 91% / 0.1);
    padding: 0.5rem 1.5rem 1.25rem;
  }
  .topbar__nav.is-open { display: flex; }
  .navlink { padding: 0.75rem 0; font-size: 1rem; }
  .navlink--active span { border-bottom: none; }
  .navlink--cta {
    margin-top: 0.6rem;
    justify-content: center;
    text-align: center;
  }
}

.app {
  max-width: var(--container);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
  min-height: calc(100vh - 60px - 100px);
}

.footer {
  padding: 2.5rem 1.25rem 3rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--secondary);
}
.footer p {
  font-size: 0.8rem;
  color: var(--muted-fg);
  max-width: 30rem;
  margin: 0 auto;
}
.footer strong { color: var(--primary); font-weight: 600; }

/* ─── Screens — single screen visible, smooth transitions ──── */

.screen {
  animation: fadeIn 240ms ease-out both;
}
.screen[hidden] { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

/* ─── Intro screen — granite hero ──────────────────────────────
   Mirrors the dark, full-bleed hero the rest of thenextmountain.ai
   opens with. When the intro screen is mounted, the .app column drops
   its narrow max-width so the granite band runs edge to edge; the
   question/result screens keep the clean centered column. */

.app:has(.intro) {
  max-width: none;
  margin: 0;
  padding: 0;
}

.intro {
  position: relative;
  background: var(--primary); /* granite */
  color: var(--primary-fg);
  min-height: calc(100vh - 5rem); /* fill the viewport like the app's min-h-screen hero */
  /* Top-anchored (not vertically centered) so the headline sits at a fixed
     offset like the app heroes — no font-swap "bounce", consistent across pages.
     ~5rem top ≈ the app's pt-40 once the static (non-overlay) nav is accounted for. */
  padding: 5rem 0 6rem;
  overflow: hidden;
}

/* Faint ridgeline texture inside the hero, like the app's .bg-ridgeline. */
.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/brand/bg_pattern.svg") center bottom / cover no-repeat;
  opacity: 0.07;
  pointer-events: none;
}

.intro__inner {
  position: relative;
  width: 100%;
  max-width: 72rem; /* match the app .container-wide so content left-aligns like home */
  margin: 0 auto;
  padding: 0 1.5rem;
}

.intro__glyph {
  display: inline-block;
  line-height: 0;
  margin-bottom: 1.75rem;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.3));
}
.intro__glyph svg { display: block; }

.intro__kicker {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(80 24% 64%); /* sage, lifted to read on granite */
  margin-bottom: 1.25rem;
}

.intro__title {
  font-size: 2.375rem;
  line-height: 1.08;
  margin-bottom: 1.75rem;
  max-width: 56rem; /* readable measure, left-aligned like home's max-w-4xl */
  color: var(--primary-fg); /* cream on granite */
}

@media (min-width: 640px) {
  .intro__title { font-size: 3rem; }
}

.intro__body {
  font-size: 1.0625rem;
  color: hsl(37 51% 91% / 0.82);
  margin-bottom: 2.25rem;
  max-width: 36rem;
}

.intro__start {
  padding: 1rem 1.75rem;
  font-size: 1rem;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
}

.intro__reassurance {
  font-size: 0.875rem;
  color: hsl(37 51% 91% / 0.6);
  margin-top: 1.25rem;
  font-style: italic;
}

/* ─── Progress bar ─────────────────────────────────────────── */

.progress {
  margin-bottom: 2.5rem;
}
.progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-bottom: 0.625rem;
}
.progress__track {
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  background: var(--accent);
  transition: width 320ms ease-out;
}

/* ─── Question screen ──────────────────────────────────────── */

.question__stem {
  font-size: 1.5rem;
  line-height: 1.25;
  margin-bottom: 2rem;
  color: var(--primary);
  font-family: var(--font-serif);
}

@media (min-width: 640px) {
  .question__stem { font-size: 1.875rem; }
}

.options {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  text-align: left;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  color: var(--fg);
  font-size: 0.9375rem;
  line-height: 1.45;
  transition: border-color 160ms ease, background 160ms ease;
  min-height: 3.25rem;
}

.option:hover {
  border-color: hsl(36 6% 16% / 0.4);
}

.option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option--selected {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-fg);
}

.option__bullet {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 999px;
  border: 1.5px solid var(--muted-fg);
  margin-top: 0.1rem;
  transition: all 160ms ease;
}

.option--selected .option__bullet {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--primary);
}

/* ─── Back nav ─────────────────────────────────────────────── */

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  color: var(--muted-fg);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0;
  margin-top: 0.5rem;
}
.nav-back:hover { color: var(--accent); }

/* ─── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  border: 0;
  border-radius: var(--radius);
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 160ms ease, opacity 160ms ease;
  font-family: var(--font-sans);
}
.btn:hover { background: hsl(80 19% 40%); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn--ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn--ghost:hover { background: var(--primary); color: var(--primary-fg); }

/* ─── Result screen ────────────────────────────────────────── */

.result {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.result__kicker {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.result__quadrant {
  font-size: 2.5rem;
  line-height: 1.05;
  color: var(--primary);
  margin-bottom: 0.875rem;
}

@media (min-width: 640px) {
  .result__quadrant { font-size: 3rem; }
}

.result__headline {
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--fg);
  margin-bottom: 1.5rem;
  max-width: 36rem;
}

.result__scores {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.result__score {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.result__score-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.result__score-value {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  line-height: 1;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.result__gap-line {
  font-size: 0.9375rem;
  color: var(--muted-fg);
  font-style: italic;
}

.result__why h3 {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-bottom: 0.875rem;
  font-family: var(--font-sans);
  font-weight: 500;
}
.result__why p {
  font-size: 1.0625rem;
  line-height: 1.6;
  max-width: 36rem;
}

.result__near-line {
  background: var(--muted);
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--accent);
  font-size: 0.875rem;
  font-style: italic;
  color: var(--fg);
}

/* ─── 2x2 plot ─────────────────────────────────────────────── */

.plot-wrap {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  justify-content: center;
}

.plot {
  width: 100%;
  max-width: 360px;
  height: auto;
}

@media (min-width: 640px) {
  .plot { max-width: 400px; }
}

/* ─── Email gate ───────────────────────────────────────────── */

.gate {
  margin-top: 2rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.gate__heading {
  font-size: 1.75rem;
  margin-bottom: 0.875rem;
}

.gate__body {
  font-size: 1rem;
  color: var(--fg);
  margin-bottom: 1.5rem;
  max-width: 32rem;
}

.gate__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.125rem;
}

.gate__label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.gate__input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 0.625rem 0;
  font-size: 1rem;
  color: var(--fg);
  font-family: var(--font-sans);
  transition: border-color 160ms ease;
}
.gate__input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.gate__input::placeholder { color: hsl(37 8% 60%); }

.gate__error {
  color: var(--destructive);
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

.gate__reassurance {
  font-size: 0.8125rem;
  color: var(--muted-fg);
  margin-top: 0.875rem;
  font-style: italic;
}

/* ─── Full result (gated) ──────────────────────────────────── */

.full-result {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.weakest {
  font-size: 1rem;
  color: var(--fg);
  font-style: italic;
  max-width: 36rem;
}
.weakest strong { color: var(--accent); font-style: normal; font-weight: 600; }

.next-moves__heading {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-bottom: 1rem;
  font-family: var(--font-sans);
  font-weight: 500;
}

.next-moves {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.next-move {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.5rem 1rem;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 38rem;
}
.next-move__num {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--accent);
  font-weight: 600;
}

/* ─── Methodology disclosure ───────────────────────────────── */

.methodology {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.methodology__summary {
  cursor: pointer;
  font-size: 0.875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-bottom: 0.875rem;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.methodology__summary::-webkit-details-marker { display: none; }
.methodology__summary::after {
  content: "+";
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1;
}
.methodology[open] .methodology__summary::after { content: "−"; }
.methodology p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--muted-fg);
  max-width: 38rem;
  margin-top: 0.75rem;
}

/* ─── Bottom CTA ───────────────────────────────────────────── */

.cta-block {
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  margin-top: 2rem;
}
.cta-block__heading {
  color: var(--primary-fg);
  font-size: 1.5rem;
  margin-bottom: 0.625rem;
}
.cta-block__body {
  color: hsl(37 51% 91% / 0.75);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  max-width: 32rem;
}
.cta-block .btn { background: var(--accent); }
.cta-block .btn:hover { background: hsl(80 19% 40%); }
.cta-block__secondary {
  margin: 0.875rem 0 0;
  font-size: 0.875rem;
}
.cta-block__secondary a {
  color: hsl(37 51% 91% / 0.7);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cta-block__secondary a:hover { color: var(--primary-fg); }

/* ─── Small-screen guards ──────────────────────────────────── */

@media (max-width: 359px) {
  .app { padding: 2rem 0.875rem 3rem; }
  .intro__title { font-size: 2rem; }
  .question__stem { font-size: 1.3125rem; }
  .result__quadrant { font-size: 2.125rem; }
  .result__score-value { font-size: 2.125rem; }
}
