/* ApertureLab site base stylesheet.
 *
 * Everything every page needs: the self-hosted font, the design tokens, the
 * reset, the sticky header, the footer, and the capability directory. Page
 * fragments carry their own styles in website/_pages/<slug>.css, which the
 * builder inlines after this file, so a page can still override any token.
 * aperture.html in particular narrows --max-w and adds its own accents.
 */

/* Inter, self-hosted variable font (SIL OFL 1.1; see fonts/OFL.txt).
   Two subsets: latin, plus greek for the lambda / theta / delta used
   throughout the text and the diagrams. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

/* ── Design tokens ── */
:root {
  --bg:        #0a0a0f;
  --bg-section:#0d0d14;
  --text:      #f0f0f0;
  --muted:     #888;
  --accent:    #00c8c8;
  --max-w:     1200px;
  --pad-x:     clamp(1.5rem, 5vw, 4rem);
  --pad-y:     5rem;
  --header-h:  auto;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  font-size: 1rem;
}
/* height:auto matters because images carry width/height attributes (which
   reserve space and stop layout shift); without it a CSS width of 100% is
   combined with the literal height attribute and the image is stretched. */
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Sticky site header ──
   Replaces the old per-page #section-nav, which had no position rule and so
   scrolled away permanently after the first section. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.7rem var(--pad-x);
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 200, 200, 0.18);
}
.site-wordmark {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--text);
  flex: 0 0 auto;
}
.site-wordmark:hover { color: var(--accent); text-decoration: none; }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.5rem;
  flex: 1 1 auto;
}
.nav-band {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}
.nav-band-name {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.58rem;
  font-weight: 700;
  opacity: 0.75;
}
.site-nav a {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  transition: color 0.18s;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav a.is-current { color: var(--text); }
.nav-app {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  padding: 0.38rem 0.9rem;
  border: 1px solid rgba(0, 200, 200, 0.45);
  border-radius: 3px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  transition: background 0.18s, color 0.18s;
}
.nav-app:hover { background: rgba(0, 200, 200, 0.12); text-decoration: none; }
/* The app sits behind a sign-in wall; say so rather than surprise the reader. */
.nav-app-note {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--muted);
}

/* ── Capability directory ── */
#directory {
  padding: var(--pad-y) var(--pad-x);
  background: var(--bg-section);
}
.directory-inner { max-width: var(--max-w); margin: 0 auto; }
.section-eyebrow {
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.directory-intro {
  color: #aaa;
  max-width: 60ch;
  margin: 0.9rem 0 2.5rem;
}
.directory-band + .directory-band { margin-top: 2.5rem; }
.directory-band-name {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 200, 200, 0.16);
}
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}
.directory-card {
  display: flex;
  gap: 0.9rem;
  background: #0d0d18;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid rgba(0, 200, 200, 0.3);
  padding: 0.9rem;
  transition: border-left-color 0.2s, background 0.2s, transform 0.2s;
}
.directory-card:hover {
  border-left-color: var(--accent);
  background: #0f0f1e;
  text-decoration: none;
  transform: translateY(-2px);
}
.directory-thumb {
  flex: 0 0 84px;
  height: 84px;
  overflow: hidden;
  border-radius: 2px;
  background: #000;
}
.directory-thumb img { width: 100%; height: 100%; object-fit: cover; }
.directory-body { display: flex; flex-direction: column; gap: 0.3rem; }
.directory-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.directory-card-text {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Footer ── */
footer.page-footer {
  padding: 2.5rem var(--pad-x);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-home { font-weight: 600; }

/* ── Lightbox (shared by any page with a gallery) ── */
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 0 60px rgba(0, 200, 200, 0.2);
  cursor: default;
}

@media (max-width: 900px) {
  .site-header { gap: 0.75rem; }
  .site-nav { gap: 0.3rem 1rem; }
  .nav-band { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .directory-card:hover { transform: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; }
}

/* ── Capability pages ──
   The shared layout for every page under the directory: a lede, a run of
   sections, a strip of measured numbers, and the imagery each capability
   produces. Every capability page ends in visual results; that is the rule. */
.cap-head {
  padding: 3.5rem var(--pad-x) 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}
.cap-head h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 20ch;
}
.cap-lede {
  margin-top: 1.1rem;
  max-width: 70ch;
  font-size: 1.05rem;
  line-height: 1.75;
  color: #aaa;
}
.cap-section {
  padding: 2.5rem var(--pad-x);
}
.cap-section:nth-of-type(even) { background: var(--bg-section); }
.cap-inner { max-width: var(--max-w); margin: 0 auto; }
.cap-eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.cap-section h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 28ch;
}
.cap-prose {
  max-width: 72ch;
  margin-top: 1rem;
  line-height: 1.75;
  color: #bbb;
}
.cap-prose p + p { margin-top: 0.9rem; }
.cap-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  color: var(--accent);
}
.cap-list {
  margin: 1rem 0 0 1.1rem;
  max-width: 72ch;
  color: #bbb;
  line-height: 1.7;
}
.cap-list li { margin-bottom: 0.35rem; }

