/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-3xl);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  background-color: var(--color-paper);
  background-image:
    radial-gradient(52rem 34rem at 50% 18rem, var(--color-bloom), transparent 70%),
    radial-gradient(40rem 30rem at 90% 110%, var(--color-bloom-2), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { color: var(--color-ink); font-family: var(--font-display); font-weight: 600; }

a { color: inherit; }

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

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

main, .foot-stmt {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.section-title {
  font-size: var(--text-xl);
  line-height: var(--lh-head);
  letter-spacing: var(--tracking-tight);
  max-width: 24ch;
  overflow-wrap: anywhere;
  min-width: 0;
}

/* ---------- N5 · Floating pill ---------- */

.nav-pill {
  position: fixed;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-sticky);
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-2xs) var(--space-2xs) var(--space-2xs) var(--space-md);
  background: var(--color-veil);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px -12px var(--color-shadow);
  white-space: nowrap;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  text-decoration: none;
}

.nav-pill__links {
  display: none;
  list-style: none;
  padding: 0;
  gap: var(--space-2xs);
}

.nav-pill__links a {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}

.nav-pill__links a:hover { color: var(--color-ink); background: var(--color-paper-3); }
.nav-pill__links a:active { background: var(--color-rule); }

.lang {
  display: flex;
  padding: var(--space-3xs);
  border-radius: var(--radius-pill);
  background: var(--color-paper-2);
}

.lang button {
  min-width: 44px;
  min-height: 36px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  cursor: pointer;
  font: 500 var(--text-xs) var(--font-body);
  letter-spacing: var(--tracking-label);
  color: var(--color-muted);
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}

.lang button:hover { color: var(--color-ink); }
.lang button:active { transform: translateY(1px); }
.lang button[aria-pressed="true"] {
  background: var(--color-paper-3);
  color: var(--color-ink);
  cursor: default;
}

/* ---------- Hero ---------- */

.hero {
  padding-top: calc(var(--space-4xl) + var(--space-md));
  padding-bottom: var(--space-2xl);
  text-align: center;
}

.hero__title {
  max-width: 14ch;
  margin-inline: auto;
  font-size: var(--text-display);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
  overflow-wrap: anywhere;
  min-width: 0;
}

.hero__lede {
  max-width: 54ch;
  margin: var(--space-lg) auto 0;
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--color-ink-2);
}

/* ---------- The map ---------- */

.map { padding-block: var(--space-lg) var(--space-3xl); }

.map__grid {
  position: relative;
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "cap"
    "target"
    "dns" "host" "cdn" "web" "pay" "law"
    "legend";
}

.map__edges { display: none; }

.map__caption {
  grid-area: cap;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-muted);
}

.map__legend {
  grid-area: legend;
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-muted);
  max-width: 44ch;
}

.node {
  position: relative;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-node);
  opacity: 0;
  animation: node-in var(--dur-long) var(--ease-out) forwards;
  animation-delay: calc(200ms + var(--i, 0) * 80ms);
}

.node h3 { font-size: var(--text-md); line-height: 1.25; letter-spacing: var(--tracking-tight); }
.node p { font-size: var(--text-sm); color: var(--color-muted); }

.node__tag {
  display: block;
  margin-bottom: var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
}

.node--dns { grid-area: dns; }
.node--host { grid-area: host; }
.node--cdn { grid-area: cdn; }
.node--web { grid-area: web; }
.node--pay { grid-area: pay; }
.node--law { grid-area: law; }

/* Target — the one inverted surface on the page */
.node--target {
  grid-area: target;
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-paper);
}
.node--target h3 { color: var(--color-paper); font-size: var(--text-lg); }
.node--target p { color: var(--color-paper-3); }
.node--target .node__tag { color: var(--color-paper-3); }
.node--target .node__domain {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-paper);
  margin-bottom: var(--space-xs);
  overflow-wrap: anywhere;
}

/* Mobile spine: providers hang off a single line under the target */
.node:not(.node--target) { margin-inline-start: var(--space-lg); }

.node:not(.node--target)::before,
.node:not(.node--target)::after {
  content: "";
  position: absolute;
  background: var(--color-rule-2);
}

.node:not(.node--target)::before {
  left: calc(-1 * var(--space-lg));
  top: 50%;
  width: var(--space-lg);
  height: var(--rule-hair);
}

.node:not(.node--target)::after {
  left: calc(-1 * var(--space-lg));
  top: calc(-1 * var(--space-sm) - var(--rule-hair));
  bottom: calc(-1 * var(--space-sm));
  width: var(--rule-hair);
}

.node--dns::after { top: calc(-1 * var(--space-sm) - var(--rule-hair)); }
.node--law::after { bottom: 50%; }

@keyframes node-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Process track ---------- */

.process { padding-block: var(--space-2xl) var(--space-3xl); }

.track {
  list-style: none;
  padding: 0;
  margin-top: var(--space-xl);
  display: grid;
  gap: var(--space-xl);
}

.track li {
  position: relative;
  padding-top: var(--space-lg);
  border-top: var(--rule-hair) solid var(--color-rule-2);
}

.track li::before {
  content: "";
  position: absolute;
  top: calc(-1 * var(--space-2xs) - var(--rule-hair));
  left: 0;
  width: var(--space-xs);
  height: var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}

