@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --background-50: 0.985 0.004 95;
  --background-100: 0.968 0.006 95;
  --background-200: 0.938 0.008 95;
  --background-300: 0.9 0.01 95;
  --foreground-50: 0.97 0.005 250;
  --foreground-100: 0.93 0.008 250;
  --foreground-200: 0.86 0.01 250;
  --foreground-300: 0.76 0.012 250;
  --foreground-400: 0.62 0.015 250;
  --foreground-500: 0.5 0.018 250;
  --foreground-600: 0.42 0.02 250;
  --foreground-700: 0.34 0.022 250;
  --foreground-800: 0.28 0.024 250;
  --foreground-900: 0.24 0.025 250;
  --foreground-950: 0.19 0.026 250;
  --primary-50: 0.97 0.02 50;
  --primary-100: 0.94 0.05 48;
  --primary-200: 0.89 0.09 45;
  --primary-300: 0.83 0.13 42;
  --primary-500: 0.68 0.19 38;
  --primary-600: 0.6 0.18 36;
  --primary-700: 0.51 0.16 34;
  --secondary-50: 0.96 0.02 265;
  --secondary-100: 0.92 0.05 265;
  --secondary-200: 0.85 0.09 265;
  --secondary-500: 0.51 0.21 265;
  --secondary-700: 0.39 0.18 265;
  --secondary-900: 0.28 0.12 265;
  --secondary-950: 0.2 0.08 265;
  --accent-100: 0.94 0.07 82;
  --accent-300: 0.85 0.13 78;
  --accent-500: 0.74 0.15 74;
  --accent-900: 0.37 0.08 68;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-label: 'Inter', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: oklch(var(--background-50));
  color: oklch(var(--foreground-950));
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: oklch(var(--primary-500));
  color: oklch(var(--background-50));
  padding: 10px 16px;
  border-radius: 6px;
}

