:root {
  --bg: #f4efe4;
  --bg-soft: #e8dcc6;
  --surface: rgba(255, 251, 244, 0.82);
  --surface-strong: #fffaf2;
  --text: #1d1914;
  --muted: #6e6253;
  --line: rgba(29, 25, 20, 0.1);
  --accent: #c44f29;
  --accent-strong: #8f3113;
  --accent-alt: #174956;
  --good: #198754;
  --bad: #a93e2d;
  --shadow: 0 24px 70px rgba(70, 48, 26, 0.14);
}

body.dark {
  --bg: #13110e;
  --bg-soft: #1b1712;
  --surface: rgba(30, 26, 22, 0.88);
  --surface-strong: #231e19;
  --text: #f5ede3;
  --muted: #c7bbab;
  --line: rgba(245, 237, 227, 0.1);
  --accent: #ff8b5a;
  --accent-strong: #ffb696;
  --accent-alt: #8ed5db;
  --good: #5dd39e;
  --bad: #ff8b7c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  line-height: 1.6;
  background:
    radial-gradient(circle at top left, rgba(196, 79, 41, 0.18), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(23, 73, 86, 0.18), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
}

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

code,
pre {
  font-family: "IBM Plex Mono", monospace;
}

.container {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 239, 228, 0.72);
}

body.dark .site-header {
  background: rgba(19, 17, 14, 0.76);
}

.nav-shell,
.footer-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-shell {
  min-height: 78px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  color: #fffaf2;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  box-shadow: var(--shadow);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.main-nav a,
.footer-link {
  text-decoration: none;
  color: var(--muted);
}

.main-nav a:hover,
.main-nav a:focus-visible,
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--text);
}

.main-nav a.is-active {
  color: var(--text);
  font-weight: 700;
}

.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-toggle,
.theme-toggle,
.auth-open,
.auth-close {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

.lang-toggle {
  border: 0;
  padding: 0.5rem 0.75rem;
  min-width: 3rem;
  background: transparent;
}

.lang-toggle.is-active {
  color: #fffaf2;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
}

.auth-open {
  font-weight: 700;
}

.auth-link {
  text-decoration: none;
}

body.auth-modal-active #auth-access {
  display: none;
}

.hero,
.section {
  padding: 5.5rem 0;
}

#auth-access {
  scroll-margin-top: 6rem;
}

.hero-grid,
.lesson-grid,
.daily-card,
.split-heading,
.footer-shell {
  display: grid;
  gap: 1.5rem;
}

.hero-grid {
  grid-template-columns: 1.15fr 0.85fr;
  align-items: start;
}

.daily-card,
.split-heading {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.eyebrow,
.panel-label,
.progress-kicker,
.exercise-level,
.quiz-topic {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

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

h1 {
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.95;
  margin-bottom: 1.2rem;
  max-width: 11ch;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.03;
  margin-bottom: 1rem;
  max-width: 14ch;
}

h3 {
  font-size: 1.35rem;
}

.lead,
.section-heading p,
.lesson-card p,
.roadmap-card p,
.project-card p,
.faq-list p,
.footer-shell p,
.stack-card p,
.daily-card p {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn-primary {
  color: #fffaf2;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hero-metrics li,
.stack-card,
.roadmap-card,
.lesson-card,
.quiz-card,
.project-card,
.score-card,
.daily-card,
.progress-shell,
.faq-list details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
}

.hero-metrics li {
  min-width: 130px;
  padding: 1rem 1.1rem;
}

.hero-metrics strong {
  display: block;
  font-size: 1.8rem;
}

.hero-panel {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.8rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero-stack {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.stack-card {
  padding: 1rem 1.1rem;
}

.hero-panel pre,
.lesson-grid pre {
  margin: 0;
  padding: 1.2rem;
  overflow-x: auto;
  border-radius: 1.1rem;
  background: #16120f;
  color: #f7e6d3;
}

body.dark .hero-panel pre,
body.dark .lesson-grid pre {
  background: #0d0b09;
}

.section-accent {
  background:
    linear-gradient(180deg, rgba(196, 79, 41, 0.08), rgba(23, 73, 86, 0.1)),
    transparent;
}

.daily-card,
.lesson-card,
.project-card,
.score-card,
.progress-shell,
.account-card {
  padding: 1.5rem;
}

.account-card {
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.06);
}

.donation-card {
  margin-bottom: 1.5rem;
  padding: 1.15rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(196, 79, 41, 0.2);
  background:
    radial-gradient(circle at top right, rgba(255, 139, 90, 0.16), transparent 36%),
    linear-gradient(135deg, rgba(196, 79, 41, 0.08), rgba(23, 73, 86, 0.08)),
    var(--surface);
  box-shadow: var(--shadow);
}

.donation-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.donation-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(23, 73, 86, 0.12);
  color: var(--accent-alt);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.donation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1rem;
}

.donation-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.account-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(23, 73, 86, 0.12);
  color: var(--accent-alt);
  font-size: 0.82rem;
  font-weight: 700;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1rem;
}

.account-actions--hidden {
  display: none;
}

.account-email,
.auth-inline-status,
.auth-modal-status {
  color: var(--muted);
}

.auth-inline-status,
.auth-modal-status {
  min-height: 1.5rem;
  margin-top: 0.9rem;
}

.auth-panel {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.auth-modal {
  width: min(560px, calc(100vw - 1.5rem));
  border: 0;
  padding: 0;
  border-radius: 1.5rem;
  background: transparent;
}

.auth-modal::backdrop {
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(6px);
}

.auth-modal__content {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.auth-modal__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.auth-close {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.3rem;
  line-height: 1;
}

.auth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0.75rem;
}

.auth-tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
}

.auth-tab.is-active {
  color: #fffaf2;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
}

.auth-form {
  display: none;
  gap: 0.9rem;
}

.auth-form.is-active {
  display: grid;
}

.auth-form label {
  display: grid;
  gap: 0.4rem;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.85rem 0.95rem;
}

.daily-checklist,
.checklist,
.lesson-stack,
.quiz-grid,
.project-grid,
.faq-list,
.roadmap-grid,
.retention-grid,
.pitfall-grid {
  display: grid;
  gap: 1rem;
}

.roadmap-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.retention-grid,
.pitfall-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.roadmap-card {
  padding: 1.35rem;
}

.module-index {
  display: inline-flex;
  margin-bottom: 1rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  background: rgba(196, 79, 41, 0.12);
  color: var(--accent-strong);
  font-family: "IBM Plex Mono", monospace;
}

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

.check-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.check-item input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent);
}

