/* CAA 2026 — Claude-inspired premium design system
   Replaces /assets/premium.css (legacy CAA Premium)
   Philosophy: light, off-white, generous whitespace, single gold accent.
   Typography: Inter (UI), Crimson Pro (editorial serif), JetBrains Mono (mindmaps).
   Mobile-first. No gradients except subtle gold tints on hover. */

:root {
  /* === Neutrals (Claude-inspired warm grays) === */
  --bg: #fafaf7;            /* off-white page background */
  --bg-elev: #ffffff;        /* cards, panels */
  --bg-tint: #f4f3ee;        /* subtle section backgrounds */
  --line: #e8e6df;           /* hairlines, dividers */
  --line-strong: #d4d2c9;    /* card borders */

  /* === Text === */
  --ink: #1a1a1a;            /* primary text (high contrast) */
  --ink-soft: #4a4a4a;       /* secondary text */
  --ink-faint: #8a8a8a;      /* tertiary, hints, timestamps */

  /* === Accent: gold (legacy CAA) === */
  --gold: #c9a55b;
  --gold-soft: #d4b876;
  --gold-deep: #a8863e;
  --gold-tint: rgba(201, 165, 91, 0.10);
  --gold-tint-strong: rgba(201, 165, 91, 0.18);

  /* === Semantic === */
  --success: #2e7d4a;
  --error: #b8364a;
  --warn: #b8860b;

  /* === Domain colors (one per subject, used in mind maps) === */
  --c-01: #c9a55b;   /* CAO - gold (organizational) */
  --c-02: #2e7d4a;   /* GPC - green (patrimony/money) */
  --c-03: #4a6fa5;   /* Projetos - blue (planning) */
  --c-04: #b8364a;   /* Liderança - red (people) */
  --c-05: #7c5b9e;   /* PAI - purple (innovation) */

  /* === Shadows (subtle, only on elevation) === */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

  /* === Geometry === */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --maxw: 1180px;
  --maxw-narrow: 720px;
  --maxw-reading: 880px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11';
  font-size: 16px;
}
.serif { font-family: 'Crimson Pro', Georgia, serif; font-feature-settings: 'liga'; }
.mono { font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace; }

a { color: var(--ink); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-deep); }

img, svg { max-width: 100%; height: auto; display: block; }

/* ============================================
   TYPOGRAPHY — Claude-like hierarchy
   ============================================ */
.t-display {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.t-h1 {
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.t-h2 {
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.t-h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.t-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}
.t-body-lg {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.t-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.t-meta {
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ============================================
   LAYOUT — Claude-like (top nav, centered main)
   ============================================ */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.nav-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-size: 14px;
  color: var(--ink-soft);
}
.nav-links a {
  color: var(--ink-soft);
  padding: 6px 0;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 500; }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
}

main {
  flex: 1;
}
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow {
  max-width: var(--maxw-narrow);
  margin: 0 auto;
  padding: 0 24px;
}
.container-reading {
  max-width: var(--maxw-reading);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   LANDING HERO
   ============================================ */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 24px;
  padding: 4px 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  padding: 6px 14px;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 24px;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold-deep);
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 500;
}
.hero .lead {
  max-width: 640px;
  margin: 0 auto 40px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}
.hero-meta {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.hero-meta strong { color: var(--ink-soft); font-weight: 600; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: #333;
  color: var(--bg);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 16px;
}
.btn-ghost:hover { color: var(--ink); }

/* ============================================
   SECTIONS
   ============================================ */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-divider { border-top: 1px solid var(--line); }

.section-head { margin-bottom: 48px; }
.section-head .eyebrow { margin-bottom: 12px; display: inline-block; }
.section-head h2 { font-size: clamp(28px, 3vw, 36px); font-weight: 500; letter-spacing: -0.02em; margin-bottom: 12px; }
.section-head p { color: var(--ink-soft); font-size: 17px; max-width: 640px; line-height: 1.6; }

/* ============================================
   MATERIA CARDS (grid on landing)
   ============================================ */
.materia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.materia-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all .15s;
  position: relative;
  overflow: hidden;
  color: var(--ink);
}
.materia-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.materia-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent, var(--gold));
  opacity: 0;
  transition: opacity .15s;
}
.materia-card:hover::before { opacity: 1; }

