/* Shared foundation. Concepts override only palette accents + their artifact. */

@font-face {
  font-family: "Literata";
  src: url("/shared/fonts/literata-var.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/shared/fonts/literata-var-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("/shared/fonts/fragment-mono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fefdfa;
  --ink: #211f1a;
  --faint: #8b8579;
  --hair: #eae6dc;
  --serif: "Literata", "Iowan Old Style", Georgia, serif;
  --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --col: 34rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 380;
  font-optical-sizing: auto;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 150ms ease;
}
a:hover { text-decoration-color: var(--ink); }
a:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection { background: var(--hair); }

.col {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- top nav (subpages) --- */
.nav {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  display: flex;
  gap: 1.5rem;
  padding-top: 2.2rem;
}
.nav a { text-decoration: none; color: var(--faint); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* --- headings --- */
h1 {
  font-size: 1.0625rem;
  font-weight: 500;
  margin: 0;
}
.page-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  font-weight: 400;
  margin: 4.5rem 0 0;
}

.intro {
  margin: 1.1rem 0 0;
  max-width: 30rem;
}
.intro .aside {
  color: var(--faint);
  font-style: italic;
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

/* --- mode toggle (by sector / by technology / by year) --- */
.modes {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  margin: 4.75rem 0 0;
  display: flex;
  gap: 1.1rem;
  align-items: baseline;
}
.modes button {
  all: unset;
  cursor: pointer;
  color: var(--faint);
  transition: color 150ms ease;
  padding: 0.1rem 0;
}
.modes button:hover { color: var(--ink); }
.modes button[aria-pressed="true"] {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}
.modes button:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 3px;
}

/* --- lists --- */
.record { margin: 1.6rem 0 0; transition: opacity 150ms ease; }
.record.is-swapping { opacity: 0; }

/* wide mode: the record breaks out of the reading column so every
   discipline is visible at once — the breadth is the point */
.record.is-wide {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 62rem);
}
.record.is-cols {
  columns: 16rem 3;
  column-gap: 3.5rem;
}
.record.is-cols .group {
  break-inside: avoid;
  margin-bottom: 1.9rem;
}

.group { margin: 0 0 2.1rem; }
.group-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  margin: 0 0 0.45rem;
  width: fit-content;                 /* underline hugs the title, not the column */
  padding-bottom: 0.22rem;
  border-bottom: 1px solid var(--hair);
}
.group ul { list-style: none; margin: 0; padding: 0; }
.group li { margin: 0.12rem 0; }

.entry-name { font-weight: 480; }
.entry-note { color: var(--faint); font-size: 0.95rem; }
.entry-note::before { content: " — "; }
.entry-outcome { color: var(--faint); font-size: 0.95rem; }
.entry-venue { color: var(--faint); font-size: 0.95rem; }
.entry-venue::before { content: " · "; }

/* year view: sparse ledger — the whitespace is the argument */
.year-row { display: flex; gap: 1.4rem; margin: 0 0 1.9rem; }
.year-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  min-width: 3.2rem;
  padding-top: 0.28rem;
}
.year-row ul { list-style: none; margin: 0; padding: 0; }

/* --- footer --- */
.footer {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  margin-top: 6rem;
  padding-bottom: 3.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer a { text-decoration: none; color: var(--faint); }
.footer a:hover { color: var(--ink); }
.footer .colophon { margin-left: auto; }

@media (max-width: 40rem) {
  .footer .colophon { margin-left: 0; }
  .year-row { gap: 1rem; }
}
