/* ===== CSS VARIABLES =====
   Paleta derivada do logo ds-explorer.png:
   - Azul primário (#3d8fd4): cor dos colchetes [ds-explorer] no logo
   - Gradiente de camadas: #3d8fd4 → #62aedc → #9acde8 → #c8e4f2
   - Texto muted (#7490a8): fonte monospace do subtítulo do logo
   ================================================= */
:root {
  --color-bg:           #0d1117;
  --color-surface:      #141c25;
  --color-border:       #1e2d3d;

  --color-primary:      #3d8fd4;   /* azul dos colchetes do logo */
  --color-primary-dim:  #1d5a8a;   /* estado pressed / accent escuro */
  --color-accent:       #62aedc;   /* camada intermediária do logo */

  --color-success:      #3db36c;
  --color-danger:       #dc5555;
  --color-warning:      #f0a020;

  /* Texto branco-azulado (camada mais clara do logo) */
  --color-text:         #d4e8f5;
  --color-text-muted:   #7490a8;   /* monospace subtitle do logo */

  /* JetBrains Mono em tudo — coerente com a identidade do logo */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: 'JetBrains Mono', 'Fira Code', system-ui, monospace;

  --radius:    6px;
  --radius-lg: 12px;
  --shadow:    0 2px 16px rgba(0, 0, 0, .55);
  --shadow-lg: 0 4px 28px rgba(61, 143, 212, .18);

  --header-h: 60px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Suaviza a renderização de fonte monospace */
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== HEADER ===== */
.site-header {
  height: var(--header-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  /* Linha de destaque sutil na base do header com o azul do logo */
  box-shadow: 0 1px 0 var(--color-border), 0 2px 12px rgba(0,0,0,.4);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo texto: replica o estilo [ds-explorer] do logo */
.logo {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0;
}
.logo:hover { text-decoration: none; opacity: 0.9; }

/* Colchetes na cor azul primária do logo */
.logo-bracket {
  color: var(--color-primary);
  font-weight: 700;
}

.site-nav { display: flex; gap: 1.5rem; align-items: center; }

/* ===== NAV DROPDOWN ===== */
.nav-dropdown {
  position: relative;
  padding-bottom: 0.35rem;
  margin-bottom: -0.35rem;
}

.nav-link--trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-dropdown-arrow {
  font-size: 0.65rem;
  opacity: 0.55;
  transition: transform 0.2s;
  display: inline-block;
}

.nav-dropdown:hover .nav-dropdown-arrow,
.nav-dropdown:focus-within .nav-dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 230px;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) var(--color-bg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 0.4rem 0;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  pointer-events: none;
}

.nav-dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.nav-dropdown-menu::-webkit-scrollbar-track {
  background: var(--color-bg);
  border-radius: 999px;
}

.nav-dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 999px;
  border: 2px solid var(--color-surface);
}

.nav-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.nav-dropdown-cat {
  padding: 0.25rem 1rem 0.15rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-primary);
  font-weight: 600;
}

.nav-dropdown-sep {
  height: 1px;
  background: var(--color-border);
  margin: 0.35rem 0;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  background: rgba(61, 143, 212, 0.08);
  color: var(--color-text);
  text-decoration: none;
}

.nav-dropdown-item--active {
  color: var(--color-primary);
}

