/*
 * Website styles, following docs/brand/Bezier-Brand-Guidelines.md: monochrome on near-black, with
 * the system accent colour reserved for the primary action (Download).
 */

@font-face {
  font-family: Archivo;
  src: url("/assets/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #09090a;
  --sunken: #111112;
  --panel: #19191b;
  --raised: #232323;
  --line: #2a2a2c;
  --line-strong: #4a4a4a;
  --faint: #6a6c6e;
  --dim: #a0a0a6;
  --text: #e0e0e0;
  --bright: #f2f2f4;
  --accent: AccentColor;
  --on-accent: AccentColorText;
  --silver: linear-gradient(180deg, #ffffff 0%, #c9c9cf 55%, #8d8d95 100%);
  --radius: 10px;
  --radius-band: 14px;
  --radius-panel: 16px;
  --width: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

/* Fallback accent for browsers without AccentColor. */
@supports not (color: AccentColor) {
  :root {
    --accent: #0a84ff;
    --on-accent: #ffffff;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ground);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font:
    400 16px / 1.6 Archivo,
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid #f4f4f5;
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 20;
  background: var(--bright);
  color: var(--ground);
  padding: 8px 12px;
}

/* Header bar. */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 var(--gutter);
  background: rgb(9 9 10 / 82%);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--line);
}

.bar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--bright);
  font-weight: 700;
  font-stretch: 114%;
  font-size: 20px;
}

.bar__brand img {
  border-radius: 7px;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.tab {
  padding: 8px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--dim);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.tab:hover {
  color: var(--bright);
  background: var(--panel);
}

.tab[aria-current="page"] {
  color: var(--bright);
  background: var(--raised);
}

.bar__end {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar__github {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--dim);
}

.bar__github:hover {
  color: var(--bright);
  background: var(--panel);
}

/* Narrow screens: tabs move to a scrolling second row. */
@media (max-width: 760px) {
  .bar {
    grid-template-columns: 1fr auto;
    height: auto;
    padding-top: 10px;
  }

  .bar__brand span {
    display: none;
  }

  .tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 6px 0 10px;
    scrollbar-width: none;
  }
}

/* Buttons. One accent per page. */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--bright);
  font:
    600 15px / 1.2 Archivo,
    sans-serif;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  background: var(--panel);
}

.button--accent {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}

.button--accent:hover {
  background: color-mix(in srgb, var(--accent) 86%, white);
}

.button--large {
  padding: 14px 24px;
  font-size: 17px;
}

.button small {
  font-weight: 400;
  opacity: 0.8;
}

/* Typography. */

.display,
.headline,
.title {
  margin: 0;
  font-stretch: 114%;
  font-weight: 600;
  color: var(--bright);
  text-wrap: balance;
}

.display,
.headline {
  background: var(--silver);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.display {
  font-size: clamp(48px, 9vw, 118px);
  line-height: 0.92;
}

.headline {
  font-size: clamp(36px, 6vw, 76px);
  line-height: 0.98;
}

.title {
  font-size: 20px;
  line-height: 1.25;
}

.lede {
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
  color: var(--dim);
  max-width: 40em;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  font-stretch: 114%;
  color: var(--faint);
  margin: 0 0 12px;
}

/* Sections. */

.section {
  max-width: var(--width);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) var(--gutter);
}

.section--center {
  text-align: center;
}

.section--center .lede {
  margin-inline: auto;
}

.hero {
  padding-top: clamp(48px, 8vw, 104px);
  padding-bottom: clamp(32px, 5vw, 64px);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.section--center .hero__actions {
  justify-content: center;
}

.hero__small {
  margin-top: 16px;
  font-size: 14px;
  color: var(--faint);
}

/* Film: poster with play button, replaced by the video on click. */

.film {
  position: relative;
  margin: 56px auto 0;
  max-width: 1040px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-panel);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 0 40px 120px rgb(0 0 0 / 60%);
}

.film img,
.film video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.film__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 24px;
  border: 0;
  background: linear-gradient(180deg, transparent 55%, rgb(0 0 0 / 55%));
  color: var(--bright);
  cursor: pointer;
  font:
    600 16px Archivo,
    sans-serif;
}

.film__play span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 12px;
  border-radius: 999px;
  background: rgb(34 34 36 / 78%);
  border: 1px solid rgb(255 255 255 / 10%);
  backdrop-filter: blur(24px);
}

/* Audience: two entry points. */

.doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.door {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px;
  border-radius: var(--radius-panel);
  background: var(--panel);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}

.door:hover {
  background: var(--raised);
}

.door p {
  margin: 0;
  color: var(--dim);
}

.door ul {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--dim);
}

.door__go {
  margin-top: auto;
  padding-top: 12px;
  color: var(--bright);
  font-weight: 600;
}

/* Feature rows, alternating image and text. */

.feature {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}

.feature + .feature {
  margin-top: clamp(64px, 8vw, 112px);
}

.feature:nth-child(even) {
  grid-template-columns: 1fr 1.4fr;
}

.feature:nth-child(even) .feature__picture {
  order: 2;
}

