/* GHOSTNET — ghostnetx.com
 *
 * One idea runs the page: the visitor's own message travels down a wire
 * as they scroll. Colour says what state it is in — cyan while it is
 * readable, violet while it is sealed, green once it is delivered — and
 * everything else stays quiet.
 *
 * No web fonts, nothing from another origin: the fonts are the reader's
 * own, and the server sends a policy that forbids anything else.
 */

:root {
  --void: #050708;
  --deep: #080b0d;
  --surface: #0b0f12;
  --raised: #11171b;
  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --ink: #f2f5f4;
  --ink-2: #9aa5a4;
  --ink-3: #6f7b7b;
  --plain: #22d3ee;      /* readable */
  --sealed: #8b7cf6;     /* in transit */
  --safe: #3dd68c;       /* delivered, available */
  --warn: #e0a44a;
  --danger: #e5484d;
  --tone: var(--plain);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --wire-x: clamp(18px, 6vw, 104px);
  --gutter: clamp(54px, 11vw, 200px);
  --measure: 62ch;
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 26px;
}

html[data-state="sealed"] { --tone: var(--sealed); }
html[data-state="delivered"] { --tone: var(--safe); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background-color: var(--void);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0; }
ul, dl { margin: 0; padding: 0; list-style: none; }
dd { margin: 0; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--void); padding: 10px 14px; border-radius: var(--r-s);
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--tone); outline-offset: 3px; border-radius: 6px; }

/* ── type ─────────────────────────────────────────────────────────── */

