:root {
  --bg: #191919;
  --paper: #f4f4f5cc;
  --paper-strong: #f4f4f5;
  --muted: rgba(244, 244, 245, 0.58);
  --line: rgba(244, 244, 245, 0.13);
  --soft-line: rgba(244, 244, 245, 0.075);
  --panel: rgba(244, 244, 245, 0.045);
  --panel-strong: rgba(244, 244, 245, 0.075);
  --accent: #f4f4f5cc;
  --sans: "Nunito Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Proxima Nova", "proxima-nova", var(--sans);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f4f5;
  --paper: rgba(25, 25, 25, 0.82);
  --paper-strong: #191919;
  --muted: rgba(25, 25, 25, 0.58);
  --line: rgba(25, 25, 25, 0.14);
  --soft-line: rgba(25, 25, 25, 0.08);
  --panel: rgba(25, 25, 25, 0.045);
  --panel-strong: rgba(25, 25, 25, 0.075);
  --accent: rgba(25, 25, 25, 0.86);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 180ms ease, color 180ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.11;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23noise)' opacity='0.75'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

main {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
}

.theme-toggle {
  position: fixed;
  top: clamp(18px, 3.4vw, 42px);
  right: clamp(41px, 12vw, 192px);
  z-index: 10000;
  min-width: 92px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--paper-strong);
  cursor: pointer;
  font: 800 11px/1 var(--sans);
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: none;
  -webkit-backdrop-filter: blur(26px) saturate(1.25);
  backdrop-filter: blur(26px) saturate(1.25);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: transparent;
}

.theme-toggle__icon {
  flex: 0 0 auto;
}

.theme-toggle__icon--light,
html[data-theme="light"] .theme-toggle__icon--dark {
  display: none;
}

html[data-theme="light"] .theme-toggle__icon--light {
  display: block;
}

.hero,
.essay {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 96px clamp(53px, 12vw, 192px);
}

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(34px, 5vw, 64px);
}

.hero-copy {
  max-width: 1040px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font: 800 11px/1.2 var(--sans);
  letter-spacing: 0;
  text-transform: uppercase;
}

.article-title,
.feature-card h2 {
  font-family: var(--display);
  letter-spacing: 0;
}

.hero h1 {
  max-width: 15ch;
  margin: 18px 0 0;
  color: var(--paper-strong);
  font-size: clamp(3.85rem, 7.4vw, 7.75rem);
  font-weight: 900;
  line-height: 0.94;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 48rem;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.5vw, 1.34rem);
  line-height: 1.68;
}

.feature-grid {
  display: grid;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feature-card {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(76px, 0.16fr) minmax(0, 0.64fr) minmax(176px, 0.42fr) 22px;
  gap: clamp(14px, 3.2vw, 48px);
  align-items: baseline;
  padding: 22px 0;
  border-top: 1px solid var(--soft-line);
  background: transparent;
  text-decoration: none;
  transition: color 160ms ease, opacity 160ms ease;
}

.feature-card:first-child {
  border-top: 0;
}

.feature-card:hover,
.feature-card:focus-visible {
  color: var(--paper-strong);
}

.feature-card::after {
  content: "";
  width: 7px;
  height: 7px;
  justify-self: end;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.46;
  rotate: -45deg;
  translate: -2px -1px;
  transition: opacity 160ms ease, translate 160ms ease;
}

.feature-card:hover::after,
.feature-card:focus-visible::after {
  opacity: 0.86;
  translate: 2px -1px;
}

.feature-card span,
.essay-number {
  color: color-mix(in srgb, var(--paper) 52%, transparent);
  font: 800 9px/1.2 var(--sans);
  letter-spacing: 0;
  text-transform: uppercase;
}

.feature-card h2 {
  max-width: 18ch;
  margin: 0;
  font-size: 19.2px;
  font-weight: 700;
  line-height: 1.12;
}

.feature-card p {
  max-width: 24.8rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.86rem, 0.92vw, 0.96rem);
  line-height: 1.58;
}

.essay {
  min-height: 100vh;
  border-top: 1px solid var(--soft-line);
}

.essay-header {
  display: grid;
  grid-template-columns: minmax(76px, 0.16fr) minmax(0, 1fr);
  gap: clamp(20px, 5vw, 72px);
  align-items: start;
  padding-top: 34px;
}

.essay-number {
  margin: 0;
  color: color-mix(in srgb, var(--paper) 22%, transparent);
  font: 800 clamp(2rem, 5vw, 4.5rem)/0.78 var(--sans);
}

.article-title {
  max-width: 12ch;
  margin: 18px 0 0;
  color: var(--paper-strong);
  font-size: clamp(1.28rem, 3.52vw, 3.6rem);
  font-weight: 900;
  line-height: 0.9;
  overflow-wrap: break-word;
}

.dek {
  max-width: 46rem;
  margin: 30px 0 0;
  color: color-mix(in srgb, var(--paper) 82%, transparent);
  font-size: clamp(1rem, 1.6vw, 1.24rem);
  line-height: 1.5;
}

.essay-body {
  max-width: 780px;
  margin: 80px auto 0;
  color: var(--paper);
  font-size: clamp(1.08rem, 1.25vw, 1.2rem);
  line-height: 1.82;
}

