/* jglot-site: the project overview (the front page). A plain reference page: white
   ground, sans-serif text, one link colour, tables and lists. It shares the
   fonts and the screenshots with the magazine page and none of its styles. */

@font-face { font-family: "Sans"; src: url("../fonts/sans-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Sans"; src: url("../fonts/sans-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Sans"; src: url("../fonts/sans-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Mono"; src: url("../fonts/mono-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ground: #ffffff;
  --ground-soft: #f5f6f8;
  --text: #1b1f24;
  --text-soft: #57606a;
  --line: #d5dae0;
  --link: #0b5cad;

  --sans: "Sans", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Mono", "NotoSansM Nerd Font Mono", ui-monospace, Menlo, Consolas, monospace;

  --measure: 74rem;
  --gap: clamp(1rem, 2.2vw, 2rem);
  --pad: clamp(1rem, 3.5vw, 2.5rem);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 0.9em; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--ground-soft); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.3em; overflow-wrap: anywhere; }

.wrap { max-width: var(--measure); margin-inline: auto; padding-inline: var(--pad); }

/* ── Header and footer ────────────────────────────────────────────────── */

.site { position: sticky; top: 0; z-index: 1; background: var(--ground); border-bottom: 1px solid var(--line); }
.site__bar { display: flex; align-items: baseline; justify-content: space-between; gap: 0.4rem 2rem; flex-wrap: wrap; padding-block: 0.8rem; }
.site__name { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.site__pages { display: flex; gap: 1.1rem; margin-right: auto; font-size: 0.92rem; }
.site__pages [aria-current] { color: var(--text); font-weight: 700; }
.site nav { display: flex; gap: 0.3rem 1.4rem; flex-wrap: wrap; font-size: 0.92rem; }

.site__foot { display: flex; justify-content: space-between; gap: 0.5rem 2rem; flex-wrap: wrap; margin-top: 3rem; padding-block: 1.2rem 2rem; border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--text-soft); }

/* ── Headings and sections ────────────────────────────────────────────── */

h1 { margin: 0 0 0.4em; font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 0 0 0.5em; font-size: 1.55rem; line-height: 1.2; font-weight: 700; }
h3 { margin: 1.6em 0 0.6em; font-size: 0.8rem; line-height: 1.3; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }

main > section { padding-block: clamp(2rem, 4vw, 3.2rem); border-bottom: 1px solid var(--line); }
main > section:last-child { border-bottom: 0; }

.intro > p, .notes > p, .notes > ul { max-width: 46rem; }
.lead { font-size: 1.2rem; line-height: 1.5; color: var(--text-soft); }
.notes li { margin-bottom: 0.5em; }

/* ── The table of projects ────────────────────────────────────────────── */

.scroll { overflow-x: auto; }
.index { width: 100%; border-collapse: collapse; font-size: 0.93rem; line-height: 1.45; }
.index th, .index td { padding: 0.55rem 0.9rem 0.55rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.index thead th { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); border-bottom-color: var(--text); white-space: nowrap; }
.index tbody th { font-weight: 700; white-space: nowrap; }
.index td:nth-child(2) { white-space: nowrap; color: var(--text-soft); }
.index td:nth-child(3) { min-width: 16rem; }

/* ── A project ────────────────────────────────────────────────────────── */

.project__area { margin: 0 0 0.3rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.project__head h2 { margin-bottom: 0.2em; font-size: 1.9rem; }
.project__summary { font-size: 1.12rem; color: var(--text-soft); max-width: 46rem; }

.project__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap) calc(var(--gap) * 1.5); align-items: start; margin-top: 1.2rem; }
.project__text ul { margin: 0; padding-left: 1.2rem; }
.project__text li { margin-bottom: 0.45em; }
.project__side h3 { margin-top: 1.4rem; }

.facts { margin: 0; border-top: 1px solid var(--text); font-size: 0.92rem; line-height: 1.45; }
.facts div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.8rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 500; color: var(--text-soft); }
.facts dd { margin: 0; }

/* ── Screenshots ──────────────────────────────────────────────────────── */

.fig { margin: 0; }
.shot__frame { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--ground-soft); cursor: zoom-in; font: inherit; color: inherit; }
.shot__frame:hover { border-color: var(--text-soft); }
.shot__frame:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.fig img { width: 100%; }
.fig figcaption { margin-top: 0.5rem; font-size: 0.86rem; line-height: 1.45; color: var(--text-soft); }
.fig figcaption b { font-weight: 700; color: var(--text); margin-right: 0.2rem; }
.fig figcaption b::after { content: ":"; }

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--gap) * 1.1) var(--gap); align-items: start; }
/* In the gallery every screenshot is cut to one shape, from the top left,
   where a terminal or a page keeps what matters. A phone, an e-paper panel
   and a drawing are shown whole instead. */
.gallery .fig img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.gallery .fig--phone img, .gallery .fig--epd img, .gallery .fig--print img { object-fit: contain; object-position: center; }

/* ── Lightbox ─────────────────────────────────────────────────────────── */

.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; }
.lightbox::backdrop { background: rgb(15 18 22 / 0.9); }
.lightbox img { max-width: 96vw; max-height: 88vh; width: auto; border-radius: 4px; cursor: zoom-out; }
.lightbox p { margin: 0.7rem 0 0; text-align: center; font-size: 0.86rem; color: #d5dae0; }

/* ── Narrower pages ───────────────────────────────────────────────────── */

@media (max-width: 60rem) {
  .project__cols { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 40rem) {
  .site { position: static; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media print {
  .site { position: static; }
  .project { break-inside: avoid-page; }
}
