/* ============================================================
   O CÉREBRO CANÔNICO — stylesheet
   ============================================================ */

:root {
  --bg: #0f0f10;
  --bg-raised: #151517;
  --bg-elev: #1b1b1d;
  --line: #26262a;
  --line-soft: #1e1e21;
  --text: #ebe8e1;
  --text-muted: #8a8680;
  --text-dim: #5a5854;
  --accent: #d19900;
  --accent-hi: #e8ae17;
  --accent-soft: rgba(209, 153, 0, 0.12);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar-w: 280px;
  --max-w: 720px;
}

[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-raised: #eeece6;
  --bg-elev: #e6e3dc;
  --line: #d7d3c9;
  --line-soft: #e2ded4;
  --text: #1a1a1a;
  --text-muted: #625f58;
  --text-dim: #8a877e;
  --accent: #a77800;
  --accent-hi: #8d6400;
  --accent-soft: rgba(167, 120, 0, 0.1);
}

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

/* ============================================================
   SCROLLBAR GLOBAL
   ============================================================ */
* { scrollbar-width: thin; scrollbar-color: rgba(209,153,0,0.25) transparent; }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(209,153,0,0.25); border-radius: 2px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(209,153,0,0.8); }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
  font-feature-settings: "ss01", "ss02";
  overflow-x: hidden;
  position: relative;
}

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

#section-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: min(42vw, 560px);
  height: min(42vw, 560px);
  border-radius: 50%;
  background: rgba(209, 153, 0, 0.16);
  filter: blur(110px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}
.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.08s linear;
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  position: fixed; top: 22px; right: 28px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text-muted);
  cursor: pointer;
  z-index: 90;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   MOBILE MENU BUTTON + OVERLAY
   ============================================================ */
.menu-btn {
  display: none;
  position: fixed; top: 18px; left: 20px;
  width: 38px; height: 38px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  z-index: 95;
}
.menu-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 85;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.menu-overlay.open { opacity: 1; }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--line-soft);
  padding: 36px 28px 36px;
  overflow-y: auto;
  z-index: 80;
  transition: transform 0.35s cubic-bezier(.6,.05,.28,.9);
}

.sidebar__brand {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.sidebar__brand-sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sidebar__nav {
  margin-top: 38px;
  display: flex;
  flex-direction: column;
}

.sidebar__section {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 22px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.sidebar__section:first-of-type { margin-top: 0; }

.sidebar__link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.35;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -12px;
  transition: all 0.18s ease;
}
.sidebar__link:hover { color: var(--text); }
.sidebar__link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}
.sidebar__num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  min-width: 14px;
  flex-shrink: 0;
}
.sidebar__link.active .sidebar__num { color: var(--accent); }

/* ============================================================
   MAIN
   ============================================================ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 80vh;
  padding: 120px 80px 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  top: 50px; right: 80px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

.hero__eyebrow,
.hero__title,
.hero__subtitle,
.hero__cta {
  position: relative;
  z-index: 2;
  will-change: transform, opacity;
}

.hero__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 40px;
}

.hero__title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(54px, 9vw, 128px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 36px;
}
.hero__title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.35;
  color: var(--text-muted);
  max-width: 640px;
  font-style: italic;
  margin-bottom: 48px;
}
.hero__subtitle strong {
  font-style: normal;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--text);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--text);
  width: fit-content;
  transition: all 0.25s ease;
}
.hero__cta:hover { color: var(--accent); border-color: var(--accent); gap: 18px; }
.arrow { display: inline-block; transition: transform 0.25s ease; }
.hero__cta:hover .arrow { transform: translateY(4px); }

/* ============================================================
   ONBOARDING — Antes de começar
   ============================================================ */
.onboard {
  padding: 100px 80px 110px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-raised);
}
.onboard__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.onboard__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 800px;
  margin-bottom: 24px;
}
.onboard__lede {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  font-style: italic;
  color: var(--text-muted);
  max-width: 700px;
  margin-bottom: 70px;
}

