/* Fonts, self-hosted (the CSP only allows 'self') */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --concrete: #edeff2;
  --panel: #ffffff;
  --ink: #101826;
  --steel: #5b6573;
  --line: #d5dae1;
  --line-2: #bcc3cd;
  --signal: #ffc21a;
  --pass: #17803d;
  --radius: 10px;
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --hazard: repeating-linear-gradient(-45deg, var(--signal) 0 10px, var(--ink) 10px 20px);
  --cycle: 12s;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--concrete);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; line-height: 1; font-stretch: 125%; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.mono { font-family: var(--mono); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 32px; } }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--ink); color: #fff;
  padding: 8px 12px; border-radius: 6px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 6px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn--lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #26324a; }
.btn--ghost { border-color: var(--line-2); color: var(--ink); background: var(--panel); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--signal { background: var(--signal); color: var(--ink); }
.btn--signal:hover { background: #ffd04d; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(237, 239, 242, .85);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 12px; height: 62px; }
@media (min-width: 480px) { .nav__inner { gap: 32px; } }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-stretch: 112%; white-space: nowrap; }
.brand__mark { width: 22px; height: 22px; fill: var(--ink); }
.nav__links { display: none; gap: 28px; font-size: 14px; color: var(--steel); }
.nav__links a:hover { color: var(--ink); }
.nav__cta { margin-left: auto; display: flex; gap: 8px; }
.nav__cta .btn--ghost span { display: none; }
@media (min-width: 480px) { .nav__cta .btn--ghost span { display: inline; } }
@media (max-width: 399px) { .nav__cta .btn--primary { display: none; } }
@media (min-width: 900px) { .nav__links { display: flex; } }

/* Hero */
.hero { padding: 56px 0 72px; }
@media (min-width: 960px) { .hero { padding: 88px 0 104px; } }

.hero__top { display: grid; gap: 32px; align-items: end; }
@media (min-width: 1100px) {
  .hero__top { grid-template-columns: auto minmax(300px, 1fr); gap: 56px; }
  .h1__in, .h1__out { white-space: nowrap; }
}

h1 { font-size: clamp(40px, 8.4vw, 88px); letter-spacing: -0.035em; line-height: .95; }
.h1__in, .h1__out { display: block; }
.h1__in { font-weight: 300; color: var(--steel); }
.h1__out { font-weight: 850; }

.lead { max-width: 30em; font-size: clamp(16px, 2vw, 18px); color: var(--steel); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.note { margin-top: 20px; font-size: 12px; color: var(--steel); letter-spacing: .02em; }

/* Factory floor: the hero's signature */
.floor {
  margin: 56px 0 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgba(16, 24, 38, .35);
  overflow: hidden;
}
.floor__head {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--steel); text-transform: uppercase; letter-spacing: .08em;
}
.live {
  display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%;
  background: var(--pass); vertical-align: 1px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(23, 128, 61, .18); } }

.stations { display: grid; }
.st {
  position: relative;
  display: grid; gap: 6px; align-content: start;
  padding: 14px 20px 16px;
  border-bottom: 1px solid var(--line);
  animation: lit var(--cycle) linear infinite;
}
.st__n { font-size: 11px; color: var(--steel); }
.st__name { font-size: 20px; font-weight: 750; font-stretch: 118%; letter-spacing: -0.01em; }
.st__out { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--steel); }
.st::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  animation: work var(--cycle) linear infinite;
  animation-delay: inherit;
}
.st--2 { animation-delay: calc(var(--cycle) * .2); }
.st--3 { animation-delay: calc(var(--cycle) * .4); }
.st--4 { animation-delay: calc(var(--cycle) * .6); }
.st--5 { animation-delay: calc(var(--cycle) * .8); }