.hero__title, .h2 {
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}
.hero__title { font-size: clamp(2.6rem, 8.4vw, 6.6rem); max-width: 13ch; }
.h2 { font-size: clamp(1.9rem, 4.6vw, 3.5rem); max-width: 18ch; }
.h3 { font-size: 1.125rem; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
.lede { color: var(--ink-2); font-size: clamp(1.05rem, 1.5vw, 1.25rem); max-width: var(--measure); }
.fine { color: var(--ink-3); font-size: 0.875rem; max-width: var(--measure); }
kbd {
  font-family: var(--mono); font-size: 0.9em; padding: 1px 6px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
}

/* ── top bar ──────────────────────────────────────────────────────── */

.top {
  position: fixed; inset: 12px 12px auto 12px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-l);
  background: rgba(8, 11, 13, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__emblem { width: 34px; height: 34px; }
.brand__word { width: 124px; height: auto; }
.nav { display: flex; align-items: center; gap: clamp(10px, 2.2vw, 28px); font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 6px 2px; }
.nav a:hover { color: var(--ink); }
.nav .nav__cta {
  color: var(--void); background: var(--ink); padding: 8px 16px; border-radius: 999px; font-weight: 650;
}
.nav .nav__cta:hover { color: var(--void); background: #ffffff; }

/* ── the wire ─────────────────────────────────────────────────────── */

.wire { position: fixed; left: var(--wire-x); top: 0; bottom: 0; width: 2px; z-index: 5; pointer-events: none; }
.wire__line { position: absolute; inset: 0; background: var(--line); }
.wire__done {
  position: absolute; left: 0; top: 0; width: 2px; height: 0;
  background: var(--tone); box-shadow: 0 0 14px var(--tone);
  transition: background-color 0.5s, box-shadow 0.5s;
}
.wire__packet { position: absolute; left: -6px; top: 0; width: 14px; height: 14px; transform: translateY(-7px); }
.wire__packet::before {
  content: ""; position: absolute; inset: 0; border-radius: 4px; transform: rotate(45deg);
  background: var(--tone); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05), 0 0 22px var(--tone);
  transition: background-color 0.5s, box-shadow 0.5s;
}
/* The state of the message, written along the wire so that it never
   sits on top of the page beside it. */
.wire__packet span {
  position: absolute; right: 20px; top: 26px; writing-mode: vertical-rl;
  font-family: var(--mono); font-size: 0.75rem; color: var(--tone); white-space: nowrap;
  transition: color 0.5s;
}

/* ── layout ───────────────────────────────────────────────────────── */

main { padding-left: var(--gutter); padding-right: clamp(18px, 5vw, 72px); }

.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; gap: 26px;
  padding-top: 110px; padding-bottom: 48px;
}
.hero__lede { color: var(--ink-2); font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 58ch; }

.station { padding-block: clamp(84px, 14vh, 170px); display: grid; gap: clamp(28px, 5vh, 56px); max-width: 1180px; }
.station.station--tight { padding-top: 0; }
.station__head { display: grid; gap: 18px; }

.scene { height: 300vh; position: relative; }
.scene__pin {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; align-items: center; padding-top: 76px; padding-bottom: 20px;
}

/* ── controls ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  transition: transform 0.12s, background-color 0.2s, border-color 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn.btn--solid { background: var(--tone); color: #041014; }
.btn.btn--solid:hover { background: #ffffff; }
.btn.btn--line { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.btn--line:hover { border-color: var(--ink-2); }

.compose { display: grid; gap: 12px; max-width: 760px; margin-top: 10px; }
.compose__label, .codebook__try label, .lock label { color: var(--ink-2); font-size: 0.95rem; }
.compose__row { display: flex; gap: 10px; flex-wrap: wrap; }
.compose__input {
  flex: 1 1 280px; min-width: 0; font: inherit; font-family: var(--mono); font-size: 1rem;
  color: var(--plain); caret-color: var(--plain);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 14px 18px;
}
.compose__input:focus { outline: none; border-color: var(--plain); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.14); }
.compose__hint { color: var(--ink-3); font-size: 0.95rem; }

.tag {
  display: inline-flex; align-items: center; gap: 7px; vertical-align: middle;
  font-family: var(--sans); font-style: normal; font-weight: 600; font-size: 0.8125rem; letter-spacing: 0;
  padding: 4px 11px 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2);
  white-space: nowrap;
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag[data-is="available"] { color: var(--safe); border-color: rgba(61, 214, 140, 0.3); }
.tag[data-is="rolling-out"] { color: var(--warn); border-color: rgba(224, 164, 74, 0.34); }
.tag[data-is="lab"] { color: var(--sealed); border-color: rgba(139, 124, 246, 0.36); }

.pairs { display: grid; gap: 22px 40px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pairs dt { font-weight: 650; margin-bottom: 4px; }
.pairs dd { color: var(--ink-2); }
.pairs > div { border-top: 1px solid var(--line); padding-top: 16px; }

/* ── seal ─────────────────────────────────────────────────────────── */

.seal { display: grid; gap: clamp(24px, 5vw, 70px); grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; }
.seal__caption { color: var(--tone); font-family: var(--mono); font-size: 0.875rem; margin-bottom: 14px; transition: color 0.4s; }
.seal__text {
  font-family: var(--mono); font-size: clamp(1.25rem, 3.3vw, 2.6rem); line-height: 1.25;
  word-break: break-word; min-height: 3.2em;
}
.seal__text span { color: var(--plain); transition: color 0.25s; }
.seal__text span.is-sealed { color: var(--sealed); }
.seal__real { margin-top: 26px; opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.4s; }
.seal__real.is-on { opacity: 1; transform: none; }
.seal__realhead { color: var(--ink-2); font-size: 0.9rem; margin-bottom: 8px; }
.seal__hex {
  display: block; font-family: var(--mono); font-size: 0.8125rem; line-height: 1.5; color: var(--sealed);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 14px 16px; word-break: break-all; max-height: 7.5em; overflow: hidden;
}
.seal__note { color: var(--ink-3); font-size: 0.875rem; margin-top: 10px; max-width: 58ch; }
.seal__facts { display: grid; gap: 26px; }
.facts { display: grid; gap: 18px; }
.facts li {
  color: var(--ink-3); padding-left: 18px; border-left: 2px solid var(--line);
  transition: color 0.35s, border-color 0.35s;
}
.facts li strong { color: inherit; font-weight: 650; display: block; }
.facts li.is-on { color: var(--ink-2); border-left-color: var(--sealed); }
.facts li.is-on strong { color: var(--ink); }

/* ── node ─────────────────────────────────────────────────────────── */

.node { display: grid; gap: clamp(26px, 5vw, 70px); grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); align-items: center; }
.node__device {
  position: relative; aspect-ratio: 5 / 7; border-radius: var(--r-l);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.01) 55%), var(--surface);
  display: grid; place-items: center;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.node__device img { width: 46%; opacity: 0.95; }
.node__light {
  position: absolute; right: 18px; top: 18px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--safe); box-shadow: 0 0 12px var(--safe);
}

/* ── shield ───────────────────────────────────────────────────────── */

