* {
  box-sizing: border-box;
}

:root {
  --bg: #0b0d10;
  --panel: #11151a;
  --text: #f5f7fa;
  --muted: #9ca6b3;
  --line: #20262e;
  --accent: #7dd3fc;
  --accent-soft: rgba(125, 211, 252, 0.12);
  --gutter: clamp(1.25rem, 3.5vw, 3.5rem);
  --band: 100%;
  /* 19.2px = 120% of the usual 16px root */
  font-size: 19.2px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 48% 42% at 0% 12%, rgba(125, 211, 252, 0.14), transparent 60%),
    radial-gradient(ellipse 42% 38% at 100% 8%, rgba(125, 211, 252, 0.1), transparent 58%),
    radial-gradient(ellipse 40% 36% at 100% 85%, rgba(148, 163, 184, 0.07), transparent 55%),
    radial-gradient(ellipse 36% 32% at 0% 90%, rgba(125, 211, 252, 0.05), transparent 55%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, #0c0f13 0%, #090b0e 48%, #080a0d 100%);
  background-size:
    auto,
    auto,
    auto,
    auto,
    3.5rem 3.5rem,
    3.5rem 3.5rem,
    auto;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(125, 211, 252, 0.045), transparent 18%, transparent 82%, rgba(125, 211, 252, 0.045)),
    radial-gradient(circle at 50% 0%, transparent 42%, rgba(8, 10, 13, 0.45) 100%);
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 58rem; /* ~1110px at 19.2px root — closer to a 120% zoom frame */
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.topbar {
  height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.125rem;
}

.mark {
  width: 2.1rem;
  height: 2.1rem;
  display: block;
  border-radius: 0.4rem;
  object-fit: cover;
  flex-shrink: 0;
}

.contact-link {
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 160ms ease;
}

.contact-link:hover {
  color: var(--text);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(14rem, 0.75fr);
  gap: clamp(2rem, 4vw, 4.5rem);
  align-items: start;
  padding: 0.85rem 0 3.5rem;
  overflow: visible;
}

.hero-logo {
  position: absolute;
  right: 0;
  bottom: 0.5rem;
  width: 12rem; /* 13.3rem * 0.9 */
  height: auto;
  border-radius: 1.15rem;
  pointer-events: none;
}

.hero-copy {
  max-width: 34rem;
  overflow: visible;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(125, 211, 252, 0.2);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font: 600 0.75rem/1 JetBrains Mono, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0.85rem 0 1rem;
  font-size: clamp(3rem, 6.5vw, 5.25rem);
  line-height: 0.93;
  letter-spacing: -0.065em;
  font-weight: 700;
}

h1 .line {
  display: block;
}

h1 .line.accent {
  color: #9aa5b1;
}

.lead {
  margin: 0;
  color: #bcc5cf;
  font-size: clamp(1.125rem, 1.7vw, 1.5rem);
  line-height: 1.5;
  letter-spacing: -0.025em;
}

.actions {
  margin-top: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.primary {
  padding: 0.8rem 1.125rem;
  border-radius: 0.55rem;
  background: var(--text);
  color: #0b0d10;
  font-weight: 700;
  font-size: 0.875rem;
  transition: transform 150ms ease, opacity 150ms ease;
}

.primary:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.status {
  color: #7f8a97;
  font-size: 0.8rem;
}

.hero-rail {
  position: relative;
  padding: 0.25rem 1.25rem 1.25rem 1.5rem;
  border-left: 1px solid rgba(125, 211, 252, 0.18);
  background:
    linear-gradient(180deg, rgba(125, 211, 252, 0.045), rgba(255, 255, 255, 0.012));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hero-rail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -1px;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(125, 211, 252, 0.55) 18%,
    rgba(125, 211, 252, 0.55) 82%,
    transparent 100%
  );
}