.feature__picture {
  border-radius: var(--radius-panel);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.feature__picture img {
  display: block;
  width: 100%;
  height: auto;
}

.feature__words .title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.feature__words p {
  color: var(--dim);
  margin: 0 0 12px;
}

.feature--code,
.feature--code:nth-child(even) {
  grid-template-columns: 1fr 1.5fr;
}

/* No double gap between a page's intro and the first section. */
.hero + .section {
  padding-top: 8px;
}

@media (max-width: 860px) {
  .feature--code,
  .feature--code:nth-child(even),
  .feature,
  .feature:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .feature:nth-child(even) .feature__picture {
    order: 0;
  }
}

/* Cards. */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 40px;
  text-align: left;
}

.card {
  padding: 24px;
  border-radius: var(--radius-panel);
  background: var(--panel);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}

a.card:hover {
  background: var(--raised);
}

.card .icon {
  display: block;
  margin-bottom: 14px;
  color: var(--bright);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-stretch: 114%;
  font-weight: 600;
  color: var(--bright);
}

.card p {
  margin: 0;
  color: var(--dim);
  font-size: 15px;
}

.card--wide {
  grid-column: 1 / -1;
}

/* Code. */

code {
  font:
    0.9em ui-monospace,
    "SF Mono",
    Menlo,
    monospace;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}

pre.code {
  margin: 16px 0;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: var(--radius-band);
  background: var(--sunken);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.55;
}

pre.code code {
  background: none;
  border: 0;
  padding: 0;
}

/* Download. */

.channel-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  margin-top: 24px;
}

.channel-switch button {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: transparent;
  color: var(--dim);
  font:
    500 15px Archivo,
    sans-serif;
  cursor: pointer;
}

.channel-switch button[aria-pressed="true"] {
  background: var(--raised);
  color: var(--bright);
}

.platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.platform {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: var(--radius-panel);
  background: var(--panel);
  border: 1px solid var(--line);
}

.platform[data-yours] {
  border-color: var(--line-strong);
}

.platform h3 {
  margin: 0;
  font-stretch: 114%;
  font-weight: 600;
  color: var(--bright);
}

.platform p {
  margin: 0;
  color: var(--dim);
  font-size: 14px;
}

.platform .files .button {
  white-space: normal;
  justify-content: space-between;
}

.platform .files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.notice {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: var(--radius-band);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--dim);
}

/* FAQ. */

.faq {
  max-width: 820px;
  margin: 40px auto 0;
  text-align: left;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.faq summary {
  cursor: pointer;
  color: var(--bright);
  font-weight: 600;
  font-size: 17px;
}

.faq details p {
  margin: 12px 0 0;
  color: var(--dim);
}

/* Developer wiki: page list, text, table of contents. */

.wiki {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 200px;
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px var(--gutter) 96px;
}

.wiki__side,
.wiki__toc {
  position: sticky;
  top: 88px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.wiki__side a,
.wiki__toc a {
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--dim);
}

.wiki__side a:hover,
.wiki__toc a:hover {
  color: var(--bright);
  background: var(--panel);
}

.wiki__side a[aria-current="page"] {
  color: var(--bright);
  background: var(--raised);
}

.wiki__group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 4px;
  padding: 0 10px;
  color: var(--bright);
  font-weight: 600;
}

.wiki__home {
  color: var(--faint) !important;
}

.wiki__toc p {
  margin: 0 0 6px;
  padding: 0 10px;
  color: var(--faint);
}

.wiki__text {
  min-width: 0;
}

.wiki__text h1 {
  margin: 0 0 24px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  font-stretch: 114%;
  font-weight: 600;
  background: var(--silver);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wiki__text h2 {
  margin: 48px 0 12px;
  font-size: 24px;
  font-stretch: 114%;
  font-weight: 600;
  color: var(--bright);
  scroll-margin-top: 88px;
}

.wiki__text h3 {
  margin: 32px 0 8px;
  font-size: 18px;
  color: var(--bright);
  scroll-margin-top: 88px;
}

.wiki__text p,
.wiki__text li {
  color: var(--text);
}

.wiki__text a {
  color: var(--bright);
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
}

.wiki__text blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--line-strong);
  background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--dim);
}

.table {
  overflow-x: auto;
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--faint);
  font-weight: 600;
}

.wiki__source {
  margin-top: 56px;
  font-size: 14px;
  color: var(--faint);
}

@media (max-width: 1080px) {
  .wiki {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .wiki__toc {
    display: none;
  }
}

@media (max-width: 760px) {
  .wiki {
    grid-template-columns: 1fr;
  }

  .wiki__side {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .wiki__group {
    width: 100%;
  }
}

/* Footer. */

.footer {
  border-top: 1px solid var(--line);
  padding: 56px var(--gutter) 40px;
}

.footer__cols {
  max-width: var(--width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}

.footer__cols div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.footer__cols strong {
  color: var(--bright);
  margin-bottom: 4px;
}

.footer__cols a {
  color: var(--dim);
  text-decoration: none;
}

.footer__cols a:hover {
  color: var(--bright);
}

.footer__line {
  max-width: var(--width);
  margin: 40px auto 0;
  font-size: 13px;
  color: var(--faint);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
