/* ---------------------------------------------------------------
   Gabriel Scarlett — personal site
   Palette: deep sea navy, tidal teal, warm sand
   --------------------------------------------------------------- */

:root {
  --bg:        #fbfaf7;
  --bg-alt:    #f2f0ea;
  --surface:   #ffffff;
  --line:      #e2ded4;
  --ink:       #14202b;
  --ink-soft:  #4d5a66;
  --ink-faint: #7d8891;
  --accent:    #0e6b74;
  --accent-2:  #c2763a;
  --shadow:    0 1px 2px rgba(20, 32, 43, .05), 0 8px 24px rgba(20, 32, 43, .05);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --wrap: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0d151c;
    --bg-alt:    #121d26;
    --surface:   #16222c;
    --line:      #25333f;
    --ink:       #eaf0f4;
    --ink-soft:  #a8b8c4;
    --ink-faint: #7a8b98;
    --accent:    #4fc0c8;
    --accent-2:  #e0995e;
    --shadow:    0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  }
}

:root[data-theme="dark"] {
  --bg:        #0d151c;
  --bg-alt:    #121d26;
  --surface:   #16222c;
  --line:      #25333f;
  --ink:       #eaf0f4;
  --ink-soft:  #a8b8c4;
  --ink-faint: #7a8b98;
  --accent:    #4fc0c8;
  --accent-2:  #e0995e;
  --shadow:    0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; letter-spacing: -.015em; }

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

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 1.25rem; height: 3.5rem; }
.nav__mark {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600;
  color: var(--ink); text-decoration: none; margin-right: auto; letter-spacing: -.01em;
}
.nav__mark span { color: var(--accent); }
.nav__links { display: flex; gap: 1.25rem; }
.nav__links a {
  color: var(--ink-soft); text-decoration: none; font-size: .875rem; font-weight: 500;
}
.nav__links a:hover { color: var(--accent); }
@media (max-width: 40rem) { .nav__links { display: none; } }

.theme-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  flex: none; width: 2rem; height: 2rem; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: .9rem; line-height: 1;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }

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

.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem); position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: var(--line);
}
.hero__grid { display: grid; grid-template-columns: 1fr auto; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 46rem) { .hero__grid { grid-template-columns: 1fr; } }

.eyebrow {
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1rem;
}
.hero h1 { font-size: clamp(2.5rem, 7vw, 4rem); margin: 0 0 .5rem; }
.hero__role {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--ink-soft); margin: 0 0 1.5rem;
  font-family: var(--serif); font-style: italic;
}
.hero__role strong { font-style: normal; font-weight: 600; color: var(--ink); }
.hero__lede { font-size: 1.075rem; color: var(--ink-soft); max-width: 34rem; margin: 0 0 2rem; }

.links { display: flex; flex-wrap: wrap; gap: .625rem; }
.link-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft);
  font-size: .875rem; font-weight: 500; text-decoration: none;
}
.link-btn:hover { border-color: var(--accent); color: var(--accent); }
.link-btn svg { width: 1rem; height: 1rem; fill: currentColor; }

/* decorative wave block */
.wavecard {
  width: clamp(11rem, 26vw, 15rem); aspect-ratio: 1;
  border-radius: 1.25rem; border: 1px solid var(--line);
  background: var(--bg-alt); box-shadow: var(--shadow);
  display: grid; place-items: center; overflow: hidden;
}
.wavecard svg { width: 100%; height: 100%; }
@media (max-width: 46rem) { .wavecard { display: none; } }

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

section { padding: clamp(3rem, 7vw, 5rem) 0; }
section + section { border-top: 1px solid var(--line); }

.sec-head { margin-bottom: 2.25rem; }
.sec-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); margin: 0 0 .4rem; }
.sec-head p { color: var(--ink-faint); margin: 0; font-size: .95rem; }

.prose p { color: var(--ink-soft); max-width: 42rem; }
.prose p:first-child { margin-top: 0; }

