/* Design of velurex-labs.com: ruled "datasheet" layout on the dark ground of the trit matrix. */

/* IBM Plex, served from this site; license in /fonts/LICENSE-IBM-Plex.txt. */
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap; src: url("/fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2"); unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00A3, U+00A4-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap; src: url("/fonts/IBMPlexSans-Regular-Latin2.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF, U+FB01-FB02; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap; src: url("/fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2"); unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00A3, U+00A4-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-display: swap; src: url("/fonts/IBMPlexSans-SemiBold-Latin2.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF, U+FB01-FB02; }
@font-face { font-family: "Plex Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/IBMPlexSansCondensed-SemiBold-Latin1.woff2") format("woff2"); unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00A3, U+00A4-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "Plex Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/IBMPlexSansCondensed-SemiBold-Latin2.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF, U+FB01-FB02; }
@font-face { font-family: "Plex Condensed"; font-weight: 700; font-display: swap; src: url("/fonts/IBMPlexSansCondensed-Bold-Latin1.woff2") format("woff2"); unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00A3, U+00A4-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "Plex Condensed"; font-weight: 700; font-display: swap; src: url("/fonts/IBMPlexSansCondensed-Bold-Latin2.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF, U+FB01-FB02; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url("/fonts/IBMPlexMono-Regular-Latin1.woff2") format("woff2"); unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00A3, U+00A4-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url("/fonts/IBMPlexMono-Regular-Latin2.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF, U+FB01-FB02; }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-display: swap; src: url("/fonts/IBMPlexMono-SemiBold-Latin1.woff2") format("woff2"); unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00A3, U+00A4-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-display: swap; src: url("/fonts/IBMPlexMono-SemiBold-Latin2.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF, U+FB01-FB02; }

:root {
  color-scheme: dark;
  --ground: #090d15;
  --panel: #0e1521;
  --panel-strong: #111a29;
  --line: #2a3547;
  --line-strong: #3a4960;
  --text: #e8edf5;
  --head: #ffffff;
  --muted: #a7b3c6;
  --faint: #93a1b8;
  --teal: #2dd4bf;
  --on-teal: #06231f;
  --violet: #6d7cff;
  --link: #a9b2ff;
  --sans: "Plex Sans", system-ui, sans-serif;
  --condensed: "Plex Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, Consolas, monospace;
}

/* ---------- basics ---------- */

* { box-sizing: border-box; }

html { background: var(--ground); }

body {
  margin: 0 auto;
  max-width: 76.5rem;
  padding: 0 2rem;
  background: var(--ground);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
}

a { color: var(--link); text-underline-offset: 0.25em; }
a:hover { color: var(--head); }

p, li { color: var(--muted); }

strong { font-weight: 600; color: var(--text); }

h1, h2, h3 { color: var(--head); font-family: var(--condensed); font-weight: 700; }

h1 { margin: 0; font-size: clamp(2.5rem, 5.5vw, 4rem); line-height: 1.05; }

h2 { margin: 0 0 1.25rem; font-size: clamp(1.9rem, 4vw, 2.625rem); line-height: 1.15; }

h3 { margin: 0; font-size: 1.375rem; }

h1 em { font-style: normal; color: var(--teal); }

code { font-family: var(--mono); font-size: 0.9em; color: var(--text); }

pre {
  margin: 1rem 0;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  line-height: 1.5;
}

pre code { display: block; font-size: 0.9rem; }

.scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.9375rem; }

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

th { font-weight: 400; color: var(--faint); font-size: 0.8125rem; }

td { color: var(--text); }

tbody tr:first-child td { border-top: 1px solid var(--line); }

/* A table row with bold cells is the one to look at. */
tbody tr:has(strong) { background: var(--teal); }
tbody tr:has(strong) td, tbody tr:has(strong) strong, tbody tr:has(strong) code { color: var(--on-teal); font-weight: 600; }

/* ---------- header and footer ---------- */

header, footer { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }

header { justify-content: space-between; padding: 1.25rem 0; border-bottom: 3px solid var(--text); }

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 2.75rem;
  font: 700 1.5rem var(--condensed);
  letter-spacing: 0.125em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--head);
}

header nav { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; font-family: var(--mono); font-size: 0.9375rem; }

