/* ========================================================================
   TrueVoice Academy — 28D Somatic Atlas Core Styles
   ======================================================================== */

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ── Typography Basics ─────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
  color: var(--fg);
  text-wrap: balance;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--accent-lit);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--accent);
  color: #fff;
}

[hidden] {
  display: none !important;
}

/* ── Utility Typography ───────────────────────────────────────────────── */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-ash);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-200%);
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-xs);
  font-weight: 600;
  transition: transform var(--dur-fast) ease;
}
.skip:focus {
  transform: none;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 6, 7, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  height: var(--head-h);
}

.head-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: 0 var(--s5);
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
  text-decoration: none;
}

.brand-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.brand-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.35); opacity: 1; }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fg);
  line-height: 1;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--fg-ash);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 3px;
}

.head-tools {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-left: auto;
}

/* ── Search Input ─────────────────────────────────────────────────────── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 36px 8px 12px;
  width: 220px;
  transition: all var(--dur-base) var(--ease-smooth);
}

.search-input::placeholder {
  color: var(--fg-dim);
}

.search-input:focus {
  width: 280px;
  background: var(--surface-2);
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px var(--accent-soft);
  outline: none;
}

.search-kbd {
  position: absolute;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--fg-ash);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 6px;
  width: 24px;
  height: 24px;
  color: var(--fg-ash);
  display: grid;
  place-items: center;
  font-size: 16px;
  border-radius: 50%;
}
.search-clear:hover {
  color: var(--fg);
  background: var(--surface-2);
}

/* ── Segmented Control ────────────────────────────────────────────────── */
.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--r-xs);
  color: var(--fg-ash);
  transition: all var(--dur-fast) ease;
}

.seg-btn:hover {
  color: var(--fg);
}

.seg-btn[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--fg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Icon Button ──────────────────────────────────────────────────────── */
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--fg-ash);
  transition: all var(--dur-fast) ease;
  position: relative;
}

.icon-btn:hover {
  color: var(--fg);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.icon-btn.active {
  color: var(--accent-lit);
  border-color: var(--accent-deep);
  background: var(--accent-soft);
}

/* ── Global Progress HUD & Week Bar ───────────────────────────────────── */
.progress-hud {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 8px var(--s5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  font-size: 12px;
  max-width: 1600px;
  margin: 0 auto;
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.hud-stat-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hud-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-ash);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hud-stat-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.hud-stat-val.accent {
  color: var(--accent-lit);
}

.hud-stat-val.gold {
  color: var(--sacred-lit);
}

/* ── Weeks Tabs ───────────────────────────────────────────────────────── */
.weeks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--void);
  border-bottom: 1px solid var(--line);
  max-width: 1600px;
  margin: 0 auto;
}

.week-tab {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 14px 20px 14px;
  border-bottom: 2px solid transparent;
  transition: all var(--dur-base) ease;
  position: relative;
  background: var(--void);
}

.week-tab:hover {
  background: var(--surface);
}

.week-tab[aria-selected="true"] {
  background: var(--surface);
  border-bottom-color: var(--accent);
}

.week-tab + .week-tab {
  border-left: 1px solid var(--line);
}

.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.week-n {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.week-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-ash);
}

.week-t {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-ash);
  transition: color var(--dur-fast) ease;
  line-height: 1.25;
}

.week-tab[aria-selected="true"] .week-t {
  color: var(--fg);
}

.week-bar {
  display: block;
  height: 2px;
  background: var(--line);
  margin-top: 4px;
  border-radius: 1px;
  overflow: hidden;
}

.week-bar i {
  display: block;
  height: 100%;
  background: var(--accent-deep);
  transition: width 0.45s var(--ease-out);
}

.week-tab[aria-selected="true"] .week-bar i {
  background: var(--accent);
}

/* ── Main Layout Shell ────────────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  align-items: start;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - var(--head-h) - var(--hud-h) - 60px);
  position: relative;
}

/* ── Navigation Rail ──────────────────────────────────────────────────── */
.rail {
  position: sticky;
  top: var(--head-h);
  max-height: calc(100vh - var(--head-h));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--void);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.rail-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.rail-title {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}

.rail-subtitle {
  font-size: 12px;
  color: var(--fg-ash);
  margin-top: 3px;
  line-height: 1.4;
}

.lesson-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition: all var(--dur-fast) ease;
  background: transparent;
}

.lesson-btn:hover {
  background: var(--surface);
}

.lesson-btn[aria-current="true"] {
  background: var(--surface-2);
  border-left-color: var(--accent);
}

.lesson-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-dim);
  padding-top: 2px;
  flex: none;
  width: 36px;
  letter-spacing: 0.06em;
}

.lesson-btn[aria-current="true"] .lesson-num {
  color: var(--accent-lit);
  font-weight: 600;
}

.lesson-content {
  flex: 1;
  min-width: 0;
}

.lesson-t {
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-ash);
  font-weight: 500;
}

.lesson-btn[aria-current="true"] .lesson-t {
  color: var(--fg);
}

.lesson-btn.done .lesson-t {
  color: var(--fg-muted);
}

.lesson-dur {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
  margin-top: 4px;
}

.tick {
  flex: none;
  width: 16px;
  color: var(--ok);
  font-size: 12px;
  padding-top: 2px;
  text-align: right;
}

