:root {
  --bg: #07080a;
  --bg-raise: #0d0f13;
  --ink: #ece8df;
  --ink-dim: #9a978f;
  --ink-faint: #5c5a55;
  --rule: rgba(236, 232, 223, 0.12);
  --sodium: #ffb15e;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--sodium); color: #120c05; }

a { color: inherit; text-decoration-color: var(--ink-faint); text-underline-offset: 0.2em; transition: color .2s, text-decoration-color .2s; }
a:hover { color: var(--sodium); text-decoration-color: var(--sodium); }
a:focus-visible { outline: 1px solid var(--sodium); outline-offset: 4px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------- header ---------- */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  padding-top: 28px;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

.nav { display: flex; gap: 28px; }
.nav a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; color: var(--ink-dim); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: clamp(32px, 6vh, 64px);
  overflow: hidden;
  isolation: isolate;
}

#flux {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(7,8,10,0.55) 0%, rgba(7,8,10,0) 22%),
    linear-gradient(to top, var(--bg) 0%, rgba(7,8,10,0.6) 28%, rgba(7,8,10,0) 55%);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 15.5vw, 236px);
  line-height: 0.9;
  letter-spacing: -0.035em;
}
.hero h1 em { font-style: italic; color: var(--ink-dim); padding-left: 0.04em; }
.hero h1 .line { display: block; }
.hero h1 .line:nth-child(2) { padding-left: 0.62em; }

.hero-meta {
  margin-top: clamp(28px, 5vh, 48px);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.hero-meta p { margin: 0; max-width: 34ch; color: var(--ink-dim); }
.hero-meta p strong { color: var(--ink); font-weight: 500; }

.status { display: inline-flex; align-items: center; gap: 10px; }
.status i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sodium);
  box-shadow: 0 0 0 0 rgba(255,177,94,.6);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,177,94,.55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(255,177,94,0); }
}

/* ---------- sections ---------- */

.section { padding: clamp(80px, 14vh, 160px) 0; border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; }

.section-head {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 24px;
  margin-bottom: clamp(40px, 7vh, 72px);
}

.statement {
  font-family: var(--serif);
  font-size: clamp(32px, 4.6vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0;
  max-width: 20ch;
}
.statement em { color: var(--ink-dim); }

.cols { display: grid; grid-template-columns: 1fr 3fr; gap: 24px; }
.cols .body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; max-width: 820px; }
.cols .body p { margin: 0; color: var(--ink-dim); }

/* index list */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.index li {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  transition: padding .35s cubic-bezier(.2,.7,.2,1), background .35s;
}
.index li:hover { padding-left: 14px; background: linear-gradient(90deg, rgba(236,232,223,0.03), transparent 60%); }
.index .title { font-family: var(--serif); font-size: clamp(26px, 3vw, 40px); line-height: 1.1; }
.index .title.redacted { color: var(--ink-faint); font-style: italic; }
.index .right { text-align: right; }

/* contact */
.contact-line {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(34px, 7vw, 104px);
  line-height: 1;
  letter-spacing: -0.03em;
  text-decoration: none;
  word-break: break-word;
}
.contact-line .arrow { display: inline-block; transition: transform .35s cubic-bezier(.2,.7,.2,1); font-family: var(--sans); font-weight: 300; font-size: 0.6em; vertical-align: 0.18em; }
.contact-line:hover .arrow { transform: translate(8px, -8px); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--rule); padding: 32px 0 40px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer a { text-decoration: none; }

/* ---------- document pages (privacy, support) ---------- */

.doc-hero { padding: 168px 0 56px; border-bottom: 1px solid var(--rule); }
.doc-hero h1 {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 9vw, 128px);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.doc { display: grid; grid-template-columns: 1fr 3fr; gap: 24px; padding: 64px 0 120px; }
.doc aside { position: sticky; top: 32px; align-self: start; }
.doc aside ol { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.doc aside a { text-decoration: none; color: var(--ink-dim); font-size: 14px; }
.doc aside a:hover { color: var(--ink); }

.prose { max-width: 68ch; }
.prose h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 56px 0 14px;
  scroll-margin-top: 32px;
}
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: #c9c5bc; }
.prose ul { padding-left: 1.1em; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--ink-faint); }
.prose strong { color: var(--ink); font-weight: 500; }
.lede { font-size: 19px; color: var(--ink) !important; }

