:root {
  /* Glassmorphism — dark blue palette */
  --bg: #09090f;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-elevated: rgba(255, 255, 255, 0.09);
  --bg-terminal: #0d0e18;
  --text: #e8edf5;
  --text-muted: #7c8ba1;
  --text-faint: #5a6a82;
  --cyan: #22d3ee;
  --cyan-dim: #06b6d4;
  --cyan-glow: rgba(34, 211, 238, 0.10);
  --purple: #a78bfa;
  --blue: #60a5fa;
  --green: #22c55e;
  --green-dim: #16a34a;
  --green-glow: rgba(34, 197, 94, 0.06);
  --terminal-blue: #7dd3fc;
  --border: rgba(255, 255, 255, 0.07);
  --border-mid: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.20);
  --amber: #fbbf24;
  --red: #f87171;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  --glass-blur: blur(16px);
  --glass-blur-sm: blur(10px);
  --font-display: "Syne", sans-serif;
  --font-sans: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --transition: all 0.18s ease;
  --header-height: 78px;

  /* semantic aliases */
  --color-bg: var(--bg);
  --color-bg-alt: var(--bg-card);
  --color-surface: var(--bg-card);
  --color-surface-2: var(--bg-elevated);
  --color-surface-3: var(--bg-elevated);
  --color-code: var(--bg-terminal);
  --color-bg-code: var(--bg-terminal);
  --color-text: var(--text);
  --color-text-muted: var(--text-muted);
  --color-text-faint: var(--text-faint);
  --color-border: var(--border);
  --color-border-strong: var(--border-strong);
  --color-primary: var(--cyan);
  --color-primary-light: var(--cyan);
  --color-primary-soft: var(--cyan-glow);
  --color-info: var(--blue);
  --color-info-soft: rgba(96, 165, 250, 0.08);
  --color-warning: var(--amber);
  --color-danger: var(--red);
  --color-success: var(--green);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 55% at 15% 5%, rgba(34, 211, 238, 0.10), transparent 55%),
    radial-gradient(ellipse 60% 55% at 85% 90%, rgba(167, 139, 250, 0.09), transparent 55%),
    radial-gradient(ellipse 50% 40% at 68% 30%, rgba(96, 165, 250, 0.06), transparent 50%);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--header-height);
}

::selection {
  background: rgba(34, 211, 238, 0.22);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-decoration: underline;
  text-decoration-color: currentColor;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  transition: var(--transition);
}

button,
a,
input,
textarea,
select,
[tabindex] {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.2rem;
}

li + li {
  margin-top: 0.4rem;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.05;
}

strong {
  color: var(--text);
}

em {
  color: var(--text-muted);
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.14);
  border-radius: 6px;
  padding: 0.12rem 0.35rem;
  color: var(--cyan);
}

.btn-flashcard kbd {
  font-size: 0.8em;
  opacity: 0.7;
  margin-right: 4px;
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.18);
  color: var(--cyan);
}

.quiz-kb-hint {
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.05em;
}

/* ============================================================
   SKIP LINK
   ============================================================ */
.skip-link {
  position: absolute;
  left: 20px;
  top: -100px;
  z-index: 1000;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #000;
  font-weight: 600;
}

.skip-link:focus {
  top: 18px;
}

/* ============================================================
   LAYOUT CONTAINERS
   ============================================================ */
.container,
.container--narrow {
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
}

.container--narrow {
  max-width: 760px;
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 110;
  background: rgba(9, 9, 15, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.header-inner {
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.logo:hover {
  text-decoration: none;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.header-nav a,
.back-link {
  font-size: 13px;
  color: var(--text-muted);
}

.header-nav a:hover,
.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-start-simulado,
.btn-next-question,
.btn-retry-quiz,
.btn-print,
.btn-flashcard,
.mark-studied {
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-coffee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: rgba(255, 255, 255, 0.04);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
}

.btn-coffee:hover {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.45);
  transform: scale(1.1);
  text-decoration: none;
}

/* Pix Donation Modal */
.pix-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.pix-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.pix-modal-box {
  position: relative;
  background: #0e0f1c;
  border: 1px solid var(--border-mid);
  border-radius: 20px;
  padding: 40px 28px 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pix-modal-overlay.open .pix-modal-box {
  transform: translateY(0) scale(1);
}

.pix-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pix-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.pix-modal-coffee {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 16px;
}

.pix-modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.pix-modal-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 24px;
}

.pix-key-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-mid);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
}

.pix-key-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.pix-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pix-key-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.btn-copy-pix {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-mid);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-copy-pix:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-color: var(--border-strong);
}

.pix-modal-footer {
  font-size: 13px;
  color: var(--text-faint);
  margin: 0;
}

.btn-primary,
.btn-secondary,
.btn-start-simulado,
.btn-next-question,
.btn-retry-quiz,
.btn-ghost,
.btn-print {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
}

.btn-primary,
.btn-start-simulado,
.btn-next-question {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #000;
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.18);
}

