/* Foothills Labs — site styles
 *
 * The palette, the four schemes and the two type systems come from
 * assets/tokens.css, which is a copy of assets/tokens/tokens.css in the
 * foundation_lab repo. Do not edit the tokens here — change them there and
 * copy the file across, so the site and the brand guide cannot drift.
 *
 * Rules: https://github.com/foothills-labs/foundation_lab/blob/main/docs/brand.md
 *
 * Scheme use on this site:
 *   glacier / atlas   the lab and the models  — default, and #about
 *   field             benchmarks and tools    — #projects
 */

/* --- faces --------------------------------------------------------------- */
/* Self-hosted. No external requests, by design. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* --- base ---------------------------------------------------------------- */

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

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

body,
[data-scheme] {
  /* --fh-face-body follows the scheme's typeset: Newsreader in the warm half,
     Archivo in the technical half. Using --fh-font-body here instead would
     pin every scheme to the serif. */
  font-family: var(--fh-face-body);
}

body {
  margin: 0;
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(100% - 2.5rem, 74rem);
  margin-inline: auto;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--fh-accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--fh-accent);
  color: var(--fh-accent-on);
  padding: 0.6rem 1rem;
  font-family: var(--fh-font-mono);
  font-size: 0.8rem;
}
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; }

/* --- type roles ---------------------------------------------------------- */

/* CASE. One rule, both typesets, no exceptions:
 *
 *   headings are sentence case      — warm and technical alike
 *   uppercase belongs to mono only  — eyebrows, nav, buttons, tags, pills,
 *                                     column heads
 *
 * Uppercase is what marks a label as a label. Spending it on headings too
 * would leave the two roles looking the same, and it would wreck the package
 * names in the Code band — regexbench and labloop are identifiers, and
 * REGEXBENCH is a different string. Declared here rather than left to the
 * initial value so it cannot drift back one heading at a time. */
h1, h2, h3 {
  font-family: var(--fh-face-display);
  font-variation-settings: var(--fh-display-settings);
  font-weight: var(--fh-display-weight);
  letter-spacing: var(--fh-tracking-display);
  text-transform: none;
  line-height: 1.04;
  text-wrap: balance;
  margin: 0;
}

/* The display face also sets row headers in data tables — model names, phase
   numbers. Same case rule applies. */
.data-table tbody th { text-transform: none; }

.eyebrow {
  font-family: var(--fh-font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: var(--fh-tracking-label);
  text-transform: uppercase;
  color: var(--fh-text-muted);
  margin: 0;
}

.mono,
.tag,
.tags,
code {
  font-family: var(--fh-font-mono);
  font-variant-numeric: tabular-nums;
}

/* --- header -------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--fh-rule);
  position: sticky;
  top: 0;
  background: var(--fh-bg);
  z-index: 5;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: var(--fh-face-display);
  font-variation-settings: var(--fh-display-settings);
  font-weight: var(--fh-display-weight);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand svg { display: block; color: var(--fh-accent); flex: none; }

.site-nav {
  display: flex;
  gap: 1.6rem;
  font-family: var(--fh-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.site-nav a {
  text-decoration: none;
  color: var(--fh-text-muted);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--fh-text); border-bottom-color: var(--fh-accent); }

/* --- hero ---------------------------------------------------------------- */

.hero { padding-block: clamp(3.5rem, 9vw, 7.5rem) clamp(2.5rem, 6vw, 5rem); }
.hero-inner { display: grid; gap: 1.4rem; }
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5.1rem);
  max-width: 18ch;
}
.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--fh-text-muted);
  max-width: 58ch;
  margin: 0;
}

.cta-row { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 0.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.25rem;
  text-decoration: none;
  font-family: var(--fh-font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--fh-lichen);
  color: var(--fh-on-lichen);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost {
  border-color: var(--fh-rule);
  color: var(--fh-text);
}
.btn-ghost:hover { border-color: var(--fh-accent); }
.arrow { transition: transform 140ms ease-out; }
.btn:hover .arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .arrow { transition: none; }
  .btn:hover .arrow { transform: none; }
}

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

