/* ============================================
   Think to Know — Design System
   Light editorial theme
   ============================================ */

:root {
  --paper: #FBF9F4;
  --paper-raised: #FFFFFF;
  --ink: #1C1B18;
  --ink-soft: #4A463F;
  --muted: #807A6F;
  --line: #E6E1D6;
  --line-strong: #D5CEBF;

  --accent: #1E6B52;        /* deep green — site accent */
  --accent-soft: #E7F0EC;

  --s1: #BC5430;            /* clay — Stage 1 */
  --s1-soft: #F7EAE3;
  --s2: #1E6B52;            /* green — Stage 2 */
  --s2-soft: #E7F0EC;
  --s3: #2D5C9E;            /* blue — Stage 3 */
  --s3-soft: #E8EEF7;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1080px;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 249, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand em { color: var(--accent); font-style: normal; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
}

.site-nav a:hover { background: var(--accent-soft); color: var(--ink); }
.site-nav a.active { background: var(--ink); color: var(--paper); }

/* ---------- Hero ---------- */

.hero { padding: 72px 0 56px; }

.hero .kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero .lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 680px;
}

.hero blockquote {
  margin: 28px 0 0;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 620px;
}

.hero blockquote cite { display: block; font-size: 0.85rem; font-style: normal; color: var(--muted); margin-top: 8px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.btn:hover { background: var(--accent); color: #fff; }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
}

.btn.ghost:hover { border-color: var(--ink); background: transparent; }

.btn.small { padding: 7px 16px; font-size: 0.85rem; }

/* ---------- Stage cards (homepage) ---------- */

.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 40px 0 64px;
}

.stage-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stage-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(28, 27, 24, 0.08);
  color: var(--ink);
}

.stage-card .stage-num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 999px;
  align-self: flex-start;
}

.stage-card[data-stage="s1"] .stage-num { background: var(--s1-soft); color: var(--s1); }
.stage-card[data-stage="s2"] .stage-num { background: var(--s2-soft); color: var(--s2); }
.stage-card[data-stage="s3"] .stage-num { background: var(--s3-soft); color: var(--s3); }

.stage-card h3 { margin: 4px 0 0; }
.stage-card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; flex: 1; }

/* ---------- Progress ---------- */

.progress-wrap { margin-top: 8px; }

.progress-track {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.35s ease;
}

[data-stage="s1"] .progress-fill, .page-s1 .progress-fill { background: var(--s1); }
[data-stage="s2"] .progress-fill, .page-s2 .progress-fill { background: var(--s2); }
[data-stage="s3"] .progress-fill, .page-s3 .progress-fill { background: var(--s3); }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

/* ---------- Stage page layout ---------- */

.stage-hero { padding: 56px 0 32px; border-bottom: 1px solid var(--line); }

.stage-hero .stage-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.page-s1 .stage-tag { background: var(--s1-soft); color: var(--s1); }
.page-s2 .stage-tag { background: var(--s2-soft); color: var(--s2); }
.page-s3 .stage-tag { background: var(--s3-soft); color: var(--s3); }

.stage-hero .lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 720px; }

.stage-progress-bar { max-width: 420px; margin-top: 24px; }

/* Gate panels: goals / assumptions / stop signs */

.gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 36px 0 12px;
}

.gate {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.gate h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.gate.goals h4 { color: var(--accent); }
.gate.assumptions h4 { color: #8A6D1F; }
.gate.stop h4 { color: #A33B2E; }

.gate.stop { background: #FBF1EF; border-color: #EBD5D0; }
.gate.assumptions { background: #FBF6EA; border-color: #EBE0C4; }

.gate ul { margin: 0; padding-left: 18px; }
.gate li { margin-bottom: 8px; font-size: 0.93rem; color: var(--ink-soft); }

/* ---------- Content layout with sidebar ---------- */

.stage-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 48px;
  padding: 48px 0 80px;
}

.toc {
  position: sticky;
  top: 96px;
  align-self: start;
  font-size: 0.88rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}

.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }

.toc a {
  display: block;
  padding: 5px 10px;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid var(--line);
  line-height: 1.4;
}

.toc a:hover { color: var(--ink); border-left-color: var(--ink); }

/* ---------- Milestone sections ---------- */

.milestone {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 34px;
  margin-bottom: 28px;
  scroll-margin-top: 90px;
}

.milestone h3 { margin-bottom: 4px; }

.milestone .objective {
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 16px;
}

.milestone .why { color: var(--ink-soft); }

.milestone .resources {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 0.9rem;
}

.milestone .resources strong {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.milestone .resources ul { margin: 0; padding-left: 18px; }
.milestone .resources li { margin-bottom: 4px; }

/* ---------- Checklist ---------- */

.checklist { list-style: none; margin: 18px 0 0; padding: 0; }

.checklist li { margin-bottom: 10px; }

.check-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.check-item:hover { border-color: var(--line-strong); }

.check-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.check-item input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.page-s1 .check-item input:checked { background: var(--s1); border-color: var(--s1); }
.page-s2 .check-item input:checked { background: var(--s2); border-color: var(--s2); }
.page-s3 .check-item input:checked { background: var(--s3); border-color: var(--s3); }

.check-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.check-item .check-text strong { display: block; font-size: 0.97rem; }
.check-item .check-text span { display: block; font-size: 0.88rem; color: var(--muted); margin-top: 2px; }

.check-item input:checked ~ .check-text strong {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

/* ---------- Stage footer nav ---------- */

.stage-footer-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 72px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ---------- Sections / misc ---------- */

.section { padding: 48px 0; }

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.principle h4 { margin-bottom: 6px; }
.principle p { font-size: 0.94rem; color: var(--ink-soft); margin: 0; }

.principle .num {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

.callout {
  background: var(--accent-soft);
  border: 1px solid #CFE2DA;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 32px 0;
}

.callout p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer a { color: var(--ink-soft); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .stage-body { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .milestone { padding: 24px 20px; }
  .site-header .container { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
}