/* Flow diagram — 4 elementos */
.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
}
.flow__node {
  position: relative;
  padding: 28px 26px 30px;
  border-right: 1px solid var(--line);
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.6s ease;
}
.flow__node:last-child { border-right: none; }
.flow__node.in { opacity: 1; transform: translateY(0); }
.motion-enabled .flow__node:not(.in) { transform: translateY(10px); }

.flow__num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.flow__name {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-top: 20px;
  letter-spacing: -0.02em;
}
.flow__role {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--accent);
}
.flow__desc {
  margin-top: 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
.flow__desc code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-elev);
  padding: 1px 5px;
  border-radius: 2px;
}

.flow__arrow {
  position: absolute;
  right: -7px; top: 44px;
  width: 14px; height: 14px;
  background: var(--bg);
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  transform: rotate(45deg) scale(1);
  transform-origin: center;
  transition: transform 0.5s cubic-bezier(.5,1.4,.5,1) 0.3s;
  z-index: 2;
}
.motion-enabled .flow__node:not(.in) .flow__arrow { transform: rotate(45deg) scale(0.85); }
.flow__node.in .flow__arrow { transform: rotate(45deg) scale(1); }

.flow-legend {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-align: center;
}

/* ============================================================
   NA PRÁTICA — O que você vai usar
   ============================================================ */
.na-pratica {
  padding: 100px 80px 110px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}
.na-pratica__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.na-pratica__title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 800px;
  margin-bottom: 16px;
}
.na-pratica__title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.na-pratica__lede {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  font-style: italic;
  color: var(--text-muted);
  max-width: 700px;
  margin-bottom: 56px;
}
.na-pratica__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  max-width: 900px;
}
.na-pratica__card {
  padding: 32px 30px 34px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.na-pratica__card:hover {
  background: var(--bg-raised);
  border-color: rgba(209, 153, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(209, 153, 0, 0.08);
}
.na-pratica__card:nth-child(2n) { border-right: none; }
.na-pratica__card:nth-child(3),
.na-pratica__card:nth-child(4) { border-bottom: none; }
.na-pratica__card::after {
  content: "";
  position: absolute;
  inset: -20% auto -20% -40%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-150%) skewX(-18deg);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
  pointer-events: none;
}
.na-pratica__card:hover::after {
  transform: translateX(340%) skewX(-18deg);
  opacity: 1;
}
.na-pratica__card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.na-pratica__tool {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.na-pratica__cost {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-elev);
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid var(--line);
  white-space: nowrap;
  flex-shrink: 0;
}
.na-pratica__text {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-muted);
}
.na-pratica__text code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  color: var(--accent-hi);
  padding: 1px 5px;
  border-radius: 2px;
}
.na-pratica__text em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text);
}
.na-pratica__note {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  max-width: 900px;
}

/* ============================================================
   STEPS — "Agora você começa"
   ============================================================ */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  margin: 40px 0;
}
.step {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.step:last-child { border-bottom: none; }
.step:hover {
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px rgba(209, 153, 0, 0.06);
}
.step::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -18%;
  width: 26%;
  background: linear-gradient(90deg, transparent, rgba(209, 153, 0, 0.08), transparent);
  transform: skewX(-20deg) translateX(-180%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.step:hover::after,
.step.is-active::after {
  transform: skewX(-20deg) translateX(620%);
}
.step__num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  min-width: 64px;
  padding: 28px 0 28px 26px;
  flex-shrink: 0;
  line-height: 1;
  padding-top: 30px;
  transition: transform 0.35s ease, color 0.35s ease;
}
.step__body {
  padding: 26px 28px 28px 0;
  flex: 1;
  transition: transform 0.35s ease;
}
.step.is-active {
  background: linear-gradient(90deg, rgba(209, 153, 0, 0.08), transparent 44%);
  border-color: rgba(209, 153, 0, 0.16);
}
.step.is-active .step__num {
  color: var(--accent-hi);
  transform: translateX(6px);
}
.step.is-active .step__body { transform: translateX(4px); }
.step__title {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 8px;
}
.step__text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 0 !important;
}
.step__text code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  color: var(--accent-hi);
  padding: 1px 5px;
  border-radius: 2px;
}
.step__link {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}
.step__link:hover { border-color: var(--accent); }