.materia-card .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-tint);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.materia-card[data-subject="01"] { --accent: var(--c-01); }
.materia-card[data-subject="02"] { --accent: var(--c-02); }
.materia-card[data-subject="03"] { --accent: var(--c-03); }
.materia-card[data-subject="04"] { --accent: var(--c-04); }
.materia-card[data-subject="05"] { --accent: var(--c-05); }
.materia-card[data-subject="quiz"] { --accent: var(--ink); }
.materia-card h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}
.materia-card .sub {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  flex: 1;
}
.materia-card .meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 4px;
}
.materia-card .meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   KPI ROW (Claude-style minimal)
   ============================================ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 48px 0;
}
.kpi {
  text-align: left;
}
.kpi-value {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 4px;
}

/* ============================================
   MODE GRID (3 modos: flashcards, mapas, audiobooks)
   ============================================ */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.mode-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all .15s;
  color: var(--ink);
}
.mode-card:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.mode-card .ico {
  font-size: 24px;
  margin-bottom: 4px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-tint);
  display: grid;
  place-items: center;
}
.mode-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.mode-card p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  flex: 1;
}
.mode-card .arrow {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 8px;
}

/* ============================================
   MATERIA PAGE LAYOUT (Claude-like 2-col)
   ============================================ */
.materia-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  padding: 48px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.materia-side {
  position: sticky;
  top: 80px;
  align-self: start;
  height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 8px;
}
.materia-side::-webkit-scrollbar { width: 4px; }
.materia-side::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px; }

.materia-side h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 8px;
}
.materia-side .meta {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 32px;
  line-height: 1.5;
}

.side-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.side-section:last-child { border-bottom: 0; }
.side-section h4 {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 12px;
}
.side-link {
  display: block;
  padding: 6px 0;
  font-size: 14px;
  color: var(--ink-soft);
  border-radius: 0;
  transition: color .15s;
}
.side-link:hover { color: var(--ink); }
.side-link.active {
  color: var(--ink);
  font-weight: 500;
}
.side-link .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  margin-right: 8px;
  vertical-align: middle;
}
.side-link.active .dot { background: var(--gold); }

.progress-block {
  padding: 16px;
  background: var(--bg-tint);
  border-radius: var(--radius);
}
.progress-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 8px;
}
.progress-bar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width .4s;
}
.progress-text {
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   MATERIA ARTICLE (the readable content)
   ============================================ */
.materia-main { min-width: 0; }
.materia-head {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.materia-head .eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 8px;
}
.materia-head h1 {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 8px;
}
.materia-head .lead {
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.audio-block {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0 40px;
}
.audio-block .ico {
  font-size: 22px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--gold-tint);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.audio-block .audio-info { flex: 1; min-width: 0; }
.audio-block .label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: 2px;
}
.audio-block .desc {
  font-size: 13px;
  color: var(--ink-faint);
}
.audio-block audio {
  width: 100%;
  margin-top: 8px;
  height: 32px;
}

.materia-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 32px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.materia-actions a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-elev);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.materia-actions a:hover {
  border-color: var(--ink);
}

/* === Article body — readable prose === */
.prose {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}
.prose h1 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 56px 0 16px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.prose h1:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.prose h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 40px 0 12px;
  color: var(--ink);
}
.prose h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--ink);
}
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.prose li {
  margin-bottom: 8px;
}
.prose blockquote {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 20px;
  margin: 24px 0;
  color: var(--ink-soft);
  font-style: italic;
}
.prose blockquote p { margin-bottom: 8px; }
.prose code {
  background: var(--bg-tint);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'JetBrains Mono', monospace;
}
.prose pre {
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  margin: 20px 0;
}
.prose pre code {
  background: transparent;
  padding: 0;
  font-size: 13px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}
