/* The studio home page (index.html), dark only. The app pages keep style.css.
   Direction: "The product performs" (.taste-skill/direction.json): graphite and one orange accent,
   Stack Sans, and the apps' own screens as the pictures. */
@font-face {
  font-family: 'Stack Sans Headline';
  src: url('fonts/StackSansHeadline-latin.woff') format('woff');
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: 'Stack Sans Text';
  src: url('fonts/StackSansText-latin.woff2') format('woff2');
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --bg: #18191b;
  --surface: #222427;
  --ink: #eff0f1;
  --muted: #9c9ea3;
  --accent: #ff4a1f;
  --accent-hover: #ff6a45;
  --accent-ink: #18191b;
  --field: #eff0f1;
  --field-ink: #18191b;

  --display: 'Stack Sans Headline', 'Helvetica Neue', Arial, sans-serif;
  --text: 'Stack Sans Text', 'Helvetica Neue', Arial, sans-serif;

  /* Five sizes, no more. */
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 2.4vw, 3.25rem);
  --step-display: clamp(2.5rem, 0.6rem + 3.8vw, 3.75rem);

  --margin: clamp(16px, 2.2vw, 32px);
  --radius: 4px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, ol, figure { margin: 0; }
ol { padding: 0; list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  background: var(--accent); color: var(--accent-ink);
  font: 500 var(--step-body)/1 var(--text);
  border-radius: var(--radius); text-decoration: none; white-space: nowrap;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: var(--step-small); }

/* ---------- Hero: a sentence split by a frame, the frame a reel of the three apps ---------- */
.hero { position: relative; height: 100vh; /* taste-skill-ignore: fallback */ height: 100svh; }
.js .hero { height: calc(240vh); /* taste-skill-ignore: fallback */ height: calc(100svh + 140svh); }
.stage {
  position: sticky; top: 0;
  height: 100vh; /* taste-skill-ignore: fallback */ height: 100svh;
  overflow: hidden;
}

.nav {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px var(--margin);
  font-size: var(--step-small);
}
.nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.nav a:not(.btn):hover { color: var(--ink); text-decoration: underline; }
.wordmark { font-weight: 500; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 28px; }

.split {
  font: 300 var(--step-display)/1.05 var(--display);
  letter-spacing: -0.022em;
}
.half { display: block; white-space: nowrap; }