.steps-rail {
  position: relative;
  overflow: hidden;
}

/* ============================================================
   GRAPH VISUALIZATION
   ============================================================ */
.graph-viz {
  margin: 44px 0 32px;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  background: #0a0a0b;
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.graph-viz::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(209, 153, 0, 0.12), transparent 30%),
    radial-gradient(circle at 78% 68%, rgba(209, 153, 0, 0.08), transparent 32%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.graph-viz:hover {
  border-color: rgba(209, 153, 0, 0.26);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  transform: translateY(-2px);
}
.graph-viz:hover::after,
.graph-viz.is-active::after { opacity: 1; }
.graph-viz.is-active { border-color: rgba(209, 153, 0, 0.28); }
.graph-viz__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}
.graph-viz svg {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 50%;
  will-change: transform;
}
.graph-viz__caption {
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: var(--text-dim) !important;
  padding: 12px 18px !important;
  margin: 0 !important;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-raised);
}

/* ============================================================
   SKILLS APPENDIX
   ============================================================ */
.skill-block {
  margin: 36px 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.skill-block:hover {
  border-color: rgba(209, 153, 0, 0.26);
  box-shadow: 0 0 0 1px rgba(209, 153, 0, 0.08);
}
.skill-block::after,
.codeblock::after {
  content: "";
  position: absolute;
  inset: -10% auto -10% -35%;
  width: 32%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: skewX(-18deg) translateX(-180%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.95s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}
.skill-block:hover::after,
.codeblock:hover::after {
  transform: skewX(-18deg) translateX(640%);
  opacity: 1;
}
.skill-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.skill-block__cmd {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-hi);
  letter-spacing: 0.03em;
}
.skill-block__desc {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}
.skill-block pre {
  padding: 20px;
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
}
.skill-block pre code {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 0;
  white-space: pre;
}

/* ============================================================
   CONTENT / CHAPTERS
   ============================================================ */
.content {
  padding: 40px 80px 80px;
}

.chapter {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 90px 0;
  border-bottom: 1px solid var(--line-soft);
}
.chapter:last-child { border-bottom: none; }

.reveal {
  opacity: 1;
  clip-path: none;
  transform: translateY(0) scale(1);
  transition:
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.motion-enabled .reveal:not(.in) {
  transform: translateY(10px) scale(1);
}
.reveal.in {
  opacity: 1;
  clip-path: none;
  transform: translateY(0) scale(1);
}

.motion-item {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: none;
  transition:
    transform 0.72s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--motion-order, 0) * 58ms);
  will-change: transform;
}
.motion-enabled .motion-item:not(.in) {
  transform: translate3d(0, var(--motion-y, 12px), 0) scale(1);
}
.motion-item.in {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

.chapter__head {
  position: relative;
  z-index: 2;
}

.chapter__num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.chapter__title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(38px, 5.2vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 36px;
}
.chapter__title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.chapter__kicker {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 600px;
}

/* Prose */
.prose p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 22px;
  text-wrap: pretty;
}
.prose p.muted { color: var(--text-muted); }
.prose p strong { font-weight: 600; color: var(--text); }

.prose h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 48px 0 18px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.prose h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 36px 0 14px;
}

.prose code {
  font-family: var(--mono);
  font-size: 13.5px;
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  color: var(--accent-hi);
  padding: 1px 6px;
  border-radius: 2px;
}

