/* ---------- Design tokens ---------- */
:root {
  --color-bg: #f6f7fb;
  --color-surface: #ffffff;
  --color-surface-2: #f0f2f8;
  --color-text: #0f172a;
  --color-muted: #4b5568;
  --color-border: #e2e6ef;
  --color-border-strong: #c7cedb;
  --color-accent: #4f46e5;
  --color-accent-hover: #4338ca;
  --color-accent-soft: #eef0ff;
  --color-accent-border: #a5b4fc;
  --color-accent-text: #ffffff;
  --color-accent-2: #0e7490;
  --color-focus: #4338ca;
  --color-error: #b42318;
  --color-error-bg: #fef1ef;
  --color-level-1-bg: #e8f8f0;
  --color-level-1-text: #046c4e;
  --color-level-2-bg: #fff6e0;
  --color-level-2-text: #92400e;
  --color-level-3-bg: #ffecef;
  --color-level-3-text: #b0123b;
  --glow-1: rgba(99, 102, 241, 0.16);
  --glow-2: rgba(14, 165, 233, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px -8px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, 0.05), 0 24px 48px -16px rgba(30, 27, 75, 0.25);
  --radius-sm: 0.5rem;
  --radius: 0.875rem;
  --radius-lg: 1.25rem;
  --space: 1rem;
  --header-height: 4rem;
  --font-body: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter Display", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0a0e1a;
    --color-surface: #111729;
    --color-surface-2: #172036;
    --color-text: #e6eaf2;
    --color-muted: #9aa6bb;
    --color-border: #232d45;
    --color-border-strong: #35415e;
    --color-accent: #8b93ff;
    --color-accent-hover: #a9afff;
    --color-accent-soft: #1b2046;
    --color-accent-border: #4c53a8;
    --color-accent-text: #0a0e1a;
    --color-accent-2: #5ccfe6;
    --color-focus: #b4baff;
    --color-error: #ff9b91;
    --color-error-bg: #3a1714;
    --color-level-1-bg: #0f2e22;
    --color-level-1-text: #74e0b0;
    --color-level-2-bg: #33280f;
    --color-level-2-text: #f5c66b;
    --color-level-3-bg: #3a1622;
    --color-level-3-text: #ff9db4;
    --glow-1: rgba(99, 102, 241, 0.22);
    --glow-2: rgba(14, 165, 233, 0.12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Component display rules must never override the hidden attribute. */
[hidden] {
  display: none !important;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  background-image:
    radial-gradient(60rem 30rem at 10% -10%, var(--glow-1), transparent 70%),
    radial-gradient(50rem 28rem at 95% 0%, var(--glow-2), transparent 70%);
  background-repeat: no-repeat;
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
  padding-block: calc(var(--space) * 2.5) calc(var(--space) * 4);
}

main:focus {
  outline: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  font-weight: 800;
  margin-block: 0 var(--space);
}

h2 {
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.7rem);
  font-weight: 750;
  margin-block: calc(var(--space) * 3) calc(var(--space) * 0.75);
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration-thickness: 2px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

::selection {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

svg {
  flex: none;
}

.container {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.prose {
  max-width: 50rem;
}

.lead {
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  color: var(--color-muted);
  max-width: 42rem;
  margin-top: 0;
}

.hint,
.loading {
  color: var(--color-muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 var(--space);
  padding: 0.3rem 0.8rem 0.3rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.eyebrow-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
}

.gradient-text {
  color: var(--color-accent);
  background: linear-gradient(100deg, var(--color-accent) 10%, var(--color-accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.loading::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.6rem;
  vertical-align: -0.15rem;
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-accent);
  border-radius: 50%;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--space);
  top: -10rem;
  background: var(--color-accent);
  color: var(--color-accent-text);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 100;
}

.skip-link:focus {
  top: var(--space);
  color: var(--color-accent-text);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem var(--space);
  min-height: var(--header-height);
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-decoration: none;
}

.brand:hover {
  color: var(--color-text);
}

.brand::before {
  content: "";
  width: 1.6rem;
  height: 1.6rem;
  margin-right: 0.55rem;
  border-radius: 0.45rem;
  background:
    linear-gradient(135deg, transparent 45%, rgba(255, 255, 255, 0.35) 46%, transparent 70%),
    linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  box-shadow: 0 4px 12px -4px var(--color-accent);
}

.brand-dot {
  color: var(--color-accent);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0.2rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.nav-list a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.925rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.nav-list a[aria-current="page"] {
  color: var(--color-accent-text);
  background: var(--color-accent);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.875rem;
  padding-block: calc(var(--space) * 1.75);
}

.site-footer p {
  max-width: 60rem;
  margin-block: 0.4rem;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 0.7rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--color-accent-border);
  color: var(--color-accent-hover);
  text-decoration: none;
}

.button svg {
  width: 1.1em;
  height: 1.1em;
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-accent) 88%, white), var(--color-accent));
  color: var(--color-accent-text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 20px -8px var(--color-accent);
}

.button-primary:hover {
  border-color: transparent;
  background: var(--color-accent-hover);
  color: var(--color-accent-text);
}

.button-large {
  min-height: 3.25rem;
  padding: 0.75rem 1.5rem;
  font-size: 1.05rem;
  border-radius: 0.85rem;
}

.button-quiet {
  background: transparent;
  box-shadow: none;
  color: var(--color-muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: calc(var(--space) * 1.5) 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(1.25rem, 3vw, 2rem);
}

/* ---------- Home ---------- */
.hero {
  display: grid;
  gap: calc(var(--space) * 3);
  align-items: center;
  padding-block: calc(var(--space) * 1.5) calc(var(--space) * 2);
}

@media (min-width: 62rem) {
  .hero {
    grid-template-columns: 1.15fr 1fr;
    padding-block: calc(var(--space) * 3);
  }
}

.hero h1 {
  font-size: clamp(2.3rem, 1.4rem + 3.6vw, 3.9rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: calc(var(--space) * 1.75) calc(var(--space) * 1.25);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-muted);
  font-size: 0.925rem;
  font-weight: 500;
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-points svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--color-level-1-text);
}

.hero-visual {
  position: relative;
  max-width: 32rem;
  width: 100%;
  justify-self: center;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 8% -6% -6% 8%;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  opacity: 0.18;
  filter: blur(32px);
}

.mock {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.mock-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.mock-bar span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--color-border-strong);
}

.mock-body {
  padding: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.mock-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}

.mock-number {
  font-size: 2.4rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.mock-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 0.7rem;
  background: var(--color-bg);
}

.mock-id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.mock-line {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--color-surface-2);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.mock-line-short {
  width: 60%;
}

.section-heading {
  text-align: left;
  max-width: 40rem;
}

.section-heading h2 {
  margin-bottom: 0.4rem;
}

.section-heading p {
  color: var(--color-muted);
  margin-top: 0;
}

.steps-list,
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space);
  padding: 0;
  margin: calc(var(--space) * 1.5) 0 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .steps-list,
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.steps-list {
  counter-reset: step;
}

.steps-list li,
.feature-grid li {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

.steps-list li {
  counter-increment: step;
}

.steps-list li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 1rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 6px 16px -6px var(--color-accent);
}

.steps-list h3,
.feature-grid h3 {
  margin: 0 0 0.4rem;
}

.steps-list p,
.feature-grid p {
  margin: 0;
  color: var(--color-muted);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.feature-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.cta-band {
  margin-top: calc(var(--space) * 4);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(30rem 14rem at 100% 0%, rgba(255, 255, 255, 0.18), transparent 70%),
    linear-gradient(120deg, #4338ca, #0e7490);
  color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space) calc(var(--space) * 2);
  box-shadow: var(--shadow-lg);
}

.cta-band h2 {
  margin: 0 0 0.3rem;
  color: #ffffff;
}

.cta-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  max-width: 36rem;
}

.cta-band a:not(.button) {
  color: #ffffff;
}

.button-light {
  background: #ffffff;
  border-color: #ffffff;
  color: #312e81;
}

.button-light:hover {
  background: #eef0ff;
  border-color: #eef0ff;
  color: #312e81;
}

.cta-band :focus-visible {
  outline-color: #ffffff;
}

/* ---------- Page header ---------- */
.page-header {
  margin-bottom: calc(var(--space) * 2);
}

.page-header .lead {
  margin-bottom: 0;
}

/* ---------- Assessment ---------- */
.assessment-shell {
  max-width: 50rem;
}

.progress {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 calc(var(--space) * 1.5);
  padding: 0;
  list-style: none;
}

.progress-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.75rem;
  border-top: 4px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.progress-step.is-active,
.progress-step.is-complete {
  border-top-color: var(--color-accent);
  color: var(--color-text);
}

.progress-dot {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid var(--color-border-strong);
  font-size: 0.8rem;
  font-weight: 800;
}

.progress-step.is-active .progress-dot,
.progress-step.is-complete .progress-dot {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-accent-text);
}

