:root {
  --bg: #f8f4ea;
  --ink: #13212e;
  --muted: #526173;
  --card: #ffffff;
  --line: #d8e0eb;
  --accent: #ff6b35;
  --accent-2: #00a896;
  --accent-3: #ffca3a;
  --shadow: 0 16px 40px rgba(19, 33, 46, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Outfit", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #fff8ee 0%, #f1f7ff 100%);
  color: var(--ink);
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 30;
}

.quick-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(255, 252, 245, 0.82);
  border-bottom: 1px solid #ecdcca;
  padding: 0.55rem 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.quick-nav a {
  font-size: 0.82rem;
  text-decoration: none;
  color: #2e465c;
  border: 1px solid #dccfbe;
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  background: rgba(255, 255, 255, 0.85);
  transition: all 180ms ease;
}

.quick-nav a:hover,
.quick-nav a.active {
  color: #0f2c47;
  border-color: #9fbcdb;
  background: #eef7ff;
}

.bg-orb {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(55px);
  z-index: -1;
  opacity: 0.45;
  pointer-events: none;
}

.orb-a {
  top: -8rem;
  left: -8rem;
  background: #ffd9bf;
}

.orb-b {
  bottom: -10rem;
  right: -8rem;
  background: #b9f2ec;
}

.hero {
  max-width: 1080px;
  margin: 2.2rem auto 1rem;
  background: linear-gradient(120deg, #fff0dd 0%, #e7fbf7 50%, #fff8de 100%);
  border: 1px solid #f0d3b4;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: #875314;
}

h1 {
  margin: 0.45rem 0;
  font-size: clamp(2.3rem, 7vw, 4.1rem);
  line-height: 0.95;
}

.lead {
  margin: 0 0 1.2rem;
  max-width: 68ch;
  color: #2c3f52;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.btn {
  border-radius: 999px;
  padding: 0.68rem 1.05rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  color: inherit;
}

.btn.solid {
  background: var(--accent);
  color: #231000;
}

.btn.outline {
  background: rgba(255, 255, 255, 0.92);
  border-color: #f0be95;
}

.hero-stats {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-stats div {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid #f0d7bd;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
}

.hero-stats span {
  display: block;
  font-size: 0.78rem;
  color: #5b6674;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-stats strong {
  font-size: 0.95rem;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem 2.4rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(19, 33, 46, 0.08);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(19, 33, 46, 0.12);
}

h2 {
  margin: 0 0 0.45rem;
  font-size: 1.28rem;
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.03rem;
}

.section-note {
  margin-top: 0;
  color: var(--muted);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.stage {
  background: linear-gradient(170deg, #fbfcff 0%, #f4faf9 100%);
  border: 1px solid #d8e3f0;
  border-radius: 14px;
  padding: 0.95rem;
  position: relative;
}

.stage::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -0.7rem;
  width: 0.95rem;
  height: 0.95rem;
  border-top: 2px solid #90a7bf;
  border-right: 2px solid #90a7bf;
  transform: translateY(-50%) rotate(45deg);
}

.stage:last-child::after { display: none; }

.badge {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #00231f;
  background: linear-gradient(140deg, var(--accent-3), #fff0a8);
  margin-bottom: 0.45rem;
}

small {
  display: block;
  margin-top: 0.55rem;
  color: #496177;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

ul {
  margin: 0.3rem 0;
  padding-left: 1.1rem;
}

li { margin: 0.35rem 0; }

code, pre, .cmd {
  font-family: "JetBrains Mono", monospace;
}

.formula {
  background: #111b27;
  color: #d7f5ff;
  border: 1px solid #233548;
  border-radius: 10px;
  padding: 0.62rem 0.7rem;
  margin: 0.55rem 0;
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.65rem;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

th, td {
  border: 1px solid #dce5f0;
  padding: 0.48rem;
  text-align: left;
}

th { background: #f2f7ff; }

.pill-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  border-radius: 999px;
  background: #eef8f7;
  border: 1px solid #cde8e3;
  padding: 0.35rem 0.65rem;
  font-size: 0.83rem;
}

.code-panel pre,
pre {
  background: #111b27;
  color: #d7f5ff;
  border: 1px solid #2a3e53;
  border-radius: 10px;
  padding: 0.8rem;
  margin: 0;
  overflow-x: auto;
}

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

.cmd {
  border: 1px solid #d8e3ef;
  background: #f6f9fe;
  border-radius: 10px;
  text-align: left;
  padding: 0.64rem 0.7rem;
  cursor: pointer;
}

.btn:hover,
.cmd:hover {
  transform: translateY(-1px);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

footer {
  text-align: center;
  padding: 0.3rem 0 2rem;
  color: #5a6978;
}

@media (max-width: 980px) {
  .timeline,
  .hero-stats,
  .grid-2,
  .cmd-grid {
    grid-template-columns: 1fr;
  }

  .stage::after {
    top: auto;
    bottom: -0.55rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%) rotate(135deg);
  }

  .hero {
    margin-top: 1.2rem;
    border-radius: 16px;
    padding: 1.25rem;
  }

  .quick-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 0.55rem 0.65rem;
  }

  .quick-nav a {
    white-space: nowrap;
  }

  .card {
    padding: 1rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  .lead {
    font-size: 0.97rem;
  }

  pre {
    font-size: 0.77rem;
  }
}
