/* buffered.tv, built on the BufferedTV design system.
   Dark first, as the brand is presented: ink-950 ground, violet the one hue,
   lavender for accents and links on dark. No gradients, no drop shadows. */

@font-face { font-family: "Rubik"; src: url("../fonts/Rubik-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("../fonts/Rubik-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("../fonts/Rubik-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("../fonts/Rubik-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;

  /* Colour tokens */
  --violet: #5B4BF0;
  --violet-deep: #3E31C9;
  --lavender: #B9B2FF;
  --lavender-soft: #E3E0FF;
  --ink-950: #0B0C11;
  --ink-900: #14161F;
  --ivory: #F5F3EE;
  --white: #FFFFFF;
  --surface: #0B0C11;
  --surface-raised: #161925;
  --ink: #F5F3EE;
  --ink-muted: #A3A5B8;
  --hairline: #262A3A;
  --brand: var(--violet);
  --on-brand: var(--white);

  /* Type */
  --sans: "Rubik", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  --space-7: 80px;

  /* Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 24px;
  --radius-xl: 48px;
  --radius-full: 9999px;

  --gutter: 16px;
  --measure: 1200px;
}

@media (min-width: 720px) { :root { --gutter: 40px; } }

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 18px/28px var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }

a { color: var(--lavender); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--violet); color: var(--on-brand); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); text-decoration: none;
}
.skip:focus { top: var(--space-3); }

.wrap { width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type styles ---------- */

.display {
  font-weight: 600; letter-spacing: -0.02em;
  font-size: 40px; line-height: 44px; margin: 0;
  text-wrap: balance;
}
@media (min-width: 720px) { .display { font-size: 56px; line-height: 60px; } }

.title {
  font-weight: 600; letter-spacing: -0.01em;
  font-size: 28px; line-height: 36px; margin: 0;
  text-wrap: balance;
}
@media (min-width: 720px) { .title { font-size: 32px; line-height: 40px; } }

.heading { font-size: 24px; line-height: 32px; font-weight: 600; margin: 0; }

.label {
  font: 400 14px/20px var(--mono); letter-spacing: 0.06em;
  color: var(--ink-muted); margin: 0;
}

.strapline {
  font: 500 16px/24px var(--mono); letter-spacing: 0.06em;
  color: var(--lavender); margin: 0;
}
@media (min-width: 720px) { .strapline { font-size: 20px; line-height: 28px; } }

.lede { color: var(--ink-muted); margin: 0; max-width: 60ch; }
.muted { color: var(--ink-muted); }
.small { font-size: 15px; line-height: 22px; }

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

.site-header { border-bottom: 1px solid var(--hairline); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); min-height: 72px;
}

.lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.lockup__mark { width: 40px; height: 40px; }
.lockup__word { height: 35px; width: auto; }
.lockup--small .lockup__mark { width: 32px; height: 32px; }
.lockup--small .lockup__word { height: 28px; }

.site-nav { display: flex; align-items: center; gap: var(--space-4); }
.site-nav a {
  color: var(--ink-muted); text-decoration: none;
  font: 400 14px/20px var(--mono); letter-spacing: 0.06em;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav .nav-extra { display: none; }
@media (min-width: 900px) { .site-nav .nav-extra { display: inline; } }

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

.button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  font: 600 17px/1 var(--sans); text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.button svg { width: 22px; height: 22px; flex: none; }
.button--brand { background: var(--brand); color: var(--on-brand); }
.button--brand:hover { background: var(--violet-deep); }
.button--quiet { background: transparent; color: var(--ink); border-color: var(--hairline); }
.button--quiet:hover { border-color: var(--ink-muted); }
.button--light { background: var(--white); color: var(--violet); }
.button--light:hover { background: var(--lavender-soft); }

.store { display: inline-flex; flex-direction: column; gap: var(--space-1); }
.store .label { padding-left: var(--space-4); }

.actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); }

/* ---------- The buffer bar, as in the mark ---------- */

.bar {
  --played: 0.42; --buffered: 0.74;
  position: relative; height: 8px; border-radius: var(--radius-full);
  background: var(--violet-deep);
}
.bar__buffered, .bar__played {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; min-width: 8px;
}
.bar__buffered { width: calc(var(--buffered) * 100%); background: var(--lavender); }
.bar__played { width: calc(var(--played) * 100%); background: var(--white); }
.bar__head {
  position: absolute; top: 50%; left: calc(var(--played) * 100%);
  width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px;
  border-radius: 50%; background: var(--white); border: 3px solid var(--violet);
}

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

.hero { padding: var(--space-6) 0 var(--space-7); }
.hero .wrap { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 1000px) { .hero .wrap { grid-template-columns: 1fr 1.1fr; gap: var(--space-6); } }

.hero__copy { display: grid; gap: var(--space-4); justify-items: start; }
.hero__copy .actions { margin-top: var(--space-2); }

/* The telly: a flat set with a violet pair of uneven antennas, as on the pill. */
.tv { position: relative; padding-top: 34px; }
.tv__antennas { position: absolute; top: 0; left: 50%; width: 66px; height: 40px; margin-left: -33px; color: var(--violet); }
.tv__set {
  position: relative; background: var(--ink-900);
  border: 2px solid var(--hairline); border-radius: var(--radius-lg);
  padding: 10px;
}
@media (min-width: 720px) { .tv__set { padding: 14px; } }
.tv__screen {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--ink-950);
}
.tv__screen video, .tv__screen img { width: 100%; height: 100%; object-fit: cover; }
.tv__stand { width: 22%; height: 10px; margin: 0 auto; background: var(--hairline); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

.player {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: var(--space-3); margin-top: var(--space-4);
}
.player .label { font-variant-numeric: tabular-nums; min-width: 5ch; }
.player .bar { margin: 0 8px; }
.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 2px solid var(--hairline); background: transparent;
  color: var(--ink); cursor: pointer; padding: 0;
}
.icon-button:hover { border-color: var(--ink-muted); }
.icon-button svg { width: 18px; height: 18px; }

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