.section { padding-block: clamp(2.75rem, 6vw, 5rem); }

.section-head {
  border-top: 2px solid var(--fh-text);
  padding-top: 0.9rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.section-head p { margin: 0; }

/* --- focus grid ---------------------------------------------------------- */

.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.75rem;
}
.focus h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.focus p { color: var(--fh-text-muted); margin: 0; font-size: 0.97rem; }

/* --- projects ------------------------------------------------------------ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--fh-surface);
  border: 1px solid var(--fh-rule);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.card-title h3 { font-size: 1.1rem; }
.card p { margin: 0; color: var(--fh-text-muted); font-size: 0.95rem; }

.tags { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.4rem; }
.tag {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--fh-rule);
  color: var(--fh-text-muted);
}
.tag[data-state="live"] { background: var(--fh-lichen); color: var(--fh-on-lichen); border-color: transparent; }

/* --- about --------------------------------------------------------------- */

.about-body { max-width: var(--fh-measure); }
.about-body p { color: var(--fh-text-muted); }
.about-body p:first-child { color: var(--fh-text); font-size: 1.12rem; }

/* --- footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--fh-rule);
  padding-block: 2rem 3rem;
  margin-top: 2rem;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--fh-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fh-text-muted);
}
.footer-links { display: flex; gap: 1.4rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--fh-accent); }

/* --- 404 ----------------------------------------------------------------- */

.notfound {
  min-height: 62vh;
  display: grid;
  align-content: center;
  gap: 1rem;
  padding-block: 4rem;
}
.notfound h1 { font-size: clamp(2.4rem, 6vw, 4rem); }

/* --- wide content -------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }
.table-wrap { overflow-x: auto; }

/* --- hero contours ------------------------------------------------------- */
/* Abstract mountaineering: a section through terrain, not a horizon. Same
   language as the mark. Recedes by fading, which is Imhof's aerial
   perspective — distance reads as desaturation, not as a lighter outline. */

.contours {
  display: block;
  width: 100%;
  height: clamp(92px, 11vw, 168px);
  color: var(--fh-accent);
  opacity: 0.8;
  margin-top: clamp(1.25rem, 3vw, 2.25rem);
}
[data-scheme="atlas"] .contours,
:root:not([data-scheme]) .contours { opacity: 0.62; }

/* --- scheme seams -------------------------------------------------------- */
/* Where two schemes meet, the ground changes colour ALONG a contour line and
   the lines carry on across it. A scheme change is a change of terrain, so it
   gets drawn rather than cut. Generated by assets/brand/contours.py. */

.seam-wrap {
  background: var(--fh-bg);   /* the outgoing ground, on both seams */
  line-height: 0;             /* no descender gap under the inline svg */
}

.seam {
  display: block;
  width: 100%;
  height: clamp(64px, 8vw, 118px);
}

/* Coming back out of the band, the same drawing runs the other way up. */
.seam--up { transform: scaleY(-1); }

/* The fill is always the destination ground; the lines are inked for whichever
   ground they sit on, so no line ever lands on its own colour. */
.seam-ground { fill: var(--fh-paper); }
.seam-from path { stroke: var(--fh-accent); }
.seam-to path { stroke: var(--fh-moss); }

/* --- banded scheme ------------------------------------------------------- */
/* A scheme that paints its own ground must be full-bleed and must carry inline
   padding. An inset rectangle with flush text reads as a mistake — the ground
   has to run to the edge of the viewport, and the content has to sit in .wrap
   like everything else. */

.band {
  padding-block: clamp(0.5rem, 2vw, 1.5rem) clamp(1rem, 3vw, 2.5rem);
}

/* The seams already carry the entry and exit, so the first and last sections
   inside a band do not need their full padding on top of that. */
.band .section:first-child { padding-top: clamp(1rem, 2.5vw, 2rem); }
.band .section:last-child { padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }

