*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f5f0e6;
  --bg-alt: #ede6d6;
  --bg-card: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #3a3a3a;
  --muted: #6b6b6b;
  --accent: #c2410c;
  --accent-soft: #f3d5c0;
  --steel: #1e3a5f;
  --line: #1a1a1a;
  --line-soft: #c9c0ad;
  --shadow: 3px 3px 0 var(--line);
  --header-bg: rgba(245, 240, 230, 0.92);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 4px;
  --maxw: 1100px;
}

html[data-theme="dark"] {
  --bg: #15140f;
  --bg-alt: #1e1c16;
  --bg-card: #1f1d17;
  --ink: #ede6d6;
  --ink-soft: #c9c2b2;
  --muted: #8a8377;
  --accent: #f97316;
  --accent-soft: #2e1f12;
  --steel: #60a5fa;
  --line: #3a3630;
  --line-soft: #4a463d;
  --shadow: 3px 3px 0 var(--accent);
  --header-bg: rgba(21, 20, 15, 0.92);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition:
    background 0.25s,
    color 0.25s;
}

img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.logo-mark {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 4px 8px;
  letter-spacing: 1px;
  font-size: 14px;
  border-radius: 2px;
  transition:
    background 0.2s,
    color 0.2s;
}

.logo-text {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.main-nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-family: var(--font-mono);
}

.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.main-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle,
.menu-toggle {
  background: transparent;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 2px;
  color: var(--ink);
  line-height: 1;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.15s;
}

.theme-toggle:hover {
  background: var(--ink);
  color: var(--bg);
  transform: rotate(15deg);
}
.menu-toggle {
  display: none;
  font-size: 18px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 800px;
  margin-bottom: 22px;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
.lead {
  font-size: 1.15rem;
  max-width: 640px;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  padding-top: 24px;
  border-top: 1px dashed var(--line-soft);
}

/* ---------- Botões ---------- */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  cursor: pointer;
  transition:
    transform 0.12s,
    background 0.15s,
    color 0.15s;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

/* ---------- Índice ---------- */
.toc {
  padding: 60px 0;
  border-bottom: 1px solid var(--line);
}
.toc h2 {
  font-size: 1.5rem;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.toc-list {
  list-style: none;
  counter-reset: toc;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px 32px;
}

.toc-list li {
  counter-increment: toc;
  border-bottom: 1px dashed var(--line-soft);
  padding: 10px 0;
}

.toc-list li::before {
  content: counter(toc, decimal-leading-zero) " · ";
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
  margin-right: 6px;
}

.toc-list a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.toc-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- Secções ---------- */
.section {
  padding: 80px 0;
  border-bottom: 1px solid var(--line);
}
.section-alt {
  background: var(--bg-alt);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  line-height: 1.15;
}

.section-intro {
  max-width: 720px;
  color: var(--ink-soft);
  margin-bottom: 40px;
  font-size: 1.05rem;
}

/* ---------- Camadas ---------- */
.layer-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0;
}

.layer {
  border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.layer:hover {
  box-shadow: var(--shadow);
}

.layer-head {
  display: flex;
  align-items: center;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: background 0.15s;
}

.layer-head:hover {
  background: var(--accent-soft);
}

.layer-num {
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  align-self: stretch;
  border-right: 1px solid var(--line);
  flex-shrink: 0;
}

.layer-title {
  padding: 14px 20px;
  flex: 1;
}
.layer-title h3 {
  font-size: 1.1rem;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.layer-title p {
  font-size: 14px;
  color: var(--muted);
}

.layer-toggle {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--accent);
  padding: 0 20px;
  font-weight: 600;
  transition: transform 0.25s;
  user-select: none;
}

.layer.open .layer-toggle {
  transform: rotate(45deg);
}
.layer.open .layer-head {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
}

.layer-detail {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    padding 0.3s ease;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.02);
}

html[data-theme="dark"] .layer-detail {
  background: rgba(255, 255, 255, 0.02);
}
.layer.open .layer-detail {
  max-height: 900px;
  padding: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.detail-grid > div {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.detail-grid h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}

.detail-grid p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.detail-grid code {
  background: var(--ink);
  color: var(--bg);
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 13px;
}

.detail-example {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--steel);
  padding: 14px 18px;
  font-size: 14px;
  border-radius: 2px;
  line-height: 1.6;
}

.detail-example code {
  background: var(--ink);
  color: var(--bg);
  padding: 1px 6px;
  border-radius: 2px;
}

/* ---------- PDU (Como os dados mudam de nome) ---------- */
.pdu-legend {
  margin-top: 40px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.pdu-legend h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.pdu-legend-intro {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 24px;
  line-height: 1.65;
  max-width: 780px;
}

.pdu-legend-intro strong {
  color: var(--ink);
}

.pdu-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 24px;
}

.pdu-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}

