:root {
  --bg: #f6f7f3;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --ink: #171a18;
  --muted: #667068;
  --line: rgba(23, 26, 24, 0.1);
  --accent: #184d47;
  --accent-soft: rgba(24, 77, 71, 0.1);
  --accent-warm: #7e6a38;
  --shadow: 0 18px 46px rgba(25, 34, 29, 0.07);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: "SF Mono", "IBM Plex Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    linear-gradient(180deg, rgba(24, 77, 71, 0.06) 0%, transparent 34%),
    linear-gradient(180deg, #f7f8f4 0%, #eef2ed 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 28, 24, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 28, 24, 0.018) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
}

.page-shell {
  width: min(1040px, calc(100vw - 32px));
  margin: 28px auto 64px;
}

.topbar,
.page-footer {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
  margin-top: 10px;
}

.hero,
.principles,
.checklist-section {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero {
  padding: 46px 36px 38px;
}

.hero-copy h1,
.section-heading h2,
.stage-card h3,
.principle-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0;
}

.hero-copy h1 {
  margin: 8px 0 14px;
  font-size: clamp(2.35rem, 4vw, 4.35rem);
  line-height: 1.06;
  max-width: 720px;
}

.eyebrow,
.stage-tag,
.control-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hero-text,
.bilingual-body,
.stage-description,
.stage-exit {
  color: var(--muted);
  line-height: 1.6;
  font-size: 1rem;
}

.hero-text {
  max-width: 720px;
}

.control-row {
  display: grid;
  gap: 10px;
}

.topbar-row {
  justify-items: end;
}

.lang-switch,
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lang-btn,
.filter-chip,
.reset-btn,
.secondary-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.lang-btn:hover,
.filter-chip:hover,
.reset-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 28, 24, 0.22);
}

.lang-btn.is-active,
.filter-chip.is-active {
  background: var(--accent);
  color: #f7f3ec;
  border-color: var(--accent);
}

.progress-panel {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.95rem;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 28, 24, 0.08);
  overflow: hidden;
}

.progress-value {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-warm) 100%);
  border-radius: inherit;
  transition: width 220ms ease;
}

.reset-btn {
  justify-self: start;
}

.secondary-btn {
  justify-self: start;
}

.principles,
.checklist-section {
  margin-top: 22px;
  padding: 28px;
}

.checklist-status {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 18px 0 18px;
  padding-top: 2px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.action-note {
  min-height: 1.2rem;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
}

.section-heading-top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 2.4vw, 2.6rem);
}

.checklist-filter-row {
  justify-items: end;
}

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

.principle-card,
.stage-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.principle-card {
  padding: 18px;
}

.principle-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.principle-card h3,
.stage-card h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.stage-card {
  padding: 22px 24px;
}

.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.stage-stat {
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(31, 28, 24, 0.06);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: center;
}

.stage-subsection h4 {
  margin: 0 0 6px;
  font-size: 0.86rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

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

.check-item {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.check-item label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  cursor: pointer;
}

.check-item input {
  margin-top: 4px;
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--accent);
}

.check-copy {
  display: grid;
  gap: 4px;
}

.check-copy strong,
.principle-card .bilingual-title,
.stage-card .bilingual-title {
  display: block;
  line-height: 1.35;
}

.bilingual-primary {
  color: var(--ink);
}

.bilingual-secondary {
  display: none;
}

.is-hidden {
  display: none;
}

.meta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease;
}

.meta-link:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 28, 24, 0.22);
}

@media (max-width: 920px) {
  .stage-grid,
  .principle-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 24px;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .section-heading-top {
    flex-direction: column;
    align-items: start;
  }

  .checklist-filter-row {
    justify-items: start;
  }

  .checklist-status {
    grid-template-columns: 1fr;
  }

  .action-row {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 20px, 1180px);
    margin: 12px auto 36px;
  }

  .principles,
  .checklist-section {
    padding: 18px;
  }

  .stage-head {
    flex-direction: column;
  }

  .stage-stat {
    min-width: 0;
  }

  .topbar,
  .page-footer {
    justify-content: flex-start;
  }

  .topbar-row {
    justify-items: start;
  }
}