/* Project cards are links; keep the underline off everything but the title on
   hover, so a card reads as a card rather than a paragraph of link text. */
a.card { text-decoration: none; transition: border-color 140ms ease-out; }
a.card:hover { border-color: var(--fh-accent); }
a.card:hover .card-title h3 { text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { a.card { transition: none; } }

/* --- brand mark ---------------------------------------------------------- */
/* Masked rather than inlined, so the mark takes the scheme's accent without
   duplicating 3 KB of path data in every page that shows it. */

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  background: var(--fh-accent);
  -webkit-mask: url("brand/mark.svg") center / contain no-repeat;
  mask: url("brand/mark.svg") center / contain no-repeat;
}

/* --- utilities ----------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- the plan ------------------------------------------------------------ */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem 2.5rem;
  counter-reset: step;
}
.step { display: grid; gap: 0.45rem; align-content: start; }
.step-n {
  font-family: var(--fh-font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: var(--fh-tracking-label);
  color: var(--fh-accent);
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--fh-rule);
}
.step h3 { font-size: 1.22rem; }
.step p { margin: 0; color: var(--fh-text-muted); font-size: 0.97rem; }

/* --- data tables --------------------------------------------------------- */
/* Figures are mono and tabular in both type systems: an elevation and an eval
   score are the same kind of fact, so they have to look like it. */

.data-table { border-collapse: collapse; width: 100%; min-width: 40rem; }

/* Even gutters, flush at both outer edges. Zeroing padding-right on a .num
   column instead would butt the figure straight into the next cell. */
.data-table th,
.data-table td {
  text-align: left;
  padding: 0.7rem 1.4rem;
  border-bottom: 1px solid var(--fh-rule);
  vertical-align: middle;
}
.data-table th:first-child,
.data-table td:first-child { padding-left: 0; }
.data-table th:last-child,
.data-table td:last-child { padding-right: 0; }

.data-table thead th {
  font-family: var(--fh-font-mono);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: var(--fh-tracking-label);
  text-transform: uppercase;
  color: var(--fh-text-muted);
  border-bottom-width: 2px;
  border-bottom-color: var(--fh-text);
  white-space: nowrap;
}

.data-table tbody th {
  font-family: var(--fh-face-display);
  font-variation-settings: var(--fh-display-settings);
  font-weight: var(--fh-display-weight);
  font-size: 1.04rem;
  white-space: nowrap;
}

.data-table td { color: var(--fh-text-muted); font-size: 0.94rem; }
.data-table .num { text-align: right; }
.data-table thead .num { text-align: right; }
.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td { border-bottom: none; }

.phases { min-width: 32rem; }
.phases tbody th { font-size: 1.1rem; width: 4rem; }

/* --- model glyphs -------------------------------------------------------- */
/* Ring count is elevation / 1500, so the mark's complexity IS the tier. */

.glyph {
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  background: var(--fh-accent);
  -webkit-mask: var(--g) center / contain no-repeat;
  mask: var(--g) center / contain no-repeat;
}

.glyph-inline {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  vertical-align: -0.35rem;
  margin-right: 0.35rem;
}

.note {
  margin: 1.5rem 0 0;
  color: var(--fh-text-muted);
  font-size: 0.92rem;
  max-width: 62ch;
}
.note strong { color: var(--fh-text); font-weight: 600; }

/* --- state pills --------------------------------------------------------- */
/* State is never colour alone — the pill always carries its word. */

.pill {
  display: inline-block;
  font-family: var(--fh-font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--fh-rule);
  color: var(--fh-text-muted);
  white-space: nowrap;
}
.pill[data-state="now"] {
  background: var(--fh-lichen);
  color: var(--fh-on-lichen);
  border-color: transparent;
}

.tag[data-state="wip"] {
  border-style: dashed;
  border-color: var(--fh-text-muted);
}

/* --- about --------------------------------------------------------------- */

.about-close {
  margin: 2rem 0 0;
  color: var(--fh-text-muted);
  max-width: var(--fh-measure);
}