.reel-window { container-type: size; overflow: hidden; }
.reel {
  --cap: 34px;
  position: absolute; left: 0; right: 0;
  top: calc(50% - var(--fh) / 2);
  display: flex; flex-direction: column; gap: var(--gap);
  transition: transform 800ms var(--ease-out);
}
.frame { height: var(--fh); border-radius: var(--radius); overflow: hidden; background: #000; }
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.reel figcaption {
  height: var(--cap); padding-top: 10px;
  font-size: var(--step-small); line-height: 24px; color: var(--muted);
  transition: color 300ms ease;
}
.reel .is-current figcaption { color: var(--ink); }

.lede { max-width: 30em; }

/* Wide: the halves sit on the centre line, pushed to the edges; the frame between them. */
@media (min-width: 1100px) {
  .split {
    position: absolute; z-index: 2; left: var(--margin); right: var(--margin); top: 50%;
    transform: translateY(-50%);
    display: flex; justify-content: space-between; align-items: baseline;
  }
  /* The reel runs in a band of the stage colour, top to bottom of the screen. */
  .reel-window {
    --fw: min(37vw, 680px);
    position: absolute; top: 0; bottom: 0; left: 50%;
    width: var(--fw); margin-left: calc(var(--fw) / -2);
    background: var(--surface);
  }
  .reel {
    left: 24px; right: 24px;
    --fh: calc((100cqw - 48px) * 9 / 16);
    --gap: calc((100cqh - var(--fh)) / 2 - 60px - var(--cap));
  }
  .lede {
    position: absolute; left: var(--margin);
    top: calc(50% + var(--step-display) * 0.53 + 40px);
    width: calc((100vw - min(37vw, 680px)) / 2 - var(--margin) - 48px);
  }
}

/* Narrow: the first half under the wordmark, the frame, the second half flush right. */
@media (max-width: 1099px) {
  .stage {
    --line: calc(var(--step-display) * 1.05);
    --fw: min(100vw - 2 * var(--margin), 680px);
    display: grid;
    grid-template-rows: auto 1fr var(--line) auto var(--line) auto 1.4fr;
  }
  .nav { position: static; grid-row: 1; }
  .split {
    grid-row: 3 / 6; grid-column: 1;
    display: flex; flex-direction: column; justify-content: space-between;
    padding-inline: var(--margin);
  }
  .half-b { align-self: flex-end; }
  .reel-window {
    grid-row: 4; grid-column: 1; position: relative;
    width: var(--fw); margin: 12px auto;
    height: min(var(--fw) * 3 / 4 + 148px, 100vh - 340px); /* taste-skill-ignore: fallback */
    height: min(var(--fw) * 3 / 4 + 148px, 100svh - 340px);
  }
  .reel {
    --fh: min(100cqw * 3 / 4, 100cqh - 2 * (28px + var(--cap) + 12px));
    --gap: calc((100cqh - var(--fh)) / 2 - 28px - var(--cap));
  }
  .lede { grid-row: 6; padding: 16px var(--margin) 0; }
}
@media (max-width: 599px) {
  .nav a.nav-extra { display: none; }
  .nav-links { gap: 20px; }
}

/* ---------- What they do: six cells, the fragments in a checkerboard ---------- */
.features { padding: clamp(96px, 12vw, 176px) var(--margin) 0; }
.title {
  font: 300 var(--step-head)/1.05 var(--display);
  letter-spacing: -0.022em;
  margin-bottom: 56px;
}
.cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cell {
  display: flex; flex-direction: column;
  height: 440px;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
}
.cell-flip { flex-direction: column-reverse; }
.cell-text { padding: 24px; }
.cell h3 { font: 500 var(--step-body)/1.3 var(--text); margin-bottom: 8px; }
.cell-text p { color: var(--muted); }
.cell-frag { position: relative; flex: 1; min-height: 0; }
.cell-frag > img, .cell-frag > video {
  position: absolute; top: 0; left: 24px;
  width: 440px; max-width: none; height: auto;
  border-radius: var(--radius);
}
.cell-flip .cell-frag > img, .cell-flip .cell-frag > video { top: auto; bottom: 0; }
.cell-frag-right > img, .cell-frag-right > video { left: auto; right: 24px; }

/* Benchly's fair share, built as a piece of Benchly (dark mode). */
.fair {
  position: absolute; left: 24px; right: 24px; top: 0; bottom: 0;
  padding: 16px 16px 0;
  background: #000; color: #fff;
  border: 1px solid #2c2c2e; /* taste-skill-ignore: Benchly's own card, inside data-ui */
  border-bottom: 0; border-radius: 12px 12px 0 0;
  font-family: var(--text);
}
.fair-result { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.fair-big {
  font-size: 30px; font-weight: 600; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.fair-big.bump { animation: bump 360ms var(--ease-out); }
@keyframes bump { from { color: #6aa0f0; } to { color: #fff; } }
.fair-line { flex-basis: 100%; font-size: 13px; line-height: 1.4; color: #8e8e93; }
.fair-controls { display: grid; gap: 6px; margin-top: 14px; }
.stepper { display: grid; grid-template-columns: 1fr 44px 44px 44px; align-items: center; }
.stepper-label { font-size: 15px; }
.stepper output {
  text-align: center; font-size: 17px; font-weight: 600; color: #6aa0f0;
  font-variant-numeric: tabular-nums;
}
.stepper button {
  width: 44px; height: 44px; padding: 0;
  border: 1px solid #3a3a3c; /* taste-skill-ignore: Benchly's own stepper, inside data-ui */
  border-radius: 8px;
  background: transparent; color: #fff;
  font: 400 20px/1 var(--text); cursor: pointer;
  transition: background-color 140ms ease, transform 140ms var(--ease-out);
}
.stepper button:hover { background: #1c1c1e; }
.stepper button:active { background: #2c2c2e; transform: scale(0.96); }
.stepper button:disabled { opacity: 0.35; cursor: default; background: transparent; transform: none; }

@media (min-width: 600px) and (max-width: 1099px) {
  .cells { grid-template-columns: repeat(2, 1fr); }
  .cell { height: 460px; }
  .cell-frag-right > img, .cell-frag-right > video { left: 24px; right: auto; }
}
@media (max-width: 599px) {
  .cells { grid-template-columns: 1fr; gap: 6px; }
  .cell, .cell-flip { height: auto; flex-direction: column; }
  .cell-frag { flex: none; height: 260px; }
  .cell-frag > img, .cell-frag > video,
  .cell-flip .cell-frag > img, .cell-flip .cell-frag > video { top: 0; bottom: auto; left: 0; right: auto; }
  .cell-frag-right > img, .cell-frag-right > video { left: auto; right: 0; }
  .cell-live .cell-frag { height: auto; padding: 0 16px; }
  .fair { position: static; }
}

/* ---------- What they cost: the app names, one stage with the selected price ---------- */
.pricing { padding: clamp(120px, 14vw, 200px) var(--margin) 0; }
.plan-name {
  position: relative; display: block;
  min-height: 44px; padding: 2px 0 2px 0.6em; margin: 0;
  background: none; border: 0; cursor: pointer; text-align: left;
  color: var(--muted);
  font: 300 var(--step-display)/1.1 var(--display); letter-spacing: -0.022em;
  transition: color 200ms ease;
}
.plan-name::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 0.3em; height: 0.3em; border-radius: 50%;
  background: var(--accent);
  opacity: 0; transform: translateY(-50%) scale(0.6);
  transition: opacity 200ms ease, transform 200ms var(--ease-out);
}
.plan-name:hover { color: var(--ink); }
.plan.is-open .plan-name { color: var(--ink); }
.plan.is-open .plan-name::before { opacity: 1; transform: translateY(-50%) scale(1); }
.plan-price { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; }
.plan-figure {
  font: 300 var(--step-display)/1.05 var(--display); letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
}
.plan-period { color: var(--muted); }
.plan-text { margin-top: 20px; max-width: 32em; }
.plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 28px; }
.plan-actions a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
.note { margin-top: 72px; max-width: 40em; color: var(--muted); }

/* Without the script every app shows its price, one under another. */
.plan + .plan { margin-top: 24px; }
.plan-stage { padding: 12px 0 0 0.6em; }

@media (min-width: 900px) {
  .js .plans {
    display: grid; grid-template-columns: 6fr 1fr 5fr;
    grid-template-rows: auto auto auto 1fr;
  }
  .js .plan { display: contents; }
  .js .plan:nth-child(1) .plan-name { grid-row: 1; }
  .js .plan:nth-child(2) .plan-name { grid-row: 2; }
  .js .plan:nth-child(3) .plan-name { grid-row: 3; }
  .js .plan-name { grid-column: 1; justify-self: start; }
  .js .plan-stage {
    grid-column: 3; grid-row: 1 / 5; padding: 6px 0 0;
    opacity: 0; visibility: hidden;
    transition: opacity 200ms ease, visibility 0s linear 200ms;
  }
  .js .plan.is-open .plan-stage { opacity: 1; visibility: visible; transition: opacity 200ms ease; }
}
@media (max-width: 899px) {
  .js .plan + .plan { margin-top: 4px; }
  .js .plan:not(.is-open) .plan-stage { display: none; }
  .js .plan.is-open .plan-stage { padding: 12px 0 76px; animation: open 200ms ease; }
  .plan-actions .btn { order: 1; width: 100%; }
}
@keyframes open { from { opacity: 0; } }

/* ---------- Contact: one prompt, one field ---------- */
.contact { margin-top: clamp(120px, 14vw, 200px); padding: 160px var(--margin) 140px; background: var(--surface); }
.contact > * { width: min(520px, 100%); margin-inline: auto; }
.prompt { font: 500 var(--step-lead)/1.3 var(--text); }
.prompt span { display: block; }
.prompt span:first-child { color: var(--muted); }
.ask { position: relative; margin-top: 28px; }
.ask input {
  display: block; width: 100%; height: 64px; margin: 0;
  padding: 0 68px 0 20px;
  border: 0; border-radius: var(--radius);
  background: var(--field); color: var(--field-ink);
  font: 400 var(--step-body)/1 var(--text);
}
.ask input::placeholder { color: #5f6166; }
.ask input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.ask button {
  position: absolute; top: 10px; right: 10px;
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.ask button:hover { background: var(--accent-hover); }
.ask button:active { transform: translateX(2px); }
.ask svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ask-note { margin-top: 16px; font-size: var(--step-small); color: var(--muted); }
.facts { display: grid; gap: 4px; margin-top: 72px; }
.facts div { display: grid; grid-template-columns: 7.5em 1fr; align-items: baseline; }
.facts dt { font-size: var(--step-small); color: var(--muted); }
.facts dd a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 599px) {
  .contact { padding: 96px 20px 88px; }
  .ask input { height: 60px; }
  .ask button { top: 8px; right: 8px; }
  .facts { gap: 16px; }
  .facts div { grid-template-columns: 1fr; }
  .facts dd a { min-height: 32px; }
}

/* ---------- Footer: one quiet line ---------- */
.foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 24px;
  padding: 30vh var(--margin) 30px; /* taste-skill-ignore: fallback */
  padding: 30svh var(--margin) 30px;
  font-size: var(--step-small); color: var(--muted);
}
.foot-links { display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; color: var(--ink); }
.foot-year { justify-self: end; }
@media (max-width: 699px) {
  .foot { grid-template-columns: 1fr; gap: 8px; padding-top: 20svh; padding-bottom: 24px; }
  .foot-year { justify-self: start; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .js [data-rise] {
    opacity: 0; transform: translateY(24px);
    transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 80ms);
  }
  .js .plan-name[data-rise] {
    transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out), color 200ms ease;
    transition-delay: calc(var(--i, 0) * 80ms), calc(var(--i, 0) * 80ms), 0s;
  }
  .js [data-rise].in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reel, .reel figcaption, .plan-stage, .plan-name::before { transition: none !important; }
  .fair-big.bump, .js .plan.is-open .plan-stage { animation: none; }
}