.btn-primary:hover,
.btn-start-simulado:hover,
.btn-next-question:hover {
  background: linear-gradient(135deg, var(--cyan-dim), var(--blue));
  box-shadow: 0 6px 28px rgba(34, 211, 238, 0.30);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-secondary,
.btn-retry-quiz,
.btn-ghost,
.btn-print {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  color: var(--text);
  border-color: var(--border-mid);
}

.btn-secondary:hover,
.btn-retry-quiz:hover,
.btn-ghost:hover,
.btn-print:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--border-strong);
  text-decoration: none;
}

.btn-ghost.danger {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.24);
}

.btn-ghost.danger:hover {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.40);
}

/* ============================================================
   PROGRESS BAR (reading position, top of page)
   ============================================================ */
.module-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 140;
  width: 100%;
  height: 4px;
  background: transparent;
}

.module-progress-bar .fill,
.progress-bar .fill,
.module-card-progress .fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transition: width 0.4s ease;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
#main {
  padding-bottom: 72px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-shell {
  padding: 40px 0 0;
}

.hero-shell-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5rem;
  padding: 6rem 0;
}

.hero-copy {
  flex: 0 1 560px;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.section-kicker,
.module-card-number,
.module-number-badge,
.card-label,
.hero-terminal-name,
.terminal-title,
.progress-label,
.history-title,
.quiz-counter,
.flashcard-progress-info,
.hero-stat-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.eyebrow {
  margin-bottom: 16px;
  color: var(--cyan);
  font-size: 11px;
  opacity: 0.75;
}

.hero-title {
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 7vw, 56px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.hero-title .muted {
  color: var(--text-muted);
}

.hero-subtitle {
  max-width: 380px;
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 15px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 20px;
  position: relative;
}

.hero-stat:first-child {
  padding-left: 0;
}

.hero-stat + .hero-stat::before {
  content: "|";
  position: absolute;
  left: -4px;
  top: 2px;
  color: var(--border-strong);
  font-family: var(--font-mono);
}

.hero-stat-number {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  color: var(--text-faint);
  font-size: 10px;
}

/* ============================================================
   HERO TERMINAL
   ============================================================ */
.hero-terminal-panel {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.hero-terminal {
  max-width: 480px;
  width: 100%;
  margin-left: auto;
  background: rgba(13, 14, 24, 0.80);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-mid);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px rgba(34, 211, 238, 0.04);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
}

.hero-terminal-topbar,
.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--border);
}

.hero-terminal-name,
.terminal-title {
  margin-left: 10px;
  font-size: 11px;
  color: var(--text-faint);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red {
  background: #ff5f57;
}

.terminal-dot.yellow {
  background: #ffbd2e;
}

.terminal-dot.green {
  background: #28c840;
}

.hero-terminal-body,
.terminal-output,
.terminal-input-row {
  font-family: var(--font-mono);
  font-size: 13px;
}

.hero-terminal-body {
  padding: 20px 24px 24px;
}

.hero-cmd-group {
  margin-bottom: 14px;
}

.hero-cmd-group:last-of-type {
  margin-bottom: 0;
}

.hero-line {
  white-space: normal;
  word-break: break-word;
}

.t-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.t-dir {
  color: var(--terminal-blue);
}

.t-exe {
  color: #4ade80;
}

.t-line {
  padding: 4px 8px;
  border-radius: 8px;
}

.t-state-help {
  background: rgba(96, 165, 250, 0.08);
}

.t-state-info {
  background: rgba(34, 197, 94, 0.06);
}

.t-state-error {
  background: rgba(248, 113, 113, 0.08);
}

.hero-prompt,
.t-prompt,
.terminal-prompt {
  color: var(--green);
}

.hero-path {
  color: var(--terminal-blue);
}

.hero-dollar {
  color: var(--text-faint);
  margin: 0 4px;
}

.hero-cmd,
.t-cmd,
.t-out,
.terminal-input {
  color: var(--text);
}

.hero-out,
.t-info {
  color: var(--text-muted);
}

.hero-out.info,
.hero-out .info {
  color: var(--text-muted);
}

.hero-out.success {
  color: var(--green);
}

.t-err {
  color: var(--red);
}

.hero-out.t-dir {
  color: var(--terminal-blue);
}

.hero-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  margin-left: 4px;
  background: var(--cyan);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ============================================================
   HERO LANDING (new full-viewport hero)
   ============================================================ */
.hero-landing {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Radial glow orb */
.hl-glow {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 90vw);
  height: min(720px, 90vw);
  background: radial-gradient(
    ellipse at center,
    rgba(34, 211, 238, 0.14) 0%,
    rgba(96, 165, 250, 0.07) 38%,
    transparent 65%
  );
  filter: blur(55px);
  pointer-events: none;
}

/* Thin horizontal scan lines */
.hl-hline {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 12%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 88%,
    transparent 100%
  );
  pointer-events: none;
}
.hl-hline--top { top: 30%; }
.hl-hline--bot { top: 65%; }

/* Center content block */
.hl-center {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 620px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  background: rgba(34, 211, 238, 0.05);
  margin-bottom: 28px;
}

.hl-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.05em;
  color: var(--text);
  margin: 0 0 20px;
}

.hl-title-muted {
  color: var(--text-faint);
}

.hl-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 440px;
  margin: 0 0 36px;
}

.hl-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* Stats row */
.hl-stats {
  display: flex;
  align-items: center;
  gap: 0;
  padding-top: 4px;
}

.hl-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
}

.hl-stat-num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

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