header nav a { display: flex; align-items: center; min-height: 2.75rem; }

header nav a[aria-current="page"] { color: var(--teal); }

footer {
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line-strong);
  color: var(--faint);
  font: 400 0.8125rem var(--mono);
}

/* ---------- sections ---------- */

section { padding: 3rem 0; }

section > .body > :first-child, .column > :first-child, .group > div > :first-child { margin-top: 0; }
section > .body > :last-child, .column > :last-child, .group > div > :last-child { margin-bottom: 0; }

.hero { padding: 4.5rem 0 3.5rem; }

.hero-text > p { max-width: 40rem; margin: 1.5rem 0 0; font-size: 1.1875rem; }

.hero-text pre { width: fit-content; max-width: 100%; margin: 1.75rem 0 0; border-color: var(--teal); }

/* Pages whose first paragraph is a lead line. */
.page-quintrit .hero-text h1 + p, .page-quintrit-velurex-encoding .hero-text h1 + p {
  max-width: 52rem;
  font: 600 clamp(1.6rem, 3.5vw, 2.25rem)/1.2 var(--condensed);
}

.page-quintrit .hero-text h1 + p strong, .page-quintrit-velurex-encoding .hero-text h1 + p strong { color: var(--head); }
.page-quintrit .hero-text h1 + p em, .page-quintrit-velurex-encoding .hero-text h1 + p em { font-style: normal; color: var(--teal); }

/* Labelled rows: a list whose items begin with a bold label. */
.s-areas-of-work, .s-specialization { border-top: 3px solid var(--text); }

.s-areas-of-work ul, .s-specialization ul { margin: 0; padding: 0; list-style: none; }

.s-areas-of-work li, .s-specialization li {
  position: relative;
  min-height: 4.5rem;
  padding: 1.35rem 1.5rem 1.35rem 22rem;
  border-bottom: 1px solid var(--line);
}

.s-areas-of-work li:first-child { border-top: 1px solid var(--line); }

.s-areas-of-work li > strong:first-child, .s-specialization li > strong:first-child {
  position: absolute;
  left: 0;
  top: 1.35rem;
  width: 20rem;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--head);
}

.s-areas-of-work li:nth-child(1) > strong:first-child { color: var(--teal); }
.s-areas-of-work li:nth-child(2) > strong:first-child { color: var(--link); }

/* ---------- home ---------- */

.page-home main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; }
.page-home main > section { grid-column: 1 / -1; min-width: 0; }
.page-home main > .s-who { grid-column: 1; }
.page-home main > .s-contact { grid-column: 2; }

.page-home h1 { max-width: 62rem; font-size: clamp(2.75rem, 6.6vw, 5.25rem); line-height: 1; }

.page-home .hero-text { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; column-gap: 2.5rem; }
.page-home .hero-text h1 { flex: 1 0 100%; }
.page-home .hero-text > p { flex: 1 1 30rem; margin-top: 2rem; font-size: 1.3125rem; }
.page-home .hero-text pre { margin-top: 2rem; }

section.s-key-figures { padding: 0; border-block: 1px solid var(--line-strong); }
.s-key-figures h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.s-key-figures table { table-layout: fixed; }
.s-key-figures th, .s-key-figures td, .s-key-figures tbody tr:first-child td { border: 0; }
.s-key-figures th { padding: 1.75rem 0.75rem 0 0; font: 700 clamp(2.75rem, 7vw, 4.5rem)/1 var(--condensed); color: var(--head); }
.s-key-figures th:nth-child(2) { color: var(--violet); }
.s-key-figures th:nth-child(3) { color: var(--teal); }
.s-key-figures td { padding: 0.4rem 0.75rem 1.75rem 0; font-size: 0.875rem; color: var(--faint); }