.step {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(1.25rem, 3.5vw, 2.25rem);
}

.step-heading {
  margin-top: 0;
}

.step-heading:focus {
  outline: none;
}

.step-heading:focus-visible {
  outline: 3px solid var(--color-focus);
}

.step-intro {
  color: var(--color-muted);
  margin-top: 0;
}

.step .button-row {
  justify-content: space-between;
  padding-top: calc(var(--space) * 1.25);
  border-top: 1px solid var(--color-border);
}

.step .button-row .button-primary:only-child {
  margin-left: auto;
}

/* ---------- Form controls ---------- */
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space);
  min-width: 0;
}

legend {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.4;
  padding: 0;
  margin-bottom: 0.9rem;
}

fieldset.has-error .choice {
  border-color: var(--color-error);
}

.field-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-error);
  background: var(--color-error-bg);
  border: 1px solid color-mix(in srgb, var(--color-error) 35%, transparent);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-weight: 600;
}

.field-error::before {
  content: "Error:";
  font-weight: 800;
}

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.choice:hover {
  border-color: var(--color-accent-border);
}

.choice:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.choice input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.choice input:focus-visible {
  outline: none;
}

.choice label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  cursor: pointer;
}

/* Makes the whole card clickable while keeping the label as the accessible name. */
.choice label::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.choice-radio + .choice-radio {
  margin-top: 0.6rem;
}