.pdu-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.pdu-card-head {
  padding: 10px 14px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.pdu-cam {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pdu-card-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pdu-card-body {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.pdu-card-body strong {
  color: var(--ink);
  font-weight: 600;
}

.pdu-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-alt);
  padding: 3px 8px;
  border-radius: 100px;
  display: inline-block;
  align-self: flex-start;
  border: 1px solid var(--line-soft);
}

.pdu-arrow {
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.pdu-footnote {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  padding-top: 18px;
  border-top: 1px dashed var(--line-soft);
  font-style: italic;
}

.pdu-footnote strong {
  color: var(--ink);
  font-style: normal;
}

/* ---------- Tabelas ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 16px;
  background: var(--bg-card);
}

.table th,
.table td {
  border: 1px solid var(--line-soft);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
}

.table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.03);
}
html[data-theme="dark"] .table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.table-compare .merged {
  background: var(--accent-soft);
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
}

/* ---------- Caixas ---------- */
.analogy-box {
  border-left: 4px solid var(--accent);
  background: rgba(194, 65, 12, 0.06);
  padding: 20px 24px;
  margin-top: 40px;
  border-radius: 2px;
}

html[data-theme="dark"] .analogy-box {
  background: rgba(249, 115, 22, 0.08);
}

.analogy-box h4 {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.note {
  border-left: 4px solid var(--steel);
  background: rgba(30, 58, 95, 0.06);
  padding: 16px 20px;
  font-size: 14px;
  margin-top: 32px;
  border-radius: 2px;
  line-height: 1.65;
}

html[data-theme="dark"] .note {
  background: rgba(96, 165, 250, 0.08);
}

.ipv6-note {
  border-left-color: var(--accent);
  background: rgba(194, 65, 12, 0.06);
}
html[data-theme="dark"] .ipv6-note {
  background: rgba(249, 115, 22, 0.08);
}

/* ---------- Simulador ---------- */
.encap-explainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 24px 0 32px;
}

.encap-step {
  border: 1px solid var(--line-soft);
  background: var(--bg-card);
  padding: 16px 18px;
  border-radius: var(--radius);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 14px;
}

.encap-num {
  background: var(--accent);
  color: #fff;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
}

.simulator {
  border: 1px solid var(--line);
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
}

.sim-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line-soft);
}

.sim-controls input {
  flex: 1;
  min-width: 220px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  border-radius: var(--radius);
}

.sim-controls input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.sim-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.sim-progress-label {
  font-weight: 600;
}

.sim-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 100px;
  overflow: hidden;
}

.sim-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s ease;
  border-radius: 100px;
}

.sim-progress-text {
  min-width: 70px;
  text-align: right;
  font-weight: 600;
  color: var(--ink);
}

.sim-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.dot-data {
  background: var(--accent);
}
.dot-head {
  background: var(--steel);
}
.dot-final {
  background: #16a34a;
}

.sim-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: start;
}

.sim-side h4 {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.sim-layers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-row {
  border: 1px solid var(--line-soft);
  background: var(--bg);
  padding: 8px 10px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.35;
  transition:
    opacity 0.3s,
    transform 0.3s,
    border-color 0.3s,
    background 0.3s;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sim-row.active {
  opacity: 1;
  transform: scale(1.02);
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.sim-row.done {
  opacity: 1;
}

.sim-row-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.sim-packet {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: stretch;
}

.pkt-chunk {
  position: relative;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 600;
  white-space: nowrap;
  cursor: help;
  animation: pop 0.25s ease;
  transition:
    transform 0.15s,
    filter 0.15s;
}

.pkt-chunk:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.pkt-l7 {
  background: #c2410c;
  color: #fff;
}
.pkt-l6 {
  background: #9333ea;
  color: #fff;
}
.pkt-l5 {
  background: #0891b2;
  color: #fff;
}
.pkt-l4 {
  background: #ca8a04;
  color: #000;
}
.pkt-l3 {
  background: #1e3a5f;
  color: #fff;
}
.pkt-l2 {
  background: #16a34a;
  color: #fff;
}
.pkt-l1 {
  background: #6b7280;
  color: #fff;
}

.pkt-tooltip {
  position: fixed;
  background: #0f0f10;
  color: #ede6d6;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.5;
  max-width: 300px;
  z-index: 9999;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(249, 115, 22, 0.4);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.15s,
    transform 0.15s;
  font-weight: 400;
  text-align: left;
}

.pkt-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.pkt-tooltip-title {
  display: block;
  font-weight: 700;
  color: #f97316;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sim-arrow {
  font-size: 28px;
  color: var(--accent);
  align-self: center;
  font-family: var(--font-mono);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.6;
  }
  50% {
    transform: translateX(6px);
    opacity: 1;
  }
}

.sim-note {
  margin-top: 24px;
  padding: 14px 18px;
  border-left: 4px solid var(--steel);
  background: rgba(30, 58, 95, 0.06);
  font-size: 14px;
  border-radius: 2px;
}

html[data-theme="dark"] .sim-note {
  background: rgba(96, 165, 250, 0.08);
}

/* ---------- Filtros ---------- */
.proto-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 100px;
  width: fit-content;
  max-width: 100%;
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 100px;
  color: var(--ink-soft);
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  color: var(--muted);
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.25);
}

