/* Home page scenes. Coordinates for the line drawings: every station SVG is 600 x 600 units,
   the belt top sits at y = 500, the box is centred at x = 300. CSS maps that box onto the shared
   box so the stations line up with it while the track pans. */

/* =========================================================
   THE LINE (hero + five stations)
   ========================================================= */
.line {
  --boxX: 64vw;
  --art: min(44vw, 66svh);
  --beltB: 16svh;
  --u: calc(var(--art) / 600);
  position: relative;
}
.line__stage {
  position: relative;
  overflow: hidden;
}
.motion .line__stage { height: 100svh; }

.line__track { position: relative; }
.motion .line__track {
  display: flex;
  width: 600vw;
  height: 100%;
  will-change: transform;
}
.panel { position: relative; }
.motion .panel {
  overflow: hidden;
  flex: none;
  width: 100vw;
  height: 100%;
}

.panel__text {
  position: relative;
  z-index: 2;
  padding: calc(var(--nav-h) + 56px) var(--gutter) 0;
}
.motion .panel__text {
  position: absolute;
  left: 0;
  top: 0;
  width: min(46vw, 640px);
  padding-top: calc(var(--nav-h) + 9svh);
}
.panel__text .h2 { margin-bottom: 24px; }
.panel__text .note { margin-top: 28px; display: block; }

.motion .panel--hero .panel__text { width: min(62vw, 900px); }
.panel--hero .display { font-size: clamp(48px, 6.6vw, 112px); max-width: 11ch; }
.panel--hero .lede { margin-top: 28px; }
.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; }

.panel__art {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1;
  margin: 24px auto 0;
}
.motion .panel__art {
  position: absolute;
  margin: 0;
  width: var(--art);
  left: calc(var(--boxX) - var(--art) / 2);
  bottom: calc(var(--beltB) - var(--u) * 100);
}
.panel__art svg { width: 100%; height: 100%; overflow: visible; }

/* belt + box shared by all stations (motion mode only) */
.line__belt, .line__rail, .line__floor, .line__box { display: none; }
.motion .line__belt,
.motion .line__floor,
.motion .line__box { display: block; }
.motion .line__rail { display: block; }

.line__belt {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  bottom: calc(var(--beltB) - var(--u) * 16);
  height: calc(var(--u) * 16);
  background: #2c2c2c;
  border-top: 1px solid #4a4a47;
}
.line__rail {
  position: absolute;
  left: 0;
  width: 600vw;
  z-index: 1;
  bottom: calc(var(--beltB) - var(--u) * 50);
  height: calc(var(--u) * 34);
  background:
    linear-gradient(#1f1f1f, #1f1f1f) 0 100% / 100% calc(var(--u) * 5) no-repeat,
    radial-gradient(circle, #2b2b29 0 22%, transparent 26%) 0 0 / calc(var(--u) * 60) calc(var(--u) * 20) repeat-x;
}
.line__floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--beltB) - var(--u) * 100);
  height: 1px;
  background: var(--line);
}
.line__box {
  position: absolute;
  z-index: 4;
  width: calc(var(--u) * 120);
  height: calc(var(--u) * 80);
  left: calc(var(--boxX) - var(--u) * 60);
  bottom: var(--beltB);
  will-change: transform;
}
.line__box svg { width: 100%; height: 100%; }