.prose em { font-family: var(--serif); font-style: italic; color: var(--text); }

.prose blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.45;
  color: var(--text);
  margin: 36px 0;
  padding-left: 24px;
  border-left: 2px solid var(--accent);
  max-width: 90%;
}

.pullquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.3;
  color: var(--text);
  margin: 52px 0;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  letter-spacing: -0.01em;
}

.prose ol { padding-left: 22px; margin-bottom: 24px; }
.prose ol li {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 14px;
}

.callout {
  margin: 36px 0;
  padding: 22px 24px;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}
.callout__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ============================================================
   CODEBLOCK
   ============================================================ */
.codeblock {
  margin: 32px 0;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.codeblock:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.codeblock__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}
.codeblock__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.codeblock__copy {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.codeblock__copy:hover { color: var(--accent); border-color: var(--accent); }
.codeblock__copy.ok { color: var(--accent); border-color: var(--accent); }
.codeblock pre {
  padding: 20px;
  overflow-x: auto;
}
.codeblock pre code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 0;
  white-space: pre;
}
.codeblock--collapsible .codeblock__pre-wrap,
.skill-block--collapsible .codeblock__pre-wrap {
  position: relative;
  max-height: none;
  overflow: visible;
  transition: max-height 0.4s ease;
}
.interactions-enabled .codeblock--collapsible:not(.expanded) .codeblock__pre-wrap,
.interactions-enabled .skill-block--collapsible:not(.expanded) .codeblock__pre-wrap {
  max-height: 220px;
  overflow: hidden;
}
.interactions-enabled .codeblock--collapsible .codeblock__pre-wrap::after,
.interactions-enabled .skill-block--collapsible .codeblock__pre-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--bg-raised));
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.codeblock--collapsible.expanded .codeblock__pre-wrap,
.skill-block--collapsible.expanded .codeblock__pre-wrap {
  max-height: 9000px;
}
.codeblock--collapsible.expanded .codeblock__pre-wrap::after,
.skill-block--collapsible.expanded .codeblock__pre-wrap::after {
  opacity: 0;
}
.codeblock__expand {
  display: none;
  width: 100%;
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: none;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}
.interactions-enabled .codeblock__expand {
  display: block;
}
.codeblock__expand:hover { color: var(--accent); }
.codeblock--collapsible.expanded .codeblock__expand { border-top: none; }

/* ============================================================
   CHIPS (file names) + expandable defs
   ============================================================ */
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 2px 10px;
  margin: 0 4px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--accent-hi);
  border-radius: 12px;
  cursor: default;
  transition: all 0.2s ease;
  user-select: none;
}
.interactions-enabled .chip {
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.chip.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.chip-def {
  max-height: none;
  opacity: 1;
  overflow: visible;
  margin: 16px 0 24px;
  padding: 18px 20px;
  background: var(--bg-raised);
  border-left: 2px solid var(--accent);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}
.interactions-enabled .chip-def {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  padding: 0 20px;
}
.chip-def.open {
  max-height: 400px;
  opacity: 1;
  padding: 18px 20px;
  margin: 16px 0 24px;
}
.chip-def strong { color: var(--text); font-weight: 600; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow-x: auto;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.table-wrap th, .table-wrap td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.table-wrap th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-raised);
  font-weight: 500;
}
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap td { color: var(--text); line-height: 1.55; }

/* ============================================================
   FAQ ACCORDION
   ============================================================ */