/* ── Content Pane ─────────────────────────────────────────────────────── */
.pane {
  padding: var(--s6) var(--s7) var(--s9);
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

.pane-head {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.meta-row .eyebrow {
  color: var(--accent-lit);
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--fg-dim);
}

h1.lesson-title {
  font-size: clamp(26px, 3.6vw, 38px);
  color: var(--fg);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sense-quote {
  position: relative;
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, rgba(230,0,18,0.06) 0%, rgba(20,16,19,0.85) 100%);
  padding: 18px 22px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg-bone);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s3);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--surface);
  transition: all var(--dur-fast) ease;
}

.btn:hover {
  border-color: var(--line-strong);
  color: var(--fg);
  background: var(--surface-2);
}

.btn.primary {
  background: var(--surface-2);
  border-color: var(--accent-deep);
  color: var(--fg);
}

.btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn.primary[aria-pressed="true"] {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.btn.gold {
  border-color: var(--sacred);
  color: var(--sacred-lit);
}

.btn.gold:hover {
  background: var(--sacred);
  color: #000;
  box-shadow: 0 0 20px var(--sacred-glow);
}

/* ── Section Dividers & Headings ──────────────────────────────────────── */
.section {
  margin-top: var(--s7);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.section-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.section-head::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--line);
}

.section-head .count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-dim);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
}

/* ── Theory Cards ─────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  gap: var(--s3);
}

.cards-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.theory-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.theory-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.theory-card h3 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-lit);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.theory-card p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--fg-muted);
}

/* ── Pain Points (Internal Mode) ──────────────────────────────────────── */
.pain-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.pain-box p {
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--fg-bone);
}

/* ── Practice Step Cards & Timers ─────────────────────────────────────── */
.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  display: flex;
  align-items: stretch;
  transition: all var(--dur-fast) ease;
  overflow: hidden;
}

.step-card:hover {
  border-color: var(--line-strong);
}

.step-card.done {
  border-color: rgba(78, 140, 106, 0.3);
  background: rgba(20, 16, 19, 0.5);
}

.step-check-btn {
  flex: none;
  width: 52px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--fg-dim);
  transition: all var(--dur-fast) ease;
  background: var(--surface);
}

.step-check-btn:hover {
  background: var(--surface-2);
  color: var(--fg);
}

.step-card.done .step-check-btn {
  color: var(--ok);
  background: var(--ok-soft);
}

.step-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.step-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: 0.02em;
}

.step-card.done .step-name {
  color: var(--fg-muted);
  text-decoration: line-through rgba(139, 127, 122, 0.4);
}

.step-dur-badge {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-lit);
  border: 1px solid var(--accent-deep);
  background: var(--accent-soft);
  border-radius: var(--r-xs);
  padding: 3px 9px;
  letter-spacing: 0.04em;
}

.step-body p {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--fg-muted);
}

/* Step Timer Controls */
.step-timer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line-faint);
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
}

.timer-pill.running {
  border-color: var(--accent);
  color: var(--accent-lit);
  background: var(--accent-soft);
  animation: timer-pulse 1.8s ease-in-out infinite;
}

@keyframes timer-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 14px 2px var(--accent-soft); }
}

.timer-btn {
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--fg-muted);
  transition: all var(--dur-fast) ease;
}

.timer-btn:hover {
  background: var(--surface-3);
  color: var(--fg);
  border-color: var(--line-strong);
}

/* ── Daily Homework ───────────────────────────────────────────────────── */
.hw-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sacred);
  padding: 18px 22px;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--fg-bone);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ── Personal Notes per Lesson ────────────────────────────────────────── */
.notes-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notes-textarea {
  width: 100%;
  min-height: 90px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.6;
  padding: 12px;
  resize: vertical;
  transition: border-color var(--dur-fast) ease;
}

.notes-textarea:focus {
  border-color: var(--line-strong);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--fg-ash);
}

/* ── Anatomical Diagrams Container ────────────────────────────────────── */
.schemas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--s3);
  justify-content: center;
}

figure.schema {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 24px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  transition: border-color var(--dur-fast) ease;
}

figure.schema:hover {
  border-color: var(--line-strong);
}

figure.schema.wide {
  grid-column: 1 / -1;
}

figure.schema svg {
  width: 100%;
  max-width: 440px;
  height: auto;
  display: block;
}

figcaption {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-ash);
  text-align: center;
  line-height: 1.4;
}

/* ── Seven Sounds Table ───────────────────────────────────────────────── */
.sounds-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.sounds {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.sounds th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-ash);
  font-weight: 500;
  padding: 0 14px 10px 0;
  border-bottom: 1px solid var(--line);
}

.sounds td {
  padding: 12px 14px 12px 0;
  border-top: 1px solid var(--line);
  color: var(--fg-muted);
  vertical-align: middle;
}

.sounds td:first-child {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  color: var(--accent-lit);
  white-space: nowrap;
}

.sounds td:nth-child(2) {
  color: var(--fg);
  font-weight: 500;
}

.sounds .sound-play-btn {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-ash);
  background: var(--surface-2);
  transition: all var(--dur-fast) ease;
}

.sounds .sound-play-btn:hover {
  color: var(--accent-lit);
  border-color: var(--accent);
}

/* ── Pager Navigation ─────────────────────────────────────────────────── */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}

.pager .btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.pager-pos {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-ash);
  letter-spacing: 0.1em;
}