.shield { display: grid; gap: clamp(18px, 3vh, 34px); }
.shield__copy { display: grid; gap: 14px; }
.shield__caption { font-family: var(--mono); font-size: 0.95rem; color: var(--tone); min-height: 1.6em; }
.shield__map { display: grid; gap: 14px; }
.shield__map > svg {
  width: 100%; height: auto; max-height: 44vh;
  border: 1px solid var(--line); border-radius: var(--r-l); background: rgba(8, 11, 13, 0.75);
}
.map__backbone path { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 7; fill: none; }
.map__links path { stroke: rgba(255, 255, 255, 0.09); stroke-width: 1.5; fill: none; transition: stroke 0.4s, stroke-width 0.4s; }
.map__links path.is-live { stroke: var(--sealed); stroke-width: 2.2; }
.map__links path.is-dead { stroke: rgba(229, 72, 77, 0.35); stroke-dasharray: 4 8; }
.map__gw circle { fill: var(--raised); stroke: var(--safe); stroke-width: 2; transition: stroke 0.3s, fill 0.3s; }
.map__gw.is-live circle { fill: rgba(139, 124, 246, 0.22); stroke: var(--sealed); }
.map__gw.is-down circle { stroke: var(--danger); fill: rgba(229, 72, 77, 0.12); }
.map__gw text, .map__node text { fill: var(--ink-2); font-family: var(--mono); font-size: 15px; text-anchor: middle; }
.map__node rect { fill: var(--raised); stroke: var(--plain); stroke-width: 2; }
.map__packets circle { fill: var(--sealed); }

.gateways { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gateway {
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center;
  padding: 12px 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface);
  transition: border-color 0.25s, background-color 0.25s;
}
.gateway:hover { border-color: var(--ink-3); }
.gateway__name { font-family: var(--mono); font-weight: 650; }
.gateway__state { justify-self: end; font-size: 0.8125rem; color: var(--safe); }
.gateway .cipher { grid-column: 1 / -1; }
.gateway.is-live { border-color: rgba(139, 124, 246, 0.6); }
.gateway.is-live .gateway__state { color: var(--sealed); }
.gateway.is-down { border-color: rgba(229, 72, 77, 0.5); background: rgba(229, 72, 77, 0.06); }
.gateway.is-down .gateway__state { color: var(--danger); }

/* The mask a node shows in place of a gateway's address. */
.cipher {
  position: relative; display: inline-flex; align-items: center; gap: 1px; overflow: hidden;
  font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-3); height: 1.4em;
}
.cipher svg { flex: none; margin-right: 6px; color: var(--sealed); }
.cipher__cell { display: inline-block; height: 1.4em; overflow: hidden; }
.cipher__reel { display: flex; flex-direction: column; animation: reel 3s steps(12) infinite; }
.cipher__reel span { height: 1.4em; line-height: 1.4em; }
.cipher__dot { opacity: 0.5; padding: 0 1px; }
.cipher::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(139, 124, 246, 0.28), transparent);
  transform: translateX(-100%); animation: sweep 4.2s ease-in-out infinite;
}
@keyframes reel { to { transform: translateY(-16.8em); } }
@keyframes sweep { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ── paths, suite, limits ─────────────────────────────────────────── */

.paths { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); border-top: 1px solid var(--line); }
.paths li { padding: 22px 26px 26px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.paths .h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.paths p { color: var(--ink-2); }

.suite { border-top: 1px solid var(--line); }
.suite li {
  display: grid; grid-template-columns: minmax(150px, 0.8fr) minmax(0, 2.2fr) auto; gap: 8px 28px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.suite .h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); font-style: italic; font-weight: 800; letter-spacing: -0.02em; }
.suite p { color: var(--ink-2); }

.limits { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); column-gap: 48px; border-top: 1px solid var(--line); }
.limits li { padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.limits strong { color: var(--ink); font-weight: 650; }

/* ── codebook ─────────────────────────────────────────────────────── */

.codebook { display: grid; gap: clamp(24px, 4vw, 60px); grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: start; }
.codebook__book, .codebook__try { display: grid; gap: 14px; }
.codebook__book p { color: var(--ink-2); }
.book { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.95rem; }
.book th { text-align: left; font-family: var(--sans); font-weight: 600; color: var(--ink-3); font-size: 0.875rem; padding: 0 0 8px; }
.book td { padding: 10px 0; border-top: 1px solid var(--line); }
.book td:first-child { color: var(--plain); }
.book td:last-child { color: var(--safe); }
.codebook__label { color: var(--ink-3); font-size: 0.9rem; }
.codebook__out { font-family: var(--mono); font-size: 1.05rem; min-height: 3.2em; }
.codebook__out mark { background: rgba(61, 214, 140, 0.14); color: var(--safe); border-radius: 5px; padding: 1px 4px; }

/* ── seized ───────────────────────────────────────────────────────── */

.seized { display: grid; gap: clamp(26px, 5vw, 70px); grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); align-items: start; }
.lock {
  display: grid; gap: 12px; padding: 26px; border-radius: var(--r-l);
  border: 1px solid var(--line); background: rgba(11, 15, 18, 0.86);
  transition: border-color 0.3s;
}
.lock img { width: 56px; height: 56px; }
.lock__tries { display: flex; gap: 8px; }
.lock__tries i { width: 28px; height: 6px; border-radius: 3px; background: var(--line); transition: background-color 0.2s; }
.lock__tries i.is-used { background: var(--danger); }
.lock__msg { font-family: var(--mono); font-size: 0.9rem; color: var(--ink-2); min-height: 2.8em; }
.lock__data { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-family: var(--mono); font-size: 0.8125rem; }
.lock__data li {
  padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); text-align: center;
  transition: opacity 0.35s, transform 0.35s, color 0.2s, border-color 0.2s;
}
.lock__data li.is-gone { opacity: 0.12; transform: scale(0.94); color: var(--danger); border-color: rgba(229, 72, 77, 0.5); text-decoration: line-through; }
.lock.is-shake { animation: shake 0.32s; }
.lock.is-wiped { border-color: rgba(229, 72, 77, 0.5); }
.lock.is-wiped .lock__msg { color: var(--danger); }
@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

