:root {
  --black: #000;
  --ink: #1d1d1d;
  --muted: #6e6e6e;
  --muted-on-dark: #a1a1a1;
  --paper: #fff;
  --paper-alt: #f5f5f7;
  --line-light: rgba(0, 0, 0, 0.09);
  --line-dark: rgba(255, 255, 255, 0.16);
  --header-h: 60px;
  --ease: cubic-bezier(0.28, 0.11, 0.27, 0.99);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(0, 0, 0, 0.055);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  word-break: break-word;
}

:focus-visible {
  outline: 3px solid #868686;
  outline-offset: 3px;
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(20px, 4vw, 56px);
  background: rgba(0, 0, 0, 0.66);
  -webkit-backdrop-filter: saturate(150%) blur(20px);
  backdrop-filter: saturate(150%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(0, 0, 0, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.wordmark {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  white-space: nowrap;
}

.wordmark span {
  font-weight: 400;
  color: var(--muted-on-dark);
  margin-left: 6px;
  letter-spacing: 0.02em;
}

.wordmark:hover {
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 32px);
}

.site-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.25s var(--ease);
}

.site-nav a:hover,
.site-nav a.is-active,
.site-nav a:focus-visible {
  color: #fff;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* ---------- hero ---------- */

.hero {
  background: var(--black);
  color: #f5f5f7;
  padding: calc(var(--header-h) + clamp(56px, 9vh, 104px)) clamp(20px, 4vw, 56px) clamp(52px, 7vh, 84px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
}

.hero h1 {
  margin: 0 auto 18px;
  max-width: 18ch;
  font-size: clamp(2.3rem, 6vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.06;
}

.lede {
  margin: 0 auto;
  max-width: 62ch;
  font-size: clamp(1.02rem, 1.6vw, 1.24rem);
  line-height: 1.55;
  color: #d6d6db;
}

.lede strong {
  color: #fff;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 34px auto 0;
  padding: 0;
  max-width: 900px;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line-dark);
  border-radius: 980px;
  font-size: 0.8rem;
  font-family: var(--mono);
  color: #f5f5f7;
  background: rgba(255, 255, 255, 0.05);
  word-break: break-all;
}

.chip-k {
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
}

.hero-foot {
  margin: 28px auto 0;
  max-width: 70ch;
  font-size: 0.86rem;
  color: var(--muted-on-dark);
}

/* ---------- sections ---------- */

.section {
  padding: clamp(56px, 9vh, 104px) clamp(20px, 4vw, 56px);
  max-width: 1180px;
  margin: 0 auto;
}

.section-alt {
  max-width: none;
  background: var(--paper-alt);
}

.section-alt > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.section-dark {
  max-width: none;
  background: var(--black);
  color: #f5f5f7;
}

.section-dark > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.section-head {
  margin-bottom: clamp(28px, 4vh, 48px);
}

.micro {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-dark .micro {
  color: var(--muted-on-dark);
}

.section h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.12;
}

.section-support {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.section-dark .section-support {
  color: var(--muted-on-dark);
}

.section-support strong {
  color: inherit;
}

.section h3 {
  margin: 30px 0 12px;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

/* ---------- lists ---------- */

.clean-list,
.tick-list,
.num-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.clean-list li,
.tick-list li,
.num-list li {
  position: relative;
  padding: 10px 0 10px 34px;
  border-bottom: 1px solid var(--line-light);
}

.section-dark .clean-list li,
.section-dark .tick-list li,
.section-dark .num-list li {
  border-bottom-color: var(--line-dark);
}

.tick-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 15px;
  width: 12px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.75;
}

.num-list {
  counter-reset: n;
}

.num-list li {
  counter-increment: n;
}

.num-list li::before {
  content: counter(n, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 12px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.section-dark .num-list li::before {
  color: var(--muted-on-dark);
}

.read-order {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: r;
}

.read-order li {
  position: relative;
  padding: 12px 0 12px 40px;
  border-bottom: 1px solid var(--line-dark);
  counter-increment: r;
}

.read-order li::before {
  content: counter(r);
  position: absolute;
  left: 0;
  top: 13px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 600;
  color: #f5f5f7;
}

.read-order span {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted-on-dark);
}

.do-not-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.do-not-list li {
  padding: 20px 22px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.95rem;
  color: #d6d6db;
}

.do-not-list strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-size: 1rem;
}

.do-not-list code {
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 8px 0 4px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: var(--paper);
}

.section-dark .table-wrap {
  border-color: var(--line-dark);
  background: rgba(255, 255, 255, 0.04);
}

.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.data th,
.data td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-light);
  vertical-align: top;
}

.data th {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.data tbody tr:last-child th,
.data tbody tr:last-child td {
  border-bottom: 0;
}

.section-dark .data th,
.section-dark .data td {
  border-bottom-color: var(--line-dark);
}

.section-dark .data th {
  color: var(--muted-on-dark);
}

.section-dark .data code {
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

.data-compact th,
.data-compact td {
  padding: 10px 14px;
  font-size: 0.87rem;
}

/* ---------- code + notes ---------- */

.code {
  margin: 12px 0 18px;
  padding: 18px 20px;
  background: var(--black);
  color: #e8e8ed;
  border-radius: 14px;
  overflow-x: auto;
}

.section-dark .code {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-dark);
}

.code code {
  background: none;
  padding: 0;
  font-size: 0.83rem;
  line-height: 1.7;
  color: inherit;
  white-space: pre;
}

.note {
  margin: 20px 0;
  padding: 18px 22px;
  border: 1px solid var(--line-light);
  border-left: 3px solid var(--black);
  border-radius: 12px;
  background: var(--paper);
  font-size: 0.95rem;
  color: #3a3a3c;
}

.rule-card {
  margin: 6px 0 30px;
  padding: 22px 26px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.97rem;
  color: #d6d6db;
}

.rule-card strong {
  color: #fff;
}

.rule-card code {
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

.inline-note {
  margin: 10px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.section-dark .inline-note {
  color: var(--muted-on-dark);
}

.section-dark .inline-note code,
.section-dark .note code {
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 36px clamp(20px, 4vw, 56px) 44px;
  background: var(--paper-alt);
  border-top: 1px solid var(--line-light);
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer p {
  margin: 4px 0;
}

.site-footer code {
  font-size: 0.78rem;
}

/* ---------- mobile ---------- */

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

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px clamp(20px, 4vw, 56px) 18px;
    background: rgba(0, 0, 0, 0.92);
    -webkit-backdrop-filter: saturate(150%) blur(20px);
    backdrop-filter: saturate(150%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav a {
    padding: 12px 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }
}
