/* Stremflix-rs landing page. Direction: "the page is the object" (the ffmpeg test card). */

:root {
  --bg: #161c1a;
  --surface: #1f2725;
  --deep: #2b3632;
  --ink: #e3e2da;
  --muted: #8e948d;
  --accent: #9fc7b8;
  --accent-ink: #161c1a;
  --paper: #e3e2da;
  --paper-2: #cfcec4;
  --paper-ink: #161c1a;
  --paper-muted: #4a514d;

  --font: "Schibsted Grotesk", system-ui, sans-serif;

  --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.75rem, 1.2rem + 1.5vw, 2.25rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3.5rem, 2rem + 6vw, 7rem);

  --margin: clamp(1rem, 2.2vw, 2rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(5rem, 12vw, 13rem);
  --band: 72px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.4; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure, ul, ol, dl, dd, pre { margin: 0; }
ul { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
/* these controls draw their own :active scale */
.button, button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { font-weight: 800; letter-spacing: -0.05em; line-height: 0.88; text-wrap: balance; }
.head { font-size: var(--step-head); }
.small { font-size: var(--step-small); font-weight: 600; }
p { max-width: 62ch; text-wrap: pretty; }
.nums { font-variant-numeric: tabular-nums lining-nums; }
.wrap { padding-inline: var(--margin); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.6rem; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; white-space: nowrap; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease; }
.button:active { transform: scale(0.97); }
.link-plain { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--paper-ink); color: var(--accent); }
  .link-plain:hover { text-decoration-color: transparent; }
}

/* ---------- hero: the card over the test pattern ---------- */
.hero { position: relative; }
.hero__stage { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; place-items: center; container-type: size;
  --p: 0; --cw: 58cqw; --ch: max(62cqh, 30rem); --s: 0.3; }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.hero__scrim { position: absolute; inset: 0; background: var(--bg); opacity: calc(0.62 * (1 - var(--p))); }
.hero__card { position: relative; width: var(--cw); height: var(--ch); padding: 2rem; background: var(--paper); color: var(--paper-ink); display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; transform-origin: 0 100%;
  transform: translate(calc(var(--p) * (var(--margin) - (100cqw - var(--cw)) / 2)), calc(var(--p) * ((100cqh - var(--ch)) / 2 - var(--margin)))) scale(calc(1 - (1 - var(--s)) * var(--p))); }
.hero__title { font-size: var(--step-lead); display: flex; justify-content: space-between; gap: 0.5em; }
.hero__body { display: grid; grid-template-columns: 7fr 5fr; gap: var(--gutter); align-items: start; }
.hero__say { font-size: var(--step-lead); line-height: 1.12; letter-spacing: -0.03em; max-width: 12ch; }
.hero__facts { font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.05em; line-height: 1.15; white-space: nowrap; }
.hero__foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.hero__foot > :last-child { justify-self: end; }

@media (prefers-reduced-motion: no-preference) {
  .js .hero { height: 190svh; }
  /* compositor-driven scrub where supported; site.js drives --p elsewhere */
  @supports (animation-timeline: view()) {
    .js .hero { view-timeline: --hero block; }
    .js .hero__card, .js .hero__scrim { animation: linear both; animation-timeline: --hero; animation-range: contain 0% contain 70%; }
    .js .hero__card { animation-name: hero-card; }
    .js .hero__scrim { animation-name: hero-scrim; }
  }
}
@keyframes hero-card { to { transform: translate(calc(var(--margin) - (100cqw - var(--cw)) / 2), calc((100cqh - var(--ch)) / 2 - var(--margin))) scale(var(--s)); } }
@keyframes hero-scrim { from { opacity: 0.62; } to { opacity: 0; } }

/* ---------- performance: the benchmark table ---------- */
.perf { background: var(--surface); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; padding-block: var(--section); }
.perf__intro { grid-column: 1 / 6; }
.perf__intro p { margin-top: 2.5rem; max-width: 34ch; }
.perf__intro .perf__note { margin-top: 1.5rem; color: var(--muted); font-size: var(--step-small); font-weight: 600; }
.bench { grid-column: 7 / -1; }
.bench ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--deep); border: 1px solid var(--deep); }
.bench__tile { background: var(--surface); padding: 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; min-height: 13rem; }
.bench__x { font-size: var(--step-head); font-weight: 800; letter-spacing: -0.05em; line-height: 0.88; color: var(--accent); }
.bench__x span { margin-left: 0.15em; font-size: var(--step-lead); letter-spacing: -0.04em; color: var(--ink); }
.bench__label { margin-top: auto; max-width: 20ch; font-weight: 600; }
.bench__raw { font-size: var(--step-small); font-weight: 600; color: var(--muted); }
.bench__raw strong { color: var(--ink); }