.track__num {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

.track h3 { font-size: var(--text-lg); letter-spacing: var(--tracking-tight); margin-bottom: var(--space-xs); }
.track p { font-size: var(--text-sm); color: var(--color-muted); max-width: 34ch; }

/* ---------- Rules split ---------- */

.rules { padding-block: var(--space-2xl) var(--space-3xl); }

.rules__split {
  margin-top: var(--space-xl);
  display: grid;
  gap: var(--space-md);
}

.rules__yes,
.rules__no {
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-card);
}

.rules__yes { background: var(--color-paper-2); }
.rules__no { border: var(--rule-hair) solid var(--color-rule); }

.rules h3 { font-size: var(--text-md); margin-bottom: var(--space-md); }

.rules ul { list-style: none; padding: 0; display: grid; gap: var(--space-sm); }

.rules li {
  display: grid;
  grid-template-columns: var(--space-lg) minmax(0, 1fr);
  color: var(--color-ink-2);
}

.rules__yes li::before { content: "+"; color: var(--color-accent); font-weight: 600; }
.rules__no li::before { content: "×"; color: var(--color-muted); }
.rules__no li { color: var(--color-muted); }

.rules__no p {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: var(--rule-hair) solid var(--color-rule);
  font-size: var(--text-sm);
  color: var(--color-ink-2);
}

/* ---------- Two ways in ---------- */

.ways { padding-block: var(--space-xl) var(--space-3xl); }

.ways__grid {
  margin-top: var(--space-xl);
  display: grid;
  gap: var(--space-md);
}

.way {
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-card);
  background: var(--color-paper-2);
}

.way--public { background: var(--color-paper-3); }
.way h3 { font-size: var(--text-lg); margin-bottom: var(--space-sm); }
.way p { max-width: var(--measure); }

/* ---------- FAQ ---------- */

.faq { padding-block: var(--space-xl) var(--space-3xl); max-width: 48rem; }
.faq .section-title { margin-bottom: var(--space-lg); }

.faq details { border-bottom: var(--rule-hair) solid var(--color-rule); }

.faq summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: var(--space-md) var(--space-xl) var(--space-md) 0;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-ink);
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: var(--space-2xs);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-lg);
  color: var(--color-accent);
  transition: transform var(--dur-short) var(--ease-in-out);
}

.faq summary:hover { color: var(--color-accent-2); }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding-bottom: var(--space-lg); max-width: var(--measure); color: var(--color-muted); }

/* ---------- Contact ---------- */

.contact {
  padding-block: var(--space-2xl) var(--space-3xl);
  display: grid;
  justify-items: start;
  gap: var(--space-md);
}

.contact h2 {
  font-size: var(--text-xl);
  line-height: var(--lh-head);
  letter-spacing: var(--tracking-tight);
  max-width: 20ch;
  overflow-wrap: anywhere;
  min-width: 0;
}

.contact p { max-width: 46ch; color: var(--color-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--space-lg);
  margin-top: var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

.btn:hover { background: var(--color-accent-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); background: var(--color-accent); }

/* ---------- Ft5 · Statement ---------- */

.foot-stmt {
  display: grid;
  gap: var(--space-xl);
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}

.foot-stmt__line {
  max-width: 22ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: var(--lh-head);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  overflow-wrap: anywhere;
}

.foot-stmt__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs) var(--space-lg);
  padding-top: var(--space-sm);
  border-top: var(--rule-hair) solid var(--color-rule);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.foot-stmt__meta a {
  white-space: nowrap;
  text-decoration: underline var(--rule-hair) var(--color-rule-2);
  text-underline-offset: 4px;
  transition: color var(--dur-micro) var(--ease-out);
}
.foot-stmt__meta a:hover { color: var(--color-ink); }
.foot-stmt__meta a:active { color: var(--color-accent); }

/* ---------- ≥ 40rem ---------- */

@media (min-width: 40rem) {
  .nav-pill__links { display: flex; }
  .track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ways__grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .foot-stmt__meta { justify-content: space-between; }
}

/* ---------- ≥ 60rem · the map goes spatial ---------- */

@media (min-width: 60rem) {
  .map__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-rows: repeat(3, minmax(9.5rem, auto));
    grid-template-areas:
      "dns  cap    host"
      "cdn  target web"
      "pay  legend law";
    column-gap: var(--space-3xl);
    row-gap: var(--space-xl);
    align-items: center;
  }

  .map__edges {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: visible;
  }

  .map__edges line {
    stroke: var(--color-rule-2);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
    opacity: 0;
    animation: edge-in var(--dur-long) var(--ease-out) forwards;
    animation-delay: calc(200ms + var(--i, 0) * 80ms);
  }

  .node { z-index: var(--z-raised); }
  .node:not(.node--target) { margin-inline-start: 0; }
  .node:not(.node--target)::before,
  .node:not(.node--target)::after { content: none; }

  .node--target { padding: var(--space-xl); }

  .map__caption,
  .map__legend {
    z-index: var(--z-raised);
    justify-self: center;
    text-align: center;
    max-width: 30ch;
    margin: 0;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-paper);
    border-radius: var(--radius-node);
  }

  .map__caption { align-self: end; }
  .map__legend { align-self: start; }

  .track { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-lg); }
  .rules__split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .rules__yes, .rules__no { padding: var(--space-2xl) var(--space-xl); }
}

@keyframes edge-in { to { opacity: 1; } }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 150ms !important;
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
  }
  .node { animation-name: fade-in; animation-delay: 0ms; }
  .map__edges line { animation: none; opacity: 1; }
  @keyframes fade-in { to { opacity: 1; } }
}
