:root {
  --ink: #1c2320;
  --muted: #5b6560;
  --line: #dfe3df;
  --paper: #fdfdfb;
  --surface: #ffffff;
  --accent: #1f5c46;
  --accent-dark: #163f30;
  --accent-soft: #e7f1ec;
  --warn-bg: #fdf1e7;
  --warn-ink: #7a4a12;
  --error-bg: #fbe9e9;
  --error-ink: #8a2323;
  --radius: 10px;
  --max-width: 68rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

a { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #8fbfa9;
  outline-offset: 2px;
}

img { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.6rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
p { margin: 0 0 1rem; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent-dark);
  text-decoration: none;
  white-space: nowrap;
}
nav.main-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
nav.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
}
nav.main-nav a.button, .button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.button:hover { background: var(--accent-dark); }
.button.secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 1.5px solid var(--accent);
}
.button.secondary:hover { background: var(--accent-soft); }
.button.danger { background: #9c2b2b; }
.button.danger:hover { background: #7a1f1f; }
.button-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

main { max-width: var(--max-width); margin: 0 auto; padding: 1.5rem 1rem 4rem; }
main.narrow { max-width: 36rem; }

.hero {
  background: linear-gradient(160deg, var(--accent-soft), var(--paper));
  padding: 3rem 1rem;
}
.hero-inner { max-width: var(--max-width); margin: 0 auto; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.flash {
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}
.flash.success { background: var(--accent-soft); color: var(--accent-dark); }
.flash.error { background: var(--error-bg); color: var(--error-ink); }
.flash.warn { background: var(--warn-bg); color: var(--warn-ink); }

form.stacked { display: flex; flex-direction: column; gap: 1rem; max-width: 26rem; }
label { font-weight: 600; font-size: 0.92rem; display: block; margin-bottom: 0.3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; min-height: 6rem; }
.field-hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto; }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; }

.progress-bar { background: var(--line); border-radius: 999px; height: 0.6rem; overflow: hidden; margin: 0.4rem 0 0.8rem; }
.progress-bar-fill { background: var(--accent); height: 100%; }

.stat-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0; }
.stat { min-width: 8rem; }
.stat .value { font-size: 1.6rem; font-weight: 700; color: var(--accent-dark); }
.stat .label { color: var(--muted); font-size: 0.85rem; }

.lesson-content { font-size: 1.05rem; }
.lesson-content h3 { margin-top: 1.4rem; color: var(--accent-dark); }
.lesson-content pre { background: var(--accent-soft); padding: 0.8rem; border-radius: 8px; overflow-x: auto; }

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b1512;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-consent {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.6rem; color: #fff; text-align: center; padding: 1rem;
}
.video-consent button { cursor: pointer; }

.watermark-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  user-select: none;
}
.watermark-layer span {
  display: block;
  color: rgba(31, 92, 70, 0.08);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transform: rotate(-26deg);
  white-space: nowrap;
  padding: 2.4rem 0;
}
.content-page { position: relative; z-index: 1; }

@media print {
  .watermark-layer, .site-header, .site-footer, .no-print { display: none !important; }
  main::after {
    content: "This lesson is personal and cannot be printed or shared.";
    display: block;
    padding: 2rem 0;
    font-weight: 600;
  }
  .lesson-content, .content-page { display: none !important; }
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }

.cookie-notice {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--accent-dark); color: #fff; padding: 0.9rem 1rem;
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: space-between;
}
.cookie-notice p { margin: 0; font-size: 0.9rem; max-width: 40rem; }
.cookie-notice[hidden] { display: none; }

.qr-box { text-align: center; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.2rem; margin: 1.5rem 0; }
.pricing-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1.5rem; background: var(--surface); }
.pricing-card.featured { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pricing-card .price { font-size: 2rem; font-weight: 700; margin: 0.5rem 0; }

.streak-flame { font-size: 1.4rem; }

@media (max-width: 30rem) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  nav.main-nav { width: 100%; justify-content: space-between; }
}
