/*
 * viddown landing page.
 * Tokens mirror apps/mobile/src/theme/tokens.ts: aluminium greys, one
 * film-stock yellow used only as a fill (ink on top), Archivo for words and
 * Archivo Narrow tabular numerals for figures.
 */

:root {
  --bg: #EEF0F2;
  --surface: #FFFFFF;
  --sunken: #E3E6EA;
  --ink: #16181D;
  --ink-muted: #555C69;
  --rule: #D6DAE0;
  --accent: #F5C400;
  --accent-pressed: #DDB000;
  --on-accent: #16181D;
  --frame: #D3D7DD;
  --danger: #B3311A;
  --success: #1D7347;
  --focus: #16181D;

  /* The credits panel is always the "graphite" side of the palette. */
  --inv-bg: #16181D;
  --inv-surface: #22252A;
  --inv-ink: #ECEDEF;
  --inv-muted: #A4AAB4;
  --inv-rule: #383C43;
  --inv-focus: #F5C400;

  --r-frame: 1px;
  --r-chip: 6px;
  --r-control: 8px;
  --r-field: 12px;
  --r-panel: 14px;

  --gutter: 16px;
  --wrap: 1200px;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-fig: "Archivo Narrow", "Archivo", system-ui, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1E2024;
    --surface: #272A2F;
    --sunken: #1A1C1F;
    --ink: #ECEDEF;
    --ink-muted: #9EA4AE;
    --rule: #383C43;
    --accent-pressed: #FFD633;
    --frame: #3B3F46;
    --danger: #FF8466;
    --success: #62C990;
    --focus: #F5C400;

    --inv-bg: #272A2F;
    --inv-surface: #1E2024;
    --inv-rule: #41454D;

    color-scheme: dark;
  }
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}
@media (min-width: 1100px) {
  :root { --gutter: 48px; }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
a:hover { text-decoration-color: currentColor; }

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

.fig {
  font-family: var(--font-fig);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.split { display: grid; gap: 20px; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; }
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-control);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--ink);
  font: 600 0.9375rem/1.4 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms;
}
.btn:hover { border-color: var(--ink-muted); }
.btn .ext { font-weight: 500; color: var(--ink-muted); }
.btn .size:not(:empty) {
  margin-left: 0.4em;
  font-weight: 500;
  color: var(--ink-muted);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover { background: var(--accent-pressed); border-color: var(--accent-pressed); }
.btn-primary .ext, .btn-primary .size:not(:empty) { color: var(--on-accent); opacity: 0.72; }

.btn-quiet { background: transparent; }

.btn-large {
  min-height: 52px;
  padding: 14px 22px;
  font-size: 1.0625rem;
}

.text-link { font-weight: 500; }

.text-button {
  appearance: none;
  border: 0;
  background: none;
  padding: 4px 0;
  color: inherit;
  font: 600 0.875rem/1.4 var(--font);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

/* ---------- Header ---------- */

.site-header { padding-block: 14px; }
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  font-variation-settings: "wdth" 112;
}
.brand-mark { width: 28px; height: 28px; flex: none; }
.mark-bg { fill: var(--ink); }
.mark-on { fill: var(--accent); }
.mark-off { fill: var(--ink-muted); }
@media (prefers-color-scheme: dark) {
  .mark-bg { fill: #16181D; }
  .mark-off { fill: #555C69; }
}

.nav { display: flex; gap: 4px; }
.nav a {
  display: block;
  padding: 10px 10px;
  font-weight: 500;
  font-size: 0.9375rem;
  white-space: nowrap;
  text-decoration: none;
  border-radius: var(--r-chip);
}
.nav a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.nav-source { display: none; }
@media (min-width: 720px) {
  .nav { gap: 8px; }
  .nav-source { display: block; }
}
@media (max-width: 480px) {
  .nav { gap: 0; margin-right: -6px; }
  .nav a { padding-inline: 6px; }
  .brand { gap: 8px; }
}
@media (max-width: 380px) {
  .nav a { font-size: 0.875rem; padding-inline: 5px; }
  .brand { font-size: 1.0625rem; }
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(36px, 5vw, 72px) clamp(32px, 3.4vw, 48px); }

.hero h1 {
  max-width: 15.5em;
  font-size: clamp(2.375rem, 1.35rem + 4.2vw, 4.75rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variation-settings: "wdth" 118;
  text-wrap: balance;
}
@media (max-width: 600px) {
  .hero h1 { font-variation-settings: "wdth" 104; letter-spacing: -0.025em; }
}

.lede {
  max-width: 36em;
  margin-top: clamp(20px, 2.4vw, 32px);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-muted);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 32px;
}
.hero-note {
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.stats {
  margin-top: 6px;
  font-size: 1rem;
  color: var(--ink);
}

/* ---------- Job band: the frame bar demo ---------- */

.job {
  background: var(--surface);
  border-block: 1px solid var(--rule);
  padding-block: 22px 20px;
}
@media (min-width: 720px) {
  .job { padding-block: 28px 26px; }
}

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.job-title {
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.35;
}
.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 2px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.job-meta .fig { font-size: 0.9375rem; }
.job-status {
  font-weight: 600;
  font-size: 0.9375rem;
}

.framebar {
  --fw: 4px;
  --fg: 2px;
  --fh: 44px;
  --seg: 8px;
  display: flex;
  gap: var(--seg);
  height: calc(var(--fh) + 0px);
  overflow: hidden;
}
.framebar.has-labels { height: auto; }
@media (min-width: 720px) {
  .framebar { --fw: 5px; --fg: 3px; --fh: 64px; --seg: 12px; }
}
@media (min-width: 1100px) {
  .framebar { --fw: 6px; --fg: 3px; --fh: 84px; --seg: 16px; }
}

.run { flex: none; min-width: 0; }
.run-frames {
  display: flex;
  gap: var(--fg);
  height: var(--fh);
}
.frame {
  flex: none;
  width: var(--fw);
  height: 100%;
  border-radius: var(--r-frame);
  background: var(--frame);
  position: relative;
  overflow: hidden;
}
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: var(--o, 0);
}
.run-label {
  display: none;
  margin-top: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
}
.run.is-active .run-label { color: var(--ink); font-weight: 600; }
@media (min-width: 720px) {
  .run-label { display: block; }
}

.job-figs {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 20px;
  margin-top: 14px;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}
.job-figs .fig-pct {
  min-width: 3.2ch;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
}
.job-figs .text-button { margin-left: auto; color: var(--ink); }
@media (min-width: 720px) {
  .job-figs { margin-top: 10px; }
}

/* ---------- Sections ---------- */

.features, .download, .faq, .responsible {
  padding-block: clamp(56px, 8vw, 112px) 0;
}
.responsible { padding-bottom: clamp(56px, 8vw, 112px); }

h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variation-settings: "wdth" 112;
  text-wrap: balance;
}
h3 {
  font-size: 1.125rem;
  line-height: 1.33;
  font-weight: 650;
  letter-spacing: -0.005em;
}

/* Features: two specimen rows, then a plain list */

.features h2 { margin-bottom: clamp(28px, 4vw, 48px); }

.feature {
  display: grid;
  gap: 20px;
  padding-block: 28px;
  border-top: 1px solid var(--rule);
}
@media (min-width: 840px) {
  .feature {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 64px;
    align-items: center;
    padding-block: 40px;
  }
}
.feature-text p, .feature-list p {
  margin-top: 8px;
  max-width: 34em;
  color: var(--ink-muted);
}
.feature-text h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); line-height: 1.25; }

