/* Magic Lamp — one dark room, one source of light.
   Flat ink + grain; typography and light carry everything.
   No cards, no chips, no borders-as-decoration, no gradient washes. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink: #0e0c09;
  --ink-deep: #090806;
  --text: #ece4d3;
  --dim: #8a8071;   /* body prose: ≥4.5:1 on --ink */
  --faint: #5d564a; /* decorative/secondary chrome only */
  --flame: #e8a13d;
  --brass: #a8803c;
  --ember: #b4502e;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --mono: "Plex Mono", "SFMono-Regular", Menlo, monospace;
  --measure: 64ch;
}

* { box-sizing: border-box; margin: 0; }

html {
  background: var(--ink);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 360;
  font-size: clamp(17px, 1.25vw, 19px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(232, 161, 61, 0.28); }

/* film grain: one tiny SVG turbulence tile, fixed, never interactive */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 40;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

.mono-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.mono-link:hover { color: var(--flame); border-color: var(--brass); }

.mono-still {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--dim);
}

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 2.2rem;
}

/* ====================== hero ====================== */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(3rem, 8vh, 6rem) 1.5rem 4rem;
  position: relative;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 45% at 50% 38%,
              rgba(232, 161, 61, 0.10), rgba(232, 161, 61, 0.025) 55%, transparent 75%);
}

.lamp {
  width: clamp(150px, 22vw, 230px);
  height: auto;
  margin-bottom: 1.2rem;
  position: relative;
}
.lamp-line {
  stroke: var(--brass);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.lamp-flame {
  stroke: var(--flame);
  stroke-width: 1.6;
  stroke-linecap: round;
  fill: rgba(232, 161, 61, 0.10);
  filter: drop-shadow(0 0 8px rgba(232, 161, 61, 0.5));
}

.wordmark {
  font-family: var(--serif);
  font-weight: 340;
  font-size: clamp(2.9rem, 9vw, 6.6rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--text);
}

.tagline {
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 1.9vw, 1.35rem);
  color: var(--dim);
}
.tagline em { font-style: italic; color: var(--text); }

/* the wish line */
.wish {
  margin-top: clamp(2.4rem, 6vh, 4rem);
  font-family: var(--mono);
  font-size: clamp(0.82rem, 1.7vw, 1.02rem);
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wish-label { color: var(--brass); margin-right: 0.7em; }
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--flame);
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* run log */
.runlog {
  margin-top: 2rem;
  list-style: none;
  padding: 0;
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1.35vw, 0.84rem);
  line-height: 2.05;
  color: var(--dim);
  text-align: left;
}
.runlog { color: var(--dim); }
.runlog .r { color: var(--dim); }
.runlog li.lit { color: var(--text); }
.runlog li.lit .r { color: var(--dim); }
.runlog li.again { color: var(--flame); letter-spacing: 0.14em; }

.runlog-note, .artifact-note {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin-top: 1.6rem;
}
.artifact-note { margin-top: 3.5rem; }

.hero-sub {
  margin-top: clamp(2.2rem, 5vh, 3.4rem);
  max-width: 46ch;
  color: var(--dim);
  font-size: 0.98rem;
}

