:root {
  color-scheme: light;
  --ink: #1f2528;
  --muted: #657078;
  --paper: #f6f2ec;
  --panel: #ffffff;
  --line: #d9ded8;
  --forest: #2f6654;
  --teal: #28758a;
  --clay: #c55e45;
  --gold: #a77b2f;
  --mint: #eef6f2;
  --cream: #fff8ea;
  --rose: #fbe9e4;
  --shadow: 0 18px 48px rgba(31, 37, 40, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero {
  min-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 22px clamp(18px, 5vw, 72px) 56px;
  background:
    linear-gradient(92deg, rgba(20, 27, 31, 0.82), rgba(39, 117, 138, 0.32)),
    url("https://images.unsplash.com/photo-1560518883-ce09059eeffa?auto=format&fit=crop&w=1900&q=82");
  background-position: center;
  background-size: cover;
  color: white;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.brand {
  font-size: 1.12rem;
  font-weight: 950;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a,
.primary-link,
.secondary-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(8px);
  font-weight: 850;
}

.hero-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 34px;
  align-items: end;
  margin: auto 0 0;
}

.hero-copy {
  max-width: 850px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffd6bf;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.45rem, 5.3vw, 5.35rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 680px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.91);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-link,
.primary-button {
  border: 0;
  background: var(--clay);
  color: white;
  cursor: pointer;
}

.secondary-link {
  background: rgba(255, 255, 255, 0.18);
}

.planner-preview {
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.planner-preview h2 {
  margin: 12px 0 14px;
  font-size: 1.42rem;
  line-height: 1.2;
}

.planner-preview ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: -42px auto 56px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.status-strip article,
.workspace,
.tool-panel,
.result-panel,
.dashboard-grid article,
.budget-results article,
.program-card,
.checklist-card,
.roadmap article,
.note-card,
.link-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.status-strip article {
  min-height: 118px;
  padding: 18px;
}

.status-strip strong {
  display: block;
  margin-bottom: 6px;
  color: var(--forest);
  font-size: 1.18rem;
}

.status-strip span,
.section-heading p,
.result-panel p,
.dashboard-grid p,
.program-card p,
.checklist-card p,
.risk-card p,
.roadmap p,
.note-card p,
.link-card p,
footer,
small {
  color: var(--muted);
}

.workspace {
  margin-bottom: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.diagnosis-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.06fr 0.95fr;
  gap: 18px;
  align-items: start;
}

.section-heading h2,
.split-section h2 {
  margin-bottom: 8px;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.16;
}

.section-heading.compact {
  max-width: 760px;
  margin-bottom: 18px;
}

.tool-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfb;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 3px solid rgba(47, 102, 84, 0.18);
  border-color: var(--forest);
}

.primary-button {
  min-height: 46px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 950;
}

.result-panel {
  padding: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  background: var(--mint);
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 950;
}

.hero .badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.result-panel h3 {
  margin: 14px 0 8px;
  font-size: 1.38rem;
  line-height: 1.18;
}

.action-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.action-list li {
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  background: #faf8f2;
  border-radius: 0 8px 8px 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-grid article {
  min-height: 154px;
  padding: 18px;
}

.dashboard-grid span,
.budget-results span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.dashboard-grid strong,
.budget-results strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.42rem, 3vw, 2.2rem);
  line-height: 1.06;
}

.score-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebe7;
  margin: 16px 0 10px;
}

.score-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--clay), var(--gold), var(--forest));
  transition: width 180ms ease;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

#budgetForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.budget-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.budget-results article {
  min-height: 132px;
  padding: 18px;
}

.budget-results .risk-card {
  grid-column: 1 / -1;
}

.risk-card.good {
  background: #edf7f2;
}

.risk-card.caution {
  background: var(--cream);
}

.risk-card.danger {
  background: var(--rose);
}

.split-section {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 22px;
}

.program-grid,
.checklist-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.program-card,
.checklist-card,
.link-card {
  padding: 18px;
  box-shadow: none;
}

.program-card strong,
.checklist-card strong,
.link-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.program-card ul,
.checklist-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.checklist-grid {
  margin-top: 14px;
}

.check-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 9px;
  color: var(--muted);
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.roadmap article {
  min-height: 160px;
  padding: 18px;
  box-shadow: none;
}

.roadmap span {
  color: var(--clay);
  font-weight: 950;
}

.roadmap h3 {
  margin: 8px 0;
  font-size: 1.1rem;
}

.note-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px minmax(220px, 1.2fr) 130px auto;
  gap: 10px;
  margin-bottom: 16px;
}

.note-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.note-card {
  padding: 16px;
  box-shadow: none;
}

.note-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.note-card h3 {
  margin-bottom: 4px;
}

.note-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.note-meta span {
  border-radius: 999px;
  background: var(--mint);
  color: var(--forest);
  padding: 4px 9px;
  font-size: 0.82rem;
  font-weight: 850;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--clay);
  cursor: pointer;
  font-weight: 950;
}

.empty-note {
  grid-column: 1 / -1;
  color: var(--muted);
}

.link-card {
  display: grid;
  gap: 8px;
}

.link-card a {
  color: var(--teal);
  font-weight: 900;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 42px;
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .hero-grid,
  .diagnosis-grid,
  .calculator-grid,
  .split-section,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .roadmap,
  .note-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .note-form {
    grid-template-columns: 1fr 1fr;
  }

  .note-form .primary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 86vh;
    padding-bottom: 38px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  main {
    width: min(100% - 20px, 1180px);
    margin-top: -30px;
  }

  #budgetForm,
  .budget-results,
  .program-grid,
  .checklist-grid,
  .dashboard-grid,
  .roadmap,
  .note-form,
  .note-list,
  .link-grid {
    grid-template-columns: 1fr;
  }
}