/* stat strip */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: .75rem; overflow: hidden; margin-top: 2.5rem;
}
.stat { background: var(--bg); padding: 1.1rem 1.25rem; }
.stat dt { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.stat dd { margin: .25rem 0 0; font-family: var(--serif); font-size: 1.75rem; color: var(--ink); line-height: 1; }

/* ---------- themes / interests ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: .75rem;
  padding: 1.4rem; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .925rem; }
.card__tag {
  display: inline-block; font-family: var(--mono); font-size: .7rem; letter-spacing: .04em;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: .15rem .5rem; border-radius: .3rem; margin-bottom: .75rem;
}

/* ---------- publications ---------- */

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.filter {
  font: inherit; font-size: .8rem; font-weight: 500;
  padding: .35rem .8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
}
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.pubs { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid; grid-template-columns: 4.25rem 1fr; gap: 1.25rem;
  padding: 1.15rem 0; border-top: 1px solid var(--line);
}
.pub:last-child { border-bottom: 1px solid var(--line); }
/* class rules beat the UA [hidden] rule, so restate it for the filter */
.pub[hidden] { display: none; }
.pub__year { font-family: var(--mono); font-size: .8rem; color: var(--ink-faint); padding-top: .2rem; }
.pub__title { margin: 0 0 .3rem; font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1.4; }
.pub__meta { margin: 0; font-size: .875rem; color: var(--ink-soft); }
.pub__meta em { color: var(--ink-faint); }
.pub__authors b { font-weight: 700; color: var(--ink); }
.pub__cites {
  display: inline-block; margin-top: .35rem; font-family: var(--mono); font-size: .72rem;
  color: var(--ink-faint);
}
@media (max-width: 34rem) {
  .pub { grid-template-columns: 1fr; gap: .3rem; }
}

/* ---------- code ---------- */

.repo {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: .75rem;
  padding: 1.25rem; box-shadow: var(--shadow);
}
.repo:hover { border-color: var(--accent); color: inherit; }
.repo h3 { font-family: var(--mono); font-size: .95rem; font-weight: 600; margin: 0 0 .5rem; letter-spacing: -.01em; }
.repo p { margin: 0 0 .9rem; font-size: .9rem; color: var(--ink-soft); }
.repo__foot { display: flex; align-items: center; gap: .9rem; font-size: .775rem; color: var(--ink-faint); font-family: var(--mono); }
.dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; margin-right: .35rem; vertical-align: -1px; }
.dot--matlab { background: #e16737; }
.dot--python { background: #3572a5; }
.dot--fortran { background: #4d41b1; }

/* ---------- contact ---------- */

.contact { text-align: center; }
.contact h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 .75rem; }
.contact p { color: var(--ink-soft); max-width: 34rem; margin: 0 auto 2rem; }
.contact .links { justify-content: center; }

footer {
  border-top: 1px solid var(--line); padding: 2rem 0 2.5rem;
  font-size: .8rem; color: var(--ink-faint);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}
footer a { color: var(--ink-faint); }

/* ---------- skills ---------- */

.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.75rem 2.5rem; }

.skillset { border-top: 2px solid var(--accent); padding-top: 1.1rem; }
.skillset:nth-child(2) { border-top-color: var(--accent-2); }
.skillset:nth-child(3) { border-top-color: var(--ink-soft); }

.skillset h3 { margin: 0 0 .35rem; font-size: 1.2rem; }
.skillset > p { margin: 0 0 1.1rem; font-size: .9rem; color: var(--ink-soft); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.chips li {
  font-size: .8rem; font-weight: 500; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: .4rem; padding: .25rem .6rem;
}

/* ---------- toolbelt ---------- */

.toolbelt {
  margin-top: 2.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.25rem;
}
.toolbelt dt {
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); width: 100%;
}
.toolbelt dd {
  margin: 0; font-family: var(--mono); font-size: .82rem; color: var(--ink-soft);
}
.toolbelt dd::after { content: "·"; margin-left: 1.25rem; color: var(--line); }
.toolbelt dd:last-child::after { content: ""; }

/* ---------- sub-page hero ---------- */

.pagehero { padding: clamp(3rem, 7vw, 5rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.pagehero h1 { font-size: clamp(2.2rem, 6vw, 3.25rem); margin: 0 0 .75rem; }
.pagehero p { color: var(--ink-soft); max-width: 40rem; margin: 0; font-size: 1.05rem; }
.backlink {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--ink-faint); text-decoration: none; margin-bottom: 1.25rem;
}
.backlink:hover { color: var(--accent); }

/* ---------- activity cards ---------- */

.disc-head { display: flex; align-items: baseline; gap: .75rem; margin-bottom: 1.75rem; }
.disc-head h2 { font-size: clamp(1.5rem, 3.2vw, 1.9rem); margin: 0; }
.disc-head span { font-family: var(--mono); font-size: .75rem; color: var(--ink-faint); }

.events { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }

.event {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: .75rem;
  padding: 1.4rem; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.event::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent);
}
.event--run::before { background: var(--accent-2); }

.event__where {
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 .35rem;
}
.event h3 { margin: 0 0 .75rem; font-size: 1.18rem; }
.event__desc { margin: 0 0 1.15rem; font-size: .9rem; color: var(--ink-soft); }

.event__stats {
  display: flex; flex-wrap: wrap; gap: .35rem .5rem;
  margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--line);
}
.event__stat {
  font-family: var(--mono); font-size: .74rem; color: var(--ink-soft);
  background: var(--bg-alt); border-radius: .3rem; padding: .2rem .5rem;
}
.event__stat--hard { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, transparent); }

