/* Cyber Hopes: "a calm network at night" */

@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/instrument-serif-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/instrument-serif-italic.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("fonts/instrument-sans-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("fonts/jetbrains-mono-normal.woff2") format("woff2"); }

:root {
  --night-0: #05080f;
  --night-1: #070b16;
  --night-2: #0c1324;
  --night-3: #121b33;
  --line: rgba(160, 180, 230, 0.12);
  --line-strong: rgba(160, 180, 230, 0.24);
  --ink: #e9edf7;
  --ink-2: #b7bfd6;
  --muted: #7c86a3;
  --amber: #ffb547;
  --amber-soft: rgba(255, 181, 71, 0.16);
  --sky: #8fb8ff;
  --ok: #7be0a8;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --maxw: 1180px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night-1);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* the night continues below the hero: a sparse, fixed dusting of stars */
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(233,237,247,.35), transparent 60%),
    radial-gradient(1px 1px at 67% 9%, rgba(233,237,247,.25), transparent 60%),
    radial-gradient(1.2px 1.2px at 84% 41%, rgba(255,181,71,.35), transparent 60%),
    radial-gradient(1px 1px at 33% 57%, rgba(233,237,247,.22), transparent 60%),
    radial-gradient(1px 1px at 91% 77%, rgba(233,237,247,.28), transparent 60%),
    radial-gradient(1px 1px at 6% 88%, rgba(233,237,247,.2), transparent 60%),
    radial-gradient(1px 1px at 52% 94%, rgba(143,184,255,.3), transparent 60%);
  background-size: 640px 640px;
  background-attachment: fixed;
}
/* faint film grain over everything, for atmosphere */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--amber); color: var(--night-0); }
a { color: inherit; }
em { font-style: italic; }
.mono { font-family: var(--mono); }
.dim { color: var(--muted); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 8px 14px; background: var(--amber); color: var(--night-0);
  font: 500 14px var(--mono); border-radius: 6px; text-decoration: none;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  background: linear-gradient(var(--night-1) 0%, rgba(7, 11, 22, 0.7) 60%, transparent);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  font: 500 13px/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase;
}
/* the mark is a tiny Feynman diagram: e⁻ e⁺ → γ */
.wordmark svg { width: 24px; height: 24px; fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.wordmark svg .photon { stroke: var(--amber); }
.wordmark svg .arrow { fill: var(--ink-2); stroke: none; }
.wordmark:hover svg .photon { animation: wiggle 0.9s ease-in-out; }
@keyframes wiggle { 50% { transform: translateX(1px); } }
.pill {
  margin: 0; display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 999px;
  font: 400 12px/1 var(--mono); color: var(--ink-2);
  background: rgba(12, 19, 36, 0.6); backdrop-filter: blur(8px);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(123, 224, 168, 0.6);
  animation: beacon 2.6s ease-out infinite;
}
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(123, 224, 168, 0.55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(123, 224, 168, 0); } }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; align-items: end;
  padding: 120px var(--gutter) clamp(96px, 14vh, 150px);
  background:
    radial-gradient(1200px 700px at 78% 12%, rgba(143, 184, 255, 0.10), transparent 60%),
    radial-gradient(900px 600px at 10% 100%, rgba(255, 181, 71, 0.07), transparent 60%),
    linear-gradient(180deg, var(--night-0) 0%, var(--night-2) 62%, var(--night-1) 100%);
  overflow: hidden;
  isolation: isolate;
}
#sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-copy { max-width: 920px; position: relative; }
/* a soft pool of darkness behind the text so the network never fights the headline */
.hero-copy::before {
  content: ""; position: absolute; inset: -12% -18% -18% -14%; z-index: -1;
  background: radial-gradient(closest-side, rgba(5, 8, 15, 0.78), transparent);
  pointer-events: none;
}
.eyebrow {
  margin: 0 0 22px; font: 400 12.5px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  opacity: 0; animation: rise 1s var(--ease) 0.15s forwards;
}
h1 {
  margin: 0; font: 400 clamp(54px, 10.4vw, 150px)/0.94 var(--serif); letter-spacing: -0.02em;
}
h1 .line { display: block; padding-bottom: 0.06em; }
h1 .line > span { display: inline-block; opacity: 0; transform: translateY(0.35em); filter: blur(6px); animation: lift 1.3s var(--ease) forwards; }
h1 .line:nth-child(2) > span { animation-delay: 0.12s; }
h1 em { color: var(--amber); text-shadow: 0 0 42px rgba(255, 181, 71, 0.45); }
.lede {
  max-width: 540px; margin: 30px 0 0; font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2);
  opacity: 0; animation: rise 1s var(--ease) 0.55s forwards;
}
.figure-note {
  position: absolute; left: var(--gutter); bottom: 30px; margin: 0;
  font: 400 11.5px/1 var(--mono); color: var(--muted); letter-spacing: 0.04em;
  opacity: 0; animation: rise 1s var(--ease) 0.9s forwards;
}
.scroll-cue {
  position: absolute; right: var(--gutter); bottom: 26px;
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  font: 400 11.5px/1 var(--mono); color: var(--muted); text-decoration: none; letter-spacing: 0.12em;
  opacity: 0; animation: rise 1s var(--ease) 1s forwards;
}
.scroll-cue span { animation: bob 2.4s ease-in-out infinite; color: var(--amber); }
@keyframes lift { to { opacity: 1; transform: none; filter: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes bob { 50% { transform: translateY(5px); } }

/* ---------- sections ---------- */
main > section:not(.hero) {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(96px, 14vw, 170px) var(--gutter) 0;
}
.section-head {
  display: grid; grid-template-columns: 90px 1fr; column-gap: 24px; align-items: baseline;
  margin-bottom: clamp(44px, 6vw, 72px);
}
.kicker { margin: 0; font: 400 12px var(--mono); color: var(--amber); letter-spacing: 0.08em; }
h2 { margin: 0; font: 400 clamp(40px, 6vw, 76px)/1 var(--serif); letter-spacing: -0.015em; }
h2 em { color: var(--ink-2); }
.aside { grid-column: 2; max-width: 520px; margin: 18px 0 0; color: var(--muted); }

/* rules */
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); }
.rule-list li {
  position: relative;
  display: grid; grid-template-columns: 90px 1fr; column-gap: 24px;
  padding: 34px 36px 40px 0;
  border-bottom: 1px solid var(--line);
}
.rule-list li:nth-child(odd) { border-right: 1px solid var(--line); }
.rule-list li:nth-child(even) { padding-left: 36px; }
.rule-list .num { font: italic 400 44px/1 var(--serif); color: var(--amber); opacity: 0.9; }
.rule-list h3 { margin: 4px 0 10px; font: 500 21px/1.25 var(--sans); letter-spacing: -0.01em; grid-column: 2; }
.rule-list p { margin: 0; color: var(--muted); grid-column: 2; }
.rule-list li::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 0;
  background: linear-gradient(90deg, var(--amber), transparent);
  transition: width 0.8s var(--ease);
}
.rule-list li:hover::after { width: 100%; }

