/* ============================================================
   ADS-Simulado-InfraTI — "blueprint" design system
   Infraestrutura de TI — simulado
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;

  --bg: #f4efe8;
  --bg-elev: #fffdfa;
  --bg-sunken: #ece4d9;
  --ink: #2b2118;
  --ink-soft: #5c4d40;
  --ink-faint: #8c7b6a;
  --line: #ddd0bf;
  --line-soft: #e8ddd0;
  --accent: #c2410c;
  --accent-strong: #7c2d12;
  --accent-tint: #fde3cd;
  --good: #2f7d5c;
  --good-tint: #dcefe4;
  --bad: #b5483f;
  --bad-tint: #f6e2e0;

  --font-display: 'IBM Plex Mono', ui-monospace, monospace;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(43, 33, 24, 0.08), 0 8px 24px rgba(43, 33, 24, 0.06);
  --grid-size: 28px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #1a140e;
  --bg-elev: #251c14;
  --bg-sunken: #120d08;
  --ink: #f2ece2;
  --ink-soft: #c9b8a4;
  --ink-faint: #94816c;
  --line: #423225;
  --line-soft: #2f2419;
  --accent: #fb923c;
  --accent-strong: #fdba74;
  --accent-tint: #3a2313;
  --good: #6cc39c;
  --good-tint: #123023;
  --bad: #e0958c;
  --bad-tint: #331c1a;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

a { color: var(--accent-strong); }
a:hover { color: var(--accent); }

::selection { background: var(--accent-tint); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden { display: none !important; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: .12em;
  color: var(--bg-elev);
  background: var(--accent-strong);
  padding: 3px 6px;
  border-radius: 4px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: .01em;
}

.brand-name span { color: var(--ink-faint); }

nav.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  font-family: var(--font-display);
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 7px 12px;
  border-radius: 5px;
  border: 1px solid transparent;
}

.site-nav a:hover { color: var(--ink); background: var(--bg-sunken); }
.site-nav a[aria-current="page"] {
  color: var(--accent-strong);
  border-color: var(--line);
  background: var(--bg-elev);
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- corner ticks (blueprint sheet motif — used sparingly) ---------- */

.sheet {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.sheet::before,
.sheet::after,
.sheet .tick-br,
.sheet .tick-bl {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.sheet::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.sheet::after { top: -1px; right: -1px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.sheet .tick-bl { bottom: -1px; left: -1px; border-bottom: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.sheet .tick-br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

/* ---------- hero ---------- */

.hero {
  margin: 40px 0 56px;
  padding: 36px 36px 30px;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 1px;
  transform: rotate(45deg);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  line-height: 1.2;
  margin: 14px 0 10px;
  letter-spacing: -0.01em;
}

.hero p.lede {
  color: var(--ink-soft);
  font-size: 1.02rem;
  max-width: 62ch;
  margin: 0 0 26px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}
.meta-chip {
  font-family: var(--font-display);
  font-size: 0.74rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: var(--bg-sunken);
  padding: 5px 10px;
  border-radius: 999px;
}

/* pipeline schematic (signature element) */

.pipeline-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.pipeline { width: 100%; height: auto; display: block; }
.pipeline .node-circle {
  fill: var(--bg-elev);
  stroke: var(--accent);
  stroke-width: 2;
}
.pipeline .node-label {
  font-family: var(--font-display);
  font-size: 11px;
  fill: var(--ink);
}
.pipeline .node-index {
  font-family: var(--font-display);
  font-size: 10px;
  fill: var(--accent-strong);
}
.pipeline .connector {
  stroke: var(--ink-faint);
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
  fill: none;
}
.pipeline .rail {
  stroke: var(--line);
  stroke-width: 1;
}

/* ---------- chapters ---------- */

.chapter { margin: 56px 0; scroll-margin-top: 80px; }

.chapter-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.chapter-tag {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-tint);
  padding: 4px 9px;
  border-radius: 4px;
  white-space: nowrap;
}

.chapter-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0;
  font-weight: 600;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  margin: 0 0 10px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h3::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  flex: none;
}

.card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.card ul li { margin-bottom: 6px; }
.card ul li:last-child { margin-bottom: 0; }
.card ul li strong { color: var(--ink); font-weight: 600; }

.card p { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }

.card .quote {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--ink-soft);
  border-left: 2px solid var(--line);
  padding-left: 10px;
  margin: 10px 0 0;
}

/* comparison table used for lifecycle / process models */

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.compare-table th, .compare-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.compare-table th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.compare-table td:first-child, .compare-table th:first-child {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.compare-table tr:last-child td { border-bottom: none; }

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card-wide { grid-column: 1 / -1; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag-pill {
  font-family: var(--font-display);
  font-size: 0.72rem;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 3px 8px;
  border-radius: 999px;
}
.tag-pill.a { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-tint); }

/* ---------- sources ---------- */

.sources {
  margin: 64px 0 40px;
  padding: 26px 28px;
}

.sources h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 6px;
}

.sources > p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 60ch;
  margin: 0 0 18px;
}

