:root {
  --bg: #f1f1ef;
  --bg-2: #ebebea;
  --paper: #f7f7f5;
  --ink: #111111;
  --ink-2: #2a2a2a;
  --muted: #6f6f6c;
  --muted-2: #9a9a96;
  --rule: #d9d9d4;
  --rule-2: #c8c8c2;
  --accent: #ff0080;
  --accent-ink: #d9006e;

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="dark"] {
  --bg: #111110;
  --bg-2: #1b1b19;
  --paper: #0d0d0c;
  --ink: #f0f0ee;
  --ink-2: #ccccca;
  --muted: #7a7a77;
  --muted-2: #4f4f4c;
  --rule: #2a2a28;
  --rule-2: #363634;
  --accent: #ff0080;
  --accent-ink: #ff3d96;
}

/* CTA section has background: var(--ink) which flips in dark mode — pin it dark */
[data-theme="dark"] .cta {
  background: #0a0a09;
}

/* nav-cta uses background: var(--ink) + hardcoded color:#fff — both go white in dark */
[data-theme="dark"] .nav-cta {
  background: var(--ink);
  color: var(--bg);
}

[data-theme="dark"] .nav-cta:hover {
  background: #fff;
  color: #111;
}

/* toggle border needs more contrast on dark nav */
[data-theme="dark"] .theme-toggle {
  border-color: var(--muted-2);
}

[data-theme="dark"] .theme-toggle:hover {
  border-color: var(--ink);
}

/* btn-primary: --ink flips to light in dark mode; text was hardcoded #fff → white on white */
[data-theme="dark"] .btn-primary {
  color: var(--bg);
}

[data-theme="dark"] .btn-primary:hover {
  background: #fff;
  color: #111;
}

/* copy-btn hover: background: var(--ink) = light; color: #fff = white on white */
[data-theme="dark"] .copy-btn:hover {
  color: var(--bg);
}

body {
  transition: background-color .25s ease, color .25s ease;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--rule-2);
  border-radius: 2px;
  color: var(--muted);
  padding: 0;
  flex-shrink: 0;
  transition: border-color .2s ease, color .2s ease;
}

.theme-toggle:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.brand-name {
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.nav-links a:hover {
  color: var(--accent-ink);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 2px;
  font-size: 13px;
  transition: background .2s ease;
}

.nav-cta:hover {
  background: #000;
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

/* ---------- Hero ---------- */
.hero {
  padding: 110px 0 80px;
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 64px;
  align-items: start;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 18px 0 28px;
  color: var(--ink);
  text-wrap: balance;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
}

.hero-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 560px;
  margin: 0 0 36px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 14px;
  border: 0;
  border-radius: 2px;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: #000;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-2);
}

.btn-ghost:hover {
  border-color: var(--ink);
}

.hero-meta {
  border-left: 1px solid var(--rule);
  padding-left: 32px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- Hero chase ---------- */
.hero-orbit {
  display: block;
  width: 100%;
  margin-bottom: 4px;
}

.chase-arena {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: 2px;
}

.chase-logo {
  position: absolute;
  width: 26px;
  height: 26px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
}

.chase-logo svg {
  width: 26px;
  height: 26px;
  display: block;
}

.meta-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-k {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.meta-v {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--ink);
  line-height: 1.1;
}

.meta-v small {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-left: 6px;
}

/* ---------- Section base ---------- */
section {
  padding: 110px 0;
  border-bottom: 1px solid var(--rule);
}

.sec-head {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 64px;
  margin-bottom: 64px;
  align-items: start;
}

.sec-head .label {
  position: sticky;
  top: 96px;
}

.sec-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.012em;
  margin: 14px 0 24px;
  color: var(--ink);
  text-wrap: balance;
}

.sec-title em {
  font-style: italic;
}

.sec-lede {
  font-size: 18px;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.55;
}

/* ---------- Problem section ---------- */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}

