:root {
  --bg: #f7f4ee;
  --panel: #fffdf8;
  --panel-2: #f0ece3;
  --ink: #171512;
  --muted: #6e675c;
  --line: #ded7c9;
  --line-strong: #c7bda9;
  --accent: #ff6b2c;
  --accent-soft: #ffe2d3;
  --good: #157f55;
  --good-soft: #dff4eb;
  --warn: #a85d00;
  --warn-soft: #fff0d1;
  --bad: #a73535;
  --bad-soft: #ffe1df;
  --code: #171512;
  --code-ink: #f6efe5;
  --shadow: 0 16px 50px rgba(28, 22, 14, .10);
  --radius: 24px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(circle at top left, rgba(255, 107, 44, .14), transparent 36rem),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 42%, #eee7dc 100%);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: .8rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid rgba(222, 215, 201, .88);
  background: rgba(247, 244, 238, .86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: max-content;
  font-weight: 800;
  letter-spacing: -.03em;
}

.brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: .8rem;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 7px 20px rgba(23, 21, 18, .18);
}

.nav {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 700;
  padding: .65rem .8rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.nav a:hover,
.nav a.active {
  color: var(--ink);
  background: #fffaf0;
  border-color: var(--line);
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  padding: clamp(3rem, 7vw, 6.5rem) 0 2.4rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 800;
  color: #83330d;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 107, 44, .28);
  padding: .45rem .8rem;
  border-radius: 999px;
  font-size: .86rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 2rem;
  align-items: end;
}

h1 {
  font-size: clamp(2.55rem, 7vw, 5.8rem);
  line-height: .92;
  letter-spacing: -.08em;
  margin: 1.2rem 0 1rem;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -.06em;
  margin: 0 0 1rem;
}

h3 {
  font-size: 1.12rem;
  letter-spacing: -.03em;
  margin: 0 0 .7rem;
}

p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.lede {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  max-width: 70ch;
}

.hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.stack-row {
  display: grid;
  gap: .7rem;
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .95rem;
  border-radius: 18px;
  background: #fbf6ed;
  border: 1px solid var(--line);
}

.metric strong {
  font-size: 1.2rem;
  letter-spacing: -.04em;
}

.metric span {
  color: var(--muted);
  font-size: .9rem;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 2rem 0 5rem;
}

.page-card {
  position: relative;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 36px rgba(25, 20, 13, .07);
  overflow: hidden;
}

.page-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.page-card .number {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: .85rem;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  margin-bottom: 1rem;
}

.page-card p {
  margin-top: .5rem;
  font-size: .95rem;
}

.page-card .arrow {
  align-self: flex-start;
  margin-top: 1rem;
  padding: .55rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 800;
  background: #fffaf0;
}

.section {
  padding: 4rem 0;
}

.section.tight {
  padding: 2.5rem 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 2vw, 1.5rem);
  box-shadow: 0 12px 36px rgba(25, 20, 13, .06);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--line);
  background: #fffaf0;
  color: var(--muted);
  padding: .35rem .55rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: .78rem;
}

.badge.red {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: rgba(167,53,53,.24);
}

.badge.green {
  color: var(--good);
  background: var(--good-soft);
  border-color: rgba(21,127,85,.24);
}

.badge.orange {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(168,93,0,.24);
}

.codeblock {
  background: var(--code);
  color: var(--code-ink);
  border-radius: 18px;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.55;
  border: 1px solid rgba(255,255,255,.08);
}

.codeblock .dim { color: #aaa49a; }
.codeblock .add { color: #98e6b2; }
.codeblock .del { color: #ffaaa4; }
.codeblock .key { color: #ffd38e; }
.codeblock .fn { color: #b9d3ff; }

.diff-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1.2rem;
  align-items: start;
  padding: 2rem 0 5rem;
}

.diff-main {
  min-width: 0;
}

.checklist {
  position: sticky;
  top: 5.2rem;
  background: rgba(255, 253, 248, .92);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.checklist h3 {
  margin: .2rem 0 .3rem;
}

.progress-track {
  position: relative;
  height: .65rem;
  background: var(--panel-2);
  border-radius: 999px;
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: inherit;
  transition: width .35s ease;
}

.criteria-list {
  display: grid;
  gap: .65rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.criteria-list li {
  display: grid;
  grid-template-columns: 1.65rem 1fr;
  gap: .65rem;
  align-items: start;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbf6ed;
  color: var(--muted);
}

.criteria-list li .box {
  width: 1.45rem;
  height: 1.45rem;
  display: grid;
  place-items: center;
  border-radius: .45rem;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  color: transparent;
  font-weight: 900;
  transition: all .25s ease;
}

.criteria-list li.done {
  color: var(--ink);
  background: var(--good-soft);
  border-color: rgba(21,127,85,.25);
}

.criteria-list li.done .box {
  background: var(--good);
  color: white;
  border-color: var(--good);
}

.diff-section {
  scroll-margin-top: 6.5rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--line);
  background: rgba(255,253,248,.84);
  border-radius: 30px;
  padding: clamp(1rem, 2vw, 1.35rem);
  box-shadow: 0 10px 30px rgba(25,20,13,.05);
}

.diff-section.is-active {
  outline: 2px solid rgba(255, 107, 44, .36);
}

.diff-section-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.diff-section-title p {
  max-width: 72ch;
}

.diff-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}

.diff-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  padding: 1rem;
  min-width: 0;
}

.diff-card.current {
  background: linear-gradient(180deg, #fffdf8, #fff4f3);
}

.diff-card.proposed {
  background: linear-gradient(180deg, #fffdf8, #effaf4);
}

.callout {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffaf0;
  margin: 1rem 0 0;
}

.callout strong {
  display: block;
  margin-bottom: .25rem;
}

.icon-dot {
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: .7rem;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  padding: 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  background: #fbf6ed;
}

td {
  color: #3a352e;
}

tr:last-child td {
  border-bottom: none;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.step {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
}

.step .when {
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.api-grid {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 1.2rem;
  align-items: start;
}

.endpoint {
  display: grid;
  gap: .8rem;
}

.endpoint-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  padding: 1rem;
}

.method {
  display: inline-flex;
  font-family: var(--mono);
  font-weight: 900;
  font-size: .8rem;
  padding: .28rem .45rem;
  border-radius: .45rem;
  background: var(--ink);
  color: #fff;
  margin-right: .4rem;
}

.footer-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 3rem 0 4rem;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-weight: 800;
}

.mobile-menu-note {
  display: none;
}

@media (max-width: 980px) {
  .hero-grid,
  .diff-layout,
  .api-grid {
    grid-template-columns: 1fr;
  }

  .checklist {
    position: relative;
    top: auto;
    order: -1;
  }

  .diff-layout {
    display: flex;
    flex-direction: column;
  }

  .page-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
    overflow-x: auto;
    width: 100%;
    flex-wrap: nowrap;
    padding-bottom: .15rem;
  }

  .nav a {
    white-space: nowrap;
  }

  .two-col,
  .diff-pair,
  .page-grid {
    grid-template-columns: 1fr;
  }

  .diff-section-title,
  .panel-header,
  .footer-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .hero {
    padding-top: 2.5rem;
  }

  h1 {
    font-size: clamp(2.4rem, 16vw, 4rem);
  }
}