.scroll-cue {
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

/* ====================== sections ====================== */

main section {
  padding: clamp(7rem, 16vh, 12rem) 1.5rem 0;
  max-width: 56rem;
  margin: 0 auto;
}

.manifesto {
  font-weight: 320;
  font-size: clamp(1.7rem, 4.4vw, 3.2rem);
  line-height: 1.22;
  letter-spacing: 0.005em;
  max-width: 24ch;
}
.manifesto .line { display: block; }
.manifesto .line + .line { color: var(--flame); }

.prose {
  margin-top: 2.6rem;
  max-width: var(--measure);
  color: var(--dim);
}
.prose p + p { margin-top: 1.3em; }
.prose em { color: var(--text); }

/* ====================== the loop ====================== */

.loop { max-width: 72rem; }

.loop-title {
  font-weight: 320;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  max-width: 22ch;
}

.loop-stage-wrap {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  margin-top: 4rem;
}

.astrolabe {
  width: 100%;
  max-width: 420px;
  position: sticky;
  top: 14vh;
}
.ring { stroke: var(--faint); stroke-width: 1; }
.ring-inner { stroke: rgba(77, 71, 61, 0.5); stroke-dasharray: 2 6; }
.ticks line { stroke: var(--brass); stroke-width: 1.4; }
.ticks text {
  fill: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ticks .on line { stroke: var(--flame); }
.ticks .on text { fill: var(--flame); }
.ring-marker {
  stroke: var(--flame);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(232, 161, 61, 0.55));
}
.ring-count {
  fill: var(--text);
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 300;
}

.stages {
  list-style: none;
  padding: 0;
  max-width: 52ch;
}
.stage { padding: clamp(3rem, 12vh, 7rem) 0; }
.stage-no {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.1rem;
}
.stage h3 {
  font-weight: 380;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.25;
}
.stage p { color: var(--dim); margin-top: 1rem; max-width: 48ch; }
.stage h3 + p { margin-top: 1.2rem; }
.stage .artifact {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-top: 1.6rem;
}

/* budget reallocation: data-ink lines, not boxes */
.artifact .bar {
  display: block;
  margin-top: 0.9em;
  position: relative;
  padding-top: 0.2em;
}
.artifact .bar i {
  font-style: normal;
  color: var(--dim);
  font-size: 0.92em;
}
.artifact .bar::before {
  content: "";
  display: block;
  width: var(--w);
  height: 2px;
  background: var(--flame);
  margin-bottom: 0.45em;
  box-shadow: 0 0 6px rgba(232, 161, 61, 0.4);
}
.artifact .bar-dead::before { background: var(--ember); box-shadow: none; opacity: 0.6; }
.artifact .bar-dead i { color: var(--faint); text-decoration: line-through; }

/* ====================== the search tree ====================== */
/* one campaign drawn as smoke splitting: explosion, pruning, the walk */

.thesis { max-width: 72rem; }

.tree { margin: 4rem 0 0; }
.tree-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tree svg { width: 100%; min-width: 700px; display: block; }

.tree .t-branch { stroke: var(--brass); stroke-width: 1.4; }
.tree .t-dot { fill: var(--brass); }
.tree text {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  fill: var(--dim);
}

.t-win .t-branch { stroke: var(--flame); stroke-width: 1.8; }
.t-win .t-dot { fill: var(--flame); }
.tree .t-win .t-label { fill: var(--flame); }

.t-dead { opacity: 0.35; }
.tree .t-dead .t-label { fill: var(--faint); }
.t-strike { stroke: var(--faint); stroke-width: 1; }

.t-tail { stroke: var(--flame); stroke-width: 1.4; stroke-dasharray: 2 6; opacity: 0.6; }
.tree .t-again { fill: var(--flame); }

.tree .t-rounds text {
  fill: var(--faint);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.t-wish circle {
  fill: var(--flame);
  filter: drop-shadow(0 0 6px rgba(232, 161, 61, 0.55));
}
.tree .t-wish text { fill: var(--brass); letter-spacing: 0.16em; }

.tree .artifact-note { margin-top: 1.6rem; }

/* ====================== thesis / wedge / cta ====================== */

.wedge h2, .cta h2 {
  font-weight: 320;
  font-size: clamp(1.9rem, 4.6vw, 3.2rem);
}

.cta { text-align: center; padding-bottom: 0; }
.three-wishes {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--dim);
  max-width: 44ch;
  margin: 0 auto 4.5rem;
}
.three-wishes em { color: var(--text); }
.cta h2 { margin-top: 0; }
.prose-center { color: var(--dim); margin: 1.6rem auto 0; max-width: 44ch; }
.cta-line { margin-top: 2.6rem; }

/* ====================== footer ====================== */

.footer {
  margin-top: clamp(7rem, 16vh, 12rem);
  padding: 3rem 1.5rem 3.4rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.foot-mark { color: var(--brass); }
.footer .mono-link { font-size: inherit; }

/* ====================== motion guards ====================== */

.js .reveal { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 900px) {
  .loop-stage-wrap { grid-template-columns: 1fr; }
  .astrolabe { position: static; max-width: 320px; margin: 0 auto; }
  .stage { padding: 2.6rem 0; }
  .wish {
    font-size: 0.72rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: 30ch;
    line-height: 1.9;
  }
}