.progress-summary {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.progress-summary strong {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.progress-bar {
  height: 0.9rem;
  margin-top: 1rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(29, 25, 20, 0.08);
}

body.dark .progress-bar {
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt));
  transition: width 0.25s ease;
}

.lesson-card {
  padding: 1.5rem;
}

.lesson-head {
  margin-bottom: 1rem;
}

.lesson-grid {
  grid-template-columns: 1fr 0.9fr;
  align-items: start;
  margin-bottom: 1rem;
}

.memory-line {
  font-weight: 700;
  color: var(--accent-strong);
}

.challenge-box {
  padding: 1rem 1.1rem;
  border-radius: 1.1rem;
  border: 1px dashed rgba(196, 79, 41, 0.4);
  background: rgba(196, 79, 41, 0.06);
}

.practice-lab {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 1.1rem;
  border: 1px solid var(--line);
  background: rgba(23, 73, 86, 0.06);
}

.practice-field {
  display: grid;
  gap: 0.35rem;
}

.practice-field textarea,
.practice-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0.85rem 0.95rem;
}

.practice-field textarea {
  resize: vertical;
  min-height: 110px;
}

.code-dojo-card {
  gap: 1rem;
}

.code-dojo-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #16120f;
  color: #f7e6d3;
  padding: 1rem 1.05rem;
  resize: vertical;
  min-height: 170px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark .code-dojo-input {
  background: #0d0b09;
}

.code-dojo-input:focus-visible {
  outline: 2px solid rgba(142, 213, 219, 0.55);
  outline-offset: 2px;
}

.code-dojo-feedback {
  margin-top: 0;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
}

.code-dojo-feedback.is-correct {
  border-color: rgba(25, 135, 84, 0.35);
  background: rgba(25, 135, 84, 0.12);
  color: var(--good);
}

.code-dojo-feedback.is-wrong {
  border-color: rgba(196, 79, 41, 0.35);
  background: rgba(196, 79, 41, 0.08);
  color: var(--accent-strong);
}

.quiz-grid,
.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quiz-card,
.project-card,
.pitfall-card,
.retention-card,
.capstone-card {
  padding: 1.4rem;
}

.retention-card,
.pitfall-card,
.capstone-card {
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.retention-card summary {
  cursor: pointer;
  font-weight: 700;
}

.retention-card p {
  margin-top: 0.8rem;
  color: var(--muted);
}

.capstone-card {
  margin-top: 1.5rem;
}

.quiz-options {
  display: grid;
  gap: 0.75rem;
}

.quiz-option {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
}

.quiz-option:hover,
.quiz-option:focus-visible {
  border-color: var(--accent);
}

.quiz-option.is-correct {
  border-color: rgba(25, 135, 84, 0.5);
  background: rgba(25, 135, 84, 0.12);
}

.quiz-option.is-wrong {
  border-color: rgba(169, 62, 45, 0.5);
  background: rgba(169, 62, 45, 0.12);
}

.quiz-feedback {
  min-height: 1.6rem;
  margin-top: 0.9rem;
  color: var(--muted);
}

.score-card {
  margin-top: 1rem;
}

.score-card strong {
  display: block;
  font-size: 2.6rem;
  margin-bottom: 0.4rem;
}

.project-card ul {
  padding-left: 1rem;
  color: var(--muted);
}

.faq-list details {
  padding: 1rem 1.2rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
}

.footer-title {
  font-weight: 700;
  color: var(--text);
}

@media (max-width: 960px) {
  .hero-grid,
  .daily-card,
  .split-heading,
  .lesson-grid,
  .roadmap-grid,
  .retention-grid,
  .pitfall-grid,
  .quiz-grid,
  .project-grid,
  .checklist-grid,
  .footer-shell {
    grid-template-columns: 1fr;
  }

  .nav-shell {
    min-height: auto;
    padding: 1rem 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .header-controls {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .hero,
  .section {
    padding: 4rem 0;
  }

  .hero-actions,
  .main-nav {
    gap: 0.8rem;
  }

  h1,
  h2 {
    max-width: none;
  }

  .hero-metrics li {
    width: calc(50% - 0.5rem);
  }
}