.hl-stat-sep {
  width: 1px;
  height: 28px;
  background: var(--border-mid);
  flex-shrink: 0;
}

/* Scroll hint — bottom-left */
.hl-scroll {
  position: absolute;
  bottom: 28px;
  left: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}

.hl-scroll-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  animation: hl-bounce 2.2s ease-in-out infinite;
}

@keyframes hl-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

/* Corner label — bottom-right */
.hl-corner {
  position: absolute;
  bottom: 28px;
  right: 36px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  line-height: 1.5;
}

.hl-corner-line {
  display: block;
  width: 28px;
  height: 1px;
  background: var(--border-strong);
  margin-top: 6px;
  margin-left: auto;
}

/* Brand / keyword strip */
.brand-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.012);
  padding: 18px 0;
}

.brand-strip-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 20px;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand-strip-inner span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

.brand-strip-inner .bs-sep {
  color: var(--border-strong);
  font-size: 10px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hl-hline,
  .hl-scroll,
  .hl-corner {
    display: none;
  }

  .hl-title {
    font-size: clamp(2.6rem, 10vw, 3.5rem);
  }

  .hl-stat {
    padding: 0 14px;
  }

  .hl-stat-num {
    font-size: 20px;
  }
}

/* ============================================================
   SECTION BLOCKS
   ============================================================ */
.section-block {
  padding: 60px 0;
}

.section-heading {
  margin-bottom: 22px;
}

.section-kicker {
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 11px;
  opacity: 0.75;
}

.section-title {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.section-subtitle {
  max-width: 800px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ============================================================
   MODULE & TOOL GRIDS — glass card layout
   ============================================================ */
.modules-grid,
.tools-grid {
  display: grid;
  gap: 12px;
  background: transparent;
  align-items: stretch;
}

.modules-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tools-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-card,
.tool-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  transition: var(--transition);
}

.module-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  height: 100%;
  padding: 24px;
  cursor: pointer;
}

.module-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(34, 211, 238, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(34, 211, 238, 0.06);
  text-decoration: none;
}

.module-card:hover .module-card-title {
  color: var(--cyan);
}

.module-card-number {
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 11px;
}

.module-card-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 10px;
  font-size: 1.5rem;
}

.module-card-title {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  transition: color 0.18s ease;
  letter-spacing: -0.02em;
}

.module-card-desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.module-card-footer {
  margin-top: auto;
  padding-top: 14px;
}

.module-card-status {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.module-card-progress {
  height: 3px;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
  border-radius: 999px;
  overflow: hidden;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  padding: 28px 24px;
}

.tool-card::after {
  content: "Abrir →";
  margin-top: auto;
  color: var(--cyan);
  font-size: 12px;
  opacity: 0;
  transform: translateY(4px);
  transition: var(--transition);
}

.tool-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(34, 211, 238, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.tool-card:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.tool-card-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
}

.tool-card-icon {
  font-family: var(--font-mono);
  font-size: 1.5rem;
}

.tool-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tool-card-desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

/* ============================================================
   PROGRESS SECTION
   ============================================================ */
.progress-section,
.progress-overall,
.study-history,
.simulado-header,
#simulado-area,
#simulado-intro,
.flashcard-done,
.quiz-container,
.page-404,
#due-modules-list,
#weak-topics {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.progress-section {
  padding: 24px;
}

.progress-overall {
  padding: 16px;
}

.progress-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--text-faint);
  font-size: 10px;
}