.faq {
  border-top: 1px solid var(--line-soft);
  margin-top: 8px;
}
.faq__item {
  border-bottom: 1px solid var(--line-soft);
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.faq__item:hover {
  border-color: rgba(209, 153, 0, 0.18);
  background: rgba(209, 153, 0, 0.03);
  transform: translateX(4px);
}
.faq__q {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: default;
  padding: 20px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.interactions-enabled .faq__q {
  cursor: pointer;
}
.faq__q:hover { color: var(--accent); }
.faq__q::after {
  content: '+';
  display: none;
  font-family: var(--mono);
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
  transition: transform 0.3s ease;
}
.interactions-enabled .faq__q::after {
  display: block;
}
.faq__item.open .faq__q::after { transform: rotate(45deg); }
.faq__a {
  max-height: none;
  overflow: visible;
  transition: max-height 0.45s cubic-bezier(.5,.05,.2,1), padding 0.3s ease;
  padding-bottom: 24px;
}
.interactions-enabled .faq__a {
  max-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}
.faq__item.open .faq__a {
  max-height: 900px;
  padding-bottom: 24px;
}
.faq__a p {
  font-size: 15.5px !important;
  line-height: 1.7 !important;
  color: var(--text-muted) !important;
  margin-bottom: 14px !important;
}
.faq__a p:last-child { margin-bottom: 0 !important; }
.faq__a strong { color: var(--text) !important; font-weight: 600; }
.faq__a code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  color: var(--accent-hi);
  padding: 1px 5px;
  border-radius: 2px;
}
.faq__a em { font-family: var(--serif); font-style: italic; color: var(--text); }
.faq__a ul {
  padding-left: 20px;
  margin-bottom: 14px;
}
.faq__a ul li {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ============================================================
   GLOSSARY
   ============================================================ */
.glossary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line-soft);
}
.glossary__item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
}
.glossary__term {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.glossary__def {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

/* ============================================================
   CLOSING SECTION
   ============================================================ */
.closing {
  min-height: 80vh;
  padding: 120px 80px 100px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.closing__inner {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: 0;
  text-align: right;
}
.closing__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 40px;
}
.closing__title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(54px, 9vw, 128px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 36px;
}
.closing__lede strong {
  font-style: normal;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--text);
}
.closing__title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.closing__lede {
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 28px);
  font-style: italic;
  line-height: 1.35;
  color: var(--text-muted);
  margin-bottom: 48px;
  max-width: 640px;
  margin-left: auto;
}
.closing__steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 56px;
}
.closing__step {
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 24px;
}
.closing__step-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}
.closing__step p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
}
.closing__step code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-hi);
  background: var(--bg-elev);
  padding: 1px 5px;
  border-radius: 3px;
}
.closing__ignitor {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 28px 32px;
  margin-bottom: 48px;
  background: var(--bg-raised);
}
.closing__ignitor-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.closing__ignitor p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.closing__ignitor p:last-of-type { margin-bottom: 20px; }
.closing__ignitor strong { color: var(--text); }
.closing__ignitor-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.closing__ignitor-link:hover { border-color: var(--accent); }
.closing__social {
  width: 100%;
  padding: 80px 80px 0;
  text-align: center;
}
.closing__social-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 26px);
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  padding: 0 48px;
}
.closing__social-text::before,
.closing__social-text::after {
  font-family: var(--serif);
  font-size: 120px;
  line-height: 0;
  color: var(--accent);
  opacity: 0.25;
  position: absolute;
}
.closing__social-text::before {
  content: "\201C";
  top: 48px;
  left: 0;
}
.closing__social-text::after {
  content: "\201D";
  bottom: -16px;
  right: 0;
}
.closing__social-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.closing__social-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 18px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.closing__social-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.closing__discord-btn {
  display: block;
  width: fit-content;
  margin: 0 auto 20px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--bg);
  background: var(--accent);
  border-radius: 6px;
  padding: 12px 28px;
  text-decoration: none;
  margin-bottom: 20px;
  transition: opacity 0.2s ease;
}
.closing__discord-btn:hover {
  opacity: 0.85;
}
@media (min-width: 980px) {
  .chapter__head--sticky,
  .chapter--sticky .prose {
    position: relative;
  }
  .steps--horizontal {
    flex-direction: column;
    width: 100%;
  }
  .steps--horizontal .step {
    min-width: 0;
    max-width: none;
  }
  .steps--horizontal .step:last-child {
    border-bottom: 1px solid var(--line);
  }

  .closing--horizontal {
    min-height: auto;
    overflow: visible;
    padding: 100px 80px 80px;
    display: block;
  }
  .closing__track {
    display: block;
    width: 100%;
    min-height: 0;
  }
  .closing__panel {
    width: 100%;
    min-height: 0;
    display: block;
  }
  .closing__panel .closing__inner,
  .closing__panel .closing__social {
    width: 100%;
    padding: 0;
  }
}
@media (max-width: 680px) {
  .closing { padding: 60px 24px 40px; }
  .closing__steps { grid-template-columns: 1fr; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 60px 80px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.footer__brand {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--text-muted);
}
.footer__note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.footer__note a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}
.footer__note a:hover { border-bottom-color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .sidebar {
    transform: translateY(-100%);
    width: 100%;
    height: auto;
    max-height: 80vh;
    bottom: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 64px 24px 30px;
  }
  .sidebar.open { transform: translateY(0); }
  .main { margin-left: 0; }
  .menu-btn { display: flex; align-items: center; justify-content: center; }
  .menu-overlay.open { display: block; }
  .theme-toggle { top: 18px; right: 20px; }

  .hero { padding: 100px 28px 80px; min-height: 80vh; }
  .onboard { padding: 70px 28px; }
  .na-pratica { padding: 70px 28px; }
  .na-pratica__grid { grid-template-columns: 1fr; }
  .na-pratica__card { border-right: none !important; }
  .na-pratica__card:nth-child(3),
  .na-pratica__card:nth-child(4) { border-bottom: 1px solid var(--line); }
  .na-pratica__card:last-child { border-bottom: none; }
  .content { padding: 30px 28px 60px; }
  .footer { padding: 40px 28px; flex-direction: column; align-items: flex-start; }

  .flow { grid-template-columns: 1fr; }
  .flow__node {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .flow__node:last-child { border-bottom: none; }
  .flow__arrow {
    right: auto; left: 44px; top: auto; bottom: -7px;
    border-top: none; border-right: none;
    border-bottom: 1px solid var(--accent);
    border-left: 1px solid var(--accent);
  }

  .glossary__item { grid-template-columns: 1fr; gap: 6px; }
  .chapter { padding: 60px 0; }
  .prose blockquote { padding-left: 18px; font-size: 19px; }
}

@media (max-width: 560px) {
  .hero { padding: 90px 22px 70px; }
  .onboard { padding: 60px 22px; }
  .na-pratica { padding: 60px 22px; }
  .content { padding: 20px 22px 50px; }
  .footer { padding: 40px 22px; }
  .hero__subtitle { font-size: 18px; }
}

/* ============================================================
   SCAN LINE (code blocks on hover)
   ============================================================ */
@keyframes scan {
  from { top: 0; }
  to   { top: 100%; }
}
.scan-line {
  position: absolute;
  left: 0; right: 0; height: 1px;
  background: #d19900;
  opacity: 0.15;
  pointer-events: none;
  z-index: 10;
  animation: scan 2.5s linear infinite;
}

/* ============================================================
   TILT 3D — preserve existing transforms in flow__node
   ============================================================ */
.flow__node,
.callout,
.chip,
.na-pratica__card,
.graph-viz {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ============================================================
   CURSOR GLOW
   ============================================================ */
#cursor-glow {
  position: fixed;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(209,153,0,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: none;
}

/* ============================================================
   PREFERS-REDUCED-MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal, .flow__node {
    opacity: 1 !important;
    clip-path: none !important;
    transform: none !important;
    transition: none !important;
  }
  .motion-item {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .flow__arrow { transform: rotate(45deg) scale(1) !important; }
  .char {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .scan-line, #cursor-glow, #section-ambient { display: none !important; }
}