.source-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--bg-sunken);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.88rem;
}
.source-item .file-tag {
  font-family: var(--font-display);
  font-size: 0.68rem;
  color: var(--bg-elev);
  background: var(--accent-strong);
  padding: 2px 6px;
  border-radius: 3px;
  flex: none;
}
.source-item .file-label strong { font-weight: 600; }

.source-citation {
  margin: 20px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.source-note {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin: 0;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  margin-top: 40px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--accent); }

/* ============================================================
   quiz section
   ============================================================ */

.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 34px 0 20px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.quiz-progress .bar {
  flex: 1;
  height: 5px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin: 0 14px;
  overflow: hidden;
}
.quiz-progress .bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width .25s ease;
}

.question-card {
  padding: 26px 28px 24px;
  margin-bottom: 22px;
}

.question-card .q-tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--accent-strong);
  background: var(--accent-tint);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
}

.question-card p.q-prompt {
  font-size: 0.97rem;
  color: var(--ink);
  margin: 0 0 18px;
}

.options { display: flex; flex-direction: column; gap: 8px; }

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: var(--bg-sunken);
  border-radius: var(--radius);
  padding: 11px 13px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink);
  text-align: left;
}

.option:hover:not(:disabled) { border-color: var(--accent); }

.option .letter {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-faint);
  flex: none;
}

.option.correct {
  border-color: var(--good);
  background: var(--good-tint);
}
.option.correct .letter { color: var(--good); }

.option.incorrect {
  border-color: var(--bad);
  background: var(--bad-tint);
}
.option.incorrect .letter { color: var(--bad); }

.option:disabled { cursor: default; }
.option:disabled:not(.correct):not(.incorrect) { opacity: .55; }

.feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--bg-sunken);
  border-radius: 0 6px 6px 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  display: none;
}
.feedback.show { display: block; }
.feedback strong { color: var(--ink); }

.quiz-intro {
  text-align: center;
  padding: 40px 28px;
}
.quiz-intro p { color: var(--ink-soft); max-width: 50ch; margin: 0 auto 22px; }

.quiz-result {
  text-align: center;
  padding: 40px 28px;
  display: none;
}
.quiz-result.show { display: block; }
.quiz-result .score {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin: 6px 0;
}
.quiz-result p { color: var(--ink-soft); max-width: 50ch; margin: 8px auto 0; }

.btn {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 20px;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost {
  background: transparent;
  color: var(--accent-strong);
}
.btn.ghost:hover { background: var(--accent-tint); }

@media (max-width: 640px) {
  .site-nav a { padding: 7px 8px; font-size: 0.76rem; }
  .hero { padding: 26px 20px 22px; }
  .question-card { padding: 20px 18px 18px; }
  .pipeline { min-width: 560px; }
  .quiz-progress { flex-wrap: wrap; row-gap: 8px; }
  .quiz-progress .bar { order: 3; flex-basis: 100%; margin: 0; }
}

@media (max-width: 480px) {
  .site-header .wrap { flex-wrap: wrap; row-gap: 8px; }
  .brand-name span { display: none; }
  nav.site-nav { gap: 2px; }
  .hero-meta .meta-chip:nth-child(2) { display: none; }
}