.progress-label #overall-progress-pct {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-display strong {
  color: var(--text);
  font-weight: 500;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.study-history {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.history-title {
  margin-bottom: 12px;
  color: var(--text-faint);
  font-size: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.history-date,
.history-time {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.history-modules {
  color: var(--text);
}

.history-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 16px 0;
}

/* ============================================================
   MODULE PAGE LAYOUT
   ============================================================ */
.module-page {
  padding-top: 48px;
}

.page-shell {
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

.module-header {
  padding: 0 0 32px;
}

.module-number-badge {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--cyan);
  font-size: 11px;
}

.module-page-title {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.module-intro {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 16px;
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}

.module-meta-item,
.progress-display {
  color: var(--text-faint);
  font-size: 13px;
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.content-section,
.flashcards-section,
.quiz-section,
.cheatsheet-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.section-stack {
  margin-bottom: 2.5rem;
}

.section-title-row {
  margin-bottom: 1rem;
}

.tool-section-title,
.exercise-category-title,
.cheatsheet-subtitle {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.tool-section-title {
  margin-bottom: 0;
}

.section-body-note,
.exercise-body > p,
.simulado-metric-label,
.cheatsheet-footer-note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.section-body-note,
.exercise-body > p {
  margin-top: 0.75rem;
}

.metric-accent {
  color: var(--cyan);
}

.metric-warning {
  color: var(--amber);
}

.metric-danger {
  color: var(--red);
}

.study-module-grid,
.cheatsheet-nav {
  display: grid;
  gap: 0.75rem;
}

.study-module-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: 1.5rem;
}

.cheatsheet-nav {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-bottom: 2rem;
}

.simulado-metric-label {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ============================================================
   UTILITY
   ============================================================ */
.is-hidden {
  display: none !important;
}

.with-top-gap {
  margin-top: 1rem;
}

.with-bottom-gap {
  margin-bottom: 1rem;
}

.with-bottom-gap-lg {
  margin-bottom: 1.5rem;
}

.card-spacious {
  margin-bottom: 2rem;
}

/* ============================================================
   SECTION HEADER (within content sections)
   ============================================================ */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-header h2,
.flashcards-section h2,
.quiz-section h2,
.cheatsheet-section h2,
.page-404 h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ============================================================
   MARK STUDIED BUTTON
   ============================================================ */
.mark-studied {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
  border-color: var(--border-mid);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 12px;
}

.mark-studied:hover,
.mark-studied.studied {
  border-color: rgba(34, 211, 238, 0.32);
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.06);
  text-decoration: none;
}

.mark-studied:focus-visible,
.quiz-option:focus-visible,
.module-card:focus-visible,
.tool-card:focus-visible,
.module-nav-link:focus-visible,
.badge:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ============================================================
   CONTENT CARDS
   ============================================================ */
.card {
  margin: 16px 0;
  padding: 20px 24px;
  border-radius: 12px;
}

.card-label,
.exercise-solution-label {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 11px;
}

.card-side-label {
  margin-bottom: 10px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-explanation,
.card-info {
  background: rgba(96, 165, 250, 0.06);
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-left: 3px solid var(--blue);
  border-radius: 0 12px 12px 0;
}

.card-explanation .card-label,
.card-info .card-label {
  color: var(--blue);
}

.card-analogy {
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.14);
  border-left: 3px solid var(--amber);
  border-radius: 0 12px 12px 0;
}

.card-analogy .card-label {
  color: var(--amber);
}

.card-example {
  background: rgba(34, 211, 238, 0.04);
  border: 1px solid rgba(34, 211, 238, 0.12);
  border-left: 3px solid var(--cyan);
  border-radius: 0 12px 12px 0;
}

.card-example .card-label,
.card-summary .card-label {
  color: var(--cyan);
}

.card-warning {
  background: rgba(248, 113, 113, 0.05);
  border: 1px solid rgba(248, 113, 113, 0.14);
  border-left: 3px solid var(--red);
  border-radius: 0 12px 12px 0;
}

.card-warning .card-label {
  color: var(--red);
}

.card-summary {
  background: rgba(34, 211, 238, 0.05);
  border: 1px solid rgba(34, 211, 238, 0.10);
}

/* ============================================================
   CODE BLOCKS
   ============================================================ */
pre,
.code-block {
  margin: 0;
  background: rgba(13, 14, 24, 0.90);
  border: 1px solid var(--border-mid);
  border-left: 3px solid var(--cyan);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  overflow-x: auto;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  position: relative;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  -webkit-text-fill-color: inherit;
}

.code-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(13, 14, 24, 0.92);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0;
  transition: var(--transition);
}

.code-wrapper:hover .copy-btn,
.copy-btn:focus-visible,
.copy-btn.copied {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.3);
}

/* ============================================================
   EMBEDDED TERMINAL
   ============================================================ */
.embedded-terminal,
.terminal-wrapper {
  max-width: 680px;
  margin: 24px 0;
  background: rgba(13, 14, 24, 0.80);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid var(--border-mid);
  border-radius: 14px;
  overflow: hidden;
}

.terminal-output {
  padding: 20px 20px 10px;
  min-height: 220px;
  max-height: 340px;
  overflow-y: auto;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 16px;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  caret-color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.terminal-input:focus,
.terminal-input:focus-visible {
  outline: none;
  box-shadow: none;
}

.terminal-input::placeholder {
  color: transparent;
}

.terminal-input-row:focus-within {
  background: rgba(255, 255, 255, 0.02);
}

.terminal-notice {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem !important;
  padding: 0.8rem 1rem !important;
  border-radius: 10px !important;
  border: 1px solid rgba(251, 191, 36, 0.22) !important;
  background: rgba(251, 191, 36, 0.07) !important;
  color: var(--amber) !important;
  font-size: 0.8125rem !important;
}

.terminal-wrapper::after {
  content: "Terminal simulado — para prática. Use um terminal real para comandos avançados.";
  display: block;
  padding: 10px 16px;
  border-top: 1px solid rgba(251, 191, 36, 0.16);
  background: rgba(251, 191, 36, 0.05);
  color: var(--amber);
  font-size: 11px;
}

/* ============================================================
   FLASHCARD
   ============================================================ */
.flashcard-container {
  perspective: 1200px;
}

.flashcard-progress {
  height: 4px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.flashcard-progress .fill,
.quiz-progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
}

.flashcard {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border: 1px solid var(--border-mid);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.30);
}

.flashcard:hover {
  border-color: rgba(34, 211, 238, 0.28);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.40);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  transition: opacity 0.3s ease;
}

.flashcard-back {
  background: rgba(34, 211, 238, 0.04);
  border-radius: 16px;
  opacity: 0;
  pointer-events: none;
}

.flashcard.flipped .flashcard-front {
  opacity: 0;
  pointer-events: none;
}

.flashcard.flipped .flashcard-back {
  opacity: 1;
  pointer-events: auto;
}

.flashcard-question {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.flashcard-answer {
  color: var(--text-muted);
  font-size: 15px;
}

.flashcard-hint {
  margin-top: 12px;
  color: var(--text-faint);
  font-size: 12px;
}

.flashcard-progress-info {
  margin-bottom: 12px;
  color: var(--text-faint);
  font-size: 10px;
}

.flashcard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.flashcard-actions.is-hidden {
  display: none;
}

.btn-flashcard {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  color: var(--text);
}

.btn-flashcard.no {
  border-color: rgba(248, 113, 113, 0.35);
}

.btn-flashcard.no:hover {
  background: rgba(248, 113, 113, 0.08);
}

.btn-flashcard.maybe {
  border-color: rgba(251, 191, 36, 0.35);
}

.btn-flashcard.maybe:hover {
  background: rgba(251, 191, 36, 0.07);
}

.btn-flashcard.yes {
  border-color: rgba(34, 211, 238, 0.35);
}

.btn-flashcard.yes:hover {
  background: rgba(34, 211, 238, 0.07);
}

/* ============================================================
   QUIZ
   ============================================================ */
.quiz-container,
#simulado-area {
  padding: 24px;
}

.quiz-progress {
  height: 4px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-header,
.quiz-footer,
.simulado-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: 16px;
  padding: 20px 28px;
  margin-top: 24px;
}

.quiz-body {
  margin: 20px 0;
}

.quiz-counter,
.quiz-feedback,
.quiz-result-label {
  color: var(--text-faint);
  font-size: 12px;
}

.quiz-question {
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: var(--transition);
}

.quiz-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
}