/* station drawing vocabulary */
.d-body { fill: #252525; stroke: #3d3d3a; stroke-width: 1.5; }
.d-body-2 { fill: #1f1f1f; stroke: #3d3d3a; stroke-width: 1.5; }
.d-line { fill: none; stroke: #4a4a47; stroke-width: 2; }
.d-thin { fill: none; stroke: #4a4a47; stroke-width: 1; }
.d-wire { fill: none; stroke: #575753; stroke-width: 2.5; stroke-linejoin: round; }
.d-ink { fill: var(--ink); }
.d-txt { font-family: var(--mono); font-size: 15px; fill: var(--ink-3); letter-spacing: 0.02em; }
.d-txt-2 { font-family: var(--mono); font-size: 15px; fill: var(--ink-2); }
.d-val { font-family: var(--mono); font-size: 26px; fill: var(--ink); font-variant-numeric: tabular-nums; }
.d-amber { fill: var(--amber); }
.d-amber-s { fill: none; stroke: var(--amber); stroke-width: 2; }
.d-lamp { fill: #2a2a2a; stroke: #3d3d3a; stroke-width: 1.5; transition: fill 160ms linear; }
.d-lamp.on-g { fill: var(--run); }
.d-lamp.on-a { fill: var(--amber); }
.d-lamp.on-r { fill: var(--stop); }
.d-led { fill: #333; transition: fill 120ms linear; }
.d-led.on { fill: var(--run); }
.d-solo { display: inline; }
.motion .d-solo { display: none; }

.st-hero { z-index: 0; }
html:not(.motion) .st-hero { display: none; }
.motion .hero-wave { stroke-dasharray: 1600; stroke-dashoffset: 1600; }
.motion .hero-flat { stroke-dasharray: 350; stroke-dashoffset: 350; }

/* station moments: start states (motion only), JS animates to the finished drawing */
.motion .st-sees .bb { stroke-dasharray: 260; stroke-dashoffset: 260; }
.motion .st-sees .bb-label { opacity: 0; }
.motion .st-sees .scanline { opacity: 0; }
.motion .st-thinks .feed { opacity: 0; }
.motion .st-thinks .feed-line { stroke-dasharray: 340; stroke-dashoffset: 340; }

/* =========================================================
   THE STOP
   ========================================================= */
.stop { position: relative; }
.stop__stage {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  --beltB: 13svh;
  --u: calc(min(44vw, 66svh) / 600);
}
.stop__head {
  position: absolute;
  top: calc(var(--nav-h) + 6svh);
  left: var(--gutter);
  z-index: 2;
}
.stop__head .note { margin-top: 14px; display: block; }
.stop__risk {
  position: absolute;
  left: calc(var(--gutter) - 0.04em);
  bottom: calc(var(--beltB) + 6svh);
  z-index: 2;
  font-size: clamp(150px, 30vw, 460px);
  color: var(--ink);
  transition: color 120ms linear;
}
.stop__risk.is-warn { color: var(--amber); }
.stop__scale {
  position: absolute;
  z-index: 2;
  left: calc(var(--gutter) + clamp(250px, 47vw, 720px));
  bottom: calc(var(--beltB) + 9svh);
  display: grid;
  gap: 10px;
}
.stop__scale li {
  list-style: none;
  display: grid;
  grid-template-columns: 34px auto;
  gap: 12px;
  color: var(--ink-3);
  transition: color 120ms linear;
}
.stop__scale li.is-on { color: var(--ink); }
.stop__scale li.is-on span:first-child { color: var(--amber); }
.stop__scale li.note { display: block; margin-top: 6px; white-space: nowrap; }

.stop__tower {
  position: absolute;
  z-index: 2;
  right: calc(var(--gutter) + 2vw);
  bottom: var(--beltB);
  height: min(62svh, 560px);
  width: auto;
  aspect-ratio: 120 / 520;
}
.stop__tower svg { width: 100%; height: 100%; overflow: visible; }
.buzz { opacity: 0; }
.stop__stage.is-buzz .buzz { animation: buzz 500ms steps(1, end) infinite; }
.stop__stage.is-buzz .buzz-2 { animation-delay: 250ms; }
@keyframes buzz { 0% { opacity: 1; } 50% { opacity: 0; } }

.stop__belt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--beltB) - var(--u) * 16);
  height: calc(var(--u) * 16);
  background: #2c2c2c;
  border-top: 1px solid #4a4a47;
  overflow: hidden;
  z-index: 1;
}
.stop__belt .ribs {
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--u) * -50);
  width: calc(100% + var(--u) * 50);
  background: repeating-linear-gradient(90deg, transparent 0 calc(var(--u) * 46), rgba(255,255,255,0.05) calc(var(--u) * 46) calc(var(--u) * 50));
  will-change: transform;
}
.stop__box {
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: var(--beltB);
  width: calc(var(--u) * 120);
  height: calc(var(--u) * 80);
  will-change: transform;
}
.stop__box svg { width: 100%; height: 100%; }
.stop__floor {
  position: absolute; left: 0; right: 0; height: 1px;
  bottom: calc(var(--beltB) - var(--u) * 100);
  background: var(--line);
}

.stop__cut {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #0d0d0d;
  visibility: hidden;
}
.stop__stage.is-stopped .stop__cut { visibility: visible; }
.stop__cut .redline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--beltB);
  height: 2px;
  background: var(--stop);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.stop__stage.is-stopped .redline { transform: scaleX(1); transition: transform 280ms linear; }
.stop__cut .display {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--beltB) + 9svh);
  max-width: 10ch;
}
.stop__cut .note {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(var(--beltB) - 44px);
}
.stop__cut .note b { color: var(--stop); }