/* A measured claim, with the file it came from. */
.cap-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}
.cap-number {
  background: #0d0d18;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 2px solid var(--accent);
  padding: 1.1rem 1.2rem;
}
.cap-number-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.cap-number-label {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
.cap-number-src {
  margin-top: 0.5rem;
  font-size: 0.68rem;
  color: rgba(136, 136, 136, 0.75);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

.cap-figure { margin-top: 1.75rem; }
.cap-figure img {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
.cap-figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 80ch;
}
.cap-callout {
  margin-top: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(0, 200, 200, 0.5);
  max-width: 70ch;
  color: var(--accent);
  font-style: italic;
  line-height: 1.7;
}
.cap-next {
  padding: 2.5rem var(--pad-x) 3.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── Dataset pages ──
   Shared by datasets.html and the per-release pages. Every sample figure from
   tools/build_datasets_figures.py is 1600 x 800 px, so a two-column grid of
   2:1 tiles stays even at every width (the Fidelity page's tile pattern).
   The one exception is the v1.1 class strip, a full-width 5:1 row (.ds-wide). */
.ds-toc { margin-top: 1.5rem; max-width: 72ch; }
.ds-toc ol { margin: 0.4rem 0 0 1.3rem; color: var(--muted); line-height: 1.6; }
.ds-toc li + li { margin-top: 0.7rem; }
.ds-toc a { font-weight: 600; }
.ds-toc span { display: block; font-size: 0.88rem; }
.ds-status {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.12rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.ds-status.published { color: #6fcf97; }
.ds-status.rendering { color: #f0a35e; }
.ds-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}
.ds-tile {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: #0d0d18;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  cursor: zoom-in;
}
.ds-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ds-tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: contain;
  background: #0d0d18;
}
/* The v1.1 class strip (v11_classes.webp, 1920 x 384) spans the grid. */
.ds-tile.ds-wide { grid-column: 1 / -1; }
/* Labels per class and split, written by tools/build_dataset_class_tables.py. */
.ds-class-wrap { margin-top: 1.75rem; max-width: 640px; overflow-x: auto; }
.ds-class-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.ds-class-table th, .ds-class-table td { text-align: right; padding: 0.4rem 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.07); font-size: 0.86rem; white-space: nowrap; }
.ds-class-table thead th { color: var(--accent); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.ds-class-table td:first-child, .ds-class-table th:first-child { text-align: left; }
.ds-class-table td { color: #ccc; }
.ds-class-table td code { color: var(--text); font-size: 0.82rem; }
.ds-class-table tr.ds-class-group th { text-align: left; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; padding-top: 1.1rem; }
.ds-class-table tr.ds-class-sub td { color: var(--text); font-weight: 600; }
.ds-class-table tr.ds-class-total td { color: var(--text); font-weight: 700; border-top: 1px solid rgba(255,255,255,0.25); }
.ds-class-pending { margin-top: 1.5rem; color: var(--muted); font-style: italic; }
@media (max-width: 520px) {
  .ds-class-table th, .ds-class-table td { padding: 0.35rem 0.4rem; font-size: 0.8rem; }
  .ds-class-table td code { font-size: 0.74rem; }
}
.ds-tile.ds-wide img { aspect-ratio: 5 / 1; }
.ds-tile figcaption {
  padding: 0.6rem 0.8rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ds-tile figcaption strong { color: var(--text); font-size: 0.9rem; }
.ds-dl {
  margin-top: 1.5rem;
  max-width: 80ch;
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: 0.5rem 1.2rem;
  line-height: 1.6;
}
.ds-dl dt {
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  padding-top: 0.2rem;
}
.ds-dl dd { color: #ccc; margin: 0; overflow-wrap: anywhere; }
.ds-dl code, .ds-links code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  color: var(--accent);
}
.ds-links { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; font-weight: 600; }
@media (max-width: 720px) {
  .ds-tiles { grid-template-columns: minmax(0, 1fr); }
  .ds-dl { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .ds-dl dd + dt { margin-top: 0.6rem; }
}