/* ---------- pull quote ---------- */

.pull {
  margin: 0; padding: 1.75rem 0 0; border-top: 1px solid var(--line);
  font-family: var(--serif); font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  line-height: 1.5; color: var(--ink-soft); max-width: 44rem;
}
.pull strong { color: var(--ink); font-weight: 500; }

/* ---------- event editions ---------- */

.editions { list-style: none; margin: 0 0 1.15rem; padding: 0; border-top: 1px solid var(--line); }
.editions li {
  display: grid; grid-template-columns: 3.2rem 1fr auto; gap: .75rem; align-items: baseline;
  padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .84rem;
}
.editions .ed-year { font-family: var(--mono); color: var(--ink-faint); font-size: .78rem; }
.editions .ed-detail { color: var(--ink-faint); font-size: .78rem; }
.editions .ed-time { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.editions .pb { color: var(--accent-2); }
.editions .pb::after { content: " ◆"; font-size: .7em; vertical-align: 1px; }

.event__note {
  margin: 0; font-size: .78rem; color: var(--ink-faint); font-style: italic;
}

.datanote {
  margin-top: 2.5rem; padding: 1rem 1.15rem;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: .6rem;
  font-size: .8rem; color: var(--ink-faint); line-height: 1.6;
}
.datanote strong { color: var(--ink-soft); font-weight: 600; }

/* ---------- annual volume chart ---------- */
/* Series colours: the site accents snapped to the nearest steps that pass the
   categorical checks (lightness band, chroma floor, CVD separation, contrast).
   Light #058e9a/#c1763b on #ffffff; dark #32a6ae/#c68248 on #16222c. */

.viz {
  --viz-bike: #058e9a;
  --viz-run:  #c1763b;
  --viz-surface: var(--surface);
  --viz-grid: var(--line);
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .viz { --viz-bike: #32a6ae; --viz-run: #c68248; }
}
:root[data-theme="dark"] .viz { --viz-bike: #32a6ae; --viz-run: #c68248; }

.viz__head { margin-bottom: 1.1rem; }
.viz__head h3 { margin: 0 0 .3rem; font-size: 1.15rem; }
.viz__head p { margin: 0; font-size: .85rem; color: var(--ink-faint); }

.viz__legend { display: flex; gap: 1.1rem; margin: 0 0 .5rem; }
.viz__legend span { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--ink-soft); }
.viz__legend i { width: .7rem; height: .7rem; border-radius: .15rem; display: inline-block; }

.viz__plot { position: relative; }
.viz__plot svg { display: block; width: 100%; height: auto; }
.viz__plot text { font-family: var(--sans); }

.viz__tip {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .1s;
  background: var(--ink); color: var(--bg);
  font-size: .75rem; line-height: 1.45; padding: .4rem .6rem; border-radius: .35rem;
  white-space: nowrap; transform: translate(-50%, -115%); z-index: 5;
}
.viz__tip strong { display: block; font-size: .78rem; }
.viz__tip[data-show="1"] { opacity: 1; }

.viz__foot { margin: .9rem 0 0; font-size: .75rem; color: var(--ink-faint); }

.viz details { margin-top: 1rem; }
.viz summary { font-size: .8rem; color: var(--ink-soft); cursor: pointer; }
.viz summary:hover { color: var(--accent); }
.viz table { width: 100%; border-collapse: collapse; margin-top: .8rem; font-size: .8rem; }
.viz th, .viz td { text-align: right; padding: .35rem .5rem; border-bottom: 1px solid var(--line); }
.viz th:first-child, .viz td:first-child { text-align: left; }
.viz thead th { color: var(--ink-faint); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.viz tbody th { font-weight: 600; font-size: .8rem; color: var(--ink-soft); font-family: var(--mono); }
.viz td { font-family: var(--mono); color: var(--ink-soft); }
.viz .tbl-wrap { overflow-x: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- media ---------- */

.portrait {
  width: clamp(11rem, 26vw, 15rem); height: auto; aspect-ratio: 1;
  border-radius: 1.25rem; object-fit: cover;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  background: var(--bg-alt);
}
@media (max-width: 46rem) {
  /* single column: portrait leads, then the text */
  .hero__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .portrait { width: 7.5rem; border-radius: 1rem; order: -1; }
}

/* photo across the top of an event card, clearing the accent bar */
.event__photo {
  display: block; flex: none;
  width: calc(100% + 2.8rem - 3px); max-width: none; height: auto;
  margin: -1.4rem -1.4rem 1.15rem calc(-1.4rem + 3px);
  aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: .7rem .7rem 0 0;
  background: var(--bg-alt);
}

/* a figure inside a prose section */
.fig { margin: 2.25rem 0 0; }
.fig img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: .6rem;
  background: #fff; padding: .5rem;
}
.fig figcaption {
  margin-top: .7rem; font-size: .8rem; color: var(--ink-faint); line-height: 1.6; max-width: 42rem;
}
.fig figcaption b { color: var(--ink-soft); font-weight: 600; }

/* gallery */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem;
  list-style: none; margin: 0; padding: 0;
}
.gallery figure { margin: 0; }
.gallery img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: .6rem; border: 1px solid var(--line); background: var(--bg-alt);
}
.gallery figcaption {
  margin-top: .5rem; font-size: .78rem; color: var(--ink-faint);
}
.gallery figcaption b { display: block; color: var(--ink-soft); font-weight: 600; font-size: .82rem; }

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

.hero__tagline {
  font-family: var(--serif); font-size: clamp(1.1rem, 2.6vw, 1.45rem);
  line-height: 1.3; color: var(--ink); margin: 0 0 .6rem; max-width: 30rem;
}

/* ---------- career timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.5rem;
  padding: 1.15rem 0; border-top: 1px solid var(--line);
}
.timeline > li:last-child { border-bottom: 1px solid var(--line); }
.tl-when {
  font-family: var(--mono); font-size: .8rem; color: var(--ink-faint);
  padding-top: .15rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tl-when b { color: var(--accent); font-weight: 500; }
.timeline h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 0 0 .15rem; line-height: 1.35; }
.tl-org { margin: 0 0 .4rem; font-size: .875rem; color: var(--ink-soft); }
.tl-org b { font-weight: 600; color: var(--ink); }
.tl-note { margin: 0; font-size: .875rem; color: var(--ink-soft); max-width: 40rem; }
.tl-tag {
  display: inline-block; margin-top: .45rem; font-family: var(--mono); font-size: .7rem;
  color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 11%, transparent);
  padding: .15rem .45rem; border-radius: .3rem;
}
.tl-tag { border-radius: 0; }
@media (max-width: 34rem) {
  .timeline > li { grid-template-columns: 1fr; gap: .3rem; }
}

/* ---------- skills: one lead discipline, then the rest ---------- */

.skillset--lead {
  border-top-width: 3px; padding-top: 1.3rem; margin-bottom: 2.25rem;
}
.skillset--lead h3 { font-size: 1.5rem; }
.skillset--lead > p { font-size: .95rem; max-width: 44rem; }
.skillset--lead .chips li { font-size: .84rem; padding: .3rem .7rem; }
.skills--rest { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.75rem 2.5rem; }
.skills--rest .skillset { border-top-width: 2px; }
.skillset--quiet { border-top-color: var(--line) !important; }
.skillset--quiet h3 { font-size: 1.05rem; color: var(--ink-soft); }

/* labelled contact buttons */
.link-btn__tag {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); border-right: 1px solid var(--line); padding-right: .5rem; margin-right: .1rem;
}

