:root {
  color-scheme: dark;
  --ink: #0c1020;
  --deep: #05070e;
  --surface: #172038;
  --surface-elevated: #202a46;
  --text: #f4f7ff;
  --dim: rgba(244, 247, 255, 0.67);
  --faint: rgba(244, 247, 255, 0.54);
  --border: rgba(244, 247, 255, 0.1);
  --border-strong: rgba(244, 247, 255, 0.18);
  --accent: #f666af;
  --fill: #c1327d;
  --on-fill: #fff3f9;
  --blue: #3878ff;
  --danger: #ff6b5c;
  --display: Archivo, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, sans-serif;
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 0;
  width: 100%;
  height: 100svh;
  pointer-events: none;
}

body::before {
  top: 0;
  background: radial-gradient(80% 42% at 96% -4%, rgba(255, 64, 160, 0.34), transparent 68%);
}

body::after {
  bottom: 0;
  background: radial-gradient(92% 44% at 5% 101%, rgba(56, 120, 255, 0.47), transparent 72%);
}

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

a:hover {
  color: #ff91ca;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--text);
  border-radius: 999px;
  font-weight: 750;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1120px);
  min-height: 100svh;
  margin: 0 auto;
  padding:
    max(22px, env(safe-area-inset-top))
    clamp(20px, 5vw, 56px)
    max(24px, env(safe-area-inset-bottom));
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 42px;
}

.home-link {
  color: var(--text);
  text-decoration: none;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 1.26px;
  color: currentColor;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.wordmark svg {
  width: 23.24px;
  height: 23.24px;
  margin-top: 1px;
  transform: translateX(1.12px);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--dim);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.page-hero {
  max-width: 800px;
  padding: clamp(72px, 12vw, 132px) 0 52px;
}

.eyebrow,
.section-label,
.updated {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow,
.section-label {
  color: var(--accent);
}

.eyebrow {
  margin: 0 0 18px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  text-wrap: balance;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(48px, 10vw, 78px);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.lede {
  max-width: 660px;
  margin: 22px 0 0;
  color: var(--dim);
  font-size: clamp(17px, 2.6vw, 20px);
  line-height: 1.48;
}

.updated {
  margin: 19px 0 0;
  color: var(--faint);
  letter-spacing: 0.08em;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 680px);
  align-items: start;
  gap: clamp(32px, 7vw, 88px);
}

.toc {
  position: sticky;
  top: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(23, 32, 56, 0.68);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.toc p {
  margin: 0 0 10px;
}

.toc nav {
  display: grid;
  gap: 6px;
}

.toc a {
  padding: 4px 0;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover {
  color: var(--text);
}

.prose {
  min-width: 0;
}

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

.prose section {
  scroll-margin-top: 24px;
  padding: 0 0 42px;
  margin: 0 0 42px;
  border-bottom: 1px solid var(--border);
}

.prose section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.prose h2 {
  margin: 0 0 14px;
  font-size: clamp(25px, 4vw, 32px);
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.prose h3 {
  margin: 26px 0 8px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

.prose p,
.prose li {
  color: var(--dim);
}

.prose p {
  margin: 0 0 14px;
}

.prose p:last-child,
.prose ul:last-child,
.prose ol:last-child {
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  margin: 14px 0 18px;
  padding-left: 1.25rem;
}

.prose li {
  padding-left: 0.25rem;
  margin: 8px 0;
}

.prose strong {
  color: var(--text);
}

.callout {
  margin: 0 0 42px;
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid rgba(246, 102, 175, 0.25);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(217, 66, 143, 0.14), rgba(56, 120, 255, 0.09)),
    rgba(23, 32, 56, 0.62);
}

.callout h2,
.callout h3 {
  margin-top: 0;
}

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

.callout.danger {
  border-color: rgba(255, 107, 92, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 107, 92, 0.12), rgba(217, 66, 143, 0.1)),
    rgba(23, 32, 56, 0.68);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  color: var(--text);
  border-color: rgba(244, 247, 255, 0.34);
}

.button.primary {
  color: var(--on-fill);
  border-color: transparent;
  background: var(--fill);
  box-shadow: 0 12px 30px rgba(217, 66, 143, 0.24);
}

.button.primary:hover {
  background: #b72b72;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 0;
}

.card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(23, 32, 56, 0.64);
}

.card h3 {
  margin-top: 0;
}

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

.plain-list {
  list-style: none;
  padding: 0 !important;
}

.plain-list li {
  position: relative;
  padding-left: 26px;
}

.plain-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(246, 102, 175, 0.11);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: clamp(64px, 10vw, 110px);
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.site-footer a {
  color: var(--dim);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
  }

  .site-nav {
    max-width: 220px;
  }

  .page-hero {
    padding-top: 68px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .toc {
    position: static;
  }

  .toc nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }
}

@media (max-width: 540px) {
  body {
    font-size: 15.5px;
  }

  .site-shell {
    padding-left: 19px;
    padding-right: 19px;
  }

  .site-header {
    display: grid;
  }

  .site-nav {
    max-width: none;
    justify-content: flex-start;
  }

  .page-hero {
    padding-top: 56px;
    padding-bottom: 42px;
  }

  .card-grid,
  .toc nav {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}

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

@media print {
  :root {
    color-scheme: light;
    --text: #0c1020;
    --dim: #293044;
    --faint: #5d6475;
    --border: rgba(12, 16, 32, 0.15);
  }

  body {
    color: #0c1020;
    background: #fff;
  }

  body::before,
  body::after {
    display: none;
  }

  .site-shell {
    width: 100%;
    padding: 0;
  }

  .site-header,
  .toc,
  .site-footer,
  .button-row {
    display: none;
  }

  .page-hero {
    padding: 0 0 32px;
  }

  .content-grid {
    display: block;
  }

  .callout,
  .card {
    background: #fff;
    box-shadow: none;
    break-inside: avoid;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
  }

  .prose section {
    break-before: auto;
  }

  a {
    color: inherit;
  }
}
