/* Scrolling pages (demos/ and each demo's page): a scrolling page on top of styles.css — same tokens, type, bar,
   buttons and legal line. Reads like a drawing sheet: numbered sections, hairline rules, figure captions. */

.page .bar {
  max-width: 1120px;
  margin: 0 auto;
}

.sector {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Until the page's script translates it; shown anyway if the script never runs. */
.sector { transition: opacity 0.4s; }
.translating .sector {
  opacity: 0;
  animation: reveal 0s 3s forwards;
}

h2, h3, figure, ol, ul { margin: 0; }

/* ---------- intro ---------- */

.intro {
  max-width: 860px;
  padding: clamp(40px, 9vh, 104px) 0 clamp(36px, 6vh, 64px);
}

.eyebrow {
  margin-bottom: 20px;
  color: var(--brand);
  font: 500 0.8125rem/1.4 var(--font-mono);
}

.title {
  max-width: 17ch;
  font-weight: 600;
  font-size: clamp(2.375rem, 5.4vw, 4.375rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.lead {
  max-width: 58ch;
  margin-top: 24px;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.sector .actions {
  justify-content: flex-start;
  margin-top: 32px;
}

/* ---------- figures ---------- */

.reel video,
.feature img,
.pair img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  outline: 1px solid var(--guide);
  outline-offset: -1px;
  background: #DCDAD4; /* the demo's paper, so a figure never flashes black while it loads */
}

.reel video { aspect-ratio: 8 / 5; }

figcaption {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font: 400 0.75rem/1.55 var(--font-mono);
}

.fig {
  flex: none;
  color: var(--brand);
}

/* fictional data, flagged like a sign on a site hoarding: a yellow tab with the text beside it */
.demo-note {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font: 400 0.75rem/1.55 var(--font-mono);
}

.demo-note::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: translateY(-1px);
}

/* ---------- numbered sections ---------- */

.block {
  margin-top: clamp(80px, 13vh, 144px);
  padding-top: 28px;
  border-top: 1px solid var(--guide);
}

.block h2 {
  margin-bottom: clamp(28px, 4.5vh, 48px);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.2vw, 2.625rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.num {
  display: block;
  margin-bottom: 16px;
  color: var(--brand);
  font: 500 0.8125rem/1 var(--font-mono);
  letter-spacing: 0;
}

.block h3 {
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.block p { text-wrap: pretty; }

.body {
  max-width: 62ch;
  font-size: 1.0625rem;
}

/* 01: four things the buyer sees, each a picture and a paragraph */
.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 7vh, 72px) clamp(24px, 4vw, 48px);
}

.feature h3 { margin: 20px 0 8px; }

.feature p {
  max-width: 50ch;
  color: var(--muted);
}

/* the phone: a portrait screen beside its text, as tall as the landscape pictures next to it */
.feature-phone {
  display: grid;
  grid-template-columns: 35% 1fr;
  gap: clamp(20px, 3vw, 32px);
  align-items: end;
}

.feature-phone img {
  align-self: start; /* level with the picture beside it; the text sits on the shared baseline */
  border-radius: 14px;
}
.feature-phone h3 { margin-top: 0; }

/* 02: text, then two drawings side by side */
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.5vw, 28px);
  margin-top: 36px;
}

/* 03: three steps along one rule */
.steps-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 48px);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps-list li {
  counter-increment: step;
  padding-top: 18px;
  border-top: 1px solid var(--text);
}

.steps-list li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 14px;
  color: var(--brand);
  font: 500 0.75rem/1 var(--font-mono);
}

.steps-list h3 { margin-bottom: 8px; }
.steps-list p { color: var(--muted); }

/* 04: custom software */
.statement {
  margin-bottom: 14px;
  font-weight: 500;
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.needs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(24px, 4vw, 48px);
  margin: 28px 0 32px;
  padding: 0;
  list-style: none;
}

.needs li {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--guide);
}

/* the same slash that separates the services on the home page */
.needs li::before {
  content: "/";
  color: var(--brand);
  font-family: var(--font-mono);
}

/* ---------- the demos index ---------- */

/* the demos follow the intro closely: they are the page */
.block-first { margin-top: clamp(16px, 3vh, 40px); }

.demos {
  padding: 0;
  list-style: none;
}

/* A demo: its reel beside its text. The title's link covers the card; the live demo's link sits above it. */
.demo {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: end;
}

.demo + .demo {
  margin-top: clamp(56px, 9vh, 96px);
  padding-top: clamp(56px, 9vh, 96px);
  border-top: 1px solid var(--guide);
}

.demo-media { position: relative; }

.demo-media video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  border-radius: 6px;
  outline: 1px solid var(--guide);
  outline-offset: -1px;
  background: #DCDAD4;
}

/* Registration marks, as on a print sheet: they open out around the reel when the card is picked. */
.demo-media::before {
  --tick: linear-gradient(var(--brand) 0 0);
  content: "";
  position: absolute;
  inset: -4px;
  background:
    var(--tick) top left / 12px 1px, var(--tick) top left / 1px 12px,
    var(--tick) top right / 12px 1px, var(--tick) top right / 1px 12px,
    var(--tick) bottom left / 12px 1px, var(--tick) bottom left / 1px 12px,
    var(--tick) bottom right / 12px 1px, var(--tick) bottom right / 1px 12px;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: inset 0.5s var(--ease-out), opacity 0.25s;
}

.demo:is(:hover, :focus-within) .demo-media::before {
  inset: -11px;
  opacity: 1;
}

.demo-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font: 400 0.75rem/1.55 var(--font-mono);
}

.block .demo-name {
  font-weight: 600;
  font-size: clamp(1.75rem, 3.2vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

/* the underline draws in from the left, like a line on the plotter */
.demo-link {
  text-decoration: none;
  background: linear-gradient(var(--brand) 0 0) 0 100% / 0 2px no-repeat;
  transition: background-size 0.45s var(--ease-out);
}

.demo-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.demo-arrow {
  display: inline-block;
  margin-left: 0.3em;
  color: var(--brand);
  font-weight: 400;
  transition: transform 0.45s var(--ease-out);
}

.demo:is(:hover, :focus-within) .demo-link { background-size: 100% 2px; }
.demo:is(:hover, :focus-within) .demo-arrow { transform: translateX(6px); }

.demo-body {
  max-width: 46ch;
  margin-top: 14px;
  color: var(--muted);
  text-wrap: pretty;
}

.demo-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

.demo-specs li {
  padding: 5px 9px;
  border: 1px solid var(--guide);
  border-radius: 3px;
  color: var(--muted);
  font: 400 0.6875rem/1.2 var(--font-mono);
}

.demo-actions { margin-top: 26px; }
.demo-live { position: relative; z-index: 1; }
.demo .demo-note { margin-top: 18px; }

.page .foot {
  margin-top: clamp(96px, 14vh, 160px);
  padding-bottom: 28px;
}

@media (max-width: 760px) {
  .features,
  .pair,
  .steps-list,
  .needs { grid-template-columns: 1fr; }

  .feature-phone { grid-template-columns: 40% 1fr; }

  .demo {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