/* ---------- sea feature ---------- */

.seafeature {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 2.75rem); align-items: center;
}
@media (max-width: 46rem) { .seafeature { grid-template-columns: 1fr; } }

.seafeature img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: .75rem; border: 1px solid var(--line); background: var(--bg-alt);
}
.seafeature img { border-radius: 0; }

.seafeature p { color: var(--ink-soft); margin: 0 0 1rem; }
.seafeature p:last-of-type { margin-bottom: 0; }
.seafeature .swims { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.seafeature .swims li {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: baseline;
  padding: .5rem 0; border-top: 1px solid var(--line); font-size: .875rem;
}
.seafeature .swims li:last-child { border-bottom: 1px solid var(--line); }
.seafeature .swims i { font-style: normal; color: var(--ink-faint); font-size: .78rem; }
.seafeature .swims b { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; font-size: .82rem; }

/* two photographs stacked in the sea feature */
.seafeature__pics { display: grid; gap: .75rem; }
.seafeature__pics figure { margin: 0; }
.seafeature__pics figcaption {
  margin-top: .4rem; font-size: .75rem; color: var(--ink-faint); font-family: var(--mono);
}

/* ---------- sector breadth strip ---------- */

.sectors {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: .75rem; overflow: hidden;
}
.sectors { border-radius: 0; }
.sector { background: var(--bg); padding: 1.25rem 1.35rem; }
.sector__name {
  font-family: var(--serif); font-size: 1.25rem; margin: 0 0 .1rem; line-height: 1.1;
}
.sector__years {
  font-family: var(--mono); font-size: .72rem; color: var(--accent); letter-spacing: .04em;
  font-variant-numeric: tabular-nums; display: block; margin-bottom: .6rem;
}
.sector p { margin: 0; font-size: .85rem; color: var(--ink-soft); line-height: 1.55; }

.sectors__note {
  margin: 1.25rem 0 0; font-size: .9rem; color: var(--ink-soft); max-width: 44rem;
  border-left: 2px solid var(--accent); padding-left: 1rem;
}
.sectors__note { border-left-color: var(--accent-2); }

.eyebrow__coord {
  font-family: var(--mono); color: var(--ink-faint); letter-spacing: .06em;
  margin-left: .6rem; font-variant-numeric: tabular-nums;
}

/* ---------- the sea line ----------
   An irregular free surface synthesised from a JONSWAP spectrum
   (Hs 4 m, Tp 9.5 s, gamma 3.3, 70 components, cut off at 2.6 fp,
   random phase), used as the boundary between the hero and the page.
   A moderate sea rather than a sine wave, so it never quite repeats.
   Raising Hs makes it rougher; extending the cut-off makes it jagged. */

.hero { position: relative; }
.hero::after { display: none; }               /* the line replaces the plain rule */
.hero__sea {
  position: absolute; left: 0; right: 0; bottom: -1px;
  width: 100%; height: 5rem; overflow: visible; pointer-events: none;
}
.hero__sea-line {
  fill: none; stroke: var(--accent); stroke-width: 1.25;
  stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; opacity: .55;
}
.hero__sea-fill { fill: var(--accent); opacity: .09; stroke: none; }
@media (max-width: 46rem) { .hero__sea { height: 3.25rem; } }


/* ===========================================================================
   Admiralty chart layer: palette, type and ornament. Layout, grids and
   component structure come from the rules above. Loaded unconditionally;
   the values here win because they come later in the cascade.
   =========================================================================== */

:root {
  color-scheme: dark;     /* dark is the default; the light block below flips it */
  --bg:        #f4efe2;   /* chart paper */
  --bg-alt:    #eae2ce;
  --surface:   #f9f5ec;
  --line:      #c6b99e;
  --ink:       #0d2438;   /* chart ink */
  --ink-soft:  #3b4b59;
  --ink-faint: #6d7b86;
  --accent:    #0e5f6e;
  --accent-2:  #c8471f;   /* signal red */
  --shadow:    none;

  --sans:  "IBM Plex Sans", system-ui, sans-serif;
  --serif: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0a1922;   /* night chart */
    --bg-alt:    #0f2432;
    --surface:   #102a38;
    --line:      #2b4757;
    --ink:       #eee7d5;
    --ink-soft:  #b3bfc7;
    --ink-faint: #7d8f9b;
    --accent:    #56b8c4;
    --accent-2:  #e2764a;
  }
}
:root[data-theme="dark"] {
  --bg:        #0a1922;
  --bg-alt:    #0f2432;
  --surface:   #102a38;
  --line:      #2b4757;
  --ink:       #eee7d5;
  --ink-soft:  #b3bfc7;
  --ink-faint: #7d8f9b;
  --accent:    #56b8c4;
  --accent-2:  #e2764a;
}