/* ── terminal ─────────────────────────────────────────────────────── */

.term {
  border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden;
  background: rgba(8, 11, 13, 0.9);
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.95);
}
.term__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); font-family: var(--mono); font-size: 0.8125rem; }
.term__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.term__bar span { margin-left: 8px; }
.term__out {
  height: min(56vh, 520px); overflow-y: auto; padding: 18px 20px 6px;
  font-family: var(--mono); font-size: 0.9375rem; line-height: 1.6;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px);
}
.term__out p { margin-bottom: 10px; max-width: 86ch; white-space: pre-wrap; }
.term__out .t-you { color: var(--plain); }
.term__out .t-q { color: var(--ink); font-weight: 650; }
.term__out .t-a { color: var(--ink-2); }
.term__out .t-dim { color: var(--ink-3); }
.term__out .t-ok { color: var(--safe); }
.term__out .t-seal { color: var(--sealed); word-break: break-all; }
.term__out button.t-link {
  font: inherit; color: var(--ink-2); background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px;
}
.term__out button.t-link:hover { color: var(--ink); text-decoration-color: var(--ink-2); }
.term__in { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 20px; border-top: 1px solid var(--line); }
.term__prompt { font-family: var(--mono); color: var(--plain); }
.term__in input {
  flex: 1; min-width: 0; font: inherit; font-family: var(--mono); color: var(--ink); caret-color: var(--plain);
  background: transparent; border: 0; padding: 8px 0;
}
.term__in input:focus { outline: none; }
.term__in .btn { padding: 8px 16px; font-size: 0.9rem; }
.term .fine { padding: 0 20px 14px; }

/* ── arrive ───────────────────────────────────────────────────────── */

.arrive { display: grid; gap: 18px; }
.arrive__caption { font-family: var(--mono); font-size: 0.875rem; color: var(--tone); }
.arrive__text { font-family: var(--mono); font-size: clamp(1.25rem, 3.3vw, 2.6rem); line-height: 1.25; word-break: break-word; min-height: 2.6em; }
.arrive__text span { color: var(--sealed); transition: color 0.25s; }
.arrive__text span.is-open { color: var(--safe); }
.arrive__state { font-family: var(--mono); color: var(--safe); min-height: 1.6em; }
.order { display: grid; gap: 18px; margin-top: clamp(12px, 4vh, 40px); opacity: 0; transform: translateY(14px); transition: opacity 0.5s, transform 0.5s; }
.order.is-on { opacity: 1; transform: none; }
.order__row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── foot ─────────────────────────────────────────────────────────── */

.foot {
  padding: 40px clamp(18px, 5vw, 72px) 60px var(--gutter);
  border-top: 1px solid var(--line); display: grid; gap: 16px; color: var(--ink-3); font-size: 0.9rem;
}
.foot img { width: 124px; opacity: 0.8; }
.foot p { max-width: 70ch; }

/* ── small screens ────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .nav a:not(.nav__cta) { display: none; }
  .seal, .node, .seized { grid-template-columns: minmax(0, 1fr); }
  .node__device { max-width: 190px; }
  .suite li { grid-template-columns: minmax(0, 1fr); }
  .scene { height: 260vh; }
  .wire__packet span { display: none; }
  .gateways { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .gateway { padding: 9px 12px; }
  .seal__facts .h2 { font-size: 1.6rem; }
  .shield__copy .lede { font-size: 1rem; }
}

@media (max-height: 760px) and (min-width: 861px) {
  .shield__map > svg { max-height: 36vh; }
}

/* ── less motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cipher__reel, .cipher::after, .lock.is-shake { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
