/* ============================================================
   CID Quest — Sistema de Design
   Tema claro + escuro, fundo aurora animado, layout SPA
   ============================================================ */

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

:root {
  --font-ui: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --t: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --max-w: 1200px;

  /* Tema claro — paleta sofisticada com violeta + petróleo */
  --bg0: #f4f1fb;
  --bg1: #ffffff;
  --bg2: #efeaf7;
  --bg3: #e3dcf0;
  --text: #1a1530;
  --text-secondary: #4a4660;
  --muted: #7d7a8e;
  --accent: #6a4dff;
  --accent-2: #d946a8;
  --accent-3: #14b8a6;
  --accent-hover: #5a3fe8;
  --accent-soft: rgba(106, 77, 255, 0.10);
  --accent-soft-hover: rgba(106, 77, 255, 0.18);
  --line: rgba(26, 21, 48, 0.08);
  --line-strong: rgba(26, 21, 48, 0.14);
  --shadow-sm: 0 2px 8px rgba(50, 30, 90, 0.06);
  --shadow-md: 0 10px 30px rgba(50, 30, 90, 0.10);
  --shadow-lg: 0 24px 60px rgba(50, 30, 90, 0.16);
  --card-bg: rgba(255, 255, 255, 0.78);
  --card-bg-solid: #ffffff;
  --card-border: rgba(26, 21, 48, 0.07);

  --aurora-1: #b794f6;
  --aurora-2: #f6a6c1;
  --aurora-3: #7dd3fc;
  --aurora-4: #fcd34d;

  --tag-bg: rgba(106, 77, 255, 0.10);
  --tag-text: #6a4dff;
}

[data-theme="dark"] {
  --bg0: #0a0814;
  --bg1: #14101f;
  --bg2: #1c1730;
  --bg3: #251f3d;
  --text: #f0ecff;
  --text-secondary: #b8b3cc;
  --muted: #7c7894;
  --accent: #a78bfa;
  --accent-2: #f472b6;
  --accent-3: #2dd4bf;
  --accent-hover: #c4b5fd;
  --accent-soft: rgba(167, 139, 250, 0.12);
  --accent-soft-hover: rgba(167, 139, 250, 0.20);
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  --card-bg: rgba(28, 23, 48, 0.65);
  --card-bg-solid: #1c1730;
  --card-border: rgba(255, 255, 255, 0.06);

  --aurora-1: #6d28d9;
  --aurora-2: #be185d;
  --aurora-3: #0e7490;
  --aurora-4: #7c2d12;

  --tag-bg: rgba(167, 139, 250, 0.14);
  --tag-text: #c4b5fd;
}

html {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg0);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg0);
  position: relative;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   SPLASH SCREEN — tela de carregamento inicial
   ============================================================ */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at top left, color-mix(in srgb, var(--aurora-1) 24%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse at bottom right, color-mix(in srgb, var(--aurora-3) 20%, transparent) 0%, transparent 55%),
    var(--bg0);
  opacity: 1;
  transition: opacity 0.6s ease, visibility 0s linear 0s;
  visibility: visible;
}

.splash-screen--hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}

.splash-logo {
  width: clamp(64px, 9vw, 96px);
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 22px color-mix(in srgb, var(--accent) 32%, transparent));
  animation: splashFloat 3.2s ease-in-out infinite, splashPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes splashFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes splashPop {
  0%   { opacity: 0; transform: scale(0.7); }
  60%  { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

.splash-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.025em;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: splashFade 0.8s ease 0.15s both;
}

.splash-tag {
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
  animation: splashFade 0.8s ease 0.3s both;
}

@keyframes splashFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.splash-bar {
  margin-top: 1.5rem;
  width: clamp(120px, 18vw, 180px);
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  animation: splashFade 0.8s ease 0.45s both;
}

.splash-bar-fill {
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% 100%;
  animation: splashSlide 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite, splashShine 2s linear infinite;
}

@keyframes splashSlide {
  0%   { left: -45%; width: 45%; }
  50%  { width: 60%; }
  100% { left: 100%; width: 45%; }
}

@keyframes splashShine {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-logo, .splash-bar-fill { animation: none; }
}

/* ============================================================
   FUNDO AURORA — orbs animados + grão sutil
   ============================================================ */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at top left, color-mix(in srgb, var(--aurora-1) 18%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse at bottom right, color-mix(in srgb, var(--aurora-3) 16%, transparent) 0%, transparent 55%),
    var(--bg0);
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: floatOrb 22s ease-in-out infinite;
  will-change: transform;
}

.aurora-orb--1 {
  width: 520px; height: 520px;
  top: -120px; left: -160px;
  background: var(--aurora-1);
  animation-duration: 26s;
}
.aurora-orb--2 {
  width: 460px; height: 460px;
  top: 25%; right: -180px;
  background: var(--aurora-2);
  animation-duration: 32s;
  animation-delay: -6s;
  opacity: 0.45;
}
.aurora-orb--3 {
  width: 600px; height: 600px;
  bottom: -200px; left: 15%;
  background: var(--aurora-3);
  animation-duration: 38s;
  animation-delay: -12s;
  opacity: 0.4;
}
.aurora-orb--4 {
  width: 380px; height: 380px;
  top: 55%; right: 25%;
  background: var(--aurora-4);
  animation-duration: 30s;
  animation-delay: -18s;
  opacity: 0.32;
}