.nav-dropdown-item--soon {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

.nav-dropdown-badge {
  font-size: 0.66rem;
  color: var(--color-text-muted);
  background: var(--color-border);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.nav-dropdown-loading {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.nav-link {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--color-text); text-decoration: none; }
.nav-link--active { color: var(--color-primary); }
.nav-link--disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== MAIN / FOOTER ===== */
.site-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.site-footer {
  text-align: center;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-edu {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  opacity: 0.55;
  letter-spacing: 0.2px;
}

.footer-github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  transition: color 0.15s;
  text-decoration: none;
}
.footer-github-link:hover {
  color: var(--color-text);
  text-decoration: none;
}

.footer-git-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 0.5rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hero-logo-img {
  width: min(86vw, 43rem);
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 0.2rem;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Comentário de código como título — estilo do logo */
.hero-comment {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  /* Gradiente usando a paleta do logo: azul primário → azul claro */
  background: linear-gradient(135deg, var(--color-text) 40%, var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* Subtítulo em estilo de path de arquivo, como no logo */
.hero-filename {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 0.7rem;
  letter-spacing: 0.5px;
}

.hero-subtitle {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto 1.2rem;
  line-height: 1.7;
}

/* ===== CARDS GRID ===== */
.structures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--color-text);
}

.card--available:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.card--available:hover .card-name,
.card--available:hover .card-name-en {
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}

.card--soon {
  opacity: 0.45;
  cursor: default;
}

.card-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--color-primary);
  font-weight: 600;
}

.card-subtype {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
  margin-top: -0.25rem;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-name-en {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.2px;
  margin-top: -0.2rem;
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.card-meta-label {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.card-complexity {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-warning);
  background: rgba(240, 160, 32, 0.1);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(240, 160, 32, 0.2);
  cursor: help;
  white-space: nowrap;
}

.card-complexity--excellent {
  color: #6ee7a8;
  background: rgba(62, 179, 108, 0.14);
  border-color: rgba(62, 179, 108, 0.32);
}

.card-complexity--good {
  color: #9ae6b4;
  background: rgba(80, 200, 120, 0.12);
  border-color: rgba(80, 200, 120, 0.24);
}

.card-complexity--fair {
  color: #f0d37a;
  background: rgba(240, 160, 32, 0.12);
  border-color: rgba(240, 160, 32, 0.24);
}

.card-complexity--warning {
  color: #ffb36b;
  background: rgba(224, 126, 52, 0.14);
  border-color: rgba(224, 126, 52, 0.28);
}

.card-complexity--danger {
  color: #ff9a9a;
  background: rgba(220, 85, 85, 0.16);
  border-color: rgba(220, 85, 85, 0.32);
}

.card-complexity--neutral {
  color: var(--color-text-muted);
  background: rgba(116, 144, 168, 0.12);
  border-color: rgba(116, 144, 168, 0.24);
}

.card-footer { margin-top: auto; padding-top: 0.75rem; }

.ada-home-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.6rem;
}

.ada-home-hint strong {
  color: var(--color-primary);
}

.badge-soon {
  font-size: 0.72rem;
  background: var(--color-border);
  color: var(--color-text-muted);
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}

/* ===== USAGE FREQUENCY BADGE ===== */

.card-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.badge-usage {
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-style: italic;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: help;
  background: var(--color-border);
  color: var(--color-text-muted);
  border: 1px solid transparent;
}

.badge-usage--very-common {
  color: #6ee7a8;
  background: rgba(62, 179, 108, 0.14);
  border-color: rgba(62, 179, 108, 0.32);
}

.badge-usage--common {
  color: #9ae6b4;
  background: rgba(80, 200, 120, 0.12);
  border-color: rgba(80, 200, 120, 0.24);
}

.badge-usage--uncommon {
  color: #f0d37a;
  background: rgba(240, 160, 32, 0.12);
  border-color: rgba(240, 160, 32, 0.24);
}

.badge-usage--rare {
  color: #ffb36b;
  background: rgba(224, 126, 52, 0.14);
  border-color: rgba(224, 126, 52, 0.28);
}

/* ===== REFERENCES ===== */
.references-hero {
  padding: 0.75rem 0 1.5rem;
  max-width: 760px;
}

.references-kicker,
.references-section-kicker {
  font-size: 0.72rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.35rem;
}

.references-title {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.references-subtitle {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 66ch;
}

.references-section {
  margin-top: 2rem;
}

.references-section-head {
  margin-bottom: 1rem;
}

.references-section-title {
  font-size: 1.15rem;
}

.references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.reference-card {
  background: linear-gradient(180deg, rgba(20, 28, 37, 0.98), rgba(13, 17, 23, 0.98));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.reference-card-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.reference-category {
  font-size: 0.7rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-weight: 600;
}

.reference-subtype {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.reference-status {
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.reference-status--available {
  color: #9ae6b4;
  background: rgba(62, 179, 108, 0.12);
  border: 1px solid rgba(62, 179, 108, 0.28);
}

.reference-status--soon {
  color: #f0d37a;
  background: rgba(240, 160, 32, 0.12);
  border: 1px solid rgba(240, 160, 32, 0.24);
}

.reference-name {
  font-size: 1.08rem;
  line-height: 1.3;
}

.reference-name-en {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  margin-top: -0.45rem;
}

.reference-meta {
  display: grid;
  gap: 0.45rem;
}

.reference-meta-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.reference-meta-row dt {
  color: var(--color-primary);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.reference-meta-row dd {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.reference-copy {
  display: grid;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.reference-copy strong {
  color: var(--color-text);
}

.reference-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.reference-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.2rem;
}

.reference-source {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.reference-internal-link {
  font-size: 0.78rem;
  color: var(--color-accent);
}

/* ===== GUIDES ===== */
.guide-hero {
  padding: 0.75rem 0 1.6rem;
  max-width: 860px;
}

.guide-kicker,
.guide-card-kicker {
  font-size: 0.72rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.85px;
  margin-bottom: 0.4rem;
}

.guide-title {
  font-size: 2rem;
  line-height: 1.18;
  margin-bottom: 0.85rem;
}

.guide-subtitle,
.guide-section-copy {
  color: var(--color-text-muted);
  font-size: 0.94rem;
  max-width: 72ch;
}

.guide-section {
  margin-top: 2rem;
}

.guide-section-head {
  margin-bottom: 1rem;
}

.guide-section-title,
.guide-card-title {
  font-size: 1.15rem;
  line-height: 1.3;
}

.guide-grid {
  display: grid;
  gap: 1rem;
}

.guide-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-card,
.chart-card,
.notation-card,
.growth-card,
.storage-card,
.memory-tier,
.guide-callout {
  background: linear-gradient(180deg, rgba(20, 28, 37, 0.98), rgba(13, 17, 23, 0.98));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.guide-card {
  padding: 1.25rem;
}

.guide-card--emphasis {
  border-color: rgba(61, 143, 212, 0.35);
  box-shadow: 0 4px 28px rgba(61, 143, 212, 0.14);
}

.guide-copy {
  display: grid;
  gap: 0.7rem;
  color: var(--color-text-muted);
  font-size: 0.86rem;
  line-height: 1.75;
}

.guide-copy strong,
.guide-callout strong {
  color: var(--color-text);
}

.notation-grid,
.growth-grid,
.storage-grid {
  display: grid;
  gap: 1rem;
}

.notation-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.growth-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.storage-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.notation-card,
.growth-card,
.storage-card {
  padding: 1.15rem;
}

.notation-card h3,
.growth-card h3,
.storage-card h3,
.memory-tier h3,
.mini-title {
  font-size: 1rem;
  margin-bottom: 0.55rem;
}

.notation-card p,
.growth-card p,
.storage-card p,
.memory-tier p,
.guide-callout p {
  color: var(--color-text-muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.notation-note {
  margin-top: 0.55rem;
}

.chart-card {
  padding: 1rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.9rem;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.chart-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.chart-swatch--o1 { background: #6ee7a8; }
.chart-swatch--ologn { background: #8bd3ff; }
.chart-swatch--on { background: #b9f27c; }
.chart-swatch--onlogn { background: #f0d37a; }
.chart-swatch--on2 { background: #ffb36b; }
.chart-swatch--o2n { background: #ff8d8d; }
.chart-swatch--onf { background: #ff5f8f; }

.growth-chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart-note {
  margin-top: 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.76rem;
}

.source-list {
  display: grid;
  gap: 0.75rem;
}

.source-link {
  display: block;
  background: rgba(20, 28, 37, 0.85);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  color: var(--color-text);
  text-decoration: none;
}

.source-link:hover {
  border-color: var(--color-primary);
  text-decoration: none;
}

.memory-ladder {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.memory-cycle-card {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: 1.15rem;
  background: linear-gradient(180deg, rgba(20, 28, 37, 0.98), rgba(13, 17, 23, 0.98));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.memory-cycle-copy {
  color: var(--color-text-muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.memory-cycle-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 360px);
  gap: 1rem;
  align-items: stretch;
}

.memory-cycle-demo {
  position: relative;
  min-height: 380px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background:
    radial-gradient(circle at center, rgba(61, 143, 212, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(20, 28, 37, 0.98), rgba(13, 17, 23, 0.98));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.memory-demo-caption {
  position: absolute;
  left: 50%;
  bottom: 0.9rem;
  transform: translateX(-50%);
  color: var(--color-text-muted);
  font-size: 0.72rem;
  background: rgba(13, 17, 23, 0.78);
  border: 1px solid rgba(30, 45, 61, 0.9);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  white-space: nowrap;
}

.memory-ring,
.memory-core,
.memory-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
}

.memory-ring {
  border: 1px solid rgba(116, 144, 168, 0.22);
}

.memory-ring--l1 {
  width: 110px;
  height: 110px;
  border-color: rgba(110, 231, 168, 0.55);
}

.memory-ring--l2 {
  width: 180px;
  height: 180px;
  border-color: rgba(139, 211, 255, 0.45);
}

.memory-ring--l3 {
  width: 260px;
  height: 260px;
  border-color: rgba(240, 211, 122, 0.35);
}

.memory-ring--ram {
  width: 340px;
  height: 340px;
  border-color: rgba(255, 141, 141, 0.3);
}

.memory-core {
  width: 62px;
  height: 62px;
  background: radial-gradient(circle at 35% 35%, rgba(139, 211, 255, 0.95), rgba(29, 90, 138, 0.92));
  border: 1px solid rgba(139, 211, 255, 0.35);
  box-shadow: 0 0 24px rgba(61, 143, 212, 0.28);
  z-index: 3;
  display: grid;
  place-items: center;
}

.memory-core span {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.memory-packet {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #d4e8f5;
  box-shadow: 0 0 18px rgba(212, 232, 245, 0.8);
  animation: memory-packet-travel 4.8s linear infinite;
  z-index: 4;
}

.memory-pulse {
  opacity: 0;
  border-style: solid;
  z-index: 2;
}

.memory-pulse--l1 {
  width: 110px;
  height: 110px;
  border-color: rgba(110, 231, 168, 0.7);
  animation: memory-pulse-l1 4.8s ease-out infinite;
}

.memory-pulse--l2 {
  width: 180px;
  height: 180px;
  border-color: rgba(139, 211, 255, 0.6);
  animation: memory-pulse-l2 4.8s ease-out infinite;
}

.memory-pulse--l3 {
  width: 260px;
  height: 260px;
  border-color: rgba(240, 211, 122, 0.55);
  animation: memory-pulse-l3 4.8s ease-out infinite;
}

.memory-pulse--ram {
  width: 340px;
  height: 340px;
  border-color: rgba(255, 141, 141, 0.5);
  animation: memory-pulse-ram 4.8s ease-out infinite;
}

.memory-cycle-legend {
  display: grid;
  gap: 0.7rem;
}

.memory-cycle-item {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: rgba(13, 17, 23, 0.7);
}

.memory-cycle-item-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.memory-cycle-item strong {
  color: var(--color-text);
  font-size: 0.86rem;
}

.memory-cycle-item p {
  color: var(--color-text-muted);
  font-size: 0.77rem;
  line-height: 1.55;
}

.memory-cycle-item p + p {
  margin-top: 0.18rem;
}

.memory-cycle-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.memory-cycle-item--l1 .memory-cycle-dot { background: #6ee7a8; }
.memory-cycle-item--l2 .memory-cycle-dot { background: #8bd3ff; }
.memory-cycle-item--l3 .memory-cycle-dot { background: #f0d37a; }
.memory-cycle-item--ram .memory-cycle-dot { background: #ff8d8d; }

.memory-cycle-item--l1 { border-color: rgba(110, 231, 168, 0.24); }
.memory-cycle-item--l2 { border-color: rgba(139, 211, 255, 0.22); }
.memory-cycle-item--l3 { border-color: rgba(240, 211, 122, 0.2); }
.memory-cycle-item--ram { border-color: rgba(255, 141, 141, 0.2); }

.memory-tier {
  padding: 1.1rem;
  position: relative;
  overflow: hidden;
}

.memory-tier::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--color-primary);
}

.memory-tier--l1::before { background: #6ee7a8; }
.memory-tier--l2::before { background: #8bd3ff; }
.memory-tier--l3::before { background: #f0d37a; }
.memory-tier--ram::before { background: #ff8d8d; }

.memory-tier-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.55rem;
}

.memory-tier-head span {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.memory-tier-points {
  margin-top: 0.7rem;
  padding-left: 1rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  line-height: 1.75;
}

.storage-rating {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.4px;
  font-weight: 500;
  border: 1px solid transparent;
}

.storage-rating--good {
  color: #9ae6b4;
  background: rgba(80, 200, 120, 0.12);
  border-color: rgba(80, 200, 120, 0.26);
}

.storage-rating--warning {
  color: #ffb36b;
  background: rgba(224, 126, 52, 0.12);
  border-color: rgba(224, 126, 52, 0.26);
}

.storage-rating--mixed {
  color: #8bd3ff;
  background: rgba(61, 143, 212, 0.12);
  border-color: rgba(61, 143, 212, 0.26);
}

.guide-callout {
  padding: 1.15rem 1.2rem;
  border-color: rgba(61, 143, 212, 0.35);
}

.guide-callout h2 {
  font-size: 1rem;
  margin-bottom: 0.55rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, border-color 0.15s;
  background: var(--color-border);
  color: var(--color-text);
}

.btn:hover { opacity: 0.85; }

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn--accent {
  background: var(--color-primary-dim);
  color: #fff;
  border-color: var(--color-primary);
}

.btn--sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

.btn--icon {
  padding: 0.4rem 0.65rem;
  font-size: 0.88rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.btn--disabled, .btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===== INPUTS ===== */
.input {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  transition: border-color 0.15s;
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.input--number { width: 70px; }

.select {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  width: 100%;
  cursor: pointer;
}

.select:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb-sep { opacity: 0.5; }

/* ===== PLACEHOLDER PAGE ===== */
.placeholder-page {
  text-align: center;
  padding: 5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.placeholder-icon {
  font-size: 3rem;
  opacity: 0.25;
  margin-bottom: 0.5rem;
}

.placeholder-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.placeholder-text {
  color: var(--color-text-muted);
  max-width: 480px;
}

.placeholder-text--muted { opacity: 0.6; }

/* ===== SLIDER ===== */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
}

/* ===== MOBILE NAV TOGGLE ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.nav-toggle--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle--open span:nth-child(2) { opacity: 0; }
.nav-toggle--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    flex-direction: column;
    padding: 0.75rem 1.5rem 2rem;
    gap: 0;
    z-index: 98;
  }

  .site-nav--open {
    display: flex;
  }

  .site-nav > .nav-link {
    font-size: 0.95rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    width: 100%;
  }

  .site-nav > .nav-link:last-child {
    border-bottom: none;
  }

  .nav-dropdown {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-dropdown > .nav-link--trigger {
    font-size: 0.95rem;
    padding: 0.75rem 0;
    width: 100%;
    color: var(--color-text);
  }

  /* Dropdown colapsável no mobile — fechado por padrão */
  .site-nav .nav-dropdown-menu {
    display: none;
    position: static !important;
    transform: none !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: none;
    box-shadow: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    min-width: 0;
    width: 100%;
    margin-bottom: 0.75rem;
    transition: none;
  }

  .site-nav .nav-dropdown--mobile-open .nav-dropdown-menu {
    display: block;
  }

  /* Rotaciona seta quando expandido */
  .site-nav .nav-dropdown--mobile-open .nav-dropdown-arrow {
    transform: rotate(180deg);
  }

  .site-main {
    padding: 1.25rem 1rem;
  }

  .hero-title {
    font-size: 1.45rem;
  }

  .hero-subtitle {
    font-size: 0.88rem;
  }

  .card {
    padding: 1.1rem;
  }

  .structures-grid {
    gap: 0.85rem;
    margin-top: 1rem;
  }

  .guide-title {
    font-size: 1.5rem;
  }

  .guide-section-title,
  .guide-card-title {
    font-size: 1rem;
  }
}

@media (max-width: 720px) {
  .guide-grid--two,
  .guide-grid--three,
  .references-grid {
    grid-template-columns: 1fr;
  }

  .reference-meta-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .reference-metrics {
    grid-template-columns: 1fr;
  }

  .memory-ladder {
    grid-template-columns: 1fr;
  }

  .memory-cycle-card {
    grid-template-columns: 1fr;
  }

  .memory-cycle-layout {
    grid-template-columns: 1fr;
  }

  .memory-cycle-demo {
    min-height: 320px;
  }

  .memory-ring--ram {
    width: 290px;
    height: 290px;
  }

  .memory-ring--l3 {
    width: 220px;
    height: 220px;
  }

  .memory-ring--l2 {
    width: 155px;
    height: 155px;
  }

  .memory-ring--l1 {
    width: 96px;
    height: 96px;
  }

  .chart-legend {
    gap: 0.55rem 0.8rem;
  }
}

@media (max-width: 960px) {
  .guide-grid--three,
  .memory-ladder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memory-cycle-card {
    grid-template-columns: 1fr;
  }

  .memory-cycle-layout {
    grid-template-columns: 1fr;
  }
}

@keyframes memory-packet-travel {
  0%,
  8% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
  12% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  24% {
    transform: translate(5px, -50%) scale(1);
    opacity: 1;
  }
  36% {
    transform: translate(40px, -50%) scale(1);
    opacity: 1;
  }
  52% {
    transform: translate(78px, -50%) scale(1);
    opacity: 1;
  }
  72% {
    transform: translate(118px, -50%) scale(1);
    opacity: 1;
  }
  86% {
    transform: translate(138px, -50%) scale(0.95);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
}

@keyframes memory-pulse-l1 {
  0%, 10%, 100% { opacity: 0; }
  14%, 22% { opacity: 0.95; box-shadow: 0 0 16px rgba(110, 231, 168, 0.22); }
  30% { opacity: 0; }
}

@keyframes memory-pulse-l2 {
  0%, 24%, 100% { opacity: 0; }
  28%, 38% { opacity: 0.9; box-shadow: 0 0 18px rgba(139, 211, 255, 0.18); }
  46% { opacity: 0; }
}

@keyframes memory-pulse-l3 {
  0%, 40%, 100% { opacity: 0; }
  46%, 60% { opacity: 0.88; box-shadow: 0 0 18px rgba(240, 211, 122, 0.16); }
  68% { opacity: 0; }
}

@keyframes memory-pulse-ram {
  0%, 58%, 100% { opacity: 0; }
  66%, 84% { opacity: 0.84; box-shadow: 0 0 22px rgba(255, 141, 141, 0.18); }
  92% { opacity: 0; }
}