.quiz-option.correct {
  background: rgba(34, 211, 238, 0.08);
  border-color: var(--cyan);
}

.quiz-option.wrong {
  background: rgba(248, 113, 113, 0.08);
  border-color: var(--red);
}

.quiz-option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  flex: 0 0 24px;
}

.quiz-feedback {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.quiz-feedback.show {
  display: block;
}

.quiz-fb-label {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}

.quiz-feedback.correct-fb .quiz-fb-label {
  color: var(--cyan);
}

.quiz-feedback.wrong-fb .quiz-fb-label {
  color: var(--red);
}

.quiz-fb-explanation {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.quiz-score,
.timer-display,
.simulado-progress-text,
.quiz-result-score {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.simulado-result-breakdown,
.quiz-result-breakdown {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.breakdown-score.good {
  color: var(--cyan);
}

.breakdown-score.ok {
  color: var(--amber);
}

.breakdown-score.bad {
  color: var(--red);
}

/* ============================================================
   EXERCISES / ACCORDIONS
   ============================================================ */
.exercise-item,
.accordion-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  overflow: hidden;
  margin-bottom: 14px;
  transition: border-color 0.18s ease;
}

.exercise-item:hover,
.accordion-item:hover {
  border-color: var(--border-mid);
}

.exercise-category {
  margin-bottom: 2.5rem;
}

.exercise-category-title {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.exercise-header,
.accordion-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
}

.exercise-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
}

.exercise-question {
  font-size: 15px;
}

.exercise-toggle {
  color: var(--text-faint);
  transition: var(--transition);
}

.exercise-body,
.accordion-body {
  display: none;
  padding: 0 20px 20px;
  color: var(--text-muted);
}

.exercise-item.open .exercise-body,
.accordion-item.open .accordion-body {
  display: block;
}

.exercise-item.open .exercise-toggle,
.accordion-item.open .exercise-toggle {
  transform: rotate(180deg);
}

.exercise-solution-label {
  color: var(--cyan);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-mid);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  font-size: 12px;
}

.badge-blue {
  color: var(--text);
}

.badge:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(34, 211, 238, 0.28);
  text-decoration: none;
}

/* ============================================================
   CHEATSHEET TABLE
   ============================================================ */
.cheatsheet-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  border-radius: 14px;
}

.cheatsheet-table th,
.cheatsheet-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.cheatsheet-table th {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.07);
}

.cheatsheet-table td:first-child {
  color: var(--cyan);
  font-family: var(--font-mono);
}

/* ============================================================
   MODULE NAVIGATION
   ============================================================ */
.module-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 24px;
}

/* ============================================================
   MODULE SIDEBAR + TOC
   ============================================================ */
.module-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 32px;
}

.module-main {
  min-width: 0;
}

.module-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
}

.module-toc {
  padding: 18px;
  border: 1px solid var(--border-mid);
  border-radius: 16px;
  background: rgba(9, 9, 15, 0.65);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.module-toc-title,
.module-summary-label {
  margin-bottom: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.module-summary {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.module-summary-count {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.module-summary-copy {
  color: var(--text-muted);
  font-size: 13px;
}

.module-summary-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--cyan);
  font-size: 12px;
}

.module-summary-link:hover {
  text-decoration: underline;
}

.module-toc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.module-toc-toolbar .module-toc-title {
  margin-bottom: 0;
}

.module-toc-toggle {
  display: none;
  padding: 6px 10px;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-toc-toggle:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
  text-decoration: none;
}

.module-toc.is-collapsed .module-summary,
.module-toc.is-collapsed .module-toc-list {
  display: none;
}

.module-toc-list {
  display: grid;
  gap: 8px;
}

.module-toc-link {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  transition: var(--transition);
}

.module-toc-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
}

.module-toc-link.is-active {
  background: rgba(34, 211, 238, 0.08);
  color: var(--text);
  border: 1px solid rgba(34, 211, 238, 0.15);
}

.module-toc-link.is-done .module-toc-dot,
.section-state.is-done {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-color: transparent;
}

.module-toc-dot,
.section-state {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
}

.module-toc-index {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
}

.section-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-state {
  width: 8px;
  height: 8px;
}

/* ============================================================
   MODULE CARD STATES (progress)
   ============================================================ */

.module-card-featured {
  border-color: rgba(255, 255, 255, 0.12);
}
.module-card.is-in-progress {
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.07), rgba(255, 255, 255, 0.04));
  border-top: 1px solid rgba(167, 139, 250, 0.18);
}

