/* Theme ported from the 2024 React/Tailwind site (tag cra-final), with the slate rules/selection from its unfinished `layout` branch. Values are the rendered ones, not Tailwind names. */
@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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Arial metrics-matched to Inter so swap-in doesn't shift layout */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.49%;
  descent-override: 22.56%;
  line-gap-override: 0%;
  size-adjust: 107.06%;
}
/* Berkeley Mono: personal-use license (~/dev/assets.md). Repo must stay private while this file is committed. */
@font-face {
  font-family: "Berkeley Mono";
  src: url(/fonts/berkeley-mono-variable.woff2) format("woff2");
  font-stretch: 60 100;
  font-weight: 100 900;
  font-style: oblique -16deg 0deg;
  font-display: swap;
}

:root {
  --header-h: 91px;
  --nav-w: max(15vw, 150px);
  --font-sans: "Inter", "Inter Fallback", sans-serif;
  --font-mono: "Berkeley Mono", ui-monospace, Menlo, monospace;
  --ink: #000;
  --paper: #fff;
  --rule: #64748b;
  --rule-item: #708090;
  --selected: #e2e8f0;
  --pressed: #2563eb;
  --accent: #f094a4;
}

*, ::before, ::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  /* Inter 4 has an opsz axis; the old site's Inter 3 didn't. Auto would switch big text to the tighter display cut. */
  font-optical-sizing: none;
  color: var(--ink);
  background: var(--paper);
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--header-h) minmax(0, 1fr);
  overflow: hidden;
}
html[data-font="mono"] body { font-family: var(--font-mono); }
img, svg { display: block; }
a { color: inherit; text-decoration: inherit; }
button { font: inherit; color: inherit; background: none; cursor: pointer; }

/* header */
.site-header { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.head-row { display: flex; align-items: center; }
.brand { display: flex; align-items: center; flex-shrink: 0; padding: 8px; }
.brand a { margin-right: 16px; }
.brand-name { font-size: 2.25rem; line-height: 2.5rem; }
/* the old site's img reset rendered distn tiles 101 wide, height from aspect (~90px) */
.strip { flex: 1 0 0; height: 91px; background: url(/images/distn.png) repeat-x 0 0 / 101px auto; }
.head-contact { display: none; position: absolute; top: 0; bottom: 0; right: 0; height: fit-content; margin: auto 0; padding: 8px; }
@media (min-width: 640px) { .head-contact { display: block; } }

.contact { display: flex; align-items: center; gap: 8px; }
.contact a:hover svg, .contact a:focus-visible svg { fill: var(--accent); }

/* nav: top bar below 1160px, sidebar above */
.site-body { overflow: auto; display: flex; flex-direction: column; }
.site-nav { display: flex; flex-wrap: wrap; font-weight: 500; border-right: 1px solid var(--rule); }
.nav-item {
  display: flex; flex: 1 0 auto; align-items: center; white-space: nowrap; padding: 4px 6px;
  border-bottom: 1px solid var(--rule-item); border-right: 1px solid var(--rule-item);
}
.nav-item img { height: auto; } /* old img reset: 32×26 folder drawn 24 wide, not squared */
.nav-item span { margin: 0 auto 0 4px; }
.nav-item .arrow { flex-shrink: 0; transform: rotate(90deg); }
.nav-item[aria-current="page"] { background: var(--selected); }
.nav-item:active { background: var(--pressed); color: #fff; }
main { flex: 1; padding: 8px; }

@media (min-width: 1160px) {
  .site-body { overflow: hidden; display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); }
  /* rule sits just outside the column, as on the old site */
  .site-nav { flex-direction: column; flex-wrap: nowrap; overflow: auto; border-right: 0; box-shadow: 1px 0 0 var(--rule); z-index: 1; }
  .nav-item { flex: none; border: 0; }
  .nav-item .arrow { transform: none; }
  main { overflow: auto; }
}

/* pages */
.welcome { display: flex; flex-direction: column; gap: 8px; }
.contact-page { display: flex; justify-content: center; }

/* entry rows: live + feed */
.entries { list-style: none; max-width: 40rem; }
.entry { padding: 8px 0; border-bottom: 1px solid var(--rule-item); }
.entry:first-child { padding-top: 0; }
.entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
.entry-title { font-weight: 500; }
.entry-meta { color: var(--rule); font-size: 0.875rem; }
.entry-links { display: flex; gap: 12px; }
.entry a { text-decoration: underline; text-underline-offset: 2px; }
.entry a:hover, .entry a:focus-visible { color: var(--accent); }

/* lab: toggle styled like nav items; each option previews its own font */
.toggle { display: flex; align-items: center; gap: 8px; }
.toggle button { padding: 4px 6px; border: 1px solid var(--rule-item); }
.toggle button[value="sans"] { font-family: var(--font-sans); }
.toggle button[value="mono"] { font-family: var(--font-mono); }
.toggle button[aria-pressed="true"] { background: var(--selected); }
.toggle button:active { background: var(--pressed); color: #fff; }