/* ---------- the built-in player ---------- */
.play { display: grid; grid-template-columns: 1fr 1fr; min-height: 88svh; background: var(--surface); }
.play__plate { padding: 40px; display: grid; align-content: center; }
.play__side { padding: 40px var(--margin) 40px 0; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.play__tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; margin-top: -0.5rem; }
.play__tabs button { min-height: 2.75rem; font-weight: 600; color: var(--muted); transition: color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.play__tabs button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.4em; }
.play__tabs button:active { transform: scale(0.97); }
.play__panels h3 { font-size: var(--step-lead); }
.play__panels p { margin-top: 1.25rem; max-width: 38ch; min-height: 4.5em; }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem var(--gutter); margin-top: 2rem; max-width: 34rem; }
.keys > div { display: flex; align-items: center; gap: 0.75rem; }
.keys dt { display: flex; gap: 0.3rem; }
.keys dt span { min-width: 2rem; height: 2rem; padding: 0 0.5rem; display: grid; place-items: center; background: var(--deep); font-size: var(--step-small); font-weight: 600; }
.play__actions { display: grid; }
.cell { height: 72px; background: var(--deep); font-weight: 600; transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.cell[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.cell:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) {
  .play__tabs button:hover { color: var(--ink); }
  .cell:hover { background: var(--accent); color: var(--accent-ink); }
}

/* real screenshots of the app, kept at their own 16:10 */
.play__shot img { width: 100%; height: auto; }
.play__shot img[hidden] { display: none; }

/* ---------- features: stacking sheets ---------- */
.does { padding-top: var(--section); }
.does > h2 { margin-bottom: 48px; }
.sheet { position: sticky; top: calc(var(--n) * var(--band)); height: calc(100svh - var(--n) * var(--band)); overflow: hidden;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: var(--band) minmax(0, 1fr); column-gap: var(--gutter); padding-inline: var(--margin);
  background: var(--surface); color: var(--ink); }
.sheet--paper { background: var(--paper); color: var(--paper-ink); }
.sheet--deep { background: var(--deep); }
.sheet--paper2 { background: var(--paper-2); color: var(--paper-ink); }
.sheet__name { grid-column: 1 / 7; grid-row: 1; align-self: center; font-size: var(--step-lead); }
.sheet__text { grid-column: 1 / 6; grid-row: 2; align-self: start; padding-top: 1rem; max-width: 40ch; }
.sheet__fig { grid-column: 7 / -1; grid-row: 2; margin-right: calc(var(--margin) * -1); min-height: 0; overflow: hidden; }
.where { width: 100%; margin-bottom: 2rem; border-collapse: collapse; font-size: var(--step-small); text-align: left; }
.where caption { text-align: left; font-weight: 600; padding-bottom: 0.5rem; font-size: var(--step-body); }
.where th, .where td { padding: 0.55rem 0; vertical-align: top; border-top: 1px solid var(--muted); overflow-wrap: anywhere; }
.where th { width: 6rem; font-weight: 600; }
@media (max-height: 720px) { .sheet { position: relative; top: auto; height: auto; min-height: 30rem; } }

/* real screenshots, cropped by the sheet's right edge, on the app's own background */
.sheet__fig { background: #141414; padding: 24px 0 0 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.sheet__fig img { width: auto; max-width: none; height: auto; }

/* ---------- tests: the printed list ---------- */
.proof { padding: var(--section) var(--margin) 0; overflow: hidden; }
.proof__card { width: 56%; min-width: min(100%, 34rem); margin: 0 auto -7rem; padding: 56px 56px 12rem; aspect-ratio: 5 / 7; background: var(--paper); color: var(--paper-ink); text-align: center; rotate: -1.5deg; }
.proof__card h2 { font-size: var(--step-lead); }
.proof__card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; margin-top: 2rem; outline: 1px solid oklch(0 0 0 / 0.1); outline-offset: -1px; }
.proof__say { margin: 2rem auto 0; max-width: 30ch; font-size: var(--step-lead); line-height: 1.12; letter-spacing: -0.03em; font-weight: 600; }
.proof__list { margin-top: 2rem; line-height: 1.7; }

/* ---------- download: one word is the button ---------- */
.cta { position: relative; display: block; min-height: 60svh; padding: var(--margin); background: var(--accent); color: var(--accent-ink); text-decoration: none; overflow: hidden; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.cta__say { max-width: 28ch; font-weight: 600; }
.cta__arrow { position: absolute; top: var(--margin); right: var(--margin); width: clamp(32px, 3.4vw, 48px); height: auto; transition: transform 200ms var(--ease-out); }
.cta__word { position: absolute; left: var(--margin); right: var(--margin); bottom: 24px; font-size: calc((100vw - 2 * var(--margin)) / 4.72); line-height: 0.78; white-space: nowrap; }
.cta:focus-visible { background: var(--accent-ink); color: var(--accent); outline-offset: -6px; }
@media (hover: hover) and (pointer: fine) {
  .cta:hover { background: var(--accent-ink); color: var(--accent); }
  .cta:hover .cta__arrow { transform: translate(6px, -6px); }
}

/* ---------- footer: the back of the card ---------- */
.foot { background: var(--paper); color: var(--paper-ink); padding-bottom: var(--margin); overflow: hidden; }
.foot__mark { padding: 0.12em var(--margin) 0; font-size: calc((100vw - 2 * var(--margin)) / 5.5); line-height: 0.9; white-space: nowrap; }
.foot__row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: 72px; }
.foot__places { grid-column: 1 / 6; display: grid; gap: 1.25rem; align-content: start; }
.foot__places a { display: block; font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.05em; line-height: 1; text-decoration: underline transparent; text-decoration-thickness: 0.08em; text-underline-offset: 0.12em; transition: text-decoration-color var(--t-hover) ease; }
.foot__places span { display: block; margin-top: 0.3rem; color: var(--paper-muted); font-size: var(--step-small); font-weight: 600; }
.foot__cols { grid-column: 7 / -1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--gutter); align-content: start; font-size: var(--step-small); font-weight: 600; }
.foot__cols h3 { font-size: var(--step-small); font-weight: 800; letter-spacing: -0.01em; line-height: 1.4; margin-bottom: 0.6rem; }
.foot__cols li + li { margin-top: 0.35rem; }
.foot__cols pre { margin-top: 0.75rem; padding: 0.75rem; background: var(--paper-2); font-size: var(--step-small); font-weight: 400; white-space: pre-wrap; overflow-wrap: anywhere; }
.foot__legal { display: flex; justify-content: space-between; align-items: end; gap: var(--gutter); margin-top: 96px; font-size: var(--step-small); font-weight: 600; }
.foot__legal p { max-width: 70ch; }
.foot__legal a { white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .foot__places a:hover { text-decoration-color: currentColor; }
}

