/* Prometheus Pantheon site: terminal-phosphor brand from the banner. Single dark look by choice.
   Shared by Home, Lore and Proposal; the Generator keeps its own inline styles with the same tokens. */
:root {
  --bg: #040705;
  --surface: #09110b;
  --raise: #0e1a11;
  --line: #1b2f20;
  --fg: #d6f0d9;
  --muted: #8aa88f;
  --flame: #8dffa6;
  --flame-dim: #3f9a58;
  --font-display: "VT323", "IBM Plex Mono", ui-monospace, monospace;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: var(--flame); }
:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; font-weight: 400; margin: 0; }
p { margin: 0; }

/* Navigation */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--bg);
}
.site-nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: rgba(4, 7, 5, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav__in {
  max-width: 1040px; margin: 0 auto;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.site-nav__brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 24px; line-height: 1; color: var(--flame);
  text-decoration: none; text-shadow: 0 0 10px rgba(141, 255, 166, .35);
}
.site-nav__brand img { border-radius: 50%; display: block; }
.site-nav__links { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.site-nav__links a {
  font-family: var(--font-mono); font-size: 13px; color: var(--muted); text-decoration: none;
  padding-block: 4px;
}
.site-nav__links a:hover, .site-nav__links a[aria-current="page"] { color: var(--flame); }
.site-nav__links .site-nav__cta {
  color: var(--bg); background: var(--flame); border-radius: 999px; padding: 4px 12px;
}
.site-nav__links .site-nav__cta:hover { color: var(--bg); }
@media (max-width: 560px) { .site-nav__brand span { display: none; } }

/* Page frame */
.page {
  max-width: 1040px; margin: 0 auto;
  padding-block: 40px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 72px;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: .14em; color: var(--flame-dim);
}
.section-head { display: grid; gap: 8px; margin-bottom: 24px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(36px, 5vw, 48px); line-height: 1; }
.section-head p { color: var(--muted); max-width: 62ch; }
.lede { font-size: 19px; max-width: 60ch; }
.muted { color: var(--muted); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  font-family: var(--font-mono); font-size: 14px; padding: 10px 16px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--raise); color: var(--fg); text-decoration: none;
}
.btn:hover { border-color: var(--flame-dim); }
.btn--primary {
  font-family: var(--font-display); font-size: 24px; line-height: 1; padding: 12px 18px;
  color: var(--flame); background: transparent; border-color: var(--flame);
  text-shadow: 0 0 10px rgba(141, 255, 166, .4);
}
.btn--primary:hover { background: rgba(141, 255, 166, .08); }

/* Home hero */
.home-hero { display: grid; gap: 24px; justify-items: center; text-align: center; }
.home-hero__banner { width: 100%; max-width: 820px; }
.home-hero__banner img {
  display: block; width: 100%; height: auto; mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent), linear-gradient(transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent), linear-gradient(transparent, #000 10%, #000 90%, transparent);
  mask-composite: intersect;
}
.home-hero__law {
  font-family: var(--font-display); font-size: clamp(30px, 5vw, 46px); line-height: 1.05; color: var(--flame);
  text-shadow: 0 0 18px rgba(141, 255, 166, .35);
}
.home-hero .lede { margin-inline: auto; }
.home-hero .btn-row { justify-content: center; }

/* Story beats */
.beats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.beat { display: grid; gap: 8px; align-content: start; border-top: 1px solid var(--line); padding-top: 16px; }
.beat h3 { font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--flame); }
.beat p { color: var(--muted); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px;
  display: grid; gap: 8px; align-content: start;
}
.step__num { font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--flame); }
.step h3 { font-weight: 600; font-size: 18px; }
.step p { color: var(--muted); font-size: 16px; }
.hands {
  margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.hand { border-left: 2px solid var(--flame-dim); padding-left: 16px; display: grid; gap: 4px; }
.hand strong { font-family: var(--font-display); font-size: 26px; font-weight: 400; color: var(--flame); line-height: 1; }
.hand span { color: var(--muted); }

/* Hyperstition loop */
.loop { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: loop; }
.loop li {
  list-style: none; position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 18px;
  display: grid; gap: 6px; align-content: start; min-width: 0;
}
.loop li strong { font-family: var(--font-display); font-size: 28px; font-weight: 400; line-height: 1; color: var(--flame); }
.loop li span { color: var(--muted); font-size: 15px; }
.loop li:not(:last-child)::after {
  content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%);
  color: var(--flame-dim); font-family: var(--font-mono); background: var(--bg); padding: 0 1px;
}
.loop-return { margin-top: 12px; font-family: var(--font-mono); font-size: 13px; color: var(--flame-dim); }
.loop { padding: 0; margin: 0; }