/* epigraph */
.epigraph { margin: clamp(64px, 9vw, 110px) 0 0 114px; max-width: 760px; }
.epigraph .squiggle { width: 120px; height: 12px; display: block; margin-bottom: 26px; fill: none; stroke: var(--amber); stroke-width: 1.2; opacity: 0.8; }
.epigraph blockquote { margin: 0; }
.epigraph p { margin: 0; font: italic 400 clamp(26px, 3.3vw, 40px)/1.2 var(--serif); color: var(--ink-2); letter-spacing: -0.005em; }
.epigraph p::before { content: "\201C"; color: var(--amber); }
.epigraph p::after { content: "\201D"; color: var(--amber); }
.epigraph figcaption { margin-top: 18px; font: 400 12px var(--mono); color: var(--muted); letter-spacing: 0.08em; }

/* strata */
.strata { margin: 0; }
.strata ul { list-style: none; margin: 0; padding: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.strata li {
  --tone: 0;
  position: relative;
  display: grid; grid-template-columns: minmax(150px, 230px) 1fr; align-items: center; gap: 24px;
  padding: 0 28px; min-height: 62px;
  background: rgb(calc(12 + var(--tone) * 3) calc(19 + var(--tone) * 3) calc(36 + var(--tone) * 4));
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  transition: min-height 0.5s var(--ease), background-color 0.4s;
}
.strata li:nth-child(1) { --tone: 7; }
.strata li:nth-child(2) { --tone: 6; }
.strata li:nth-child(3) { --tone: 5; }
.strata li:nth-child(4) { --tone: 4; }
.strata li:nth-child(5) { --tone: 3; }
.strata li:nth-child(6) { --tone: 2; }
.strata li:nth-child(7) { --tone: 1; }
.strata li:nth-child(8) { --tone: 0; }
.strata li::before {
  /* a thin contour line through each stratum, like a geological section */
  content: ""; position: absolute; inset: auto 0 0 0; height: 18px; opacity: 0.35;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='18'%3E%3Cpath d='M0 12 C40 4 80 16 120 9 S200 4 240 12' fill='none' stroke='%238fb8ff' stroke-opacity='.35'/%3E%3C/svg%3E") repeat-x;
  pointer-events: none;
}
.strata .label { font: 500 13px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.strata .desc { color: var(--muted); transition: color 0.4s; }
.strata li:hover { min-height: 86px; background-color: #1a2647; }
.strata li:hover .desc { color: var(--ink); }
.strata li:hover .label { color: var(--amber); }
.strata figcaption, .figure-caption { margin-top: 14px; font: 400 11.5px var(--mono); color: var(--muted); text-align: right; }

/* status */
.panel {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.tile { background: var(--night-2); padding: 22px 22px 24px; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; }
.tile.wide { grid-column: 1 / -1; min-height: 150px; }
.t-label { margin: 0; font: 400 11.5px var(--mono); color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 12px; }
.t-label .mono { text-transform: none; letter-spacing: 0; }
.t-value { margin: 14px 0 0; font: 400 30px/1 var(--serif); font-variant-numeric: tabular-nums; }
.t-value.mono { font: 400 22px/1 var(--mono); }
.t-value.ok { display: flex; align-items: center; gap: 10px; color: var(--ok); }
#spark { width: 100%; height: 70px; margin-top: 16px; display: block; }

/* footer */
.footer {
  max-width: var(--maxw); margin: clamp(110px, 14vw, 170px) auto 0;
  padding: 28px var(--gutter) 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-2);
}
.footer p { margin: 0; }
.footer .mono { font-size: 12px; }
.footer .sep { color: var(--muted); margin: 0 4px; }
/* the address is drawn as pixels so it can be read but not scraped, clicked or copied */
.mail { height: 15px; width: 0; vertical-align: -2px; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.strata .reveal { transform: translateX(-14px); }
.strata .reveal.in { transform: none; }
.strata li:nth-child(2) { transition-delay: 0.05s; }
.strata li:nth-child(3) { transition-delay: 0.1s; }
.strata li:nth-child(4) { transition-delay: 0.15s; }
.strata li:nth-child(5) { transition-delay: 0.2s; }
.strata li:nth-child(6) { transition-delay: 0.25s; }
.strata li:nth-child(7) { transition-delay: 0.3s; }
.strata li:nth-child(8) { transition-delay: 0.35s; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .rule-list { grid-template-columns: 1fr; }
  .rule-list li, .rule-list li:nth-child(odd), .rule-list li:nth-child(even) { padding: 28px 0 32px; border-right: 0; }
  .panel { grid-template-columns: repeat(2, 1fr); }
  .tile:nth-child(5) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.12em; }
  h1 { font-size: clamp(54px, 16vw, 72px); }
  .section-head { grid-template-columns: 1fr; }
  .section-head .kicker { margin-bottom: 14px; }
  .aside { grid-column: 1; }
  .rule-list li { grid-template-columns: 56px 1fr; column-gap: 14px; }
  .rule-list .num { font-size: 34px; }
  .epigraph { margin-left: 0; }
  .rule-list h3 { font-size: 19px; }
  .strata li { grid-template-columns: 1fr; gap: 4px; padding: 14px 18px; min-height: 0; }
  .strata li:hover { min-height: 0; }
  .figure-note { display: none; }
  .pill { font-size: 11px; padding: 6px 10px; }
  .wordmark span { letter-spacing: 0.16em; }
  .t-value.mono { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-delay: 0s !important; transition-duration: 0.001s !important; }
  .reveal { opacity: 1; transform: none; }
}