/* ---------- phone and tablet: their own composition ---------- */
@media (max-width: 860px) {
  :root { --band: 52px; }
  .hero__stage { --cw: calc(100cqw - 2 * var(--margin)); --ch: max(56cqh, 24rem); --s: 0.34; }
  .hero__card { padding: 1.25rem; }
  .hero__title { display: block; font-size: clamp(var(--step-lead), 5.9vw, var(--step-head)); }
  .hero__facts { font-size: 1.5rem; }
  .hero__title span:first-child { display: block; }
  .hero__body { grid-template-columns: 1fr; gap: 1.25rem; }
  .hero__say { max-width: 30ch; font-size: var(--step-body); line-height: 1.4; letter-spacing: -0.01em; }
  .hero__foot { grid-template-columns: 1fr 1fr; }
  .hero__foot .button { grid-column: 1 / -1; grid-row: 1; }
  .hero__bg { object-position: 88% 0; }

  .perf { display: block; }
  .perf__intro p { margin-top: 1.5rem; }
  .bench { margin-top: 3rem; }

  .play { grid-template-columns: 1fr; }
  .play__plate { padding: var(--margin); }
  .play__side { padding: 1.5rem var(--margin) var(--margin); }
  .cell { height: 60px; }

  .sheet { display: flex; flex-direction: column; padding-inline: 0; }
  .sheet__name { flex: none; align-self: stretch; }
  .sheet__fig { flex: 1; }
  .sheet__name { height: var(--band); display: flex; align-items: center; padding-inline: 20px; }
  .sheet__fig { min-height: 18svh; margin-right: 0; padding: 20px; align-items: stretch; }
  .sheet__fig img { width: 100%; }
  .sheet__text { padding: 20px; max-width: none; }

  .proof__card { width: 92%; padding: 28px 24px 10rem; aspect-ratio: auto; rotate: -1deg; }
  .proof__say { font-size: var(--step-body); line-height: 1.3; letter-spacing: -0.01em; }
  .cta { min-height: 46svh; }
  .foot__row { display: block; margin-top: 48px; }
  .foot__cols { grid-template-columns: 1fr 1fr; margin-top: 48px; }
  .foot__legal { margin-top: 64px; flex-direction: column; align-items: start; }
}

@media (max-width: 560px) {
  .bench__tile { padding: 1rem; min-height: 10rem; }
  .bench__x { font-size: 2.5rem; }
  .bench__x span { display: block; margin: 0.3rem 0 0; font-size: 1.125rem; }
}

/* ---------- motion: entrances, never hiding content without script ---------- */
/* .reveals is set by site.js itself, so a failed load leaves content visible */
.reveals [data-reveal] { opacity: 0; transition: opacity 300ms ease; }
.reveals [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(18px); animation: rise 500ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 60ms + 40ms); }
  .reveals [data-reveal] { transform: translateY(12px); transition: opacity 400ms var(--ease-out), transform 550ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
}
@keyframes rise { to { opacity: 1; transform: none; } }