.module-card.is-complete {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.08), rgba(255, 255, 255, 0.04));
  border-top: 1px solid rgba(34, 211, 238, 0.22);
}

.module-card.is-complete .module-card-title,
.module-card.is-complete .module-card-status {
  color: var(--text);
}

.module-complete-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-progress-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--purple);
}

/* ============================================================
   PAGE VARIANT PANELS (revisao, simulado, resumos, exercicios)
   ============================================================ */
.page-variant-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
}

body[data-page="revisao"] .module-header,
body[data-page="simulado"] .module-header,
body[data-page="resumos"] .module-header,
body[data-page="exercicios"] .module-header,
body[data-page="infinito"] .module-header {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(34, 211, 238, 0.05),
    rgba(255, 255, 255, 0.02)
  );
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  margin-bottom: 24px;
}

/* ============================================================
   PRINT / CHEATSHEET
   ============================================================ */
.print-note {
  margin-top: 2rem;
  text-align: center;
}

.print-note .btn-print {
  min-height: 40px;
  padding: 0.6rem 1.5rem;
  font-size: 0.875rem;
}

@media print {
  .site-header,
  .site-footer,
  .btn-print,
  #toast-container,
  .module-sidebar {
    display: none !important;
  }

  body[data-page="resumos"] {
    background: #f7f3ea !important;
    color: #1f1b15 !important;
    font-size: 11pt;
    padding-top: 0;
  }

  body[data-page="resumos"] .container--narrow {
    max-width: 100%;
    width: 100%;
    padding: 0;
  }

  body[data-page="resumos"] .module-header {
    background: transparent;
    border: none;
    padding: 0 0 20px;
    margin-bottom: 20px;
  }

  body[data-page="resumos"] .cheatsheet-section {
    page-break-inside: avoid;
    border-bottom-color: rgba(31, 27, 21, 0.16);
  }

  body[data-page="resumos"] .cheatsheet-table {
    background: transparent;
  }

  body[data-page="resumos"] .cheatsheet-table th {
    background: #ece4d6;
    color: #3f372c;
    border: 1px solid rgba(63, 55, 44, 0.15);
  }

  body[data-page="resumos"] .cheatsheet-table td {
    border: 1px solid rgba(63, 55, 44, 0.12);
    color: #1f1b15;
  }

  body[data-page="resumos"] .cheatsheet-table td:first-child {
    color: #0e6c6c;
  }

  body[data-page="resumos"] .cheatsheet-section h2,
  body[data-page="resumos"] .cheatsheet-subtitle {
    color: #1f1b15;
  }

  body[data-page="resumos"] pre,
  body[data-page="resumos"] code {
    background: #f2ede4;
    color: #1f1b15;
  }
}

/* ============================================================
   MODULE NAV LINKS
   ============================================================ */
.module-nav-link {
  display: inline-flex;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-mid);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  color: var(--text);
  font-size: 14px;
}

.module-nav-link:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(34, 211, 238, 0.28);
  text-decoration: none;
}

.module-nav-link.disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  background: rgba(9, 9, 15, 0.50);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.footer-inner {
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-tagline,
.footer-links a {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a:last-child,
.footer-links a:hover {
  color: var(--cyan);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: grid;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-mid);
  background: rgba(9, 9, 15, 0.90);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.50), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.toast.success .toast-icon {
  color: var(--cyan);
}

.toast .toast-icon {
  font-family: var(--font-mono);
}

/* ============================================================
   404 PAGE
   ============================================================ */
.page-404 {
  max-width: 760px;
  margin: 80px auto;
  padding: 40px 28px;
  text-align: center;
}

.page-404-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.page-404-terminal {
  max-width: 480px;
  margin-top: 3rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 10px;
  background: rgba(13, 14, 24, 0.80);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-align: left;
}

.page-404-terminal .prompt-error {
  color: var(--red);
}

.page-404-terminal .prompt-muted {
  color: var(--text-muted);
}

.page-404-terminal .prompt-highlight {
  color: var(--cyan);
}

.page-404-terminal .prompt-hint {
  color: var(--text-faint);
}

.page-404-terminal .prompt-list {
  color: var(--terminal-blue);
}

/* ============================================================
   EDITORIAL ELEMENTS
   ============================================================ */
.editorial-quote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--blue);
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   REVEAL ON SCROLL
   ============================================================ */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.30s ease var(--stagger-delay, 0ms),
    transform 0.30s ease var(--stagger-delay, 0ms);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   MISC COMPONENTS
   ============================================================ */