.specimen {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  padding: 8px;
}

.quality-list li {
  display: grid;
  grid-template-columns: 4.5em 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-control);
  font-size: 0.9375rem;
  color: var(--ink-muted);
}
.quality-list li + li { margin-top: 2px; }
.quality-list .q-res { color: var(--ink); font-weight: 600; font-size: 1rem; }
.quality-list .q-size { color: var(--ink); font-size: 1rem; }
.quality-list .is-picked {
  background: var(--accent);
  color: var(--on-accent);
}
.quality-list .is-picked .q-res,
.quality-list .is-picked .q-size { color: var(--on-accent); }

.clip { padding: 22px 16px 14px; }
.clip-track {
  position: relative;
  height: 40px;
  border-radius: var(--r-control);
  background: var(--sunken);
}
.clip-track::before {
  /* Playhead-free timeline: a single centre rule, like an editor's track. */
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--frame);
}
.clip-range {
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: 31%;
  width: 22%;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 88%, transparent);
  box-shadow: inset 4px 0 0 var(--ink), inset -4px 0 0 var(--ink);
}
.clip-times {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 1rem;
  color: var(--ink);
}
.clip-times .clip-len { color: var(--ink-muted); }

.feature-list {
  display: grid;
  gap: 0 48px;
  border-top: 1px solid var(--rule);
}
.feature-list li { padding-block: 24px; }
.feature-list li + li { border-top: 1px solid var(--rule); }
@media (min-width: 720px) {
  .feature-list { grid-template-columns: 1fr 1fr; }
  .feature-list li + li { border-top: 0; }
  .feature-list li:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}
@media (min-width: 1100px) {
  .feature-list { grid-template-columns: repeat(4, 1fr); gap: 0 40px; }
  .feature-list li:nth-child(n + 3) { border-top: 0; }
}

