/* ==========================================================================
   Expedient AI - homepage redesign styles
   Palette: ink #0A0A0A, paper #F4F4F1, graphite #1A1A1A, smoke #6B6B66,
   orange #FF5A1F. Single accent, no AI-purple, no em-dashes.
   ========================================================================== */

/* ---------- HERO ---------- */
.home-hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  padding: clamp(3rem, 6vh, 5rem) 0 clamp(4rem, 8vh, 6rem);
  overflow: hidden;
}

/* structured signal grid as a quiet interactive background layer */
.hero-canvas-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* mobile: the fluid field ends just above the hero actions (Book a chat),
   so it does not stretch down the whole tall hero */
@media (max-width: 800px) {
  .hero-cue { display: none; }
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-annotation {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
}

.hero-annotation::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 0.75rem;
}

.hero-display {
  font-size: clamp(2.9rem, 8vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.hero-line { display: block; }

.signal-word { color: var(--accent); }

.hero-support {
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 44ch;
  margin-top: clamp(1.25rem, 3vh, 2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: clamp(1.75rem, 4vh, 2.75rem);
}

/* Abstract operational visual panel */
.hero-diagram {
  position: relative;
  height: clamp(280px, 42vh, 460px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  overflow: hidden;
}

#signal-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* mobile: the fluid field ends just above the hero actions (Book a chat),
   so it does not stretch down the whole tall hero. Must sit AFTER the
   #signal-canvas base rule above - same specificity, later wins. */
@media (max-width: 800px) {
  #signal-canvas { height: 58%; }
}

.hero-diagram-label {
  position: absolute;
  left: 1rem;
  bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hero-diagram-label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.5rem;
  animation: cue-pulse 2.2s ease-out infinite;
}

/* Quiet directional cue */
.hero-cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.hero-cue::before {
  content: "";
  width: 1px;
  height: 72px;
  background: linear-gradient(to bottom, transparent, var(--ink-3));
}
.hero-cue::after {
  content: attr(data-label);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}

@keyframes cue-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 90, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0); }
}

@media (max-width: 900px) {
  .home-hero-inner { grid-template-columns: 1fr; }
  .hero-diagram { height: 260px; order: 2; }
}

/* ---------- FRICTION ---------- */
.friction { padding: clamp(3rem, 6vh, 4.5rem) 0; }

.friction-title {
  font-size: clamp(1.9rem, 4.2vw, 3.4rem);
  max-width: 24ch;
}

.fragments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: clamp(2rem, 4vh, 3rem);
}

.fragment {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.5rem 1rem;
}

/* loose document strips, not cards */
.fragment:nth-child(odd)  { transform: rotate(-1.1deg); }
.fragment:nth-child(even) { transform: rotate(0.8deg) translateY(2px); }
.fragment:nth-child(3n)   { transform: rotate(-0.4deg) translateY(-2px); }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-top: clamp(2.5rem, 5vh, 4rem);
}

.metric-block {
  border-top: 1px solid var(--ink);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.9rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.metric-label { font-size: 0.95rem; color: var(--ink-2); }

.metric-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.gap-rule {
  height: 1px;
  background: var(--ink);
  margin-top: clamp(3rem, 6vh, 4.5rem);
  transform-origin: left center;
  transition: transform 1.4s cubic-bezier(0.65, 0, 0.25, 1);
}

.gap-rule.is-closed { transform: scaleX(0); }

@media (max-width: 700px) {
  .metrics { grid-template-columns: 1fr; }
}

/* ---------- BUILD ---------- */
.build-stage-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.build-stage h3 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 0.5rem; }

.build-stage p { font-size: 0.92rem; color: rgba(244, 244, 241, 0.65); line-height: 1.55; }

.build-path-seg {
  stroke: rgba(244, 244, 241, 0.25);
  stroke-width: 2;
  stroke-linecap: round;
}

.build-path-dot {
  fill: var(--paper);
  stroke: rgba(10, 10, 10, 0.35);
  stroke-width: 2;
}

.signal-dot {
  fill: var(--accent);
}

.signal-dot.is-travelling {
  filter: drop-shadow(0 0 6px rgba(255, 90, 31, 0.55));
}