.page-home .s-velurex-encoding {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  grid-template-rows: auto 1fr;
  column-gap: 3.5rem;
  padding: 5rem 0;
}
.page-home .s-velurex-encoding > .body { display: contents; }
.page-home .s-velurex-encoding .column:first-of-type { grid-column: 1; grid-row: 2; }
.page-home .s-velurex-encoding .column:last-of-type { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.page-home .s-velurex-encoding pre { margin-top: 0; }
.page-home .s-velurex-encoding pre code { font-size: clamp(0.95rem, 2.2vw, 1.375rem); font-weight: 600; color: var(--head); }
.page-home .s-velurex-encoding td:last-child, .page-home .s-velurex-encoding th:last-child { text-align: right; }
.page-home .s-velurex-encoding .column:last-of-type > p { font-size: 0.9375rem; color: var(--faint); }

.page-home .s-quintrit { padding: 3rem; background: var(--panel-strong); border: 1px solid var(--line); }
.page-home .s-quintrit h2 { font-size: clamp(2.5rem, 5vw, 3.5rem); line-height: 1; }
.page-home .s-quintrit p { max-width: 45rem; }
.page-home .s-quintrit a { color: var(--teal); font-weight: 600; }

.s-who h2, .s-contact h2 { margin-bottom: 0.5rem; font: 600 1.25rem var(--sans); }

/* ---------- project page ---------- */

.page-quintrit .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 28rem); gap: 3.5rem; align-items: center; }
.page-quintrit h1 { font-size: clamp(3.5rem, 9vw, 7rem); line-height: 0.95; }
.hero-figure p { margin: 0; }
.hero-figure img { display: block; width: 100%; height: auto; }
.hero-figure em { display: block; margin-top: 0.875rem; font: 400 0.8125rem var(--mono); color: var(--faint); }

.s-specialization li { padding-left: 17rem; }
.s-specialization li > strong:first-child { left: 1.5rem; width: 14rem; }
.s-specialization li:first-child { background: var(--teal); border-color: var(--teal); }
.s-specialization li:first-child, .s-specialization li:first-child strong, .s-specialization li:first-child a { color: var(--on-teal); }

.page-quintrit main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3.5rem; }
.page-quintrit main > section { grid-column: 1 / -1; min-width: 0; }
.page-quintrit main > .s-limits {
  grid-column: 1;
  align-self: start;
  margin: 1rem 0 3rem;
  padding: 2.25rem;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}
.page-quintrit main > .s-links { grid-column: 2; padding-top: 1rem; }
.s-limits ul { padding-left: 1.25rem; }
.s-limits li { margin-bottom: 0.75rem; }
.s-links ul { margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 0.9375rem; }
.s-links li { border-top: 1px solid var(--line); }
.s-links li:last-child { border-bottom: 1px solid var(--line); }
.s-links a { display: flex; align-items: center; min-height: 3rem; }

/* ---------- side headings: encoding and legal pages ---------- */

.s-definition, .s-why-28-and-not-27, .s-specification, .s-citation, .page-legal main > section:not(.hero) {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 1rem 3rem;
  border-top: 1px solid var(--line-strong);
}

.s-definition > h2, .s-why-28-and-not-27 > h2, .s-specification > h2, .s-citation > h2, .page-legal main > section > h2 {
  flex: 0 0 18rem;
  margin: 0;
  font-size: 2.25rem;
}

.s-definition > .body, .s-why-28-and-not-27 > .body, .s-specification > .body, .s-citation > .body, .page-legal main > section > .body {
  flex: 1 1 30rem;
  min-width: 0;
}

.page-legal main > section > h2 { font-size: 1.75rem; }
.page-legal .hero { padding-bottom: 2.5rem; }
.page-legal li { margin-bottom: 0.75rem; }

/* ---------- encoding page ---------- */

.page-quintrit-velurex-encoding main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; }
.page-quintrit-velurex-encoding main > section { grid-column: 1 / -1; min-width: 0; }
.page-quintrit-velurex-encoding main > .s-example { grid-column: 1; }
.page-quintrit-velurex-encoding main > .s-properties { grid-column: 2; }
.page-quintrit-velurex-encoding h1 { font-size: clamp(2.75rem, 6.6vw, 5.25rem); }

.s-definition pre code { font-size: clamp(0.95rem, 2.4vw, 1.5rem); font-weight: 600; color: var(--head); }