/* ---- the chart grid, ruled faintly through the paper ---- */
body {
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: 4.5rem 4.5rem;
}

/* ---- squared off: no rounded cards, no soft shadows ---- */
.card,
.repo,
.event,
.viz,
.stats,
.datanote,
.portrait,
.fig img,
.gallery img,
.event__photo {
  border-radius: 0; box-shadow: none;
}
.link-btn,
.filter,
.chips li,
.event__stat,
.card__tag,
.viz__tip { border-radius: 0; }
.theme-btn { border-radius: 0; }

/* the accent bar on an event card becomes a ruled edge */
.event::before { width: 2px; }

/* ---- headings: condensed, uppercase, tight ---- */
.hero h1,
.pagehero h1,
.sec-head h2,
.disc-head h2,
.contact h2 {
  text-transform: uppercase; letter-spacing: -.01em; font-weight: 700;
}
.hero h1,
.pagehero h1 { line-height: .94; }

.sec-head p { font-family: var(--mono); font-size: .8rem; }

/* ---- annotation set in mono ---- */
.eyebrow,
.hero__role,
.event__where,
.stat dt,
.toolbelt dt,
.pub__meta,
.gallery figcaption,
.fig figcaption,
footer {
  font-family: var(--mono);
}
.hero__role { font-style: normal; font-size: .85rem; }
.hero__role strong { font-weight: 600; }
.pub__meta { font-size: .8rem; }
.pub__title { font-weight: 600; }

