:root {
  --bg-canvas: #f7f5f0;
  --bg-surface: #ece6db;
  --bg-surface-hover: #e3dbcd;
  --bg-red-band: #3b1313;
  --bg-red-muted: #f2e4e1;
  --text-primary: #111111;
  --text-muted: #4a453e;
  --text-hero: #fcfaf5;
  --accent-primary: #d62828;
  --accent-secondary: #9e1b1b;
  --border-subtle: rgba(17, 17, 17, 0.14);
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 12px 32px -4px rgba(17, 17, 17, 0.14);
  --glow-accent: 0 0 24px -4px rgba(214, 40, 40, 0.35);
  --glass-backdrop: blur(16px) saturate(160%);
  --radius: 4px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.65;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  margin: 24px;
  border: 1px solid var(--border-subtle);
  min-height: calc(100vh - 48px);
  overflow-wrap: anywhere;
  hyphens: auto;
}

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.65rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }

p, ul, ol {
  margin-bottom: 1.2rem;
}

.prose {
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header: strictly static/relative, far-left brand */
.site-header {
  position: relative;
  width: 100%;
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.3s var(--ease-kinetic);
  z-index: 20;
}

.site-header.scrolled {
  background-color: var(--bg-surface);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin-right: auto;
}

.brand-dot {
  width: 12px;
  height: 12px;
  background-color: var(--accent-primary);
  border-radius: 2px;
  display: inline-block;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
}

.desktop-nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  position: relative;
  padding-bottom: 3px;
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-primary);
  transition: width 0.25s var(--ease-kinetic);
}

.desktop-nav a:hover::after,
.desktop-nav a[aria-current="page"]::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-primary);
}

.mobile-nav-drawer {
  display: none;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 24px;
}

.mobile-nav-drawer.open {
  display: block;
}

.mobile-nav-drawer ul {
  list-style: none;
  margin: 0;
  display: grid;
  gap: 12px;
}

.mobile-nav-drawer a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  display: block;
  padding: 6px 0;
}

/* Hero */
.hero-full {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  background-color: #1a1110;
  overflow: hidden;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: contrast(1.15);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17,12,10,0.65) 0%, rgba(28,14,12,0.88) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 780px;
  color: var(--text-hero);
}

.hero-content h1,
.hero-content p {
  color: var(--text-hero);
}

.hero-kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(214, 40, 40, 0.85);
  color: var(--text-hero);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

/* Buttons & Links */
.btn-primary {
  display: inline-block;
  background-color: var(--accent-primary);
  color: var(--text-hero);
  font-weight: 700;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-primary);
  transition: transform 0.25s var(--ease-kinetic), box-shadow 0.25s var(--ease-kinetic), background-color 0.2s;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--accent-secondary);
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-elevation), var(--glow-accent);
}

.link-secondary {
  display: inline-block;
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
}

.hero-content .link-secondary {
  color: var(--text-hero);
  margin-left: 20px;
}

.link-secondary::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 35%;
  height: 2px;
  background-color: var(--accent-primary);
  transition: width 0.3s var(--ease-kinetic);
}

.link-secondary:hover::after {
  width: 100%;
}

/* Bands & Sections */
.band {
  padding: 72px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.band-paper { background-color: var(--bg-canvas); }
.band-surface { background-color: var(--bg-surface); }
.band-red-wash { background-color: var(--bg-red-muted); }

.section-header {
  margin-bottom: 40px;
}

.section-tag {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  display: block;
  margin-bottom: 8px;
}

/* Glass Lesson Cards & Grids */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.lesson-card {
  background: rgba(255, 253, 249, 0.72);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.3s var(--ease-kinetic), box-shadow 0.3s var(--ease-kinetic);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lesson-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: var(--shadow-elevation);
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 18px;
  background-color: #221d1a;
}

.card-img-wrap.ratio-16-9 { aspect-ratio: 16 / 9; }
.card-img-wrap.ratio-1-1 { aspect-ratio: 1 / 1; }

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Split Screen Editorial */
.split-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 36px;
  align-items: start;
}

/* Ingredient Comparison Table */
.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.85);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background-color: var(--bg-surface);
  font-weight: 800;
}

/* Caution Callout */
.caution-box {
  border-left: 4px solid var(--accent-primary);
  background: rgba(214, 40, 40, 0.08);
  padding: 20px 24px;
  border-radius: var(--radius);
  margin: 24px 0;
}

/* Symptom Disclosures */
details.symptom-item {
  background: rgba(255, 253, 249, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 12px;
  padding: 16px 20px;
}

details.symptom-item summary {
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details.symptom-item summary::after {
  content: "+";
  color: var(--accent-primary);
  font-size: 1.25rem;
  font-weight: 800;
}

details.symptom-item[open] summary::after {
  content: "−";
}

details.symptom-item .symptom-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Worksheet & Forms */
.worksheet-panel {
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
}

.output-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  font-family: monospace;
  white-space: pre-wrap;
  font-size: 0.88rem;
  margin-top: 16px;
}

/* Footer */
.site-footer {
  background-color: var(--bg-surface);
  padding: 56px 0 36px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-bottom: 36px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-kinetic), transform 0.65s var(--ease-kinetic);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  body {
    margin: 8px;
    min-height: calc(100vh - 16px);
  }
  .desktop-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-block;
  }
  .split-layout {
    grid-template-columns: 1fr;
  }
  .hero-full {
    min-height: 68vh;
    padding: 56px 16px;
  }
}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