.section { padding: var(--space-7) 0; border-top: 1px solid var(--hairline); }
.section__head { display: grid; gap: var(--space-3); margin-bottom: var(--space-5); max-width: 760px; }

/* ---------- What is PeerTube? ---------- */

.explainer {
  background: var(--surface-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); overflow: hidden;
}
.explainer__stage { position: relative; border-bottom: 1px solid var(--hairline); }
.explainer__stage svg { width: 100%; height: auto; }
.explainer__panel {
  display: grid; gap: var(--space-4); padding: var(--space-4);
}
@media (min-width: 900px) {
  .explainer__panel { grid-template-columns: 5fr 7fr; gap: var(--space-5); padding: var(--space-5); }
}
.explainer__caption { display: grid; gap: var(--space-2); min-height: 132px; align-content: start; }
.explainer__caption p { margin: 0; color: var(--ink-muted); }

.steps { display: grid; gap: var(--space-3); align-content: start; }
.steps__row { display: flex; align-items: center; gap: var(--space-3); }
.steps__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex: 1; list-style: none; margin: 0; padding: 0; }
.step {
  --fill: 0;
  display: grid; gap: 10px; width: 100%; padding: 12px 0 0; background: none; border: 0;
  color: var(--ink-muted); cursor: pointer; text-align: left;
  font: 400 13px/18px var(--mono); letter-spacing: 0.06em;
}
.step__bar { position: relative; height: 8px; border-radius: var(--radius-full); background: var(--violet-deep); overflow: hidden; }
.step__bar::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  transform-origin: left; transform: scaleX(var(--fill));
  background: var(--lavender);
}
.step[aria-current="step"] { color: var(--ink); }
.step.is-done .step__bar::after { background: var(--white); }