.problem-cell {
  padding: 36px 28px 36px 0;
  border-right: 1px solid var(--rule);
}

.problem-cell:last-child {
  border-right: 0;
  padding-right: 0;
}

.problem-cell:nth-child(n+2) {
  padding-left: 28px;
}

.problem-num {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

.problem-h {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--ink);
  font-weight: 500;
}

.problem-p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- Categories ---------- */
.cats {
  display: grid;
  grid-template-columns: 320px 1fr;
  border-top: 1px solid var(--rule);
}

.cat-list {
  border-right: 1px solid var(--rule);
  padding: 8px 0 0 0;
}

.cat-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 18px 24px 18px 0;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
  transition: color .15s ease, background .15s ease;
  font-family: var(--sans);
}

.cat-item:last-child {
  border-bottom: 0;
}

.cat-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

.cat-name {
  font-size: 15px;
  line-height: 1.25;
}

.cat-arrow {
  color: var(--muted-2);
  font-size: 14px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s ease, transform .2s ease, color .2s ease;
}

.cat-item:hover {
  color: var(--ink);
}

.cat-item:hover .cat-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

.cat-item.is-active {
  color: var(--ink);
  background: transparent;
}

.cat-item.is-active .cat-num {
  color: var(--accent);
}

.cat-item.is-active .cat-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

.cat-detail {
  padding: 40px 0 40px 56px;
  min-height: 480px;
}

.cat-d-top {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
}

.cat-d-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.cat-d-title {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 6px 0 16px;
  color: var(--ink);
}

.cat-d-title em {
  font-style: italic;
}

.cat-d-desc {
  font-size: 16.5px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 0 32px;
}

.cat-skill-list {
  border-top: 1px solid var(--rule);
}

.cat-skill {
  padding: 18px 0;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}

.cat-skill-i {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
}

.cat-skill-name {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
}

.cat-skill-name em {
  font-style: italic;
}

.cat-skill-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 4px 8px;
  border: 1px solid var(--rule-2);
  border-radius: 2px;
}

.copy-btn {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 10px 14px;
  border-radius: 2px;
  transition: background .2s ease, color .2s ease;
}

.copy-btn:hover {
  background: var(--ink);
  color: #fff;
}

.copy-btn.copied {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- Principles ---------- */
.principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}