.prose th, .prose td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
}
.prose th {
  background: var(--bg-tint);
  font-weight: 600;
  color: var(--ink);
}
.prose tr:nth-child(2n) td {
  background: var(--bg-tint);
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink-soft); }

/* ============================================
   MAPA MENTAL — Interactive layered view
   ============================================ */
.mapa-stage {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 24px 0;
  min-height: 500px;
  position: relative;
  overflow: hidden;
}
.mapa-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.mapa-breadcrumb {
  display: flex;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  align-items: center;
}
.mapa-breadcrumb a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
.mapa-breadcrumb a:hover { color: var(--ink); }
.mapa-breadcrumb .sep { color: var(--ink-faint); }
.mapa-breadcrumb .current { color: var(--ink); font-weight: 500; }
.mapa-legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-soft);
}
.mapa-legend span { display: inline-flex; align-items: center; gap: 4px; }
.mapa-legend .swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.mapa-svg-wrap {
  background:
    radial-gradient(circle at 1px 1px, rgba(0,0,0,0.04) 1px, transparent 0) 0 0/24px 24px,
    var(--bg-elev);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 480px;
}
.mapa-svg-wrap svg {
  width: 100%;
  height: 100%;
  cursor: grab;
}
.mapa-svg-wrap svg:active { cursor: grabbing; }

.mapa-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.mapa-controls button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  display: grid;
  place-items: center;
  transition: all .15s;
}
.mapa-controls button:hover {
  border-color: var(--ink);
}
.mapa-detail-panel {
  margin-top: 20px;
  padding: 20px 24px;
  background: var(--bg-tint);
  border-radius: var(--radius);
  border-left: 3px solid var(--gold);
  display: none;
}
.mapa-detail-panel.show { display: block; }
.mapa-detail-panel h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}
.mapa-detail-panel p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Map node styles (used by both SVG and HTML) */
.map-node {
  fill: var(--bg-elev);
  stroke: var(--line-strong);
  stroke-width: 1;
  transition: all .2s;
  cursor: pointer;
}
.map-node:hover {
  stroke: var(--gold);
  fill: var(--gold-tint);
}
.map-node.expanded {
  fill: var(--gold-tint);
  stroke: var(--gold);
  stroke-width: 2;
}
.map-node.central {
  fill: var(--ink);
  stroke: var(--ink);
}
.map-node.central text { fill: var(--bg); }
.map-link {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
  transition: all .2s;
}
.map-link.active { stroke: var(--gold); stroke-width: 2; }
.map-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  fill: var(--ink);
  pointer-events: none;
  dominant-baseline: middle;
  text-anchor: middle;
}
.map-label.central { fill: var(--bg); font-weight: 600; font-size: 14px; }

/* ============================================
   AUDIOBOOKS PAGE
   ============================================ */