/* The release gate: the one station agents can't pass */
.st--gate { background: var(--panel); }
.st--gate::before { height: 6px; background: var(--hazard); transform: none; animation: none; }
.lock { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.st--gate .st__out { color: var(--ink); font-weight: 500; }

@keyframes lit {
  0%, 17% { background-color: #f6f7f9; }
  19%, 100% { background-color: transparent; }
}
@keyframes work {
  0% { transform: scaleX(0); }
  16% { transform: scaleX(1); }
  18%, 100% { transform: scaleX(0); }
}
.st--gate { animation-name: none; }

@media (min-width: 760px) {
  .stations { grid-template-columns: repeat(5, 1fr); }
  .st { border-bottom: 0; border-right: 1px solid var(--line); min-height: 128px; }
  .st:last-child { border-right: 0; }
}

/* Conveyor belt with the travelling issue */
.belt { display: none; }
@media (min-width: 760px) {
  .belt {
    display: block; position: relative; height: 76px;
    background-color: var(--ink);
    background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 28px);
    animation: tread 1s linear infinite;
  }
}
@keyframes tread { to { background-position: 28px 0; } }

.ticket {
  position: absolute; top: 12px;
  left: calc(80% + 10px); width: calc(20% - 20px);
  display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 2px;
  padding: 8px 12px;
  background: var(--panel); border-radius: 6px;
  box-shadow: 0 6px 0 -2px rgba(0, 0, 0, .35);
  animation: ride var(--cycle) cubic-bezier(.6, 0, .3, 1) infinite;
}
.ticket__id { font-size: 12px; color: var(--steel); align-self: center; }
.ticket__title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket__status { grid-column: 1 / -1; height: 18px; overflow: hidden; font-size: 11px; color: var(--pass); }
.ticket__reel { display: grid; transform: translateY(-72px); animation: reel var(--cycle) steps(1) infinite; }
.ticket__reel span { height: 18px; line-height: 18px; white-space: nowrap; }
.ticket__reel span:last-child { color: var(--ink); font-weight: 500; }

@keyframes ride {
  0% { left: 10px; opacity: 0; }
  3% { opacity: 1; }
  14% { left: 10px; }
  20%, 34% { left: calc(20% + 10px); }
  40%, 54% { left: calc(40% + 10px); }
  60%, 74% { left: calc(60% + 10px); }
  80%, 96% { left: calc(80% + 10px); opacity: 1; }
  100% { left: calc(80% + 10px); opacity: 0; }
}
@keyframes reel {
  0% { transform: translateY(0); }
  18% { transform: translateY(-18px); }
  38% { transform: translateY(-36px); }
  58% { transform: translateY(-54px); }
  78% { transform: translateY(-72px); }
}

.floor__cap { padding: 14px 20px; font-size: 13px; color: var(--steel); border-top: 1px solid var(--line); }
@media (min-width: 760px) { .floor__cap { border-top: 0; } }

/* Sections */
.section { padding: 80px 0; border-top: 1px solid var(--line); scroll-margin-top: 62px; }
@media (min-width: 960px) { .section { padding: 112px 0; } }
.section__head { max-width: 44em; }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--steel); margin-bottom: 16px; }
h2 { font-size: clamp(30px, 5vw, 50px); font-weight: 800; letter-spacing: -0.03em; }
.section__lead { margin-top: 18px; color: var(--steel); font-size: 17px; }

/* The line: station spec sheet */
.sheet {
  margin-top: 48px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.sheet__head, .row { display: grid; gap: 10px 32px; padding: 20px 24px; }
.sheet__head { display: none; }
.row { border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row__st { display: flex; align-items: baseline; gap: 12px; }
.row__st strong { font-size: 19px; font-weight: 750; font-stretch: 118%; }
.row__n { font-size: 12px; color: var(--steel); }
.row__io { color: var(--steel); font-size: 15px; }
.row__io em { font-style: normal; font-weight: 700; color: var(--ink); }
.row__label { display: inline-block; width: 52px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--steel); opacity: .8; }
.loop {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 11px; color: var(--ink); white-space: nowrap;
}
.row--gate { position: relative; background: var(--panel); }
.row--gate::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--hazard); }

@media (min-width: 860px) {
  .sheet__head, .row { grid-template-columns: 200px 1fr 1.4fr; align-items: baseline; }
  .sheet__head {
    display: grid; padding-top: 14px; padding-bottom: 14px;
    background: #f6f7f9; border-bottom: 1px solid var(--line);
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--steel);
  }
  .row:first-of-type { border-top: 0; }
  .row__label { display: none; }
  .row--gate { padding-top: 26px; }
}

/* Why: cards */
.cards { margin-top: 48px; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card { padding: 28px 24px 32px; background: var(--panel); }
.card__icon { width: 24px; height: 24px; margin-bottom: 28px; fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 18px; font-weight: 750; margin-bottom: 10px; letter-spacing: -0.01em; }
.card p { color: var(--steel); font-size: 15px; }

/* How: steps */
.steps { margin-top: 48px; display: grid; gap: 32px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.step { padding-top: 20px; border-top: 2px solid var(--ink); }
.step__n { display: block; font-size: 13px; color: var(--steel); margin-bottom: 20px; }
.step h3 { font-size: 20px; font-weight: 750; margin-bottom: 10px; letter-spacing: -0.01em; }
.step p { color: var(--steel); font-size: 15px; }

.cta {
  margin-top: 72px; padding: 36px 32px; border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 24px; align-items: flex-start;
  background: var(--ink); color: #fff;
}
@media (min-width: 760px) { .cta { flex-direction: row; align-items: center; justify-content: space-between; padding: 44px 48px; } }
.cta h3 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; margin-bottom: 10px; letter-spacing: -0.02em; }
.cta p { color: #b7c0cc; }

/* FAQ */
.faq__wrap { display: grid; gap: 40px; }
@media (min-width: 960px) { .faq__wrap { grid-template-columns: 1fr 1.6fr; gap: 64px; } }
.faq { border-top: 1px solid var(--line-2); }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 0; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 650;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 400 22px/1 var(--mono); color: var(--steel); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--steel); max-width: 40em; }

/* Footer */
.footer { padding: 40px 0 56px; border-top: 1px solid var(--line); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--steel); }
.footer__links a:hover { color: var(--ink); }
.footer__note { width: 100%; font-size: 12px; color: var(--steel); }
