/* triib's website, in the blues of the icon's cables. */

@font-face {
  font-family: "Roboto Flex";
  src: url("RobotoFlex.ttf") format("truetype");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  /* The cables' own blue fills the tonal button, and their lighter blue
     the other accents; text on the light page takes the cables' shadow
     blue, as the lighter ones are too faint there to read. */
  --wire: #2970cf;
  --on-wire: #ffffff;
  --accent: #7db3f5;
  --on-accent: #0a2b57;
  --primary: #1f5ebc;
  --on-primary: #ffffff;
  --primary-container: #d8e6fb;
  --on-primary-container: #0a2b57;
  --surface: #f7f9fd;
  --surface-container: #ebeef4;
  --surface-container-high: #e5e8ef;
  --on-surface: #171c22;
  --on-surface-variant: #41474f;
  --outline-variant: #c1c7d0;
  --shadow: 0 1px 3px rgb(0 0 0 / 0.12), 0 8px 24px rgb(0 0 0 / 0.10);
  --hero-shadow: var(--shadow);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #7db3f5;
    --on-primary: #0a2b57;
    --primary-container: #1f4f93;
    --on-primary-container: #d8e6fb;
    --surface: #101318;
    --surface-container: #1c2026;
    --surface-container-high: #262b32;
    --on-surface: #dfe3ea;
    --on-surface-variant: #c1c7d0;
    --outline-variant: #41474f;
    --shadow: 0 1px 3px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
    /* A hairline and a soft glow in the accent color, so the dark hero
       screenshot stands off the dark page. */
    --hero-shadow:
      0 0 0 1px rgb(125 179 245 / 0.20),
      0 0 48px 0 rgb(125 179 245 / 0.18),
      0 0 140px 16px rgb(41 112 207 / 0.25),
      0 24px 64px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: "Roboto Flex", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a { color: var(--primary); }

code {
  font-family: ui-monospace, "DejaVu Sans Mono", monospace;
  font-size: 0.88em;
  background: var(--surface-container-high);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px max(16px, calc((100% - 1080px) / 2));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--outline-variant);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--on-surface);
  font-weight: 650;
  font-size: 20px;
  text-decoration: none;
}

.top nav { display: flex; gap: 20px; flex-wrap: wrap; }
.top nav a { color: var(--on-surface-variant); text-decoration: none; font-weight: 500; }
.top nav a:hover,
.top nav a:active { color: var(--primary); }
/* The page shown, or on the front page the section last gone to. */
.top nav a[aria-current="page"],
body:has(#features:target) .top nav a[href$="#features"],
body:has(#download:target) .top nav a[href$="#download"] { color: var(--primary); }

/* The language menu: a list of links, which opens without script. */
.top nav { align-items: center; }
.languages { position: relative; }
.languages summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  color: var(--on-surface-variant);
  font-weight: 500;
}
.languages summary::-webkit-details-marker { display: none; }
.languages summary:hover { color: var(--primary); }
.languages ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  margin: 0;
  padding: 8px;
  list-style: none;
  columns: 3;
  column-gap: 8px;
  width: max-content;
  max-width: min(640px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  background: var(--surface-container-high);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.languages li { break-inside: avoid; }
@media (max-width: 640px) {
  /* Across the screen, under the button, as the header wraps. */
  .languages ul {
    position: fixed;
    inset-inline: 16px;
    top: auto;
    margin-top: 8px;
    width: auto;
    max-width: none;
    columns: 2;
  }
}
.languages ul a {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--on-surface);
}
.languages ul a:hover { background: var(--surface-container); color: var(--on-surface); }
.languages ul a[aria-current] { color: var(--primary); font-weight: 650; }

main, footer { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

section { padding: 56px 0; }
h1 { font-size: clamp(48px, 9vw, 72px); line-height: 1; margin: 16px 0 12px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 32px; line-height: 1.2; margin: 0 0 20px; font-weight: 650; }
h3 { font-size: 20px; margin: 0 0 6px; font-weight: 650; }

.hero { text-align: center; padding-top: 48px; }
.hero-icon { display: block; margin: 0 auto; }
.lede { font-size: 20px; max-width: 680px; margin: 0 auto 24px; color: var(--on-surface-variant); }
/* The rest of the hero's lede wraps at twice the width of its first
   line, centered under it; narrower windows wrap it at their own width. */
.hero .lede { width: fit-content; max-width: none; }
.lede-first { display: block; white-space: nowrap; }
.lede-rest { display: block; width: 0; min-width: 200%; margin-inline-start: -50%; }
@media (max-width: 1000px) {
  .hero .lede { max-width: 680px; }
  .lede-rest { width: auto; min-width: 0; margin-inline-start: 0; }
}
/* The two widths are the English lede's; a translation wraps as any
   other text does. */
html:not([lang="en"]) .hero .lede { max-width: 680px; }
html:not([lang="en"]) .lede-first { white-space: normal; }
html:not([lang="en"]) .lede-rest { width: auto; min-width: 0; margin-inline-start: 0; }
@media (max-width: 640px) {
  .lede-first { white-space: normal; }
}
.small { font-size: 15px; color: var(--on-surface-variant); }

.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 0 0 12px; }
.button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.button.filled { background: var(--accent); color: var(--on-accent); }
.button.tonal { background: var(--wire); color: var(--on-wire); }
.button:hover { filter: brightness(1.08); }

.shot { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: var(--shadow); }
.hero-shot { margin-top: 40px; box-shadow: var(--hero-shadow); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid article { background: var(--surface-container); border-radius: 20px; padding: 22px 24px; }
.grid p { margin: 0; color: var(--on-surface-variant); }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 40px; }
.gallery.three { grid-template-columns: repeat(3, 1fr); }
.shot.plain { border-radius: 8px; }
.section-lede { max-width: 720px; margin: 0 auto; text-align: center; color: var(--on-surface-variant); }
figure { margin: 0; }
figure.wide { margin-top: 24px; }
figcaption { margin-top: 10px; text-align: center; color: var(--on-surface-variant); font-size: 15px; }

.table { overflow-x: auto; border-radius: 16px; border: 1px solid var(--outline-variant); }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: start; padding: 12px 16px; border-bottom: 1px solid var(--outline-variant); vertical-align: top; }
tr:last-child td { border-bottom: none; }
th { background: var(--surface-container); font-weight: 600; }
td a { white-space: nowrap; }