.rail-label {
  margin-bottom: 0.9rem;
  color: var(--accent);
  font: 600 0.7rem/1 JetBrains Mono, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rail-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.rail-flow li {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  color: #d8dee6;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.35;
  opacity: 0;
  transform: translateX(0.5rem);
  animation: rail-in 520ms ease forwards;
}

.rail-flow li:nth-child(1) { animation-delay: 40ms; }
.rail-flow li:nth-child(2) { animation-delay: 90ms; }
.rail-flow li:nth-child(3) { animation-delay: 140ms; }
.rail-flow li:nth-child(4) { animation-delay: 190ms; }
.rail-flow li:nth-child(5) { animation-delay: 240ms; }
.rail-flow li:nth-child(6) { animation-delay: 290ms; }
.rail-flow li:nth-child(7) { animation-delay: 340ms; }
.rail-flow li:nth-child(8) { animation-delay: 390ms; }
.rail-flow li:nth-child(9) { animation-delay: 440ms; }
.rail-flow li:nth-child(10) { animation-delay: 490ms; }
.rail-flow li:nth-child(11) { animation-delay: 540ms; }

.rail-flow li span {
  color: #66717d;
  font-size: 0.7rem;
}

.rail-flow li:last-child {
  color: var(--accent);
}

.rail-flow li:last-child span {
  color: rgba(125, 211, 252, 0.7);
}

@keyframes rail-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

footer {
  padding: 1.75rem 0 2.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  color: #626d79;
  font-size: 0.75rem;
  font-family: "JetBrains Mono", monospace;
}

.loop-section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}

.loop-copy {
  max-width: 36rem;
}

.loop-copy h2 {
  margin: 1.1rem 0 1rem;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.loop-copy p {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.65;
}

.loop-copy p + p {
  margin-top: 1rem;
}

.loop-diagram {
  margin-top: 2rem;
  display: block;
  width: var(--band);
  max-width: none;
}

.loop-node {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.9rem 1rem;
  background: rgba(255,255,255,0.02);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  text-align: center;
}

.loop-arrow,
.loop-return {
  text-align: center;
  color: #65717e;
  font-size: 1.25rem;
}

.loop-return {
  color: var(--accent);
  font-size: 1.6rem;
}

.converge {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  color: #cbd3dc;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.converge span {
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  background: var(--accent-soft);
  border: 1px solid rgba(125, 211, 252, 0.16);
}

.converge i {
  color: #59636f;
  font-style: normal;
}

.feedback-example {
  margin-top: 2rem;
  width: var(--band);
  max-width: none;
}

.feedback-example .map-heading {
  margin-top: 1.5rem;
}

.feedback-lead {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: none;
}

.ppa-examples {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.ppa-examples article {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 1rem 1.05rem 1.1rem;
  background: rgba(255, 255, 255, 0.02);
}

.ppa-examples strong {
  display: block;
  margin: 0.45rem 0 0.5rem;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.ppa-examples p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.ppa-examples .ppa-impact {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  color: #d8dee6;
}

.feedback-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
}

.feedback-stages li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.15rem;
}

.feedback-stages li + li {
  border-top: 1px solid var(--line);
}

.feedback-stages strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.feedback-stages p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.map-example {
  margin: 1.15rem 0 0;
  max-width: 42rem;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  color: #d8dee6;
  font: 500 0.8rem/1.55 "JetBrains Mono", monospace;
  white-space: pre;
}

.map-example code {
  font: inherit;
}

.map-comment {
  color: #7a8796;
}

.map-diagram {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  width: var(--band);
  max-width: none;
}

.map-column {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 1.15rem 1.2rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
}

.map-heading {
  margin-bottom: 0.85rem;
  color: var(--accent);
  font: 600 0.7rem/1 JetBrains Mono, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.map-column ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.map-column li {
  color: #d8dee6;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.35;
  padding-left: 0.85rem;
  position: relative;
}

.map-column li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: rgba(125, 211, 252, 0.55);
}

.map-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-width: 4.5rem;
  align-self: stretch;
}

.map-line {
  flex: 1;
  width: 1px;
  min-height: 1.25rem;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(125, 211, 252, 0.45),
    transparent
  );
}