/* ---- numbers align like a soundings table ---- */
.stat dd,
.editions,
.event__stat,
.viz table,
.pub__year { font-variant-numeric: tabular-nums; }
.stat dd { font-weight: 700; letter-spacing: -.01em; }

/* ---- the mark ---- */
.nav__mark {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
}
.nav__mark span { color: var(--accent-2); }
.nav__links a {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
}
.nav { border-bottom: 2px solid var(--ink); }

/* ---- chart series, re-validated against the paper surfaces ---- */
.viz { --viz-bike: #06899d; --viz-run: #a45e3a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .viz { --viz-bike: #33a5b2; --viz-run: #bf7b4e; }
}
:root[data-theme="dark"] .viz { --viz-bike: #33a5b2; --viz-run: #bf7b4e; }


/* a single quiet chart detail: the city's coordinates beside its name */
.eyebrow__coord { color: var(--ink-faint); }

/* an explicit choice of light: restore the paper palette and the light UA chrome */
:root[data-theme="light"] {
  color-scheme: light;
  --bg:        #f4efe2;
  --bg-alt:    #eae2ce;
  --surface:   #f9f5ec;
  --line:      #c6b99e;
  --ink:       #0d2438;
  --ink-soft:  #3b4b59;
  --ink-faint: #6d7b86;
  --accent:    #0e5f6e;
  --accent-2:  #c8471f;
  --shadow:    none;
}
:root[data-theme="light"] .viz { --viz-bike: #06899d; --viz-run: #a45e3a; }