/* Law */
.law { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 32px; padding: 0; margin: 0; }
.law li { list-style: none; display: grid; gap: 4px; }
.law li strong { font-weight: 600; }
.law li span { color: var(--muted); }

/* Callout */
.callout {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px;
  display: grid; gap: 14px;
}
.callout h3 { font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--flame); }
.ca { font-family: var(--font-mono); font-size: 13px; word-break: break-all; color: var(--fg); }

/* Prose pages rendered from Markdown */
.prose { max-width: 68ch; display: grid; gap: 18px; }
.prose h1 { font-family: var(--font-display); font-size: clamp(42px, 7vw, 64px); line-height: .95; color: var(--flame); text-shadow: 0 0 18px rgba(141, 255, 166, .3); }
.prose h2 { font-family: var(--font-display); font-size: 36px; line-height: 1; margin-top: 18px; }
.prose h3 { font-weight: 600; font-size: 19px; margin-top: 8px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.prose li::marker { color: var(--flame-dim); }
.prose blockquote {
  margin: 0; padding: 14px 18px; border-left: 2px solid var(--flame);
  font-family: var(--font-display); font-size: 28px; line-height: 1.15; color: var(--flame);
}
.prose hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 8px 0; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--raise); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.prose em { color: var(--muted); }
.prose--poem p { font-size: 19px; line-height: 1.7; }
.prose--poem blockquote { font-size: 32px; }
.chapter-mark { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--flame-dim); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); }
.site-foot__in {
  max-width: 1040px; margin: 0 auto;
  padding-block: 24px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 6px; color: var(--muted); font-size: 14px;
}
.site-foot code { font-family: var(--font-mono); font-size: 12px; color: var(--fg); word-break: break-all; }

@media (max-width: 760px) {
  .loop { grid-template-columns: 1fr; }
  .loop li:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -13px; transform: translateX(-50%); }
  .hands { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --- Atmosphere: the logo's '#' field, CRT scanlines, rising embers, phosphor flicker --- */
body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(60, 200, 100, .10), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='28'%3E%3Ctext x='6' y='19' font-family='monospace' font-size='14' fill='%238dffa6' fill-opacity='0.045'%3E%23%3C/text%3E%3C/svg%3E");
  background-attachment: fixed, scroll;
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 30;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, .45) 100%);
}
.home-hero { position: relative; padding-block: 24px 8px; }
.home-hero > :not(.fire) { position: relative; z-index: 1; }
.fire {
  position: absolute; z-index: 0; left: 50%; transform: translateX(-50%);
  top: -40px; width: min(1100px, 100vw); height: calc(100% + 80px);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at 50% 70%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 70%, #000 30%, transparent 75%);
}
@keyframes phosphor {
  0%, 100% { opacity: 1; text-shadow: 0 0 18px rgba(141, 255, 166, .35); }
  47% { opacity: 1; }
  48% { opacity: .82; text-shadow: 0 0 26px rgba(141, 255, 166, .55); }
  50% { opacity: 1; }
  80% { text-shadow: 0 0 22px rgba(141, 255, 166, .45); }
}
.home-hero__law { animation: phosphor 6s infinite; }
.section-head h2::after {
  content: "_"; color: var(--flame); margin-left: 4px; animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.step, .callout, .loop li { transition: border-color .2s, box-shadow .2s; }
.step:hover, .loop li:hover { border-color: var(--flame-dim); box-shadow: 0 0 30px rgba(141, 255, 166, .08); }
.step__num { text-shadow: 0 0 12px rgba(141, 255, 166, .4); }
.home-hero h1.home-hero__law { font-weight: 400; }