.choice-radio label {
  flex-direction: row;
  align-items: baseline;
  gap: 0.75rem;
}

.choice-radio .level-tag {
  flex: none;
}

.choice-label {
  font-weight: 650;
}

.choice-help {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.question-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.question-children {
  margin: 0.6rem 0 0 1.1rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--color-accent-border);
}

/* ---------- Level tags ---------- */
/* The text ("Level 2") carries the meaning; colour only supplements it. */
.level-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid transparent;
}

.level-tag::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.level-tag-1 {
  background: var(--color-level-1-bg);
  color: var(--color-level-1-text);
}

.level-tag-2 {
  background: var(--color-level-2-bg);
  color: var(--color-level-2-text);
}

.level-tag-3 {
  background: var(--color-level-3-bg);
  color: var(--color-level-3-text);
}

/* ---------- Notices ---------- */
.notice {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
}

.notice h2 {
  margin-top: 0;
}

.notice-error {
  border-left-color: var(--color-error);
  background: var(--color-error-bg);
}

.notice-empty {
  text-align: center;
  padding: clamp(1.5rem, 5vw, 3rem);
  border-left-width: 1px;
}

.notice-empty .button {
  margin-top: 0.5rem;
}

/* ---------- Results ---------- */
.results-layout {
  display: grid;
  gap: calc(var(--space) * 2);
}

@media (min-width: 62rem) {
  .results-layout {
    grid-template-columns: minmax(19rem, 23rem) 1fr;
    align-items: start;
  }

  .profile-panel {
    position: sticky;
    top: calc(var(--header-height) + var(--space));
    max-height: calc(100vh - var(--header-height) - 2 * var(--space));
    overflow-y: auto;
    order: 0;
  }
}