[data-theme="dark"] .aurora-orb { opacity: 0.42; filter: blur(100px); }
[data-theme="dark"] .aurora-orb--3 { opacity: 0.32; }
[data-theme="dark"] .aurora-orb--4 { opacity: 0.25; }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(60px, -40px) scale(1.08); }
  66%      { transform: translate(-40px, 50px) scale(0.94); }
}

.aurora-grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] .aurora-grain { opacity: 0.22; }

@media (prefers-reduced-motion: reduce) {
  .aurora-orb { animation: none; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg1) 70%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
  color: inherit;
}

.brand-logo {
  height: 56px;
  width: auto;
  max-width: 64px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 4px 12px color-mix(in srgb, var(--accent) 22%, transparent));
  transition: transform var(--t);
}

.header-brand:hover .brand-logo {
  transform: scale(1.04);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 2px;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: flex-end;
}

.header-search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.header-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.header-search {
  width: 100%;
  padding: 0.6rem 0.85rem 0.6rem 2.6rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg2);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}

.header-search:focus {
  border-color: var(--accent);
  background: var(--bg1);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.header-search::placeholder { color: var(--muted); }

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t), color var(--t);
  flex-shrink: 0;
}

.header-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.header-btn svg { width: 22px; height: 22px; }

.theme-btn .icon-moon { display: none; }
[data-theme="dark"] .theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-moon { display: block; }

/* ============================================================
   DRAWER
   ============================================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 8, 20, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

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

.drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(360px, 88vw);
  height: 100%;
  background: var(--bg1);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.drawer-overlay.open .drawer { transform: translateX(0); }

.drawer-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.drawer-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--t), color var(--t);
}

.drawer-close:hover { background: var(--accent-soft); color: var(--accent); }
.drawer-close svg { width: 20px; height: 20px; }

.drawer-list {
  list-style: none;
  padding: 0.75rem 0;
  flex: 1;
  overflow-y: auto;
}

.drawer-list li a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.7rem 1.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--t), color var(--t);
  line-height: 1.4;
}

.drawer-list li a:hover,
.drawer-list li a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.drawer-list li a .drawer-chapter-num {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.8rem;
  flex-shrink: 0;
  min-width: 1.6rem;
}

/* ============================================================
   MAIN
   ============================================================ */
.main-content {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  width: 100%;
}

/* ============================================================
   LOADING
   ============================================================ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
}

.loading-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { font-size: 0.92rem; color: var(--muted); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  border-radius: 28px;
  padding: clamp(2.25rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 3rem);
  margin: 2.5rem 0 3rem;
  color: var(--text);
  overflow: hidden;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 12%, transparent) 0%,
      color-mix(in srgb, var(--accent-2) 10%, transparent) 50%,
      color-mix(in srgb, var(--accent-3) 8%, transparent) 100%),
    var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 28%, transparent) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 22%, transparent) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  background: var(--bg1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

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

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

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
  color: var(--text);
}

.hero h1 .accent-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}

.hero p {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 620px;
}

.hero-features {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.hero-feature {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.hero-feature svg {
  width: 14px; height: 14px;
  color: var(--accent);
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 2.75rem 0 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title::before {
  content: '';
  width: 6px;
  height: 26px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
}

.section-subtitle {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================================
   CARDS GRID — Capítulos
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2rem;
}

.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t), background var(--t);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  color: inherit;
  background: var(--card-bg-solid);
}

.card:hover::before { transform: scaleX(1); }

.card-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.card-num .num-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 26px;
  padding: 0 0.5rem;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
  padding-top: 0.5rem;
}

.card-arrow svg {
  width: 16px; height: 16px;
  transition: transform var(--t);
}

.card:hover .card-arrow svg { transform: translateX(4px); }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 1.5rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--t);
}

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

.breadcrumb-sep {
  color: var(--muted);
  opacity: 0.4;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

/* ============================================================
   TOPIC HEADER (capítulo / tema atual)
   ============================================================ */
.topic-header {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  margin: 1.5rem 0 2rem;
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.topic-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.topic-header .topic-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.74rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.topic-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.95rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* ============================================================
   TOPIC LIST — Lista unificada (temas + diagnósticos)
   ============================================================ */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 2rem;
}

.topic-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 0.95rem 1.15rem;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t), background var(--t);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topic-card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: var(--shadow-md);
  transform: translateX(3px);
  color: inherit;
  background: var(--card-bg-solid);
}

.topic-card-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topic-card-icon--block {
  width: 44px;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 14%, transparent));
  color: var(--accent);
}
.topic-card-icon--block svg { width: 22px; height: 22px; }