.s-dividing-by-28-without-division { border-top: 3px solid var(--text); }
.s-dividing-by-28-without-division table { font-size: 1.0625rem; }
.s-dividing-by-28-without-division td { padding-block: 1.1rem; }
.s-dividing-by-28-without-division tbody tr:has(strong) td { padding-block: 1.6rem; }
.s-dividing-by-28-without-division td:first-child { width: 4rem; color: var(--link); font-weight: 600; }
.s-dividing-by-28-without-division td code { font-size: 1.0625rem; }
.s-dividing-by-28-without-division td:nth-child(2) code + code { display: block; font-size: 0.9375rem; color: var(--faint); }
.s-dividing-by-28-without-division td:last-child { color: var(--faint); }
.s-dividing-by-28-without-division tbody tr:has(strong) code { font-size: 1.25rem; }
.s-dividing-by-28-without-division tbody tr:has(strong) td:last-child code { font-size: 1rem; }

section.s-the-key-step-is-one-simd-instruction { padding: 2.25rem; background: var(--panel); border: 2px solid var(--teal); }
.s-the-key-step-is-one-simd-instruction h2 { font-size: 2.125rem; }
.s-the-key-step-is-one-simd-instruction blockquote { margin: 0 0 1.25rem; font-size: 1.25rem; }
.s-the-key-step-is-one-simd-instruction blockquote p { margin: 0; color: var(--text); }
.s-the-key-step-is-one-simd-instruction blockquote code { color: var(--teal); }

.s-bit-tricks-of-each-instruction-set .group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}
.s-bit-tricks-of-each-instruction-set .group > h3 { flex: 0 0 16rem; }
.s-bit-tricks-of-each-instruction-set .group > div { flex: 1 1 30rem; min-width: 0; }
.s-bit-tricks-of-each-instruction-set ul { margin: 0; padding-left: 1.25rem; }
.s-bit-tricks-of-each-instruction-set li { margin-bottom: 0.6rem; }
.s-bit-tricks-of-each-instruction-set .group:nth-of-type(1) h3 { color: var(--teal); }
.s-bit-tricks-of-each-instruction-set .group:nth-of-type(2) h3 { color: var(--link); }

.s-citation pre code { font-size: 0.8125rem; }

/* ---------- narrow screens ---------- */

@media (max-width: 56rem) {
  body { padding: 0 1.25rem; }

  .page-home main, .page-quintrit main, .page-quintrit-velurex-encoding main { display: block; }

  .page-quintrit .hero { grid-template-columns: minmax(0, 1fr); }

  .page-home .s-velurex-encoding { display: block; }
  .page-home .s-velurex-encoding > .body { display: block; }
  .page-home .s-velurex-encoding .column + .column { margin-top: 2rem; }

  .s-areas-of-work li, .s-specialization li { padding: 1.25rem 0; }
  .s-specialization li:first-child { padding-inline: 1rem; }
  .s-areas-of-work li > strong:first-child, .s-specialization li > strong:first-child {
    position: static;
    display: block;
    width: auto;
    margin-bottom: 0.25rem;
  }

  .page-home .s-quintrit, section.s-the-key-step-is-one-simd-instruction { padding: 1.5rem; }

  /* The formula fits the screen without scrolling. */
  .page-home .s-velurex-encoding pre, .s-definition pre { padding: 1rem 0.75rem; }
  .page-home .s-velurex-encoding pre code, .s-definition pre code { font-size: 0.78rem; }

  /* Each step of the division: the number beside the operation and its meaning. */
  .s-dividing-by-28-without-division thead { display: none; }
  .s-dividing-by-28-without-division table, .s-dividing-by-28-without-division tbody { display: block; }
  .s-dividing-by-28-without-division tr { display: grid; grid-template-columns: 2rem minmax(0, 1fr); border-bottom: 1px solid var(--line); }
  .s-dividing-by-28-without-division tbody tr td, .s-dividing-by-28-without-division tbody tr:has(strong) td { border: 0; padding-block: 0.5rem; }
  .s-dividing-by-28-without-division td:first-child { grid-row: span 2; width: auto; }
  .s-dividing-by-28-without-division td code, .s-dividing-by-28-without-division tbody tr:has(strong) code { font-size: 0.875rem; }

  .page-home main > .s-who { padding-bottom: 0; }
  .page-home main > .s-contact { padding-top: 1.5rem; }

  th, td { padding-inline: 0.4rem; }
  .s-key-figures td { font-size: 0.75rem; }
}