/* static sequence for reduced motion / no JS */
.stop__static { display: none; }
html:not(.motion) .stop__stage { display: none; }
html:not(.motion) .stop__static { display: block; padding: 120px 0; }
.stop__frames {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.stop__frames li { list-style: none; border-top: 1px solid var(--line); padding-top: 20px; }
.stop__frames .figure-num { font-size: clamp(72px, 10vw, 140px); }
.stop__frames li:last-child .figure-num { color: var(--stop); }
@media (max-width: 760px) { .stop__frames { grid-template-columns: 1fr; } }

/* =========================================================
   PULL THE PLUG
   ========================================================= */
.plug { padding: clamp(96px, 14vw, 180px) 0; }
.plug__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 48px 72px;
  align-items: start;
}
.plug__text { position: sticky; top: calc(var(--nav-h) + 40px); }
.plug__text .h2 { margin-bottom: 24px; }
.plug__text .body { margin-top: 16px; }

.scope {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ground-2);
}
.scope__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.scope__state { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.scope__state[data-s="run"] { color: var(--run); }
.scope__state[data-s="stop"] { color: var(--stop); }
.scope__state[data-s="warn"] { color: var(--amber); }

.scope__trace {
  display: block;
  width: 100%;
  height: clamp(150px, 20vw, 220px);
  position: relative;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 12.5% 100%;
}
.scope__trace canvas { width: 100%; height: 100%; }
.scope__trace .note {
  position: absolute;
  left: 14px;
  top: 10px;
  pointer-events: none;
}
.scope__trace .hint {
  position: absolute;
  left: auto;
  right: 14px;
  top: 10px;
  pointer-events: none;
}

.scope__read {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.scope__read > div { padding: 18px 20px; }
.scope__read > div + div { border-left: 1px solid var(--line); }
.scope__count {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(40px, 4vw, 60px);
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-top: 6px;
}
.scope__count.is-stop { color: var(--stop); }
.scope__val {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  margin-top: 10px;
}
.scope__val.is-run { color: var(--run); }
.scope__val.is-stop { color: var(--stop); }

.scope__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.scope__mini {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 20px;
  align-items: end;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--line);
}
.mini-belt { position: relative; height: 60px; overflow: hidden; }
.mini-belt__band {
  position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
  background: #2c2c2c;
  border-top: 1px solid #4a4a47;
  overflow: hidden;
}
.mini-belt__band .ribs {
  position: absolute; top: 0; bottom: 0; left: -20px; width: calc(100% + 20px);
  background: repeating-linear-gradient(90deg, transparent 0 18px, #3a3a37 18px 20px);
}
.mini-belt__box {
  position: absolute; bottom: 10px; left: 0; width: 64px; height: 42px;
  will-change: transform;
}
.mini-tower { width: 54px; height: 120px; }
.scope__log {
  list-style: none;
  padding: 14px 20px 18px;
  min-height: 132px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.scope__log li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; }
.scope__log time { color: var(--ink-3); }
.scope__log li[data-k="stop"], .scope__log li[data-k="alarm"] { color: #f08b8e; }
.scope__log li[data-k="ok"] { color: var(--ink); }

@media (max-width: 960px) {
  .plug__grid { grid-template-columns: 1fr; }
  .plug__text { position: static; }
  .scope__read { grid-template-columns: 1fr 1fr; }
  .scope__read > div:nth-child(3) { border-left: 0; }
  .scope__read > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* =========================================================
   LIVE SAFETY LOOP
   ========================================================= */
.loop { padding: clamp(96px, 14vw, 180px) 0; border-top: 1px solid var(--line); }
.loop__head { margin-bottom: 48px; }
.loop__head .body { margin-top: 20px; }
/* (the loop diagram's own rules live in loop.css) */

/* =========================================================
   SUBSYSTEMS BENTO
   ========================================================= */
.subs { padding: clamp(96px, 14vw, 180px) 0; border-top: 1px solid var(--line); }
.subs .h2 { max-width: 12ch; margin-bottom: 56px; }
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(250px, auto);
  gap: 12px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ground-2);
  padding: 28px;
  overflow: hidden;
  transition: border-color 200ms ease;
}
.tile h3 { font-size: clamp(22px, 2vw, 30px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.tile p { color: var(--ink-2); margin-top: 10px; max-width: 40ch; font-size: 15.5px; }
.tile .note { margin-top: auto; padding-top: 20px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.tile .arrow { width: 16px; height: 16px; color: var(--ink-2); transition: transform 200ms var(--ease-out), color 200ms ease; }
.tile__art { margin: 18px 0 0; width: 100%; height: auto; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover { border-color: var(--ink-3); }
  .tile:hover .arrow { transform: translateX(4px); color: var(--amber); }
}
.t-control { grid-column: 1 / span 7; grid-row: span 2; }
.t-decide { grid-column: 8 / span 5; grid-row: span 2; background: var(--ground); }
.t-vision { grid-column: 1 / span 5; }
.t-arch { grid-column: 6 / span 4; }
.t-sense { grid-column: 10 / span 3; }
.t-dash { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; gap: 32px; }
.t-dash .note { margin: 0 0 0 auto; padding: 0; }
.t-decide .figure-num { font-size: clamp(120px, 15vw, 230px); color: var(--amber); margin-top: auto; }
.t-decide .scale-mini { display: grid; gap: 4px; margin-top: 18px; }
@media (max-width: 960px) {
  .bento { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .t-control, .t-decide, .t-dash { grid-column: 1 / -1; grid-row: auto; }
  .t-vision, .t-arch, .t-sense { grid-column: auto; }
  .t-sense { grid-column: 1 / -1; }
  .t-dash { flex-direction: column; align-items: flex-start; gap: 0; }
  .t-dash .note { margin: 20px 0 0; }
}
@media (max-width: 600px) { .bento { grid-template-columns: 1fr; } .t-vision, .t-arch { grid-column: 1 / -1; } }

/* =========================================================
   VERIFICATION + TEAM (daylight)
   ========================================================= */
.verify { padding: clamp(96px, 14vw, 180px) 0 clamp(64px, 8vw, 112px); }
.verify__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: end;
}
.verify__big { display: flex; align-items: flex-end; gap: clamp(20px, 3vw, 48px); }
.verify__big .figure-num { font-size: clamp(150px, 24vw, 380px); }
.verify__big .of { font-family: var(--mono); font-size: clamp(20px, 2vw, 28px); color: var(--ink-2); padding-bottom: 0.6em; }
.verify__grid .body { color: var(--ink-2); }
.timings {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: clamp(64px, 8vw, 112px);
}
.timings > div { border-top: 1px solid var(--line-2); padding-top: 18px; }
.timings .figure-num { font-size: clamp(40px, 4.6vw, 68px); letter-spacing: -0.05em; }
.timings .figure-num small { font-size: max(0.42em, 15px); letter-spacing: 0; margin-left: 4px; color: var(--ink-2); }
.timings p { margin-top: 12px; font-size: 14.5px; color: var(--ink-2); max-width: 24ch; }
@media (max-width: 960px) {
  .verify__grid { grid-template-columns: 1fr; }
  .timings { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
}

.team { padding: clamp(64px, 8vw, 112px) 0 clamp(96px, 12vw, 160px); border-top: 1px solid var(--line); }
.team__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; }
.people li { list-style: none; }
.people strong { display: block; font-weight: 600; font-size: 19px; letter-spacing: -0.015em; }
.people span { color: var(--ink-2); font-size: 15px; }
.advisors { margin-top: 40px; color: var(--ink-2); font-size: 15px; max-width: 60ch; }
.contact { margin-top: clamp(72px, 9vw, 120px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: end; }
.contact__mail {
  font-weight: 600;
  font-size: clamp(22px, 2.7vw, 40px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--line-2);
  transition: text-decoration-color 160ms ease;
}
@media (hover: hover) and (pointer: fine) { .contact__mail:hover { text-decoration-color: var(--day-ink); } }
.contact__tel { display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: 18px; }
@media (max-width: 960px) {
  .team__grid, .contact { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .people { grid-template-columns: 1fr; } }

/* =========================================================
   phones
   ========================================================= */
@media (max-width: 760px) {
  .line { --boxX: 58vw; --art: min(94vw, 48svh); --beltB: 11svh; }
  .motion .panel__text { width: 100%; padding-top: calc(var(--nav-h) + 20px); }
  .panel__text .h2 { font-size: clamp(44px, 13vw, 60px); margin-bottom: 14px; }
  .panel__text .body { font-size: 16px; }
  .panel__text .note { margin-top: 14px; }
  .panel--hero .display { font-size: clamp(40px, 11vw, 60px); max-width: none; }
  .st-hero text { display: none; }
  .panel--hero .lede { margin-top: 18px; font-size: 17px; }
  .hero__ctas { margin-top: 24px; }
  .stop__stage { --u: calc(min(94vw, 48svh) / 600); --beltB: 12svh; }
  .stop__risk { bottom: auto; top: calc(var(--nav-h) + 23svh); font-size: clamp(130px, 44vw, 220px); }
  .stop__scale { left: var(--gutter); bottom: calc(var(--beltB) + 13svh); }
  .stop__tower { height: 36svh; right: var(--gutter); }
  .stop__cut .display { font-size: clamp(48px, 14vw, 72px); bottom: calc(var(--beltB) + 12svh); }
  .stop__cut .note { bottom: calc(var(--beltB) - 64px); }
}
@media (max-width: 760px) and (max-height: 700px) {
  .panel__text .body { display: none; }
}
