/* Enlightened Machines (by Ignomagine) robot story — one pinned stage that plays the film as you scroll. System fonts only. */
:root {
  --bg: #07090b;
  --bg-2: #0d1115;
  --fg: #eef2f4;
  --muted: #9aa6ae;
  --line: rgba(255, 255, 255, 0.10);
  --panel: rgba(9, 12, 15, 0.74);
  --accent: #ff3406;          /* brand orange, from the logo */
  --ok: #4be08f;
  --warn: #ffc233;
  --bad: #ff6b5b;
  --sans: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --top: 64px;
  --edge: clamp(16px, 3vw, 40px);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 17px/1.5 var(--sans); background: var(--bg); overflow-x: clip; }
h1, h2 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.04; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rec, .scroll-cue span::after { animation: none; }
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--edge);
  background: linear-gradient(to bottom, rgba(7, 9, 11, 0.85), rgba(7, 9, 11, 0));
}
.topbar { transition: background-color .3s ease; }
.topbar.solid { background: rgba(7, 9, 11, 0.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: 0.01em; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-word { height: 19px; width: auto; display: block; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.topnav a:not(.btn) { color: var(--muted); text-decoration: none; }
.topnav a:not(.btn):hover { color: var(--fg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px;
  border-radius: 999px; background: var(--accent); color: #11140a; font-weight: 650; text-decoration: none;
  transition: transform .2s ease, background-color .2s ease;
}
.btn:hover { background: #ff5a2e; transform: translateY(-1px); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* ---------- story: pinned stage + scroll marks ---------- */
.story { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--bg); }
.marks { margin-top: -100vh; margin-top: -100svh; }
/* --pace stretches every scene's scroll length: 2 = the film moves half as far per scroll step */
.marks { --pace: 2; }
.mark { height: calc(var(--len) * var(--pace) * 100vh); height: calc(var(--len) * var(--pace) * 100svh); }
.mark-tail { height: 100vh; height: 100svh; }

.film { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 7, 9, 0.78) 0%, rgba(5, 7, 9, 0.38) 34%, rgba(5, 7, 9, 0) 56%),
    linear-gradient(to top, rgba(5, 7, 9, 0.55) 0%, rgba(5, 7, 9, 0) 28%);
}
.film { transition: filter .25s ease; }
.stage.stale .film { filter: brightness(0.45) blur(3px); }
.film-wait {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 8px 14px; border-radius: 999px;
  background: rgba(7, 9, 11, 0.7); color: var(--fg); font: 12px var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.stage.stale .film-wait { opacity: 1; }
.film-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--muted); font: 13px var(--mono); }

/* scene cards */
.cards { position: absolute; left: var(--edge); top: calc(var(--top) + 16vh); width: min(560px, 44vw); }
.card { position: absolute; inset: 0 auto auto 0; width: 100%; opacity: 0; pointer-events: none; will-change: opacity, transform; }
.card.on { pointer-events: auto; }
.card h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); }
.card h2 { font-size: clamp(2rem, 3.9vw, 3.5rem); }
.eyebrow { font: 600 13px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.lede { margin-top: 18px; max-width: 34em; font-size: clamp(1rem, 1.3vw, 1.2rem); line-height: 1.55; color: #c9d1d6; }
.card-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.scroll-cue { margin-top: 40px; display: flex; align-items: center; gap: 12px; font: 12px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.scroll-cue b { font-weight: inherit; }
.scroll-cue span { position: relative; width: 1px; height: 44px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.scroll-cue span::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--accent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { to { top: 100%; } }

/* right-hand column: the camera on top, the floor map at the bottom. One flex column, so they can never overlap,
   and each is sized from the screen's width AND height so both always fit (--fit = height left for the pictures). */
.side {
  position: absolute; right: calc(var(--edge) + 34px); top: calc(var(--top) + 8px); bottom: 28px;
  display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 12px;
  pointer-events: none;
  --fit: calc(100vh - var(--top) - 160px);
  --fit: calc(100svh - var(--top) - 160px);
}

/* robot camera panel */
.pov {
  position: relative; flex: none; width: min(30vw, 430px, calc(var(--fit) * 0.7));
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(-8px); transition: opacity .35s ease, transform .35s ease; pointer-events: none;
}
.pov.on { opacity: 1; transform: none; }
.pov-head, .pov-foot { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font: 12px/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.pov-name { color: var(--fg); white-space: nowrap; }
.pov-time { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 107, 91, 0.18); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.pov-view { position: relative; aspect-ratio: 4 / 3; background: #0b0e11; }
.pov-view canvas, .pov-overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pov-overlay text { font-family: var(--mono); font-weight: 600; }
.pov-status {
  position: absolute; left: 10px; bottom: 10px; padding: 5px 9px; border-radius: 5px; background: rgba(5, 7, 9, 0.78);
  font: 600 12px/1.2 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg);
}
.pov-status:empty { display: none; }
.pov-status.ok { color: #08140d; background: var(--ok); }
.pov-status.warn { color: #1b1203; background: var(--warn); }
.pov-foot { justify-content: space-between; color: var(--muted); text-transform: none; letter-spacing: 0.02em; }
.pov-foot span, .map figcaption span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #6f7b83; }

/* robot console */
.console {
  position: absolute; left: var(--edge); bottom: 28px; width: min(400px, 36vw);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 10px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: 12px/1.35 var(--mono); transition: opacity .35s ease;
}
.console.off { opacity: 0; }
.console-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.state { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); }
.state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.state.warn { color: var(--warn); }
.telemetry { display: grid; grid-template-columns: repeat(5, auto); justify-content: space-between; gap: 4px 12px; margin: 10px 0 8px; padding: 9px 0; border-block: 1px solid var(--line); }
.telemetry div { min-width: 0; }
.telemetry dt { color: #6f7b83; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.telemetry dd { margin: 2px 0 0; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log { list-style: none; margin: 0; padding: 0; min-height: calc(4 * 1.6em); display: flex; flex-direction: column; justify-content: flex-end; }
.log li { display: flex; gap: 10px; padding: 1px 0; color: #7d8990; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.6em; }
.log li time { color: #56616a; font-variant-numeric: tabular-nums; }
.log li:last-child { color: var(--fg); }
.log li.ok:last-child { color: var(--ok); }
.log li.warn:last-child { color: var(--warn); }
.log li.bad { color: #9a6a64; }
.log li.bad:last-child { color: var(--bad); }

/* floor map */
.map {
  position: relative; flex: none; width: min(22vw, 300px, calc(var(--fit) * 0.49)); margin: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .35s ease;
}
.map.on { opacity: 1; }
.map svg { display: block; width: 100%; height: auto; }
.map figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; font: 11px/1.2 var(--mono); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; border-top: 1px solid var(--line); }
.map .rack { fill: #1e262d; }
.map .wall { fill: none; stroke: #2a333b; stroke-width: 0.8; }
.map .zone { fill: rgba(255, 52, 6, 0.07); stroke: rgba(255, 52, 6, 0.55); stroke-width: 0.5; stroke-dasharray: 2.5 1.8; }
.map .table { fill: #3a434b; }
.map .route { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-width: 0.7; stroke-dasharray: 2 2; }
.map .trail { fill: none; stroke: var(--accent); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.map .scan { fill: none; stroke: rgba(120, 200, 255, 0.75); stroke-width: 1.1; stroke-linecap: round; }
.map .scan-p { fill: none; stroke: var(--warn); stroke-width: 1.8; stroke-linecap: round; }
.map .beam { fill: rgba(120, 200, 255, 0.07); }
.map .bot { fill: #e9eef1; }
.map .bot-front { stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; }
.map .forklift { fill: rgba(255, 196, 0, 0.28); stroke: var(--warn); stroke-width: 0.9; }
.map .lbl { font-family: var(--mono); font-weight: 600; font-size: 5px; fill: #7d8990; }
.map .lbl-z { fill: rgba(255, 120, 80, 0.95); }
.map .lbl-hit { fill: var(--accent); }

/* chapters + progress */
.chapters { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.chapters a { position: relative; display: block; width: 22px; height: 22px; }
.chapters a::before { content: ""; position: absolute; left: 8px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); transition: background .2s, transform .2s; }
.chapters a.on::before { background: var(--accent); transform: scale(1.5); }
.chapters a span { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg); opacity: 0; transition: opacity .2s; pointer-events: none; }
.chapters a:hover span, .chapters a:focus-visible span { opacity: 1; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, 0.06); }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.loading { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: 120px; height: 2px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; transition: opacity .6s; }
.loading span { display: block; height: 100%; width: 0; background: rgba(255, 255, 255, 0.5); }
.loading.done { opacity: 0; }

/* ---------- after the story ---------- */
.wrap { width: min(1120px, 100% - 2 * var(--edge)); margin: 0 auto; }
.robot { padding: clamp(80px, 12vw, 160px) 0; background: linear-gradient(var(--bg), var(--bg-2)); border-top: 1px solid var(--line); }
.robot h2, .contact h2 { font-size: clamp(2rem, 4.4vw, 3.6rem); max-width: 18em; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 56px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fact { display: flex; flex-direction: column; gap: 10px; padding: 24px 22px; background: var(--bg-2); }
.fact-k { font: 600 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.fact-v { font-size: 1.15rem; line-height: 1.4; }
.steps { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: s; }
.steps li { counter-increment: s; color: #c9d1d6; font-size: 0.98rem; }
.steps li::before { content: "0" counter(s); display: block; margin-bottom: 10px; font: 600 12px var(--mono); color: var(--accent); letter-spacing: 0.12em; }
.steps b { display: block; color: var(--fg); font-size: 1.15rem; margin-bottom: 4px; }
.note { margin-top: 48px; color: #77838b; font-size: 0.9rem; }
.contact { padding: clamp(90px, 13vw, 180px) 0; text-align: center; background: radial-gradient(60% 80% at 50% 100%, rgba(255, 52, 6, 0.13), transparent 70%), var(--bg-2); }
.contact h2 { margin: 0 auto; }
.contact .lede { margin: 20px auto 34px; }
.contact-line { margin-top: 18px; color: var(--muted); font: 14px var(--mono); }
.contact-line a { text-decoration: none; }
.contact-line a:hover { color: var(--fg); text-decoration: underline; }

/* about the company */
.company { padding: clamp(80px, 12vw, 160px) 0; background: var(--bg-2); border-top: 1px solid var(--line); }
.company h2, .team h2 { font-size: clamp(2rem, 4.4vw, 3.6rem); max-width: 18em; }
.company .lede, .team .lede { max-width: 40em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; margin-top: 56px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: 8px; padding: 26px 22px; background: var(--bg); }
.stat-v { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 650; letter-spacing: -0.02em; line-height: 1.05; }
.stat-k { color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.platform { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px 36px; margin-top: 64px; }
.pf h3 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 650; }
.pf h3::before { content: ""; display: block; width: 28px; height: 2px; margin-bottom: 14px; background: var(--accent); }
.pf p { color: #c9d1d6; font-size: 0.98rem; }

/* team */
.team { padding: clamp(80px, 12vw, 160px) 0; background: var(--bg); border-top: 1px solid var(--line); }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 24px; margin-top: 56px; }
.person { display: flex; gap: 24px; align-items: flex-start; padding: 28px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.person-photo { width: 116px; height: 116px; flex: none; border-radius: 50%; object-fit: cover; background: #1b2228; }
.person-text { min-width: 0; }
.person h3 { margin: 0; font-size: 1.45rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.15; }
.person-role { margin-top: 6px; font: 600 12px/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.person-bio { margin-top: 14px; color: #c9d1d6; font-size: 0.98rem; }
.person-focus { margin-top: 12px; color: var(--muted); font-size: 0.9rem; }
.team .note { margin-top: 32px; }
.foot { padding: 28px var(--edge); color: #66727a; font-size: 14px; border-top: 1px solid var(--line); background: var(--bg-2); }
.noscript { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 10px 16px; border-radius: 8px; background: #222; }

/* ---------- smaller landscape screens ---------- */
@media (max-width: 1100px) and (min-aspect-ratio: 1/1) {
  .pov-time { display: none; }
  .telemetry { grid-template-columns: repeat(3, auto); }
  .map { width: min(24vw, 300px, calc(var(--fit) * 0.49)); }
}
@media (max-height: 720px) and (min-aspect-ratio: 1/1) {
  .cards { top: calc(var(--top) + 6vh); }
  .lede { margin-top: 12px; }
  .log { min-height: calc(3 * 1.6em); }
}
/* very short landscape screens (phones on their side): slimmer panels, console without the telemetry row */
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  .side { --fit: calc(100vh - var(--top) - 120px); --fit: calc(100svh - var(--top) - 120px); }
  .pov-time, .pov-foot .sim, .map figcaption span:first-child { display: none; }
  .pov-head, .pov-foot { padding: 5px 8px; font-size: 10px; }
  .map figcaption { padding: 4px 8px; font-size: 9px; }
  .telemetry { display: none; }
  .console-head { margin-bottom: 6px; }
  .log { min-height: calc(2 * 1.6em); }
  .log li:nth-last-child(n+3) { display: none; }
}

/* ---------- portrait phones and tablets: film band on top, panels and text below ---------- */
@media (max-aspect-ratio: 1/1) {
  :root { --top: 56px; --band: 56.25vw; }
  body { font-size: 16px; }
  .topnav a:not(.btn) { display: none; }
  .film { top: var(--top); height: var(--band); bottom: auto; }
  .scrim { top: var(--top); height: var(--band); bottom: auto; background: linear-gradient(to top, var(--bg) 0%, rgba(7, 9, 11, 0) 22%); }
  .film-empty { top: calc(var(--top) + var(--band) / 2); }
  /* camera and map side by side under the film; --half = one panel's width, capped by the height left under the
     film so the scene text at the bottom always has room */
  .stage {
    --half: min(calc((100vw - 2 * var(--edge) - 10px) / 2), calc((100vh - var(--top) - var(--band)) * 0.33));
    --half: min(calc((100vw - 2 * var(--edge) - 10px) / 2), calc((100svh - var(--top) - var(--band)) * 0.33));
  }
  .side {
    left: var(--edge); right: var(--edge); top: calc(var(--top) + var(--band) + 12px); bottom: auto;
    flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 10px;
  }
  .pov, .map { width: var(--half); }
  .pov:not(.on), .map:not(.on) { display: none; }
  .pov { transform: none; }
  .pov-head, .pov-foot { padding: 6px 8px; font-size: 10px; }
  .pov-foot .sim { display: none; }
  .pov-status { font-size: 10px; left: 6px; bottom: 6px; }
  .map figcaption { padding: 5px 7px; font-size: 9px; }
  .map figcaption span:first-child { display: none; }
  /* the console takes the free half next to one panel, the full width when there is none, and steps aside for two */
  .console { left: calc(var(--edge) + var(--half) + 10px); right: var(--edge); bottom: auto; top: calc(var(--top) + var(--band) + 12px); width: auto; padding: 8px 10px; font-size: 11px; }
  .console.wide { left: var(--edge); }
  .stage.two-panels .console { visibility: hidden; }
  .telemetry { grid-template-columns: repeat(2, auto); justify-content: start; gap: 4px 16px; }
  .telemetry div:nth-child(n+4) { display: none; }
  .log { min-height: calc(3 * 1.6em); }
  .log li:nth-last-child(n+4) { display: none; }
  .cards { left: var(--edge); right: var(--edge); top: 0; bottom: 36px; width: auto; }
  .card { inset: auto 0 0 0; }
  .card[data-scene="s0"] { inset: calc(var(--top) + var(--band) + 32px) 0 auto 0; }
  .person { padding: 22px; gap: 18px; }
  .person-photo { width: 88px; height: 88px; }
  .pov-time { display: none; }
  .card h1 { font-size: clamp(2rem, 8.4vw, 3rem); }
  .card h2 { font-size: clamp(1.7rem, 7.4vw, 2.6rem); }
  .lede { font-size: 1rem; margin-top: 12px; }
  .scroll-cue { margin-top: 22px; }
  .chapters { display: none; }
  .facts, .steps { grid-template-columns: 1fr 1fr; }
}
/* portrait tablets: the panels are capped by height, so a third slot is free after two of them: the console uses it */
@media (max-aspect-ratio: 1/1) and (min-width: 600px) {
  .stage.two-panels .console { visibility: visible; left: calc(var(--edge) + 2 * var(--half) + 20px); }
}
@media (max-aspect-ratio: 1/1) and (max-height: 700px) {
  .log { min-height: calc(2 * 1.6em); }
  .log li:nth-last-child(n+3) { display: none; }
}
@media (max-aspect-ratio: 1/1) and (max-height: 660px) {
  .telemetry { display: none; }
  .console-head { margin-bottom: 6px; }
}
@media (max-width: 520px) {
  .facts, .steps { grid-template-columns: 1fr; }
  .person { flex-direction: column; }
}
