:root {
  --bg-canvas: #f3f0fa;
  --bg-surface: #ffffff;
  --bg-surface-hover: #fbf9ff;
  --text-primary: #3f3547;
  --text-muted: #685c73;
  --accent-primary: #57234f;
  --accent-secondary: #834478;
  --border-subtle: #e0d7ec;
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 10px 28px -6px rgba(63, 53, 71, 0.1);
  --glow-accent: 0 4px 16px -2px rgba(87, 35, 79, 0.22);
}

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

html, body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: Charter, Cambria, Georgia, serif;
  line-height: 1.68;
  font-size: 18px;
  overflow-wrap: anywhere;
  hyphens: auto;
}

button, input, select, textarea {
  font-family: Charter, Cambria, Georgia, serif;
  font-size: 1rem;
  color: var(--text-primary);
}

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  object-fit: cover;
}

/* Header & Navigation */
.site-header {
  position: relative;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.25rem 1.5rem 0.85rem;
}

.header-top {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  color: #fcfaf9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-variant: small-caps;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 1.65rem;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  line-height: 1;
}

.site-nav {
  max-width: 1200px;
  margin: 0.85rem auto 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.nav-list {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.25rem;
  flex-wrap: wrap;
}

.nav-list a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Containers & Typography */
.main-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

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

.ex-label {
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent-primary);
  font-size: 0.92rem;
  display: block;
  margin-bottom: 0.45rem;
}

h1, h2, h3, h4 {
  color: var(--text-primary);
  line-height: 1.22;
  font-weight: 700;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 3.8rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

h3 {
  font-size: 1.35rem;
}

p {
  margin-bottom: 1.2rem;
}

/* Dot Pattern Backgrounds */
.dot-pattern {
  background-color: var(--bg-canvas);
  background-image: radial-gradient(#cabdd9 1.35px, transparent 1.35px);
  background-size: 20px 20px;
}

/* Hero Section (No Image) */
.hero-stage {
  padding: 3.5rem 2.25rem;
  margin-bottom: 2.5rem;
  border-radius: 0;
  box-shadow: var(--shadow-elevation);
}

.hero-stage h1 {
  max-width: 22ch;
  margin-bottom: 1.25rem;
}

.hero-lead {
  font-size: 1.22rem;
  max-width: 64ch;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
}

/* Pill Buttons */
.btn-pill {
  display: inline-block;
  background-color: var(--accent-primary);
  color: #fdfbf7;
  border: none;
  border-radius: 9999px;
  padding: 0.72rem 1.65rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-kinetic), box-shadow 0.25s var(--ease-kinetic), background-color 0.2s ease;
}

.btn-pill:hover {
  background-color: var(--accent-secondary);
  color: #fdfbf7;
  transform: translateY(-2px);
  box-shadow: var(--glow-accent);
}

.btn-pill-secondary {
  background-color: #70557d;
}

/* Interactive Pathway / Vertical Timeline */
.pathway-stream {
  position: relative;
  padding-left: 3.75rem;
}

.pathway-stream::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.35rem;
  width: 2px;
  background-color: #cbbad8;
}

.stage-block {
  position: relative;
  margin-bottom: 3rem;
}

.stage-node {
  position: absolute;
  left: -3.75rem;
  top: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background-color: var(--accent-primary);
  color: #fdfbf7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 0 0 6px var(--bg-canvas);
  z-index: 2;
}

/* Exercise & Content Panels (Square Corners, Borderless White) */
.exercise-panel {
  background-color: var(--bg-surface);
  border: none;
  border-radius: 0;
  padding: 2.25rem;
  box-shadow: var(--shadow-elevation);
  transition: transform 0.35s var(--ease-kinetic), box-shadow 0.35s var(--ease-kinetic);
}

.exercise-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -6px rgba(63, 53, 71, 0.15);
}

.exercise-panel.dot-pattern {
  background-color: #f8f5fd;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
}

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

/* Interactive Tool Controls */
.interactive-box {
  background-color: #f8f5fc;
  padding: 1.5rem;
  margin-top: 1.25rem;
  border-radius: 0;
}

.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0;
}

.beat-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.beat-cell {
  background-color: var(--bg-surface);
  border: 2px solid #cbbad8;
  border-radius: 0;
  padding: 0.75rem 0.25rem;
  text-align: center;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.2s ease;
}

.beat-cell[aria-pressed="true"] {
  background-color: var(--accent-primary);
  color: #fdfbf7;
  border-color: var(--accent-primary);
}

.feedback-box {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background-color: #efe9f7;
  color: var(--text-primary);
  border-left: 4px solid var(--accent-primary);
  font-size: 0.96rem;
}

/* Visual Frames */
.diagram-frame {
  background-color: #fbf9fe;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0;
}

.diagram-frame img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.diagram-caption {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.55rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-surface);
}

th, td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  font-variant: small-caps;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  background-color: #f7f3fc;
}

/* Forms */
.form-row {
  margin-bottom: 1.25rem;
}

.form-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid #c5b6d4;
  border-radius: 0;
  background-color: var(--bg-surface);
}

/* Reveal Animation */
.reveal-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-kinetic), transform 0.6s var(--ease-kinetic);
}

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

/* Footer */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 1.5rem;
  margin-top: 4rem;
  font-size: 0.94rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

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

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-meta {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .nav-toggle {
    display: inline-block;
  }
  .site-nav {
    display: none;
  }
  .site-nav.nav-open {
    display: block;
  }
  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.5rem 0;
  }
  .pathway-stream {
    padding-left: 2.8rem;
  }
  .pathway-stream::before {
    left: 1rem;
  }
  .stage-node {
    left: -2.8rem;
    width: 2.15rem;
    height: 2.15rem;
    font-size: 0.85rem;
  }
  .beat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .hero-stage, .exercise-panel {
    padding: 1.4rem;
  }
}

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