.pr {
  padding: 44px 36px 44px 0;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.pr:nth-child(2n) {
  border-right: 0;
  padding-right: 0;
  padding-left: 36px;
}

.pr:nth-last-child(-n+2) {
  border-bottom: 0;
  padding-bottom: 0;
}

.pr-q {
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin: 0 0 14px;
  text-wrap: balance;
}

.pr-d {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 460px;
}

/* ---------- Scenarios ---------- */
.scenarios {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

.scn {
  display: grid;
  grid-template-columns: 140px 1fr 1.2fr;
  gap: 40px;
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.scn:last-child {
  border-bottom: 0;
}

.scn-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding-top: 6px;
}

.scn-h {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
  font-weight: 500;
}

.scn-h em {
  font-style: italic;
}

.scn-body {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

.scn-body strong {
  color: var(--ink);
  font-weight: 500;
}

.scn-foot {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
}

.scn-foot .pill {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--rule-2);
  border-radius: 2px;
  margin-right: 6px;
}

/* ---------- Usage ---------- */
.usage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.terminal {
  background: #0e0e0e;
  color: #e9e9e6;
  border-radius: 6px;
  padding: 0;
  font-family: var(--mono);
  font-size: 13px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(20, 20, 20, 0.25);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #181818;
  border-bottom: 1px solid #222;
}

.term-bar .d {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #333;
  display: inline-block;
}

.term-bar .d:nth-child(1) {
  background: #ff5f57;
}

.term-bar .d:nth-child(2) {
  background: #febc2e;
}

.term-bar .d:nth-child(3) {
  background: #28c840;
}

.term-bar .tt {
  margin-left: 12px;
  color: #777;
  font-size: 11.5px;
}

.term-body {
  padding: 22px 22px 26px;
  line-height: 1.7;
}

.term-body .pp {
  color: #ff0080;
}

.term-body .cmd {
  color: #e9e9e6;
}

.term-body .out {
  color: #9c9c97;
}

.term-body .ok {
  color: #7ad27a;
}

.term-body .warn {
  color: #ffc56b;
}

.term-body .err {
  color: #ff7e7e;
}

.term-body .cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #e9e9e6;
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.usage-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.ustep {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.ustep:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ustep-n {
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  color: var(--accent);
  line-height: 1;
}

.ustep-h {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.2;
}

.ustep-p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}

.ustep-p code {
  font-family: var(--mono);
  background: var(--bg-2);
  padding: 2px 5px;
  border-radius: 2px;
  font-size: 12.5px;
  color: var(--ink-2);
}

/* ---------- CTA ---------- */
.cta {
  text-align: left;
  padding: 130px 0;
  background: var(--ink);
  color: #f5f5f2;
  border-bottom: 0;
}

.cta .container {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 80px;
  align-items: end;
}

.cta .eyebrow {
  color: var(--accent);
}

.cta h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 5.5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 16px 0 24px;
  color: #fff;
  text-wrap: balance;
}

.cta h2 em {
  font-style: italic;
}

.cta p {
  font-size: 17px;
  color: #b8b8b3;
  line-height: 1.6;
  max-width: 540px;
  margin: 0 0 36px;
}

.cta-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.cta .btn-primary {
  background: #fff;
  color: #111;
}

.cta .btn-primary:hover {
  background: var(--accent);
  color: #fff;
}

.cta .btn-ghost {
  color: #fff;
  border-color: #444;
}

.cta .btn-ghost:hover {
  border-color: #fff;
}

.cta-stats {
  border-left: 1px solid #2a2a2a;
  padding-left: 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cta-stat .k {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #777;
}

.cta-stat .v {
  font-family: var(--serif);
  font-size: 40px;
  color: #fff;
  line-height: 1;
  margin-top: 6px;
}

/* ---------- Footer ---------- */
footer {
  background: var(--bg);
  padding: 56px 0 64px;
}

.ft {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.ft-brand {
  font-family: var(--serif);
  font-size: 32px;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 14px;
}

.ft-brand em {
  font-style: italic;
}

.ft p {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.6;
  margin: 0;
}

.ft h4 {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
  margin: 0 0 14px;
}

.ft ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ft a {
  font-size: 14px;
  color: var(--ink-2);
}

.ft a:hover {
  color: var(--accent-ink);
}

.ft-bot {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.ft-bot .l {
  font-family: var(--mono);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .container {
    padding: 0 24px;
  }

  .hero {
    padding: 80px 0 56px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-meta {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--rule);
    padding-top: 28px;
    justify-content: start;
    gap: 28px;
  }

  .hero-orbit {
    padding: 8px 0 16px;
  }

  section {
    padding: 80px 0;
  }

  .sec-head {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sec-head .label {
    position: static;
  }

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

  .problem-cell {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 28px 0;
  }

  .problem-cell:nth-child(n+2) {
    padding-left: 0;
  }

  .problem-cell:last-child {
    border-bottom: 0;
  }

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

  .cat-list {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .cat-detail {
    padding: 36px 0 0;
  }

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

  .pr {
    border-right: 0;
    padding: 32px 0;
  }

  .pr:nth-child(2n) {
    padding-left: 0;
  }

  .pr:nth-last-child(-n+2) {
    border-bottom: 1px solid var(--rule);
    padding-bottom: 32px;
  }

  .pr:last-child {
    border-bottom: 0;
  }

  .scn {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 28px 0;
  }

  .usage {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .cta .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .cta-stats {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid #2a2a2a;
    padding-top: 32px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 32px;
  }

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

  .nav-links a:not(.nav-cta) {
    display: none;
  }
}