/* The stage's pieces. */
.node rect.node__card { fill: var(--ink-950); stroke: var(--hairline); stroke-width: 2; }
.node .node__label { font: 400 14px var(--mono); letter-spacing: 0.02em; fill: var(--ink-muted); }
.node.is-home rect.node__card { stroke: var(--violet); }
.node.is-home .node__label { fill: var(--lavender); }
.edge { stroke: var(--violet-deep); stroke-width: 3; stroke-linecap: round; }
.edge--home { stroke: var(--violet); }
.packet { fill: var(--lavender); }
.packet__tri { fill: var(--ink-950); }

.explainer [data-show] { opacity: 0; transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.explainer .node[data-show] { transform: translateY(10px); transform-box: fill-box; }
.explainer .is-on[data-show] { opacity: 1; transform: none; }
.explainer .edge { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s ease; }
.explainer .edge.is-on { stroke-dashoffset: 0; }
.explainer .tv-screen-fill { transition: fill .4s ease; }

@media (prefers-reduced-motion: reduce) {
  .explainer [data-show], .explainer .edge { transition: none; }
}

.reassure {
  display: flex; gap: var(--space-3); align-items: flex-start;
  margin-top: var(--space-4); color: var(--ink-muted);
}
.reassure svg { width: 24px; height: 24px; flex: none; color: var(--lavender); margin-top: 2px; }
.reassure p { margin: 0; max-width: 70ch; }

/* ---------- Feature rows ---------- */

.features { display: grid; gap: var(--space-7); }
.feature { display: grid; gap: var(--space-4); align-items: center; }
@media (min-width: 900px) {
  .feature { grid-template-columns: 7fr 5fr; gap: var(--space-6); }
  .feature:nth-child(even) .feature__shot { order: 2; }
}
.feature__shot {
  margin: 0; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--hairline); background: var(--ink-900);
}
.feature__shot img { width: 100%; height: auto; }
.feature__copy { display: grid; gap: var(--space-3); }
.feature__copy p { margin: 0; color: var(--ink-muted); }

/* ---------- Cards ---------- */

.cards { display: grid; gap: var(--space-3); }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  display: grid; gap: var(--space-3); align-content: start;
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--surface-raised); border: 1px solid var(--hairline);
}
.card svg { width: 32px; height: 32px; color: var(--lavender); }
.card p { margin: 0; color: var(--ink-muted); font-size: 16px; line-height: 24px; }

/* ---------- Gallery ---------- */

.gallery { position: relative; }
.gallery__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 86%;
  gap: var(--space-3); overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: var(--space-3); scrollbar-width: thin; scrollbar-color: var(--hairline) transparent;
  list-style: none; margin: 0; padding-left: 0;
}
@media (min-width: 720px) { .gallery__track { grid-auto-columns: 62%; gap: var(--space-4); } }
.gallery__track li { scroll-snap-align: start; }
.gallery figure { margin: 0; display: grid; gap: var(--space-2); }
.gallery img { border-radius: var(--radius-lg); border: 1px solid var(--hairline); width: 100%; height: auto; }
.gallery__controls { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-3); }

/* ---------- Questions ---------- */

.faq { display: grid; gap: var(--space-3); max-width: 860px; }
.faq details {
  background: var(--surface-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: 0 var(--space-4);
}
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 0;
  display: flex; justify-content: space-between; gap: var(--space-3);
  font-weight: 500; font-size: 19px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px; margin-top: 7px;
  border-right: 2px solid var(--lavender); border-bottom: 2px solid var(--lavender);
  transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: 12px; }
.faq details p { margin: 0 0 20px; color: var(--ink-muted); }

/* ---------- Open source, and the closing call ---------- */

.split { display: grid; gap: var(--space-5); }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; align-items: start; } }