.filter-btn.active .num {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

html[data-theme="dark"] .filter-btn.active {
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.proto-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.proto-count strong {
  color: var(--accent);
}

/* ---------- Protocolos ---------- */
.proto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.proto-card {
  border: 1px solid var(--line);
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.proto-card.hidden {
  display: none;
}
.proto-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.proto-card header {
  margin-bottom: 10px;
}

.proto-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--steel);
  color: #fff;
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 8px;
}

.proto-card h3 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.proto-card p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ---------- Caso real ---------- */
.case-box {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.case-step {
  display: flex;
  gap: 18px;
  border: 1px solid var(--line-soft);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  align-items: flex-start;
}

.case-step:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.case-step-num {
  background: var(--accent);
  color: #fff;
  min-width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.case-step-body h4 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.case-step-body p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 8px;
}

.case-step-body p:last-child {
  margin-bottom: 0;
}

.case-step-body code {
  background: var(--ink);
  color: var(--bg);
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 13px;
}

.case-list {
  margin: 8px 0 8px 20px;
  font-size: 14px;
  color: var(--ink-soft);
}
.case-list li {
  margin-bottom: 4px;
}

.case-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--steel);
  color: #fff;
  padding: 4px 10px;
  border-radius: 2px;
  margin-top: 8px !important;
  letter-spacing: 0.03em;
}

/* ---------- Quiz ---------- */
.quiz-container {
  display: grid;
  gap: 18px;
  margin-bottom: 32px;
}

.quiz-q {
  border: 1px solid var(--line);
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  animation: fadeUp 0.3s ease;
}

.quiz-q h4 {
  font-size: 1rem;
  margin-bottom: 14px;
  font-weight: 600;
}

.qnum {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-right: 6px;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  transition:
    background 0.12s,
    border-color 0.12s;
}

.quiz-opt:hover {
  background: rgba(0, 0, 0, 0.03);
}
html[data-theme="dark"] .quiz-opt:hover {
  background: rgba(255, 255, 255, 0.04);
}

.quiz-opt input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.quiz-opt.correct {
  background: #d6f1d6;
  border-color: #2f7a2f;
}
.quiz-opt.wrong {
  background: #f8d7d7;
  border-color: #b23b3b;
}

html[data-theme="dark"] .quiz-opt.correct {
  background: #143d14;
  border-color: #4caf50;
}
html[data-theme="dark"] .quiz-opt.wrong {
  background: #3d1414;
  border-color: #e57373;
}

.quiz-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}

.quiz-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.quiz-result {
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 15px;
  display: none;
}

.quiz-result.show {
  display: block;
}
.quiz-result strong {
  font-size: 1.3rem;
  color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 40px 0;
}
html[data-theme="dark"] .site-footer {
  background: #0a0a08;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}

.footer-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.footer-sub {
  font-size: 13px;
  opacity: 0.7;
  font-family: var(--font-mono);
}
.footer-meta {
  text-align: right;
  font-size: 13px;
  font-family: var(--font-mono);
  opacity: 0.85;
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s,
    background 0.2s;
  z-index: 99;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-3px);
}

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    display: none;
  }
  .main-nav.open {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
  .sim-stage {
    grid-template-columns: 1fr;
  }
  .sim-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .footer-meta {
    text-align: center;
  }

  .pdu-flow {
    grid-template-columns: 1fr;
  }
  .pdu-arrow {
    transform: rotate(90deg);
    padding: 4px 0;
  }
}

@media (max-width: 520px) {
  .hero {
    padding: 50px 0 40px;
  }
  .section {
    padding: 60px 0;
  }
  .layer-title {
    padding: 12px 14px;
  }
  .layer-title h3 {
    font-size: 1rem;
  }
  .layer-title p {
    font-size: 12px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Explicação do quiz ---------- */
.quiz-exp {
  display: none;
  margin: 12px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  color: var(--ink-soft);
  font-size: 14px;
}
.quiz-q.revealed .quiz-exp {
  display: block;
}