.code-big {
  margin-bottom: 14px;
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 800;
}

.roadmap {
  display: grid;
  gap: 16px;
}

.roadmap-step {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  transition: var(--transition);
}

.roadmap-step:hover {
  border-color: rgba(34, 211, 238, 0.22);
  background: rgba(255, 255, 255, 0.07);
}

.roadmap-step-icon,
.roadmap-arrow {
  color: var(--cyan);
}

.roadmap-step-label {
  font-family: var(--font-display);
  font-weight: 700;
}

/* ============================================================
   RESPONSIVE — TABLET (max 980px)
   ============================================================ */
@media (max-width: 980px) {
  .modules-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .hero-shell-inner {
    flex-direction: column;
    padding: 3.5rem 0;
  }

  .hero-copy {
    max-width: none;
    flex: unset;
    width: 100%;
  }

  .hero-terminal-panel {
    flex: unset;
    width: 100%;
    justify-content: flex-start;
  }

  .footer-inner,
  .module-nav,
  .simulado-header,
  .quiz-header,
  .quiz-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .module-nav {
    gap: 12px;
  }

  .module-shell {
    grid-template-columns: 1fr;
  }

  .module-sidebar {
    position: static;
  }

  .module-toc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .module-page {
    padding-top: 32px;
  }
}

@media (max-width: 860px) {
  .modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 767px)
   ============================================================ */