.cta {
  background: var(--violet); color: var(--white);
  border-radius: var(--radius-xl); padding: var(--space-6) var(--space-4);
  display: grid; gap: var(--space-4); justify-items: center; text-align: center;
}
@media (min-width: 720px) { .cta { padding: var(--space-7) var(--space-6); } }
.cta p { margin: 0; max-width: 52ch; }
.cta .label { color: var(--white); }
.cta .store .label { padding-left: 0; text-align: center; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--hairline); padding: var(--space-6) 0 var(--space-5); }
.site-footer .wrap { display: grid; gap: var(--space-5); }
@media (min-width: 900px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } }
.footer-brand { display: grid; gap: var(--space-3); justify-items: start; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-links a:hover { color: var(--lavender); }
.legal { grid-column: 1 / -1; border-top: 1px solid var(--hairline); padding-top: var(--space-4); display: grid; gap: var(--space-2); }
.legal p { margin: 0; }

/* ---------- The privacy policy ---------- */

.doc { padding: var(--space-6) 0 var(--space-7); }
.doc .wrap { max-width: calc(820px + 2 * var(--gutter)); }
.doc header { display: grid; gap: var(--space-3); margin-bottom: var(--space-5); }
.doc h2 { font-size: 24px; line-height: 32px; font-weight: 600; margin: var(--space-6) 0 var(--space-3); }
.doc h3 { font-size: 19px; line-height: 28px; font-weight: 600; margin: var(--space-5) 0 var(--space-2); }
.doc p, .doc li { color: var(--ink-muted); }
.doc p { margin: 0 0 var(--space-3); }
.doc strong { color: var(--ink); font-weight: 500; }
.doc ul { padding-left: 1.2em; margin: 0 0 var(--space-3); }
.doc li { margin-bottom: var(--space-2); }
.doc li::marker { color: var(--lavender); }
.summary {
  background: var(--surface-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: var(--space-4);
}
.summary p { margin: 0; }
.summary p + p { margin-top: var(--space-3); }
.table-wrap { overflow-x: auto; margin: 0 0 var(--space-3); border: 1px solid var(--hairline); border-radius: var(--radius-lg); }
.doc table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 24px; min-width: 560px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 14px var(--space-3); border-bottom: 1px solid var(--hairline); }
.doc tr:last-child td { border-bottom: 0; }
.doc th { font: 400 13px/20px var(--mono); letter-spacing: 0.06em; color: var(--ink-muted); background: var(--surface-raised); }
.doc td { color: var(--ink-muted); }
.doc td:first-child { color: var(--ink); }

/* ---------- Small modifiers ---------- */

.captions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.captions [hidden] { display: none; }
.cards--after { margin-top: var(--space-7); }
.cards--stack { grid-template-columns: 1fr !important; }
.card--link { text-decoration: none; color: inherit; transition: border-color .15s ease; }
.card--link:hover { border-color: var(--violet); }
.section__head--flush { margin-bottom: 0; }
.section--flush { border-top: 0; padding-top: 0; }
[hidden] { display: none !important; }

.summary .heading { margin: 0 0 var(--space-3); }

/* Grid items may shrink below their content's intrinsic width: the tour
   video's 1280px would otherwise stretch its column past a phone's screen. */
.hero .wrap > *, .feature > *, .explainer__panel > *, .split > *,
.site-footer .wrap > *, .cards > *, .steps__list > * { min-width: 0; }

/* At phone width the site names would be a few pixels high; the captions
   carry the story there. */
@media (max-width: 600px) { .node .node__label { display: none; } }

/* The first hide, when the script takes over from the static picture, is instant. */
.explainer.is-instant, .explainer.is-instant * { transition: none !important; }

/* Phones: the smaller lockup, so the header's links keep their distance. */
@media (max-width: 480px) {
  .site-header .lockup__mark { width: 32px; height: 32px; }
  .site-header .lockup__word { height: 28px; }
  .site-nav { gap: var(--space-3); }
}

.actions--after { margin-top: var(--space-5); }

/* "Built with love, supported by" and the SquareCows logo, on one line. */
.made-by a { display: inline-block; vertical-align: middle; margin-left: 2px; }
.made-by img { width: 89px; height: 28px; }