.skip:focus {
  left: 12px;
  top: 12px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 64px;
  background: rgba(14, 18, 28, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar__inner {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: oklch(var(--primary-500));
  color: oklch(var(--background-50));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
}

.brand__sub {
  font-family: var(--font-label);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 3px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.topnav a {
  font-family: var(--font-label);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.topnav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.topbar__cta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 6px;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn--primary {
  background: oklch(var(--primary-500));
  color: oklch(var(--background-50));
}

.btn--primary:hover {
  background: oklch(var(--primary-600));
}

.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn--outline {
  border: 1px solid oklch(var(--foreground-200));
  color: oklch(var(--foreground-900));
  background: oklch(var(--background-50));
}

.btn--outline:hover {
  border-color: oklch(var(--primary-300));
  color: oklch(var(--primary-700));
}

/* ---------- Article layout ---------- */
.article-main {
  padding-top: 64px;
}

.breadcrumb {
  padding: 20px 0 4px;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  font-family: var(--font-label);
  font-size: 13px;
  color: oklch(var(--foreground-500));
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: oklch(var(--foreground-300));
}

.breadcrumb a {
  color: oklch(var(--foreground-600));
  text-decoration: none;
}

.breadcrumb a:hover {
  color: oklch(var(--primary-700));
}

.article {
  max-width: 780px;
  padding-bottom: 8px;
}

.article__eyebrow {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: oklch(var(--primary-700));
  margin: 14px 0 0;
}

.article h1 {
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 600;
  margin: 8px 0 0;
}

.article__lead {
  font-size: 17px;
  color: oklch(var(--foreground-700));
  margin: 14px 0 0;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-family: var(--font-label);
  font-size: 12.5px;
  color: oklch(var(--foreground-500));
}

.article__figure {
  margin: 22px 0;
}

.article__figure img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article__figure figcaption {
  margin-top: 8px;
  font-family: var(--font-label);
  font-size: 12.5px;
  color: oklch(var(--foreground-500));
}

.article h2 {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 600;
  margin: 30px 0 10px;
}

.article h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  margin: 20px 0 8px;
}

.article p {
  margin: 12px 0;
}

.article a:not(.btn) {
  color: oklch(var(--secondary-700));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article a:not(.btn):hover {
  color: oklch(var(--primary-700));
}

.article ul,
.article ol {
  padding-left: 22px;
  margin: 12px 0;
}

.article li {
  margin: 6px 0;
}

.callout {
  border: 1px solid oklch(var(--accent-300));
  background: oklch(var(--accent-100));
  border-radius: 14px;
  padding: 14px 16px;
  margin: 18px 0;
}

.callout p {
  margin: 0;
  font-size: 14.5px;
  color: oklch(var(--accent-900));
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  background: oklch(var(--background-50));
  border: 1px solid oklch(var(--foreground-100));
  border-radius: 14px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid oklch(var(--foreground-100));
  vertical-align: top;
}

.data-table th {
  background: oklch(var(--background-100));
  font-family: var(--font-label);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: oklch(var(--foreground-700));
}

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

.checklist {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.checklist li {
  position: relative;
  padding-left: 30px;
  margin: 8px 0;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: oklch(var(--secondary-100));
  box-shadow: inset 0 0 0 2px oklch(var(--secondary-500));
}

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

.steps li {
  position: relative;
  padding-left: 40px;
  margin: 12px 0;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: oklch(var(--primary-500));
  color: oklch(var(--background-50));
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-mini {
  margin-top: 26px;
}

.faq-mini details {
  border: 1px solid oklch(var(--foreground-100));
  background: oklch(var(--background-100));
  border-radius: 12px;
  padding: 12px 16px;
  margin: 8px 0;
}

.faq-mini summary {
  cursor: pointer;
  font-family: var(--font-label);
  font-size: 14.5px;
  font-weight: 600;
  color: oklch(var(--foreground-950));
}

.faq-mini details p {
  margin: 8px 0 0;
  font-size: 14.5px;
  color: oklch(var(--foreground-700));
}

.prevnext {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin: 34px 0 0;
  padding-top: 20px;
  border-top: 1px solid oklch(var(--foreground-100));
}

.prevnext a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  max-width: 48%;
  padding: 12px 14px;
  border: 1px solid oklch(var(--foreground-100));
  border-radius: 12px;
  background: oklch(var(--background-100));
}

.prevnext a:hover {
  border-color: oklch(var(--primary-300));
}

.prevnext span {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(var(--foreground-500));
}

.prevnext strong {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: oklch(var(--foreground-950));
}

.related {
  margin: 32px 0 0;
}

.related h2 {
  margin-top: 0;
}

.related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.related__grid a {
  display: block;
  text-decoration: none;
  padding: 14px 16px;
  border: 1px solid oklch(var(--foreground-100));
  border-radius: 14px;
  background: oklch(var(--background-100));
  font-family: var(--font-heading);
  font-size: 14.5px;
  font-weight: 600;
  color: oklch(var(--foreground-950));
}

.related__grid a:hover {
  border-color: oklch(var(--primary-300));
  color: oklch(var(--primary-700));
}

.backhome {
  margin: 26px 0 0;
}

/* ---------- Footer ---------- */
.sitefooter {
  margin-top: 40px;
  background: oklch(var(--secondary-950));
  color: oklch(var(--background-100));
  padding: 32px 0 96px;
}

.sitefooter__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.sitefooter h2 {
  font-family: var(--font-heading);
  font-size: 16px;
  color: #fff;
  margin: 0 0 8px;
}

.sitefooter p {
  font-size: 14px;
  color: oklch(var(--background-300));
  max-width: 42ch;
  margin: 0;
}

.sitefooter a {
  color: oklch(var(--background-200));
  text-decoration: none;
  font-size: 14px;
}

.sitefooter a:hover {
  color: oklch(var(--accent-300));
}

.sitefooter__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.sitefooter__bottom {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 12.5px;
  color: oklch(var(--foreground-400));
}

/* ---------- Mobile nav + sheet ---------- */
.mobilebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(14, 18, 28, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobilebar a,
.mobilebar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-label);
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}

.mobilebar a:hover,
.mobilebar button:hover {
  color: #fff;
}

.mobilebar i {
  font-size: 19px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  display: none;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-height: 80dvh;
  overflow-y: auto;
  background: rgba(16, 21, 31, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px 18px 0 0;
  padding: 16px 20px calc(32px + env(safe-area-inset-bottom));
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.sheet.is-open {
  transform: translateY(0);
}

.sheet__grab {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto 16px;
}

.sheet h2 {
  font-family: var(--font-heading);
  font-size: 17px;
  margin: 0 0 12px;
}

.sheet h3 {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 20px 0 10px;
}

.sheet__cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sheet__cats a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
}

.sheet__cats a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sheet__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sheet__list a {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  text-decoration: none;
}

.sheet__list a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sheet__group {
  font-family: var(--font-label);
  font-size: 12px;
  color: oklch(var(--accent-300));
  margin: 12px 0 4px;
}

.sheet__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .related__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .topnav {
    display: none;
  }

  .topbar__cta .btn--ghost {
    display: none;
  }

  .mobilebar {
    display: grid;
  }

  .article {
    max-width: 100%;
  }

  .article h1 {
    font-size: 25px;
  }

  .prevnext a {
    max-width: 100%;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 32px;
  }

  .topbar__inner {
    padding: 0 32px;
  }

  .article h1 {
    font-size: 34px;
  }

  .sitefooter {
    padding-bottom: 40px;
  }

  .sitefooter__grid {
    grid-template-columns: 1.3fr 2fr;
  }
}

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

  .sheet {
    transition: none;
  }
}