@media (max-width: 767px) {
  body {
    padding-top: 72px;
  }

  .container,
  .container--narrow,
  .header-inner,
  .footer-inner {
    width: min(1100px, calc(100% - 40px));
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .header-nav {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    overflow-x: auto;
  }

  .hero-shell {
    padding-top: 28px;
  }

  .hero-title {
    font-size: 42px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .hero-stat {
    padding: 0;
  }

  .hero-stat + .hero-stat::before {
    content: none;
  }

  .modules-grid,
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .section-header {
    flex-direction: column;
  }

  .mark-studied {
    width: 100%;
    justify-content: center;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .flashcard,
  .flashcard-front,
  .flashcard-back {
    padding: 28px 20px;
  }

  .page-404 {
    margin: 40px 20px;
  }

  .section-block {
    padding: 40px 0;
  }

  .section-heading {
    margin-bottom: 28px;
  }

  .hero-title {
    font-size: 38px;
    letter-spacing: -0.04em;
  }

  .hero-terminal {
    max-width: 100%;
  }

  .hero-terminal-body {
    padding: 16px 18px 20px;
    font-size: 12px;
  }

  .module-page {
    padding-top: 24px;
  }

  .module-page-title {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }

  .module-intro {
    font-size: 15px;
    max-width: 100%;
  }

  pre,
  .code-block {
    font-size: 12px;
    padding: 14px 16px;
  }

  .flashcard-question {
    font-size: 16px;
  }

  .quiz-question {
    font-size: 17px;
  }

  .quiz-option {
    padding: 12px 14px;
    font-size: 13px;
  }

  .quiz-options {
    gap: 8px;
  }

  #toast-container {
    right: 12px;
    bottom: 20px;
    left: 12px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }

  .header-nav a {
    font-size: 12px;
    flex-shrink: 0;
  }

  .module-meta {
    gap: 10px;
  }

  .section-header h2,
  .flashcards-section h2,
  .quiz-section h2 {
    font-size: 19px;
  }

  .card {
    padding: 16px 18px;
    margin: 12px 0;
  }

  .module-nav-link {
    font-size: 13px;
    padding: 10px 16px;
  }
}

/* ─── Syntax Highlighting ─────────────────────────────────────────────── */
.sh-cmd  { color: var(--green); }
.sh-kw   { color: #c792ea; }
.sh-str  { color: #c3e88d; }
.sh-var  { color: #82aaff; }
.sh-flag { color: #ffcb6b; }
.sh-path { color: var(--terminal-blue); }
.sh-op   { color: var(--text-faint); }
.sh-cmt  { color: var(--text-faint); font-style: italic; }
.sh-num  { color: #f78c6c; }

/* ─── Continue Banner ─────────────────────────────────────────────────── */
.continue-banner {
  margin-bottom: 32px;
}

.continue-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: rgba(34, 211, 238, 0.05);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid rgba(34, 211, 238, 0.20);
  border-radius: 12px;
}

.continue-banner-label {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.continue-banner-module {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.continue-banner-progress {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.continue-banner-btn {
  display: inline-block;
  flex-shrink: 0;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #000;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.18);
}

.continue-banner-btn:hover {
  box-shadow: 0 6px 24px rgba(34, 211, 238, 0.28);
  text-decoration: none;
}

/* ─── Module Completion Panel ─────────────────────────────────────────── */
.module-completion-panel {
  text-align: center;
  padding: 52px 32px 44px;
  margin: 56px 0;
  background: rgba(34, 211, 238, 0.04);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(34, 211, 238, 0.05);
}

.completion-check {
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  background: rgba(34, 211, 238, 0.10);
  border: 2px solid var(--cyan);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--green);
  line-height: 1;
}

.completion-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  font-family: var(--font-display);
}

.completion-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 32px;
}

.completion-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 36px;
}

.completion-stat {
  text-align: center;
}

.completion-stat-value {
  display: block;
  font-size: 30px;
  font-weight: 700;
  color: var(--green);
  font-family: var(--font-display);
  line-height: 1;
}

.completion-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 6px;
}

@media (max-width: 540px) {
  .continue-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .continue-banner-btn {
    width: 100%;
    text-align: center;
  }

  .completion-stats {
    gap: 24px;
  }

  .completion-stat-value {
    font-size: 24px;
  }
}

@media (hover: none) {
  .tool-card::after {
    opacity: 1;
    transform: none;
    font-size: 11px;
  }

  .module-card:hover,
  .tool-card:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ============================================================
   SEARCH — btn-search + modal
   ============================================================ */
.btn-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
}

.btn-search:hover {
  background: rgba(34, 211, 238, 0.10);
  border-color: rgba(34, 211, 238, 0.40);
  color: var(--cyan);
  transform: scale(1.08);
  text-decoration: none;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.search-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.search-box {
  width: 100%;
  max-width: 600px;
  background: #0e0f1c;
  border: 1px solid var(--border-mid);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.8);
  transform: translateY(-12px);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-overlay.open .search-box {
  transform: translateY(0);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font-sans);
}

.search-input::placeholder {
  color: var(--text-faint);
}

.search-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.search-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px 0;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.search-group {
  padding: 0 0 8px;
}

.search-group + .search-group {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.search-group-title {
  padding: 6px 20px 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.search-result-item {
  display: block;
  padding: 10px 20px;
  transition: background 0.14s;
  cursor: pointer;
  text-decoration: none;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.search-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-result-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.search-result-type {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge-tipo-modulo {
  background: rgba(34, 211, 238, 0.10);
  border-color: rgba(34, 211, 238, 0.30);
  color: var(--cyan);
}

.badge-tipo-flashcard {
  background: rgba(167, 139, 250, 0.10);
  border-color: rgba(167, 139, 250, 0.30);
  color: var(--purple);
}

.badge-tipo-quiz {
  background: rgba(96, 165, 250, 0.10);
  border-color: rgba(96, 165, 250, 0.30);
  color: var(--blue);
}

.search-result-body {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

mark {
  background: rgba(34, 211, 238, 0.22);
  color: var(--text);
  border-radius: 2px;
  padding: 0 1px;
}

/* ============================================================
   GLOSSARY TOOLTIPS
   ============================================================ */
.gloss-term {
  border-bottom: 1px dashed rgba(34, 211, 238, 0.50);
  cursor: help;
  text-decoration: none;
}

#gloss-tooltip {
  position: fixed;
  z-index: 8000;
  max-width: 280px;
  padding: 10px 14px;
  background: #0e0f1c;
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  display: none;
  pointer-events: none;
}

/* ============================================================
   PROJETO PAGE
   ============================================================ */
.projeto-hero {
  padding: 48px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.projeto-scenario {
  margin-bottom: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
}

.projeto-scenario:last-child {
  border-bottom: none;
}

.scenario-header {
  margin-bottom: 20px;
}

.scenario-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.scenario-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.scenario-difficulty {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.badge-iniciante {
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.30);
  color: var(--cyan);
}

.badge-intermediario {
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.30);
  color: var(--amber);
}

.scenario-desc-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

.scenario-terminal {
  margin-top: 20px;
}

/* ── Scenario Panel (injected by initScenario) ── */
.scenario-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-mid);
  border-radius: 12px 12px 0 0;
  border-bottom: none;
  padding: 16px 20px 12px;
}

.scenario-panel.complete {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.04);
}

.scenario-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.scenario-steps-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.scenario-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-mid);
  font-size: 11px;
  color: var(--text-faint);
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  font-family: var(--font-mono);
}

.scenario-step.active {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
}

.scenario-step.done {
  border-color: rgba(34, 197, 94, 0.40);
  background: rgba(34, 197, 94, 0.07);
  color: var(--green);
}

.scenario-step-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}

.scenario-step.done .scenario-step-num::after {
  content: "✓";
  font-size: 9px;
}

.scenario-step.done .scenario-step-num {
  font-size: 0; /* hide number, show checkmark */
}

.scenario-hint-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.scenario-hint-icon {
  flex-shrink: 0;
}

.scenario-hint {
  line-height: 1.5;
}

/* Make terminal connect visually to panel */
.scenario-panel + .terminal-wrapper,
.scenario-terminal .scenario-panel + .terminal-wrapper {
  border-radius: 0 0 10px 10px;
}

/* ============================================================
   FLASHCARD INFINITO
   ============================================================ */
.inf-session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.inf-session-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.inf-count {
  font-size: 0.9rem;
  color: var(--text);
}

.inf-correct {
  font-size: 0.8rem;
  color: var(--green);
}

.inf-module-tag {
  font-size: 0.72rem;
  color: var(--cyan);
  background: var(--cyan-glow);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  white-space: nowrap;
}

.btn-stop-infinite {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-stop-infinite:hover {
  background: rgba(248, 113, 113, 0.1);
}

/* ── Badge for tools page ── */
.badge-fundamental {
  background: rgba(167, 139, 250, 0.10);
  border: 1px solid rgba(167, 139, 250, 0.30);
  color: var(--purple);
}
