:root {
  --bg: #100e0c;
  --ink: #f4efe6;
  --muted: #a3998e;
  --dim: #6f675e;
  --line: rgba(244, 239, 230, 0.16);
  --signal: #ef9a55;
  --signal-deep: #c46a32;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(880px 460px at 78% 8%, rgba(239, 154, 85, 0.14), transparent 58%),
    var(--bg);
  font-family: Fraunces, "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  font-weight: 500;
  font-optical-sizing: auto;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--signal);
  color: #1a100a;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--signal); }

.mono {
  font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 400;
}

.wrap {
  width: min(1120px, calc(100% - 2.4rem));
  margin-inline: auto;
}

.bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.15rem 0 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bar .grow { margin-left: auto; }

.lamp {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0.55rem var(--signal);
  animation: pulse 4.2s steps(1, end) infinite;
}

.hero { padding: 7.5vh 0 0; }

.kicker {
  margin: 0 0 1.4rem;
  color: var(--signal);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3.6rem, 12.4vw, 9.6rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.8;
}

h1 em {
  font-style: italic;
  font-weight: 480;
  color: var(--signal);
}

.lede,
.prose {
  max-width: 38rem;
}

.lede {
  margin: 2.2rem 0 0;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.prose {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.55;
}

.scope {
  margin: 3.2rem 0 0;
}

.scope svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.baseline {
  fill: none;
  stroke: rgba(244, 239, 230, 0.18);
  stroke-width: 1;
}

.trace,
.spike {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.trace {
  stroke: rgba(244, 239, 230, 0.78);
  animation: draw 1.8s cubic-bezier(0.22, 0.8, 0.3, 1) forwards;
}

.spike {
  stroke: var(--signal);
  stroke-width: 2.25;
  animation: draw 0.7s cubic-bezier(0.22, 0.8, 0.3, 1) 1.45s forwards;
}

.trace.after {
  animation-delay: 2s;
  animation-duration: 1.35s;
}

.gridline {
  stroke: rgba(244, 239, 230, 0.06);
  stroke-width: 1;
}

.scope text {
  fill: var(--dim);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.14em;
}

.phases {
  display: grid;
  grid-template-columns: 1.15fr 0.7fr 1.15fr;
  gap: 1rem;
  margin-top: 0.55rem;
  color: var(--dim);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.phases span:nth-child(2) { text-align: center; color: var(--signal); }
.phases span:nth-child(3) { text-align: right; }

.defs {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.4rem;
  margin: 4.2rem 0 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--line);
}

.defs h2 {
  margin: 0.4rem 0 0.55rem;
  font-size: clamp(1.7rem, 2.4vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.defs p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.num {
  color: var(--signal);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.close {
  margin-top: 4.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  max-width: 40rem;
}

.close .aside {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 480;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.close p { margin: 1rem 0 0; color: var(--muted); font-size: 1.08rem; }

.last {
  margin-top: 1.6rem;
  color: var(--ink);
  font-style: italic;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 5rem;
  padding: 1rem 0 1.4rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quiet {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.quiet main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vh 0;
}

.quiet h1 {
  font-size: clamp(3.2rem, 8vw, 6.4rem);
}

.quiet .back {
  margin-top: 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

@keyframes pulse {
  0%, 68% { opacity: 1; }
  69%, 100% { opacity: 0.28; }
}

@media (max-width: 800px) {
  .hero { padding-top: 3.2rem; }
  .defs, .phases { grid-template-columns: 1fr; }
  .phases span:nth-child(2),
  .phases span:nth-child(3) { text-align: left; }
  .foot { flex-direction: column; }
  .bar .domain { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .trace, .spike, .lamp { animation: none; }
  .trace, .spike { stroke-dashoffset: 0; }
}