/* Download */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  margin-bottom: 28px;
}
.release-line { color: var(--ink-muted); font-size: 0.9375rem; }
.release-line .fig { color: var(--ink); font-size: 1rem; }

.ios-note {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: var(--r-field);
  background: var(--sunken);
  max-width: 44em;
}

.platforms {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
}
.platform {
  display: grid;
  gap: 14px;
  padding: 20px 16px;
}
.platform + .platform { border-top: 1px solid var(--rule); }
@media (min-width: 840px) {
  .platform {
    grid-template-columns: 15rem 1fr;
    gap: 6px 32px;
    padding: 24px 28px;
    align-items: center;
  }
  .platform-note { grid-column: 2; }
}
.platform-name h3 { font-size: 1.25rem; font-variation-settings: "wdth" 108; }
.platform-name p { font-size: 0.875rem; color: var(--ink-muted); }
.platform-name .this-device { display: none; }
.platform.is-current .this-device {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: var(--r-chip);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
}
.platform-files { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-note { font-size: 0.875rem; color: var(--ink-muted); }

.platform.is-current .platform-files .btn:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.platform.is-current .platform-files .btn:first-child:hover {
  background: var(--accent-pressed);
  border-color: var(--accent-pressed);
}
.platform.is-current .platform-files .btn:first-child .ext,
.platform.is-current .platform-files .btn:first-child .size:not(:empty) {
  color: var(--on-accent);
  opacity: 0.72;
}

/* FAQ */

.faq h2 { margin-bottom: 4px; }
details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary h3 { font-size: 1.0625rem; font-weight: 600; }
summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 160ms;
}
details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
@media (prefers-reduced-motion: reduce) {
  summary::after { transition: none; }
}
details p {
  max-width: 40em;
  margin-bottom: 14px;
  color: var(--ink-muted);
}
details p:last-child { margin-bottom: 22px; }

/* Responsible use */

.responsible h2 {
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}
@media (min-width: 900px) {
  .responsible h2 { padding-top: 2px; }
}
.responsible p {
  max-width: 44em;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}
.responsible p + p { margin-top: 10px; }
.email-link { word-break: break-word; }

/* Credits: laid out like a film's end roll. Roles right of a centre axis's
   left side, names to its right; the reel ends on a short run of frames. */

.credits {
  background: var(--inv-bg);
  color: var(--inv-ink);
  padding-block: clamp(64px, 9vw, 120px);
  --focus: var(--inv-focus);
}
.credits a { color: var(--inv-ink); text-underline-offset: 3px; }
.credits a:hover { text-decoration-thickness: 2px; }
/* Nine underlined names shout; keep them quiet until pointed at. */
.credit-roll a { text-decoration-color: var(--inv-rule); }
.credit-roll a:hover, .credit-roll a:focus-visible { text-decoration-color: currentColor; }

.credits-head { text-align: center; }
.credits-prod {
  font-family: var(--font-fig);
  font-weight: 500;
  font-size: 1rem;
  color: var(--inv-muted);
}
.credits h2 {
  margin-top: 6px;
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.credit-roll {
  margin: clamp(40px, 6vw, 64px) auto 0;
  max-width: 44rem;
  display: grid;
  gap: 14px;
}
.credit-roll > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 28px;
  align-items: baseline;
}
.credit-roll dt {
  text-align: right;
  font-family: var(--font-fig);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--inv-muted);
}
.credit-roll dd {
  margin: 0;
  font-weight: 600;
  font-size: 1.0625rem;
}
/* Phones: stack each credit, still on the centre axis. */
@media (max-width: 520px) {
  .credit-roll { gap: 18px; }
  .credit-roll > div { grid-template-columns: 1fr; text-align: center; row-gap: 2px; }
  .credit-roll dt { text-align: center; }
}

/* End of reel: the frame-bar motif, once, as a full stop. */
.reel-end {
  width: 46px;
  height: 18px;
  margin: clamp(40px, 6vw, 60px) auto;
  background: repeating-linear-gradient(90deg, var(--accent) 0 4px, transparent 4px 7px);
  border-radius: var(--r-frame);
}

.credits-after {
  max-width: 34rem;
  margin-inline: auto;
  text-align: center;
}
.credits-after p { color: var(--inv-muted); font-size: 1.0625rem; }
.credits-links {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 24px;
}
.btn-ghost {
  background: transparent;
  border-color: var(--inv-rule);
  color: var(--inv-ink);
}
.btn-ghost:hover { border-color: var(--inv-muted); }
.credits .btn-ghost { text-decoration: none; }
.credits-after .sponsor {
  margin-top: 28px;
  font-size: 0.9375rem;
}

/* Footer */

.site-footer {
  padding-block: 28px 36px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a, .site-footer a { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
