:root {
  --paper: #f3efe5;
  --surface: #fffdf8;
  --surface-2: #e8e1d4;
  --ink: #19161d;
  --muted: #68616c;
  --line: #d4cbbb;
  --accent: #6e37c8;
  --accent-2: #007f99;
  --mark: #f1e4ff;
  --code: #201a26;
  --code-ink: #f8f0ff;
  --shadow: 0 20px 60px rgb(42 31 52 / 10%);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

:root[data-theme="ink"] {
  --paper: #151319;
  --surface: #1f1c24;
  --surface-2: #2a2630;
  --ink: #f7f1fa;
  --muted: #b9b0bf;
  --line: #3f3948;
  --accent: #bda0ff;
  --accent-2: #60d8ee;
  --mark: #35294d;
  --code: #09080b;
  --code-ink: #f8f0ff;
  --shadow: 0 20px 60px rgb(0 0 0 / 28%);
  color-scheme: dark;
}

:root[data-theme="cobalt"] {
  --paper: #075bdb;
  --surface: #fffdf7;
  --surface-2: #dbe9ff;
  --ink: #10162a;
  --muted: #44506e;
  --line: #aec9f7;
  --accent: #6630c9;
  --accent-2: #006f85;
  --mark: #e6dcff;
  --code: #10162a;
  --code-ink: #f4f8ff;
  --shadow: 0 20px 70px rgb(0 25 80 / 26%);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 2%, color-mix(in oklch, var(--accent) 14%, transparent), transparent 25rem),
    var(--paper);
  font-size: 17px;
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 1rem;
  left: 1rem;
  padding: 0.65rem 1rem;
  color: var(--surface);
  background: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0.65rem max(1rem, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid color-mix(in oklch, var(--line) 84%, transparent);
  background: color-mix(in oklch, var(--paper) 88%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-weight: 820;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand svg {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.brand span {
  display: grid;
  line-height: 1.05;
}

.brand small {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.theme-choices {
  display: flex;
  gap: 0.28rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--line);
}

.theme-choices button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.theme-choices button:nth-child(1) {
  background: #f3efe5;
}

.theme-choices button:nth-child(2) {
  background: #151319;
}

.theme-choices button:nth-child(3) {
  background: #075bdb;
}

.content-shell {
  width: min(100% - 2rem, 1120px);
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 6.5rem) 0 5rem;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(210px, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.breadcrumb a {
  color: inherit;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-block: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 940px;
  font-size: clamp(2.7rem, 7vw, 5.7rem);
}

.article-shell h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
}

h2 {
  margin-top: 3.5rem;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
}

h3 {
  margin-top: 2.2rem;
  font-size: clamp(1.3rem, 3vw, 1.65rem);
}

.lede {
  max-width: 760px;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.3vw, 1.34rem);
  line-height: 1.55;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.article-body {
  margin-top: 3rem;
}

.article-body p,
.article-body li {
  max-width: 72ch;
}

.article-body strong {
  color: var(--ink);
}

.article-body code {
  padding: 0.12em 0.32em;
  border-radius: 0.3em;
  color: color-mix(in oklch, var(--accent) 82%, var(--ink));
  background: var(--mark);
  font-size: 0.9em;
}

.article-body pre {
  max-width: 100%;
  overflow: auto;
  padding: 1.2rem 1.35rem;
  border-radius: 18px;
  color: var(--code-ink);
  background: var(--code);
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  line-height: 1.6;
}

.article-body pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.callout {
  margin: 2rem 0;
  padding: 1.2rem 1.35rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: var(--mark);
}

.callout p:first-child {
  margin-top: 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.data-card {
  margin: 2rem 0;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.data-card h3 {
  margin-top: 0;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.metric {
  padding: 1rem;
  border-radius: 14px;
  background: var(--surface-2);
}

.metric strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.2;
}

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

.table-wrap {
  max-width: 100%;
  margin: 2rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

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

.step-list {
  padding: 0;
  counter-reset: steps;
  list-style: none;
}

.step-list li {
  position: relative;
  min-height: 3.2rem;
  margin: 1.15rem 0;
  padding-left: 4rem;
  counter-increment: steps;
}

.step-list li::before {
  position: absolute;
  top: -0.2rem;
  left: 0;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 50%;
  color: var(--surface);
  background: var(--ink);
  content: counter(steps, decimal-leading-zero);
  font-size: 0.73rem;
  font-weight: 800;
}

.color-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 100px;
  margin: 1.6rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.color-strip span {
  display: grid;
  min-height: 100px;
  place-items: end center;
  padding: 0.6rem 0.25rem;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  text-shadow: 0 1px 4px rgb(0 0 0 / 65%);
}

.color-hue-20 {
  background: oklch(62% 0.18 20);
}

.color-hue-30 {
  background: oklch(65% 0.17 30);
}

.color-hue-80 {
  background: oklch(62% 0.18 80);
}

.color-hue-90 {
  background: oklch(65% 0.17 90);
}

.color-hue-140 {
  background: oklch(62% 0.18 140);
}

.color-hue-150 {
  background: oklch(65% 0.17 150);
}

.color-hue-200 {
  background: oklch(62% 0.18 200);
}

.color-hue-210 {
  background: oklch(65% 0.17 210);
}

.color-hue-260 {
  background: oklch(62% 0.18 260);
}

.color-hue-270 {
  background: oklch(65% 0.17 270);
}

.color-hue-320 {
  background: oklch(62% 0.18 320);
}

.color-hue-330 {
  background: oklch(65% 0.17 330);
}

.cta-panel {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  justify-content: space-between;
  margin: 3rem 0 0;
  padding: 1.35rem 1.5rem;
  border-radius: 20px;
  color: #fff;
  background: #17131d;
}

.cta-panel p {
  margin: 0;
}

.button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: #17131d;
  background: #f7f2e8;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.article-aside {
  position: sticky;
  top: 100px;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.article-aside strong {
  display: block;
  margin-bottom: 0.6rem;
}

.article-aside a {
  display: block;
  padding: 0.38rem 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.sources {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.sources h2 {
  margin-top: 0;
  font-size: 1.45rem;
}

.sources li {
  margin: 0.6rem 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.source-note {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.guide-card {
  min-height: 260px;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 30px rgb(42 31 52 / 6%);
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

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

.guide-card span {
  color: var(--accent-2);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guide-card h2 {
  margin: 1rem 0 0.8rem;
  font-size: 1.55rem;
}

.guide-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.prose-panel {
  max-width: 780px;
  margin-top: 3rem;
  padding: clamp(1.3rem, 4vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.prose-panel h2:first-child {
  margin-top: 0;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  align-items: center;
  justify-content: space-between;
  padding: 2rem max(1rem, calc((100vw - 1160px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in oklch, var(--surface) 45%, transparent);
  font-size: 0.78rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.site-footer a {
  color: inherit;
}

@media (max-width: 860px) {
  .article-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-aside {
    display: none;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 62px;
  }

  .site-nav > a:not(:first-child) {
    display: none;
  }

  .brand small {
    display: none;
  }

  .content-shell {
    width: min(100% - 1.25rem, 1120px);
    padding-top: 2.5rem;
  }

  h1,
  .article-shell h1 {
    font-size: clamp(2.35rem, 13vw, 3.7rem);
  }

  .metric-row,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .color-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .cta-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
