:root {
  /* Light cool-grey theme */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  
  /* Borders and lines */
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.15);
  
  /* Text */
  --text: #1a1a1e;
  --muted: #6e6e73;
  
  /* Accent Blue (Matching user request R:70 G:153 B:203) */
  --accent: rgb(70, 153, 203);
  --accent-soft: rgba(70, 153, 203, 0.08);
  
  /* Layout */
  --max: 1200px;
  --radius: 12px;
  --nav-height: 80px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Overrides for Serif Headers */
h1, h2, .brand-text, .pipeline-detail-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

img {
  display: block;
  width: 100%;
  height: auto;
}

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

.site-shell {
  padding: 0 24px 64px;
}

@keyframes slideDownHeader {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: min(100%, var(--max));
  min-height: var(--nav-height);
  margin: 0 auto;
  padding: 0 8px;
  background: rgba(244, 245, 247, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--line);
  animation: slideDownHeader 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.8;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-family: "SF Pro Display", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand:hover .brand-mark {
  transform: scale(1.08);
}

.brand-text {
  font-size: 1.2rem;
}

main {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.hero {
  padding: 80px 0 100px;
}

.hero-copy {
  max-width: 800px;
  margin: 0 auto 64px;
  text-align: center;
}

.kicker {
  margin: 0 0 16px;
  color: var(--accent);
  font-family: "SF Pro Display", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1,
.section-intro h2,
.chapter-header h2,
.closing h2,
.system-story-copy h2 {
  margin: 0;
  line-height: 1.15;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
}

.hero-body,
.section-intro p,
.chapter-header p,
.closing p {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
  font-weight: 400;
}

.hero-body {
  max-width: 640px;
  margin-inline: auto;
}

/* Image framing for light mode (subtle grey border, NO hover shadow) */
.hero-screen,
.screen-frame {
  margin: 0;
  overflow: hidden;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
}

.hero-screen img,
.screen-frame img {
  object-fit: cover;
  object-position: top center;
  width: 100%;
  display: block;
}

.section-intro,
.closing {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 0 32px;
  text-align: center;
}

/* System Map styling */
.system-story {
  padding: 100px 0 12px;
}

.system-story-copy {
  max-width: 920px;
  margin: 0 auto 64px;
  text-align: center;
}

.system-story-copy h2 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
}

.system-story-copy p:last-child {
  max-width: 760px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.pipeline-board {
  position: relative;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.06);
}

.pipeline-board::before {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px dashed var(--line);
  pointer-events: none;
}

.pipeline-layer {
  position: relative;
  z-index: 1;
}

.pipeline-label {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.interactive-pipeline {
  display: grid;
  grid-template-columns: minmax(232px, 0.88fr) minmax(340px, 1.32fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.pipeline-sidebar,
.pipeline-detail {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pipeline-stage-list {
  display: grid;
  gap: 12px;
}

.pipeline-stage,
.cluster-node {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pipeline-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 12px;
}

.pipeline-stage:hover,
.pipeline-stage:focus-visible,
.cluster-node:hover,
.cluster-node:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(70, 153, 203, 0.4);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
  outline: none;
}

.pipeline-stage.is-active,
.pipeline-stage[data-stage-state="current"],
.cluster-node[data-stage-state="current"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 12px 32px rgba(70, 153, 203, 0.15);
}

.pipeline-stage[data-stage-state="complete"],
.cluster-node[data-stage-state="complete"] {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.cluster-node[data-stage-state="upcoming"] {
  opacity: 0.6;
}

.cluster-node[data-stage-state="complete"],
.cluster-node[data-stage-state="current"] {
  opacity: 1;
}

.pipeline-stage-index,
.pipeline-detail-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: "SF Pro Display", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}

.pipeline-stage-body {
  display: grid;
  gap: 4px;
}

.pipeline-stage-body strong {
  font-family: "SF Pro Display", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.pipeline-stage-body span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.pipeline-visual {
  --signal-primary-left: 22%;
  --signal-primary-top: 14%;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  gap: 20px 24px;
  align-content: stretch;
  min-height: 620px;
  padding: 36px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 20% 20%, rgba(70, 153, 203, 0.04), transparent 50%), var(--surface-soft);
  isolation: isolate;
}

.pipeline-visual::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  z-index: 0;
}

.pipeline-rail {
  display: none;
}

.pipeline-orbit {
  position: absolute;
  border: 1px solid rgba(70, 153, 203, 0.15);
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

.pipeline-orbit-a {
  inset: 70px 34px 110px 52px;
}

.pipeline-orbit-b {
  inset: 118px 86px 164px 96px;
}

.pipeline-cluster {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
}

.cluster-product {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
}

.cluster-handoff {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  margin-top: 10px;
}

.cluster-engine {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
}

.cluster-label,
.pipeline-detail-eyebrow {
  color: var(--muted);
  font-family: "SF Pro Display", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cluster-node {
  position: relative;
  padding: 16px;
  border-radius: 12px;
  min-height: 72px;
}

.cluster-node-accent {
  background: rgba(70, 153, 203, 0.05);
  border-color: rgba(70, 153, 203, 0.3);
}

.pipeline-paths {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.pipeline-path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 6 10;
  transition: all 0.4s ease;
  opacity: 0.5;
}

.pipeline-path[data-path-state="complete"] {
  stroke: rgba(70, 153, 203, 0.4);
  opacity: 1;
}

.pipeline-path[data-path-state="current"] {
  stroke: var(--accent);
  stroke-width: 2.5;
  opacity: 1;
  animation: pathFlow 1.5s linear infinite;
}

.cluster-node-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.cluster-node-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.pipeline-signal {
  position: absolute;
  z-index: 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(70, 153, 203, 0.15);
  transform: translate(-50%, -50%);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.signal-primary {
  top: var(--signal-primary-top);
  left: var(--signal-primary-left);
  opacity: 1;
  animation: beaconPulse 2.6s ease-in-out infinite;
}

.signal-secondary,
.signal-return {
  display: none;
}

/* Focused View Details */
.pipeline-detail-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  overflow-y: auto; 
}

.pipeline-detail-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pipeline-detail-title,
.pipeline-note h3 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
}

.pipeline-note h3 {
  font-size: 1.3rem;
}

.pipeline-detail-copy,
.pipeline-note p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.pipeline-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.pipeline-detail-tags span {
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--line);
}

.pipeline-detail-metric {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}

.pipeline-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.pipeline-note {
  padding: 0;
}

.pipeline-note h3 {
  margin-bottom: 12px;
}

.section-intro h2,
.chapter-header h2,
.closing h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.chapter {
  padding: 100px 0 0;
}

.chapter-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 40px;
  align-items: flex-end;
  margin-bottom: 48px;
}

.chapter-header p {
  margin: 0;
}

.screen-stack {
  display: grid;
  gap: 32px;
}

.screen-grid {
  display: grid;
  gap: 32px;
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.closing {
  padding: 120px 0 80px;
}

/* 
  Elegant Butter-Smooth Animations 
*/

/* 1. Main scroll reveal: gently scales up and floats in */
.reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition:
    opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 2. Cinematic Image Reveal: The image itself slowly zooms OUT as the frame appears */
.reveal img {
  transform: scale(1.06);
  transition: transform 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible img {
  transform: scale(1);
}

/* Staggered entry classes */
.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }

/* Side Navigator */
@keyframes fadeInNav {
  from { opacity: 0; transform: translateY(-50%) translateX(20px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.side-nav {
  position: fixed;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  z-index: 100;
  animation: fadeInNav 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.6s backwards;
}

.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  flex-direction: row-reverse;
}

.side-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--line-strong);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-nav-label {
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-nav a:hover .side-nav-label {
  opacity: 1;
  transform: translateX(0);
  color: var(--text);
}

.side-nav a:hover .side-nav-dot {
  background-color: var(--accent);
  transform: scale(1.2);
}

.side-nav a.active .side-nav-dot {
  background-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform: scale(1.2);
}

.side-nav a.active .side-nav-label {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

@keyframes pathFlow {
  to {
    stroke-dashoffset: -32;
  }
}

@keyframes beaconPulse {
  0%,
  100% {
    box-shadow: 0 0 0 8px rgba(70, 153, 203, 0.1);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(70, 153, 203, 0.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal img { opacity: 1; transform: none; transition: none; }
  .signal-primary, .pipeline-path[data-path-state="current"] { animation: none; }
  .site-header, .side-nav { animation: none; }
}

@media (max-width: 1200px) {
  .side-nav {
    display: none; /* Hide on smaller screens */
  }
}

@media (max-width: 1024px) {
  .interactive-pipeline {
    grid-template-columns: 1fr;
  }
  .pipeline-visual {
    min-height: 500px;
    order: -1; 
  }
  .pipeline-detail {
    min-height: 300px;
  }
}

@media (max-width: 900px) {
  .chapter-header,
  .two-up,
  .pipeline-notes {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .chapter-header {
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding-inline: 16px;
  }
  .site-header {
    min-height: 64px;
  }
  .hero-body,
  .section-intro p,
  .chapter-header p,
  .closing p,
  .system-story-copy p:last-child {
    font-size: 1.05rem;
  }
  .screen-stack,
  .screen-grid {
    gap: 16px;
  }
  .pipeline-board {
    padding: 20px;
  }
  .pipeline-board::before {
    inset: 12px;
  }
  .pipeline-visual {
    display: none; 
  }
}