.topic-card-icon--code {
  min-width: 58px;
  padding: 0 0.7rem;
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.85rem;
  background: var(--tag-bg);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.topic-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.topic-card-title {
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.topic-card-title--muted {
  color: var(--muted);
  font-style: italic;
  font-weight: 500;
}

.topic-card-meta {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.topic-card-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--muted);
  transition: color var(--t), transform var(--t);
}

.topic-card-arrow svg { width: 18px; height: 18px; }

.topic-card:hover .topic-card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Skeleton pulsante enquanto carrega o título */
.topic-card--loading .topic-card-title {
  position: relative;
  color: transparent;
  background: linear-gradient(90deg,
    var(--bg2) 0%,
    var(--bg3) 50%,
    var(--bg2) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: 6px;
  display: inline-block;
  max-width: 65%;
  height: 1.05em;
}

@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Skeleton para texto inline (breadcrumb, header) */
.text-skel {
  display: inline-block;
  width: 8rem;
  height: 0.85em;
  vertical-align: middle;
  border-radius: 4px;
  background: linear-gradient(90deg,
    var(--bg2) 0%,
    var(--bg3) 50%,
    var(--bg2) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
}

.text-skel--lg {
  width: clamp(180px, 40%, 360px);
  height: 1em;
  border-radius: 6px;
}

/* Card que mostra apenas o código (sem título disponível) */
.topic-card--code-only {
  align-items: center;
}
.topic-card--code-only .topic-card-body {
  flex-direction: row;
  align-items: center;
}
.topic-card--code-only .topic-card-meta {
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================================
   CODE DETAIL
   ============================================================ */
.code-detail {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2.5rem 2.5rem;
  margin: 1.5rem 0 2rem;
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.code-detail::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 260px; height: 260px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.code-detail-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.code-detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.code-detail-tag--soft {
  color: var(--text-secondary);
  background: var(--bg2);
  border-color: var(--line);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--font-ui);
  font-size: 0.78rem;
}

.code-detail-tag--soft svg { width: 14px; height: 14px; color: var(--accent); }

.code-detail-code {
  position: relative;
  display: inline-block;
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", monospace;
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--accent);
  background: var(--tag-bg);
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  letter-spacing: 0.04em;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.code-detail h1 {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-results-header {
  margin: 2rem 0 1.5rem;
}

.search-results-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
}

.search-results-header h2 em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search-results-header p {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin: 2rem 0;
  backdrop-filter: blur(10px);
}

.no-results svg {
  width: 64px; height: 64px;
  margin: 0 auto 1.25rem;
  color: var(--accent);
  opacity: 0.55;
}

.no-results h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.no-results p { font-size: 0.92rem; }

.search-hint {
  background: var(--card-bg);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  backdrop-filter: blur(8px);
}

.search-hint code {
  font-family: "SF Mono", "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

/* ============================================================
   ERROR
   ============================================================ */
.error-view {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}

.error-view h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.015em;
}

.error-view p { margin-bottom: 1.5rem; }

.error-view .btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.6rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}

.error-view .btn-retry:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ============================================================
   BACK BUTTON
   ============================================================ */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg1);
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0.55rem 1.1rem;
  margin-top: 1rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  transition: background var(--t), border-color var(--t), transform var(--t);
}

.back-btn:hover {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translateX(-2px);
}

.back-btn svg { width: 16px; height: 16px; }

/* ============================================================
   FOOTER override
   ============================================================ */
.footer-brand-logo-img--custom {
  filter: none !important;
  height: 48px;
  max-width: 48px;
  opacity: 0.92;
  border-radius: 6px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .header-inner { padding: 0 1rem; height: 70px; }
  .header-search-wrap { max-width: 200px; }
  .brand-logo { height: 44px; max-width: 50px; }
  .brand-title { font-size: 1.15rem; }
  .brand-tag { display: none; }
  .main-content { padding: 0 1rem 3rem; }
  .hero { padding: 2rem 1.5rem; margin: 1.5rem 0 2rem; border-radius: 22px; }
  .hero h1 { font-size: 1.75rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .topic-header { padding: 1.5rem 1.6rem; }
  .code-detail { padding: 1.75rem 1.5rem; }
  .section-header { margin: 2rem 0 1.25rem; }
  .topic-card { padding: 0.85rem 1rem; gap: 0.75rem; }
  .topic-card-icon { height: 40px; }
  .topic-card-icon--block { width: 40px; }
  .topic-card-icon--block svg { width: 20px; height: 20px; }
  .topic-card-icon--code { min-width: 54px; font-size: 0.8rem; }
  .topic-card-title { font-size: 0.9rem; }
  .aurora-orb { filter: blur(60px); }
  .aurora-orb--1 { width: 360px; height: 360px; }
  .aurora-orb--2 { width: 320px; height: 320px; }
  .aurora-orb--3 { width: 420px; height: 420px; }
  .aurora-orb--4 { width: 260px; height: 260px; }
}

@media (max-width: 480px) {
  .header-search-wrap { max-width: 150px; }
  .brand-text { display: none; }
  .hero { padding: 1.6rem 1.25rem; }
  .hero h1 { font-size: 1.55rem; }
  .hero-feature { font-size: 0.78rem; }
  .topic-card-meta { display: none; }
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
.view-enter {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