.policy { border-top: 1px solid var(--outline-variant); }
.policy ul { padding-inline-start: 20px; }
.policy li { margin-bottom: 8px; }
.policy h3 { margin-top: 28px; }

/* The specifications: label and value rows. */
.spec { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 16px; }
.spec th, .spec td { text-align: start; vertical-align: top; padding: 10px 0; border-bottom: 1px solid var(--outline-variant); }
.spec th { width: 190px; padding-inline-end: 20px; background: none; color: var(--on-surface-variant); font-weight: 600; }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: none; }
.lede-left { color: var(--on-surface-variant); font-size: 18px; }
@media (max-width: 640px) {
  .spec, .spec tbody, .spec tr, .spec th, .spec td { display: block; width: auto; }
  .spec tr { padding: 0; border-bottom: 1px solid var(--outline-variant); }
  .spec tr:last-child { border-bottom: none; }
  .spec th { padding: 10px 0 0; border: none; }
  .spec td { padding: 2px 0 10px; border: none; }
}

/* The guide: one column of text, its screenshots a little wider. */
.guide { max-width: 860px; padding-top: 32px; padding-bottom: 56px; }
.guide h1 { font-size: clamp(40px, 7vw, 56px); margin-bottom: 24px; }
.guide h2 { margin-top: 56px; scroll-margin-top: 80px; }
.guide h3 { margin-top: 32px; scroll-margin-top: 80px; }
.guide figure { margin: 24px 0; }
.guide .table { margin: 16px 0; }
.guide pre { background: var(--surface-container-high); border-radius: 12px; padding: 14px 16px; overflow-x: auto; }
.guide pre code { background: none; padding: 0; overflow-wrap: normal; }
.guide li { margin-bottom: 6px; }
.guide .gallery { margin: 16px 0; gap: 16px; }
.guide figure.states { max-width: 520px; margin-left: auto; margin-right: auto; }
.guide figure.portrait { max-width: 460px; margin-left: auto; margin-right: auto; }
.guide figure.panel { max-width: 320px; margin-left: auto; margin-right: auto; }
.contents ul { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 24px; list-style: none; }
.contents li { margin: 0; }
.contents a { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--surface-container); color: var(--on-surface); text-decoration: none; font-size: 15px; }
.contents a:hover { background: var(--primary-container); color: var(--on-primary-container); }

/* Building from source, until the first release. */
.download pre { background: var(--surface-container-high); border-radius: 12px; padding: 14px 16px; overflow-x: auto; }
.download pre code { background: none; padding: 0; overflow-wrap: normal; }

footer { padding: 32px 16px 48px; border-top: 1px solid var(--outline-variant); color: var(--on-surface-variant); font-size: 15px; }

@media (max-width: 640px) {
  section { padding: 40px 0; }
  .gallery, .gallery.three { grid-template-columns: 1fr; }
  /* Each download as a small card: the system, the file, then how. */
  thead { display: none; }
  table, tbody, tr, td { display: block; }
  tr { padding: 12px 16px; border-bottom: 1px solid var(--outline-variant); }
  tr:last-child { border-bottom: none; }
  td { padding: 2px 0; border: none; }
  td:first-child { font-weight: 600; }
  td:empty { display: none; }
  td code { white-space: normal; word-break: break-all; }
  .lede { font-size: 18px; }
  .top nav { gap: 14px; font-size: 15px; }
  /* The inspector's tabs side by side, swiped through, the next one
     showing at the edge, rather than three screens of them. */
  .guide .gallery.three { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; }
  .guide .gallery.three figure { flex: 0 0 78%; margin: 0; scroll-snap-align: start; }
}