.faq { border-top: 1px solid var(--rule); margin-top: 18px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 18px;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--ink-dim); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 22px; }

.card {
  margin: 0 0 8px;
  padding: 28px;
  background: var(--bg-raise);
  border: 1px solid var(--rule);
}
.card .contact-line { font-size: clamp(21px, 5.6vw, 48px); margin-top: 10px; word-break: normal; overflow-wrap: anywhere; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero-meta { grid-template-columns: 1fr 1fr; }
  .hero-meta p { grid-column: 1 / -1; }
  .section-head, .cols, .doc { grid-template-columns: 1fr; }
  .cols .body { grid-template-columns: 1fr; }
  .index li { grid-template-columns: auto 1fr; row-gap: 6px; }
  .index li .hide-sm { display: none; }
  .doc aside { display: none; }
}

@media (max-width: 520px) {
  .nav { gap: 18px; }
  .brand span { display: none; }
  .hero h1 .line:nth-child(2) { padding-left: 0.3em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* load-in */
.rise { opacity: 0; transform: translateY(18px); animation: rise 1.1s cubic-bezier(.2,.7,.2,1) forwards; }
.rise.d1 { animation-delay: .08s; } .rise.d2 { animation-delay: .2s; } .rise.d3 { animation-delay: .38s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; } }

/* ---------- below the surface ---------- */

/* a faint ember glow along the hero's lower edge, like a sky lit from underneath */
.hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -30% -10%;
  height: 60%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, rgba(170, 34, 44, 0.16), rgba(170, 34, 44, 0) 65%);
  transition: opacity 1.2s;
}

html[data-realm="below"] { --bg: #0e0507; --ink-dim: #b08c88; --rule: rgba(236, 200, 190, 0.14); }
html[data-realm="below"] body { transition: background-color 1.2s; }
html[data-realm="below"] .hero::before { background: radial-gradient(ellipse at 50% 100%, rgba(210, 40, 50, 0.38), rgba(210, 40, 50, 0) 70%); }
html[data-realm="below"] .hero::after {
  background:
    linear-gradient(to bottom, rgba(14,5,7,0.55) 0%, rgba(14,5,7,0) 22%),
    linear-gradient(to top, var(--bg) 0%, rgba(14,5,7,0.5) 24%, rgba(14,5,7,0) 50%);
}
html[data-realm="below"] .hero h1 em { color: #d4434d; }
html[data-realm="below"] .status i { background: #7fdc8c; animation-name: pulse-amulet; }
@keyframes pulse-amulet {
  0% { box-shadow: 0 0 0 0 rgba(127,220,140,.55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(127,220,140,0); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translate(-50%, 12px);
  opacity: 0;
  padding: 10px 16px;
  background: rgba(13, 15, 19, 0.92);
  border: 1px solid var(--rule);
  color: var(--ink);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.fly {
  position: absolute;
  top: 0; left: 0;
  z-index: 3;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  padding: 0;
  border: 0;
  background: none;
  color: #d8d3c8;
  cursor: crosshair;
  opacity: 0;
  pointer-events: none;
}
.fly.on { opacity: 0.85; pointer-events: auto; }
.fly svg { width: 100%; height: 100%; display: block; }
.fly .wing { fill: rgba(216, 211, 200, 0.35); transform-box: fill-box; transform-origin: center; animation: buzz .05s linear infinite alternate; }
@keyframes buzz { to { opacity: .3; } }
.fly.caught { transition: transform .5s cubic-bezier(.5,0,.8,.4), opacity .6s .3s; opacity: 0; }
.fly.caught .wing { animation: none; }
.fly:focus-visible { outline: 1px solid var(--sodium); }
