:root {
  --bg: #f3ecdf;
  --bg-deep: #e5d5bf;
  --paper: rgba(255, 251, 245, 0.84);
  --paper-strong: rgba(255, 249, 241, 0.94);
  --ink: #17120d;
  --muted: #5d5247;
  --accent: #8f4f24;
  --accent-soft: #c78752;
  --teal: #295e60;
  --gold: #b0833a;
  --line: rgba(32, 22, 11, 0.1);
  --line-strong: rgba(32, 22, 11, 0.16);
  --shadow: 0 24px 80px rgba(64, 35, 16, 0.14);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(203, 131, 82, 0.28), transparent 25%),
    radial-gradient(circle at top right, rgba(41, 94, 96, 0.18), transparent 24%),
    linear-gradient(180deg, #f7f0e4 0%, #efe2cd 48%, #f8f2e8 100%);
  font-family: "Instrument Sans", system-ui, sans-serif;
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.page-shell {
  width: min(1220px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.hero,
.value-strip,
.feature-belt,
.planner-shell,
.results-shell {
  animation: float-up 700ms ease both;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0 2rem;
}

.brand,
.nav-actions,
.hero-actions,
.results-actions,
.score-cluster,
.chip-list,
.preset-rail,
.feature-belt {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.brand {
  align-items: center;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(145deg, #3a2a1f, var(--accent));
  color: #fff8f0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.2rem;
}

.eyebrow,
.kicker,
.panel-label,
.section-tag,
.mini-label,
.risk-label,
.generated-at {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.78fr;
  gap: 1.2rem;
}

.hero-copy,
.hero-panel,
.value-strip article,
.planner-form,
.result-card,
.highlight-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-copy {
  padding: 3rem;
}

.hero-copy h2,
.value-strip h3,
.planner-copy h3,
.results-head h3,
.highlight-card h4,
.result-card h4,
.quote-card blockquote {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.hero-copy h2 {
  font-size: clamp(3.2rem, 5vw, 6rem);
  line-height: 0.95;
  margin: 0.7rem 0 1rem;
  max-width: 10ch;
}

.hero-copy .lede,
.value-strip p,
.planner-copy p,
.result-card p,
.highlight-card p,
.mode-list p,
.hero-stats p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-panel {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(242, 228, 209, 0.84)),
    var(--paper);
}

.editorial-card,
.quote-card {
  border-radius: calc(var(--radius-xl) - 8px);
  border: 1px solid rgba(32, 22, 11, 0.08);
  background: rgba(255, 252, 247, 0.88);
  padding: 1.2rem;
}

.mode-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.9rem;
}

.mode-list article {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(32, 22, 11, 0.08);
}

.mode-list article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.quote-card blockquote {
  margin: 0.8rem 0 0;
  font-size: 1.65rem;
  line-height: 1.2;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-top: 1.8rem;
}

.hero-stats article,
.highlight-card,
.feature-belt article {
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  border: 1px solid rgba(32, 22, 11, 0.08);
  background: rgba(255, 252, 248, 0.78);
}

.hero-stats span,
.feature-belt p {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hero-stats strong,
.feature-belt article span,
.mode-list strong,
.highlight-card h4 {
  display: block;
}

.ghost-link,
.primary-button,
.secondary-button,
.ghost-button,
.preset-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.ghost-link,
.ghost-button,
.preset-chip {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.primary-button {
  color: #fff8f2;
  background: linear-gradient(135deg, #522d16, var(--accent));
  box-shadow: 0 18px 40px rgba(82, 45, 22, 0.24);
}

.secondary-button {
  color: var(--teal);
  background: rgba(41, 94, 96, 0.08);
  border: 1px solid rgba(41, 94, 96, 0.18);
}

.ghost-link:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.preset-chip:hover,
.preset-chip.active {
  transform: translateY(-1px);
}

.preset-chip.active {
  background: rgba(143, 79, 36, 0.12);
  border-color: rgba(143, 79, 36, 0.28);
}

.value-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.value-strip article,
.planner-shell,
.results-shell {
  padding: 1.5rem;
}

.feature-belt {
  justify-content: space-between;
  margin-top: 1.2rem;
}

.feature-belt article {
  flex: 1 1 0;
  min-width: 220px;
}

.planner-shell,
.results-shell {
  margin-top: 1.4rem;
  border-radius: 36px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 250, 241, 0.72), rgba(255, 255, 255, 0.48));
  box-shadow: var(--shadow);
}

.planner-copy {
  max-width: 760px;
  margin-bottom: 1rem;
}

.planner-form {
  display: grid;
  gap: 1rem;
  padding: 1.35rem;
}

.planner-form label {
  display: grid;
  gap: 0.55rem;
  font-weight: 600;
}

.planner-form input,
.planner-form select,
.planner-form textarea {
  width: 100%;
  border: 1px solid rgba(32, 22, 11, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 0.95rem 1rem;
}

.planner-form textarea {
  resize: vertical;
}

.split-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.split-fields-wide {
  grid-template-columns: repeat(3, 1fr);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(32, 22, 11, 0.08);
  font-weight: 500;
}

.check-grid input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.wide-button {
  width: 100%;
}

.risk-banner,
.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.risk-banner {
  margin-top: 1rem;
  padding: 1.3rem 1.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(143, 79, 36, 0.15);
  background:
    radial-gradient(circle at top left, rgba(199, 135, 82, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(255, 246, 235, 0.92), rgba(244, 235, 222, 0.88));
}

.risk-main {
  max-width: 620px;
}

#risk-level {
  display: block;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.95;
  margin-top: 0.35rem;
}

.risk-summary {
  margin-top: 0.7rem;
}

.score-cluster article {
  min-width: 120px;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(32, 22, 11, 0.08);
  background: rgba(255, 252, 248, 0.82);
}

.score-cluster span {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.score-cluster strong,
.highlight-card h4 {
  margin-top: 0.4rem;
  font-size: 1.1rem;
  line-height: 1.35;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.chip-list {
  margin-top: 1rem;
}

.flag-chip,
.snapshot-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
}

.flag-chip {
  background: rgba(143, 79, 36, 0.1);
  color: #61371a;
  border: 1px solid rgba(143, 79, 36, 0.16);
}

.snapshot-chip {
  background: rgba(41, 94, 96, 0.08);
  color: var(--teal);
  border: 1px solid rgba(41, 94, 96, 0.12);
}

.muted-chip-list {
  margin-top: 0.7rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.result-card {
  padding: 1.3rem;
}

.result-card-wide {
  grid-column: span 2;
}

.result-card h4,
.value-strip h3,
.planner-copy h3,
.results-head h3 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  line-height: 1.05;
}

.result-card ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.7rem;
  color: var(--muted);
  line-height: 1.55;
}

.timeline-items {
  display: grid;
  gap: 0.8rem;
}

.timeline-step {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 251, 245, 0.82);
  border: 1px solid rgba(32, 22, 11, 0.08);
}

.timeline-step span {
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.timeline-step strong {
  font-size: 1rem;
}

.hidden {
  display: none;
}

@keyframes float-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .value-strip,
  .highlight-grid,
  .results-grid,
  .split-fields,
  .split-fields-wide {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .result-card-wide {
    grid-column: auto;
  }

  .topbar,
  .risk-banner,
  .results-head {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
  }

  .hero-copy,
  .planner-form,
  .value-strip article,
  .result-card,
  .highlight-card,
  .planner-shell,
  .results-shell {
    padding: 1.1rem;
  }

  .hero-copy h2 {
    font-size: 2.7rem;
  }

  .check-grid {
    grid-template-columns: 1fr;
  }
}