.audiobook-list { display: flex; flex-direction: column; gap: 12px; }
.audiobook-item {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all .15s;
}
.audiobook-item:hover { border-color: var(--ink); }
.audiobook-item .num {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  width: 28px;
  flex-shrink: 0;
}
.audiobook-item .info { flex: 1; min-width: 0; }
.audiobook-item h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}
.audiobook-item .desc {
  font-size: 13px;
  color: var(--ink-faint);
}
.audiobook-item audio {
  width: 320px;
  max-width: 100%;
  height: 32px;
}
.audiobook-item .actions { display: flex; gap: 8px; }
.audiobook-item a {
  font-size: 13px;
  color: var(--ink-soft);
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.audiobook-item a:hover { background: var(--bg-tint); color: var(--ink); }

/* ============================================
   FLASHCARDS (keep minimal Claude-like)
   ============================================ */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.deck-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all .15s;
  color: var(--ink);
}
.deck-card:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.deck-card .num {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.deck-card h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}
.deck-card .meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.flip-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
}
.flip-card {
  width: 100%;
  max-width: 640px;
  min-height: 340px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  perspective: 1400px;
  cursor: pointer;
  user-select: none;
  transition: box-shadow .2s;
}
.flip-card:hover { box-shadow: var(--shadow-md); }
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 260px;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 0 8px;
}
.flip-back { transform: rotateY(180deg); }
.flip-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 16px;
}
.flip-text {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 500;
}
.flip-card-back .flip-text {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.flip-card-back .flip-text strong { color: var(--ink); font-weight: 600; }
.flip-hint {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 11px;
  color: var(--ink-faint);
  font-style: italic;
}
.flip-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.flip-progress {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ============================================
   QUIZ PAGE
   ============================================ */
.quiz-layout { display: grid; grid-template-columns: 280px 1fr; gap: 56px; padding: 48px 24px; max-width: var(--maxw); margin: 0 auto; }
.quiz-side { position: sticky; top: 80px; align-self: start; }
.quiz-side h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin-bottom: 8px; }
.quiz-side .meta { font-size: 13px; color: var(--ink-faint); margin-bottom: 32px; line-height: 1.5; }

.quiz-stage { min-height: 480px; }
.quiz-intro {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
}
.quiz-intro h2 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.quiz-intro p {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.quiz-intro .actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.quiz-intro .mode-select {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
}

.quiz-result {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
}
.quiz-result h2 {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.quiz-result .pct {
  font-size: 64px;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--gold-deep);
  margin: 16px 0;
  font-family: 'Crimson Pro', Georgia, serif;
}
.quiz-result .breakdown {
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.quiz-result .breakdown-row {
  display: grid;
  grid-template-columns: 60px 1fr 40px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.quiz-result .breakdown-label { color: var(--ink-soft); }
.quiz-result .breakdown-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.quiz-result .breakdown-fill { height: 100%; background: var(--gold); border-radius: 3px; }
.quiz-result .breakdown-pct { font-variant-numeric: tabular-nums; color: var(--ink-soft); text-align: right; }

/* ============================================
   CRONOGRAMA / TIMELINE
   ============================================ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
}
.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-item:last-child { border-bottom: 0; }
.timeline-when {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 4px;
}
.timeline-when.highlight { color: var(--gold-deep); }
.timeline-content h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}
.timeline-content p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 4px;
}
.timeline-content .meta {
  font-size: 12px;
  color: var(--ink-faint);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
  margin-top: 80px;
}
.footer a { color: var(--ink-soft); }
.footer a:hover { color: var(--ink); }
.footer p { margin-bottom: 4px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .materia-layout, .quiz-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 20px;
  }
  .materia-side, .quiz-side {
    position: static;
    height: auto;
    border-bottom: 1px solid var(--line);
    padding-bottom: 24px;
  }
  .topnav-inner { gap: 16px; padding: 12px 16px; }
  .nav-links { gap: 16px; font-size: 13px; }
  .container, .container-narrow, .container-reading { padding: 0 20px; }
  .hero { padding: 56px 0 40px; }
  .section { padding: 48px 0; }
  .prose { font-size: 16px; }
  .prose h1 { font-size: 26px; }
  .prose h2 { font-size: 21px; }
  .flip-card { min-height: 280px; padding: 24px; }
  .flip-text { font-size: 18px; }
  .audiobook-item { flex-direction: column; align-items: stretch; }
  .audiobook-item audio { width: 100%; }
  .audiobook-item .actions { justify-content: flex-end; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 36px; }
  .materia-grid { grid-template-columns: 1fr; }
}

/* ============================================
   UTILITIES
   ============================================ */
.muted { color: var(--ink-faint); }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mt-6 { margin-top: 48px; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.mb-6 { margin-bottom: 48px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.text-center { text-align: center; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