.profile-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.profile-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.profile-panel legend {
  font-size: 0.95rem;
}

.profile-panel .choice {
  padding: 0.7rem 0.8rem;
  font-size: 0.9rem;
}

.profile-panel .choice-radio label {
  flex-direction: column;
  gap: 0.3rem;
}

.profile-panel .choice-radio .level-tag {
  align-self: flex-start;
}

.scope-details {
  margin-bottom: var(--space);
  border-top: 1px solid var(--color-border);
  padding-top: 0.75rem;
}

.scope-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 700;
  padding: 0.5rem 0;
  color: var(--color-accent);
  list-style: none;
}

.scope-details summary::-webkit-details-marker {
  display: none;
}

.scope-details summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--color-accent-soft);
  font-size: 1.1rem;
  line-height: 1;
}

.scope-details[open] summary::after {
  content: "\2212";
}

.scope-details .scope-fieldset {
  margin-top: 0.75rem;
}

.summary-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(28rem 12rem at 100% 0%, var(--glow-1), transparent 70%),
    var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.summary-card h2 {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
}

.summary-number {
  font-size: clamp(2.75rem, 2rem + 3vw, 4rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1;
}

.summary-text {
  color: var(--color-muted);
  margin: 0.75rem 0 0;
  max-width: 44rem;
}

.level-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.level-breakdown .level-tag {
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
}

.export-row {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.export-status {
  color: var(--color-muted);
  min-height: 1.5em;
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
}

.chapter-nav {
  margin-top: 1.5rem;
}

.chapter-nav h3 {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.chapter-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 17rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.chapter-nav a:hover {
  border-color: var(--color-accent-border);
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.chapter-nav-id {
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-weight: 800;
}

.chapter-nav-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-nav-count {
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.results-list > .notice {
  margin-top: 1.5rem;
}

.chapter {
  margin-top: calc(var(--space) * 2.5);
}

.chapter-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.chapter-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 8px 18px -8px var(--color-accent);
}

.chapter h3 {
  margin: 0.1rem 0 0.25rem;
  font-size: 1.2rem;
  scroll-margin-top: calc(var(--header-height) + var(--space));
}

.chapter-count {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--color-surface-2);
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 700;
  vertical-align: 0.15em;
}

.chapter-objective {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.requirement-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.requirement {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0.95rem 1.15rem;
  break-inside: avoid;
}

.requirement:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}

.requirement-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.requirement-id {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}

.requirement-text {
  margin: 0;
}

/* ---------- About ---------- */
.prose section {
  margin-top: calc(var(--space) * 2.5);
}

.prose section h2 {
  margin-top: 0;
}

.prose ol,
.prose ul {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose li::marker {
  color: var(--color-accent);
  font-weight: 700;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .button,
  .nav-list a,
  .choice,
  .requirement,
  .chapter-nav a {
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease, color 0.15s ease, transform 0.15s ease;
  }

  .button-primary:hover,
  .steps-list li:hover,
  .feature-grid li:hover {
    transform: translateY(-1px);
  }

  .steps-list li,
  .feature-grid li {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .steps-list li:hover,
  .feature-grid li:hover {
    box-shadow: var(--shadow-md);
  }

  .step,
  .summary-card,
  .hero-copy,
  .hero-visual {
    animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero-visual {
    animation-delay: 0.1s;
  }

  .loading::before {
    animation: spin 0.8s linear infinite;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Print ---------- */
@media print {
  :root {
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-surface-2: #f3f3f3;
    --color-text: #000000;
    --color-muted: #333333;
    --color-border: #bbbbbb;
  }

  body {
    background: #ffffff;
  }

  .site-header,
  .skip-link,
  .profile-panel,
  .export-row,
  .export-status,
  .chapter-nav {
    display: none;
  }

  .results-layout {
    display: block;
  }

  .summary-card,
  .requirement {
    box-shadow: none;
  }

  .chapter-badge {
    background: none;
    color: #000000;
    border: 1px solid #000000;
    box-shadow: none;
  }

  a {
    color: #000000;
  }
}