.build-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  counter-reset: buildstep;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: rgba(10, 10, 10, 0.55);
}

.build-fallback li { counter-increment: buildstep; }

.build-fallback li::before {
  content: counter(buildstep, decimal-leading-zero) " ";
  color: var(--accent);
}

/* ---------- CAPABILITIES ---------- */
.capability-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-top: clamp(3.5rem, 7vh, 5.5rem);
  padding-bottom: clamp(3.5rem, 7vh, 5.5rem);
}

/* single light theme: both classes render the same paper surface */
.chapter--light,
.chapter--dark {
  --c-bg: #F4F4F1;
  --c-fg: #0A0A0A;
  --c-graphite: #1A1A1A;
  background: var(--c-bg);
  color: var(--c-fg);
}

.capability-meta {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.capability-num { opacity: 0.5; }

.capability-tag::before {
  content: "/ ";
  color: #FF5A1F;
}

.capability h3 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
  max-width: 20ch;
}

.capability p {
  margin-top: 1rem;
  max-width: 52ch;
  font-size: 1.02rem;
  line-height: 1.6;
  opacity: 0.78;
}

.capability-visual { display: flex; justify-content: flex-end; }

.capability-visual svg {
  width: 100%;
  max-width: 480px;
  height: auto;
}

/* capability visual strokes and fills (brand palette only, single light theme) */
.cv-ghosts rect { fill: none; stroke: #6B6B66; stroke-width: 1.5; opacity: 0.45; }

.cv-flow path { stroke: #6B6B66; stroke-width: 2; }

.cv-steps rect { fill: #0A0A0A; stroke: none; }

.cv-bracket path { stroke: #FF5A1F; stroke-width: 2; }

.cv-noise circle { fill: none; stroke: #6B6B66; stroke-width: 1.5; opacity: 0.55; }

.cv-ranked circle { fill: #0A0A0A; stroke: none; }
.cv-ranked circle:first-child { fill: #FF5A1F; }

.cv-rank-lines path { stroke: #6B6B66; stroke-width: 2; }

.cv-track { stroke: #0A0A0A; stroke-width: 2; }
.cv-track-a, .cv-track-c { opacity: 0.75; }

.cv-junction circle { fill: #FF5A1F; stroke: none; }

.cv-sources circle { fill: #0A0A0A; stroke: none; }

.cv-sheets rect { fill: #1A1A1A; stroke: #6B6B66; stroke-width: 1.5; }

.cv-route-link path { stroke: #FF5A1F; stroke-width: 2; }

.cv-answer rect { fill: none; stroke: #0A0A0A; stroke-width: 2; }

.cv-answer-route { stroke: #0A0A0A; stroke-width: 2; stroke-linecap: round; }

.cv-answer circle { fill: #FF5A1F; stroke: none; }

.cv-frame rect { fill: none; stroke: #0A0A0A; stroke-width: 2; }

.cv-fill rect { fill: #0A0A0A; stroke: none; }
.cv-fill path { stroke: #0A0A0A; stroke-width: 2; }

.cv-grid path { stroke: #6B6B66; stroke-width: 1.5; stroke-linecap: round; }

.cv-live-dot circle { fill: #FF5A1F; stroke: none; }

.cv-links path { stroke: #6B6B66; stroke-width: 1.5; opacity: 0.7; }

.cv-nodes circle { fill: #0A0A0A; stroke: none; }

.cv-hub circle:first-child { fill: none; stroke: #FF5A1F; stroke-width: 2; }
.cv-hub circle:last-child { fill: #FF5A1F; stroke: none; }

@media (max-width: 900px) {
  .capability-inner { grid-template-columns: 1fr; }
  .capability-visual { justify-content: flex-start; }
}

/* ---------- WAY OF WORKING ---------- */
.working { padding: clamp(2.5rem, 5vh, 4rem) 0; }

.process-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  counter-reset: procstep;
}

.process-steps li {
  counter-increment: procstep;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.process-steps li::before {
  content: counter(procstep, decimal-leading-zero) " ";
  color: var(--accent);
}

.process-trace {
  position: relative;
  height: 1px;
  background: var(--rule);
  margin: clamp(1.75rem, 4vh, 2.5rem) 0 clamp(2.5rem, 5vh, 3.5rem);
}

.process-trace::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.6s cubic-bezier(0.65, 0, 0.25, 1);
}

.process-trace.in-view::after { transform: scaleX(1); }

.working-body h2 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  max-width: 18ch;
}

.working-line {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  color: var(--ink-2);
  max-width: 48ch;
  margin-top: 1.4rem;
}

.working-model {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  margin-top: 2.25rem;
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
}

.principles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: clamp(2.25rem, 5vh, 3rem);
}

.principle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
}

/* ---------- ABOUT STUDIO: padded band ---------- */
#about-studio { padding: clamp(2.5rem, 5vh, 4rem) 0; }
#about-studio .studio-copy { margin-bottom: 0; }

/* ---------- WORKING: operator story (no pin) ---------- */
#working { padding: clamp(2.5rem, 5vh, 4rem) 0; }
.studio-copy { max-width: 68ch; }
#working .studio-copy { font-size: clamp(1.02rem, 1.6vw, 1.18rem); line-height: 1.65; color: rgba(10,10,10,0.78); max-width: 68ch; margin: 0 0 1.1rem; }

/* ---------- CAPABILITIES: editorial list ---------- */
.cap-list {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}
.cap-row {
  padding: 1.4rem 0 1.5rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 0.5rem 3rem;
  align-items: baseline;
}
.cap-row:last-child { border-bottom: 1px solid var(--rule); }
.cap-row h3 {
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  letter-spacing: -0.01em;
  margin: 0;
}
.cap-row p { margin: 0; color: rgba(10,10,10,0.68); max-width: 52ch; }
@media (max-width: 800px) {
  .cap-row { grid-template-columns: 1fr; gap: 0.35rem; }
}


/* ---------- WORKING: operator story (plain flow) ---------- */
#working .studio-copy { font-size: clamp(1.02rem, 1.6vw, 1.18rem); line-height: 1.65; color: rgba(10,10,10,0.78); max-width: 68ch; margin: 0 0 1.1rem; }

/* ---------- CLOSING ---------- */
.closing {
  padding: clamp(3rem, 7vh, 5.5rem) 0;
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  text-align: center;
}

.closing-title {
  font-size: clamp(2.5rem, 6.5vw, 5.5rem);
  letter-spacing: -0.04em;
  margin: 0 auto;
  max-width: 16ch;
}

.closing-sub {
  margin: 1.5rem auto 0;
  max-width: 46ch;
  font-size: 1.08rem;
  color: var(--ink-2);
}

.closing .btn-lg { margin-top: 2.25rem; }

.closing-converge {
  display: block;
  width: min(800px, 100%);
  height: auto;
  margin: clamp(2.5rem, 6vh, 4rem) auto 0;
}
@media (max-width: 800px) {
  /* mobile only: keep the diagram full-width but scale the SVG text up
     so labels are physically larger and readable */
  .closing-converge .cl-head { font-size: 13px; }
  .closing-converge .cl-label { font-size: 15px; }
  .closing-converge .cl-label-big { font-size: 16px; }
  .closing-converge .cl-sub { font-size: 12px; }
}

/* workflow diagram palette */
.closing-converge .cl-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  fill: rgba(10, 10, 10, 0.55);
}
.closing-converge .cl-head-accent { fill: #FF5A1F; }
.closing-converge .cl-box {
  fill: #FFFFFF;
  stroke: rgba(10, 10, 10, 0.35);
  stroke-width: 1.5;
}
.closing-converge .cl-box-accent {
  fill: #FFFFFF;
  stroke: #FF5A1F;
  stroke-width: 2;
}
.closing-converge .cl-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  fill: #0A0A0A;
}
.closing-converge .cl-label-big {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.closing-converge .cl-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  fill: rgba(10, 10, 10, 0.55);
}
.cc-path { stroke: var(--mid); stroke-width: 1.5; opacity: 0.6; }
.cc-path-accent { stroke: var(--accent); opacity: 1; stroke-width: 2; }
/* boxes + labels pop in per group */
.cl-group { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.cl-group.is-on { opacity: 1; transform: none; }

/* ---------- HERO LINE REVEAL ---------- */
.hero-line { display: block; overflow: hidden; }
.hero-line-inner {
  display: block;
  transform: translateY(112%);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-display.is-hero-in .hero-line:nth-child(1) .hero-line-inner { transform: none; transition-delay: 0s; }
.hero-display.is-hero-in .hero-line:nth-child(2) .hero-line-inner { transform: none; transition-delay: 0.12s; }
.hero-display.is-hero-in .hero-line:nth-child(3) .hero-line-inner { transform: none; transition-delay: 0.24s; }
.signal-word { position: relative; color: var(--accent); }
.signal-word::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.04em;
  width: 100%;
  height: 0.06em;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.8s;
}
.signal-word.is-signaled::after { transform: scaleX(1); }

/* ---------- FRICTION FRAGMENTS ---------- */
.fragment {
  transition: left 1s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.fragment.is-aligned { left: 12%; transform: rotate(0deg) translateY(0); }

/* ---------- BUILD STAGE ACTIVATION ---------- */
.build {
  background: var(--paper);
  color: var(--ink);
  /* tall scroll runway so the pinned narrative has room to play out */
  padding: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.build > .container {
  height: 250vh;
  position: relative;
}
.build-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  padding: 3rem 0;
  box-sizing: border-box;
}
.build-stages {
  position: relative;
  height: clamp(260px, 36vh, 360px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.build-stage {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.build-stage.is-active { opacity: 1; transform: none; }
.build-stage.is-exiting {
  opacity: 0;
  transform: translateY(-24px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.build-stage > * { position: relative; z-index: 1; }
.build-stage h3 { color: var(--ink); }
.build-stage p { color: rgba(10, 10, 10, 0.72); }
/* "What changes" callout under each stage */
.build-change {
  margin-top: 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}
.build-change span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #FF5A1F;
  margin-bottom: 0.3rem;
}
.build-visual {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.build-progress {
  display: flex;
  gap: 0.35rem;
}
.build-progress-bar {
  flex: 1;
  height: 2px;
  background: rgba(10, 10, 10, 0.14);
  transition: background 0.4s ease;
}
.build-progress-bar.is-filled {
  background: var(--accent);
}
.build-path { width: 100%; height: auto; }
.build-path-seg { transition: stroke 0.4s ease; stroke: rgba(10, 10, 10, 0.18); }
.build-path-seg.is-drawn { stroke: var(--accent); }
.build-fallback li { transition: color 0.4s ease; color: rgba(10, 10, 10, 0.55); }
.build-fallback li.is-active { color: var(--accent); }

@media (max-width: 800px) {
  .build > .container { height: auto; }
  .build-pin {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 0;
  }
  .build-stages { height: auto; display: block; }
  /* stacked stages reveal one by one on scroll (IO adds .is-active) */
  .build-stage {
    position: relative;
    inset: auto;
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    margin-bottom: 2.25rem;
  }
  .build-stage.is-active { opacity: 1; transform: none; }
  .build-stage.is-exiting { opacity: 1; transform: none; }
  .build-visual { order: 2; }
}

/* ---------- CAPABILITY VISUALS ---------- */
.capability-visual .cv-ghosts rect,
.capability-visual .cv-noise circle,
.capability-visual .cv-sheets rect,
.capability-visual .cv-grid path,
.capability-visual .cv-links path {
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.capability-visual .cv-steps rect,
.capability-visual .cv-ranked circle,
.capability-visual .cv-answer,
.capability-visual .cv-fill,
.capability-visual .cv-live-dot,
.capability-visual .cv-junction,
.capability-visual .cv-nodes circle {
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.capability-visual .cv-tracks path { transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }

/* capability visual elements animate via Web Animations API from home.js.
   Static (no-JS) state = complete final composition. Single light theme. */

/* ---------- PROCESS STEPS LOCK ---------- */
.process-steps li::after {
  content: '\2713';
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.process-steps li.is-locked::after { opacity: 1; }

/* ---------- CLOSING CONVERGE ---------- */
.cc-path { transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1); }

/* ---------- GENERIC DATA REVEAL ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .gap-rule { transition: none; }
  .process-trace::after { transition: none; transform: scaleX(1); }
  .hero-diagram-label::before { animation: none; }
  .hero-line-inner { transform: none; transition: none; }
  .signal-word::after { transform: scaleX(1); transition: none; }
  .fragment { left: 12%; transform: none; transition: none; }
  .build-stage { opacity: 1; transform: none; transition: none; }
  .build-stage.is-exiting { opacity: 1; transform: none; transition: none; }
  .build-progress-bar.is-filled { background: var(--accent); }
  .build-path-seg.is-drawn { stroke: var(--accent); }
  .process-steps li::after { opacity: 1; transition: none; }
  .capability-visual .cv-ghosts rect,
  .capability-visual .cv-steps rect,
  .capability-visual .cv-noise circle,
  .capability-visual .cv-ranked circle,
  .capability-visual .cv-junction,
  .capability-visual .cv-sheets rect,
  .capability-visual .cv-answer,
  .capability-visual .cv-grid path,
  .capability-visual .cv-live-dot,
  .capability-visual .cv-nodes circle,
  .capability-visual .cv-links path {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cc-path { stroke-dashoffset: 0; transition: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- SERVICES + WORK: choreographed scroll entrances ---------- */
#services .asym-tile,
#work-home .work-card {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
#services .asym-tile.is-shown,
#work-home .work-card.is-shown {
  opacity: 1;
  transform: none;
}

/* mono label rule draws in when the tile lands */
#services .mono-label { position: relative; padding-top: 0.9rem; }
#services .mono-label::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}
#services .asym-tile.is-shown .mono-label::before { transform: scaleX(1); }

/* example strip settles in last */
#services .asym-tile-example {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease 0.45s, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.45s;
}
#services .asym-tile.is-shown .asym-tile-example { opacity: 1; transform: none; }

/* screenshots wipe open left-to-right */
#work-home .project-screenshot img {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}
#work-home .work-card.is-shown .project-screenshot img { clip-path: inset(0 0 0 0); }

/* badge pops once the card lands */
#work-home .work-card .badge {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.4s ease 0.55s, transform 0.45s cubic-bezier(0.34, 1.5, 0.64, 1) 0.55s;
}
#work-home .work-card.is-shown .badge { opacity: 1; transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  #services .asym-tile,
  #work-home .work-card { opacity: 1 !important; transform: none !important; transition: none !important; }
  #services .mono-label::before { transform: scaleX(1) !important; transition: none !important; }
  #services .asym-tile-example { opacity: 1 !important; transform: none !important; transition: none !important; }
  #work-home .project-screenshot img { clip-path: none !important; transition: none !important; }
  #work-home .work-card .badge { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- SERVICES: pinned narrative, one accumulating diagram ---------- */
.svc-runway { height: 200vh; position: relative; }
.svc-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 0;
  box-sizing: border-box;
  background: var(--paper);
}
.svc-progress { display: flex; gap: 0.35rem; margin-bottom: 2.25rem; }
.svc-progress span { flex: 1; height: 2px; background: rgba(10,10,10,0.14); transition: background 0.4s ease; }
.svc-progress span.is-filled { background: var(--accent); }
.svc-pin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.svc-stages { position: relative; height: clamp(220px, 30vh, 320px); }
.svc-stage {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22,1,0.36,1);
}
.svc-stage.is-active { opacity: 1; transform: none; }
.svc-stage.is-exiting {
  opacity: 0;
  transform: translateY(-18px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22,1,0.36,1);
}
.svc-stage .mono-label { color: var(--ink-2); margin-bottom: 1rem; display: block; }
.svc-stage h3 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); letter-spacing: -0.02em; line-height: 1.12; margin-bottom: 1rem; max-width: 22ch; }
.svc-stage p { color: rgba(10,10,10,0.72); font-size: 1.02rem; line-height: 1.62; max-width: 44ch; }
.svc-visual-wrap { position: relative; }
.svc-visual { width: 100%; height: auto; border: 1px solid var(--rule); padding: 1rem; box-sizing: border-box; background: var(--paper); }
.svc-caption {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(10,10,10,0.55);
}

/* svg palette: one continuous pipeline */
.svc-visual .sv-colhead {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  fill: rgba(10,10,10,0.75);
}
.svc-visual .sv-colrule { stroke: rgba(10,10,10,0.12); stroke-width: 1; }
.svc-visual .sv-node { fill: #0A0A0A; stroke: none; }
.svc-visual .sv-flow { stroke: #FF5A1F; stroke-width: 2.2; stroke-linecap: round; }
.svc-visual .sv-flow.sv-weak { stroke: #6B6B66; stroke-width: 1.8; }
.svc-visual .sv-line { stroke: #6B6B66; stroke-width: 2; stroke-linecap: round; }
.svc-visual .sv-sysbox { fill: none; stroke: #0A0A0A; stroke-width: 2; }
.svc-visual .sv-boxlabel {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-anchor: middle;
  fill: #0A0A0A;
}
.svc-visual .sv-boxlabel.sv-dim { font-size: 10px; fill: rgba(10,10,10,0.55); }
.svc-visual .sv-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  fill: rgba(10,10,10,0.7);
}
.svc-visual .sv-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  fill: rgba(10,10,10,0.45);
}
.svc-visual .sv-tick { stroke: #FF5A1F; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.svc-visual .sv-endpoint { fill: #FF5A1F; stroke: none; }

/* layers stay dim until their scroll beat switches them on */
.svc-visual .sv-layer { opacity: 0.12; transition: opacity 0.55s ease; }
.svc-visual .sv-layer.is-on { opacity: 1; }

@media (max-width: 800px) {
  .svc-runway { height: auto; }
  .svc-pin { position: static; height: auto; padding: 3rem 0; }
  .svc-progress { margin-bottom: 1.75rem; }
  .svc-pin-grid { grid-template-columns: 1fr; gap: 2rem; }
  .svc-stages { height: auto; display: block; }
  .svc-stage { position: relative; inset: auto; margin-bottom: 2.25rem; }
  /* keep the entrance: stages stay hidden until IO adds .is-active */
  .svc-stage.is-active { opacity: 1; transform: none; }
  .svc-visual .sv-layer { opacity: 1; }
}


/* ---------- HOME FAQ ACCORDION ---------- */
.home-faq { border-top: 1px solid var(--rule); }
.home-faq-item { border-bottom: 1px solid var(--rule); }
.home-faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  padding: 1rem 0;
}
.home-faq-item summary::-webkit-details-marker { display: none; }
.home-faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.25s ease;
  line-height: 1;
}
.home-faq-item[open] summary::after { transform: rotate(45deg); }
.home-faq-item p {
  color: rgba(10,10,10,0.72);
  line-height: 1.6;
  margin: 0 0 1.1rem;
  max-width: 62ch;
}

/* ---------- WORK CARDS: system-boot reveal ---------- */
#work-home .project-screenshot { position: relative; overflow: hidden; }
#work-home .boot-frame img {
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.7s ease 0.15s, transform 0.9s cubic-bezier(0.22,1,0.36,1) 0.15s;
}
#work-home .boot-frame.is-booted img { opacity: 1; transform: none; }
.boot-terminal {
  position: absolute;
  inset: 0;
  background: #0A0A0A;
  display: flex;
  align-items: center;
  padding: 0.9rem 1rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  opacity: 1;
  transition: opacity 0.5s ease 0.9s;
}
.boot-frame.is-booted .boot-terminal { opacity: 0; pointer-events: none; }
.boot-line { color: #F4F4F1; white-space: pre-wrap; }
.boot-line .ok-word { color: var(--accent); }
/* verified tick stamps into the corner after boot */
.boot-tick {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(244,244,241,0.94);
  padding: 3px 7px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0A0A0A;
  opacity: 0;
  transform: scale(0.6);
}
.boot-frame.is-booted .boot-tick {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.35s ease 1.5s, transform 0.4s cubic-bezier(0.34,1.5,0.64,1) 1.5s;
}
@media (prefers-reduced-motion: reduce) {
  #work-home .boot-frame img { opacity: 1 !important; transform: none !important; transition: none !important; }
  .boot-terminal, .boot-tick { display: none !important; }
}


/* ---------- DIAGRAM DARK MODE ----------
   Both homepage SVGs (closing map + services pipeline) hardcode
   light-theme colours. Invert them under dark theme so boxes, lines
   and labels stay visible. */

/* closing map (WHAT YOU HAVE / THE MAP / WHAT YOU GET) */
[data-theme="dark"] .closing-converge .cl-head { fill: rgba(244, 244, 241, 0.6); }
[data-theme="dark"] .closing-converge .cl-box {
  fill: #1A1A1A;
  stroke: rgba(244, 244, 241, 0.4);
}
[data-theme="dark"] .closing-converge .cl-box-accent {
  fill: #1A1A1A;
  stroke: var(--accent);
}
[data-theme="dark"] .closing-converge .cl-label { fill: #F4F4F1; }
[data-theme="dark"] .closing-converge .cl-sub { fill: rgba(244, 244, 241, 0.6); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .closing-converge .cl-head { fill: rgba(244, 244, 241, 0.6); }
  :root:not([data-theme="light"]) .closing-converge .cl-box {
    fill: #1A1A1A;
    stroke: rgba(244, 244, 241, 0.4);
  }
  :root:not([data-theme="light"]) .closing-converge .cl-box-accent {
    fill: #1A1A1A;
    stroke: var(--accent);
  }
  :root:not([data-theme="light"]) .closing-converge .cl-label { fill: #F4F4F1; }
  :root:not([data-theme="light"]) .closing-converge .cl-sub { fill: rgba(244, 244, 241, 0.6); }
}

/* services pipeline (INPUTS / THE SYSTEM / YOUR TEAM) */
[data-theme="dark"] .svc-visual { background: var(--paper-2); border-color: var(--rule); }
[data-theme="dark"] .svc-visual .sv-colhead { fill: rgba(244, 244, 241, 0.8); }
[data-theme="dark"] .svc-visual .sv-colrule { stroke: rgba(244, 244, 241, 0.15); }
[data-theme="dark"] .svc-visual .sv-node { fill: #F4F4F1; }
[data-theme="dark"] .svc-visual .sv-sysbox { stroke: #F4F4F1; }
[data-theme="dark"] .svc-visual .sv-boxlabel { fill: #F4F4F1; }
[data-theme="dark"] .svc-visual .sv-boxlabel.sv-dim { fill: rgba(244, 244, 241, 0.55); }
[data-theme="dark"] .svc-visual .sv-label { fill: rgba(244, 244, 241, 0.7); }
[data-theme="dark"] .svc-visual .sv-note { fill: rgba(244, 244, 241, 0.45); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .svc-visual { background: var(--paper-2); border-color: var(--rule); }
  :root:not([data-theme="light"]) .svc-visual .sv-colhead { fill: rgba(244, 244, 241, 0.8); }
  :root:not([data-theme="light"]) .svc-visual .sv-colrule { stroke: rgba(244, 244, 241, 0.15); }
  :root:not([data-theme="light"]) .svc-visual .sv-node { fill: #F4F4F1; }
  :root:not([data-theme="light"]) .svc-visual .sv-sysbox { stroke: #F4F4F1; }
  :root:not([data-theme="light"]) .svc-visual .sv-boxlabel { fill: #F4F4F1; }
  :root:not([data-theme="light"]) .svc-visual .sv-boxlabel.sv-dim { fill: rgba(244, 244, 241, 0.55); }
  :root:not([data-theme="light"]) .svc-visual .sv-label { fill: rgba(244, 244, 241, 0.7); }
  :root:not([data-theme="light"]) .svc-visual .sv-note { fill: rgba(244, 244, 241, 0.45); }
}

/* ---------- WORKING SECTION DARK MODE ----------
   The operator-story copy hardcodes near-black; invert under dark theme. */
[data-theme="dark"] #working .studio-copy { color: rgba(244, 244, 241, 0.78); }
[data-theme="dark"] #working .working-body h2 { color: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #working .studio-copy { color: rgba(244, 244, 241, 0.78); }
  :root:not([data-theme="light"]) #working .working-body h2 { color: var(--ink); }
}