.essay-body h2 {
  margin: 4.2rem 0 1.15rem;
  color: var(--paper-strong);
  font-family: var(--sans);
  font-size: clamp(1.36rem, 3.04vw, 2.4rem);
  font-weight: 800;
  line-height: 1.02;
}

.essay-body h3 {
  margin: 4.2rem 0 1.15rem;
  color: var(--paper-strong);
  font-family: var(--sans);
  font-size: clamp(1.088rem, 2.432vw, 1.92rem);
  font-weight: 800;
  line-height: 1.08;
}

.essay-body p,
.essay-body li {
  margin: 1.35rem 0;
}

.essay-body a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--paper-strong) 45%, transparent);
  text-underline-offset: 0.18em;
}

.essay-body blockquote {
  margin: 2.4rem 0;
  padding: 1.4rem 1.6rem;
  border-left: 2px solid var(--accent);
  background: var(--panel);
  color: color-mix(in srgb, var(--paper) 92%, var(--paper-strong));
}

.essay-body ol {
  padding-left: 1.3rem;
}

.essay-body pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
  padding: 1.1rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  color: var(--paper);
  font: 500 0.82rem/1.7 var(--mono);
}

.essay-body code {
  font-family: var(--mono);
}

.essay-body pre code {
  display: block;
  min-width: 100%;
}

.essay-body hr {
  height: 1px;
  margin: 3.5rem 0;
  border: 0;
  background: var(--line);
}

.island-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.island-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.toc-island {
  position: fixed;
  right: clamp(41px, 12vw, 192px);
  bottom: 30px;
  z-index: 9999;
  width: min(280px, calc(100vw - 32px));
  height: 52px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: transparent;
  color: var(--paper);
  box-shadow: none;
  -webkit-backdrop-filter: blur(30px) saturate(1.28);
  backdrop-filter: blur(30px) saturate(1.28);
  cursor: pointer;
  transition:
    width 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.toc-island.is-expanded {
  width: min(340px, calc(100vw - 32px));
  height: min(400px, calc(100vh - 60px));
  border-radius: 24px;
  cursor: default;
}

.toc-closed,
.toc-open {
  position: absolute;
  inset: 0;
  transition:
    opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    scale 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.toc-closed {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 0 18px;
}

.toc-island.is-expanded .toc-closed {
  opacity: 0;
  scale: 0.95;
  filter: blur(4px);
  pointer-events: none;
}

.toc-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--paper);
}

.toc-active {
  flex: 1;
  overflow: hidden;
  color: var(--paper);
  font: 700 0.86rem/1.1 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-progress {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  rotate: -90deg;
}

.toc-progress .track {
  fill: none;
  stroke: color-mix(in srgb, var(--paper) 22%, transparent);
  stroke-width: 2.5;
}

.toc-progress .bar {
  fill: none;
  stroke: var(--paper);
  stroke-linecap: round;
  stroke-width: 2.5;
  transition: stroke-dashoffset 140ms ease-out;
}

.toc-open {
  display: flex;
  flex-direction: column;
  opacity: 0;
  scale: 1.04;
  pointer-events: none;
}

.toc-island.is-expanded .toc-open {
  opacity: 1;
  scale: 1;
  pointer-events: auto;
}

.toc-open-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}

.toc-open-header span {
  color: color-mix(in srgb, var(--paper) 56%, transparent);
  font: 800 11px/1.2 var(--sans);
  letter-spacing: 0.08em;
}

.toc-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--paper) 62%, transparent);
  cursor: pointer;
}

.toc-close:hover,
.toc-close:focus-visible {
  color: var(--paper);
}

.toc-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 16px;
}

.toc-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: color-mix(in srgb, var(--paper) 52%, transparent);
  cursor: pointer;
  font: 700 0.86rem/1.2 var(--sans);
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.toc-list button:hover,
.toc-list button:focus-visible {
  background: var(--panel);
  color: color-mix(in srgb, var(--paper) 88%, var(--paper-strong));
}

.toc-list button.is-active {
  background: var(--panel-strong);
  color: var(--paper);
}

.toc-list button span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-list button::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--paper);
  opacity: 0;
  scale: 0;
  transition: opacity 160ms ease, scale 160ms ease;
}

.toc-list button.is-active::after {
  opacity: 1;
  scale: 1;
}

@media (max-width: 940px) {
  .essay-header {
    grid-template-columns: 1fr;
  }

  .essay-body {
    margin-top: 54px;
  }
}

@media (max-width: 620px) {
  .hero,
  .essay {
    padding-inline: 36px;
  }

  .hero h1 {
    font-size: 4.1rem;
  }

  .feature-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 19px 0;
  }

  .feature-card::after {
    justify-self: start;
    margin-top: 2px;
  }

  .article-title {
    font-size: 1.5rem;
  }

  .essay-body h2 {
    font-size: 2.16rem;
  }

  .essay-body h3 {
    font-size: 1.728rem;
  }

  .essay-body pre,
  .essay-body pre code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .toc-island {
    right: 29px;
    bottom: 18px;
  }
}

@media (max-width: 390px) {
  .hero h1 {
    font-size: 3.55rem;
  }

  .article-title {
    font-size: 1.2rem;
  }
}

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

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