.map-badge {
  flex-shrink: 0;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 0.4rem;
  background: rgba(125, 211, 252, 0.08);
  color: var(--accent);
  font: 600 0.65rem/1 JetBrains Mono, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.negotiate {
  margin-top: 2rem;
  width: var(--band);
  max-width: none;
}

.negotiate-rhythm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: #cbd3dc;
}

.negotiate-rhythm span {
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.negotiate-rhythm span.agree {
  border-color: rgba(125, 211, 252, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.negotiate-rhythm i {
  color: #59636f;
  font-style: normal;
}

.negotiate-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
}

.negotiate-stages li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.15rem;
}

.negotiate-stages li + li {
  border-top: 1px solid var(--line);
}

.stage-index {
  color: #66717d;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  line-height: 1.6;
  padding-top: 0.1rem;
}

.negotiate-stages strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.negotiate-stages p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.tools-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: var(--band);
  max-width: none;
}

.tool-card {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 1.15rem 1.2rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
}

.tool-card strong {
  display: block;
  margin: 0.55rem 0 0.45rem;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.tool-table-wrap {
  margin-top: 1.25rem;
  width: var(--band);
  max-width: none;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.015);
}

.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.tool-table th,
.tool-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.tool-table thead th {
  color: var(--accent);
  font: 600 0.7rem/1.2 JetBrains Mono, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(125, 211, 252, 0.05);
}

.tool-table tbody th {
  color: #d8dee6;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.tool-table td {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.4;
}

.tool-table tr:last-child th,
.tool-table tr:last-child td {
  border-bottom: 0;
}

.tool-table tbody tr:hover th,
.tool-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.formats {
  margin-top: 1.25rem;
  width: var(--band);
  max-width: none;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 1.15rem 1.2rem 1.25rem;
  background: rgba(255, 255, 255, 0.015);
}

.formats ul {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.formats li {
  padding: 0.45rem 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: var(--accent-soft);
  color: #d8dee6;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.3;
}

.formats .mono {
  opacity: 0.85;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0.75rem 0 2.5rem;
    align-items: start;
  }

  .hero-logo {
    position: static;
    width: 8.8rem;
    margin-top: 0.5rem;
    margin-left: auto;
    display: block;
  }

  .hero-rail {
    padding: 1.25rem 0 0;
    border-left: 0;
    border-top: 1px solid rgba(125, 211, 252, 0.18);
    background: none;
  }

  .hero-rail::before {
    inset: -1px 0 auto 0;
    width: auto;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(125, 211, 252, 0.55) 18%,
      rgba(125, 211, 252, 0.55) 82%,
      transparent 100%
    );
  }

  .rail-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.25rem;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 1.1rem;
    font-size: 16px;
  }

  .topbar {
    height: 3.4rem;
  }

  .hero-rail {
    padding: 1.25rem 0 0;
    background: none;
  }

  h1 {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .lead {
    font-size: 1.125rem;
  }

  .rail-flow {
    grid-template-columns: 1fr;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .ppa-examples {
    grid-template-columns: 1fr;
  }

  .tool-table th,
  .tool-table td {
    padding: 0.75rem 0.8rem;
  }

  .tool-table tbody th {
    white-space: normal;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .map-diagram {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .map-bridge {
    flex-direction: row;
    min-width: 0;
    width: 100%;
    gap: 0.75rem;
    padding: 0.15rem 0;
  }

  .map-line {
    width: auto;
    height: 1px;
    min-height: 0;
    flex: 1;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(125, 211, 252, 0.45),
      transparent
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  .rail-flow li {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* Visual diagrams (added on top of full text content) */
.section-split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  margin-bottom: 1.5rem;
  width: var(--band);
}

.viz-panel {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.65rem;
}

.viz-loop,
.viz-wide {
  width: 100%;
  margin-top: 0;
}

.viz-wide {
  margin: 1.5rem 0;
}

.mini-chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.65rem 0 0.85rem;
}

.negotiate {
  margin-top: 0.5rem;
}

.converge {
  width: var(--band);
}

.ppa-examples {
  width: var(--band);
}

@media (max-width: 960px) {
  .section-split {
    grid-template-columns: 1fr;
  }
}
