/* Site styles, built on tokens.css (design system v2). One block per section.
   Colors come only from semantic tokens, so swapping tokens.css re-themes the site. */

:root {
  --header-h: 64px;
  --page-max: 1280px;
  --meta-col: 200px;

  /* Paper grain: tiny SVG noise tile, layered over every paper surface. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ── Page surface & texture ─────────────────────────
   The window background (seen when scrolling past either end) matches the
   footer, and rubber-band overscroll is turned off where supported. */
html {
  background: var(--bg-secondary);
  overscroll-behavior-y: none;
}
body {
  background: var(--grain), var(--bg-primary);
  overflow-x: clip; /* full-bleed bands use 100vw */
}

::selection { background: var(--highlight); color: var(--text-primary); }

html { scroll-padding-top: calc(var(--header-h) + var(--space-5)); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

a { color: var(--accent-primary); }
a:hover { color: var(--accent-hover); }
p, h1, h2, h3, ul { margin: 0; }

/* ── Skip link ──────────────────────────────────── */
.skip-link {
  position: absolute;
  left: var(--space-5);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.skip-link:focus { top: var(--space-3); }

/* ── Page frame ─────────────────────────────────── */
.page {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--space-8);
}
/* Header spans the full window rather than the content column. */
.site-header__inner { padding-inline: var(--space-8); }
@media (min-width: 1440px) {
  .site-header__inner { padding-inline: var(--space-11); }
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--weight-medium);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.btn--primary {
  background: var(--action-primary);
  border-color: var(--action-primary);
  color: var(--text-inverse);
}
.btn--primary:hover {
  background: var(--action-primary-hover);
  border-color: var(--action-primary-hover);
  color: var(--text-inverse);
}
.btn--sm { padding: var(--space-2) var(--space-5); }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: 0;
  list-style: none;
}

/* ── Header ─────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border-default);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  height: var(--header-h);
}
.site-header__name {
  color: var(--text-primary);
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: var(--weight-bold);
  text-decoration: none;
  white-space: nowrap;
}
.site-header__name:hover { color: var(--text-primary); }
.site-nav {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}
.site-nav a {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--weight-medium);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text-primary); background: var(--bg-elevated); }
.site-nav a { position: relative; }
.site-nav a::after {
  /* Underline lives on its own layer, so it never changes the link's box
     and can slide in and out smoothly. */
  content: "";
  position: absolute;
  left: var(--space-4);
  right: var(--space-4);
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--highlight-strong);
  transform: scaleX(0);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.site-nav a[aria-current="true"] { color: var(--text-primary); }
.site-nav a[aria-current="true"]::after { transform: scaleX(1); }

/* ── Hero ───────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: center;
  gap: var(--space-11);
  padding-block: var(--space-12);
}
.hero__name {
  margin-bottom: var(--space-5);
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  font-weight: var(--weight-bold);
  letter-spacing: -0.015em;
}
.hero__focus {
  max-width: 34rem;
  margin-bottom: var(--space-8);
  font-size: var(--fs-h4);
  line-height: 1.6;
  color: var(--text-secondary);
}
.hero__photo { justify-self: end; width: 100%; max-width: 360px; }
.hero__photo img,
.hero__photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
}
.hero__photo-placeholder {
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  box-shadow: none;
}

/* The hero sits on plain paper (no grain): this full-width layer covers the
   body's grain from the top of the window (under the header) to the hero's end. */
.hero::after {
  content: "";
  position: absolute;
  top: calc(-1 * var(--header-h) - var(--space-12));
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -2;
  background: var(--bg-primary);
}

/* Graph-paper grid behind the hero, full width, fading toward the edges. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  background-image:
    linear-gradient(var(--border-default) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-default) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 50% 45%, #000 20%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 75% at 50% 45%, #000 20%, transparent 85%);
  opacity: .55;
}

/* Highlighter marks: amber swipe across the lower part of the line, ink on top. */
mark {
  padding: 0 .12em;
  margin: 0 -.12em;
  color: inherit;
  background: linear-gradient(transparent 52%, var(--highlight) 52%, var(--highlight) 94%, transparent 94%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.hero__focus mark { color: var(--text-primary); }

/* ── Sections ───────────────────────────────────── */
.section {
  padding-block: var(--space-11);
  border-top: 1px solid var(--border-default);
}
.section__title::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  margin-bottom: var(--space-4);
  background: var(--highlight-strong);
  border-radius: var(--radius-sm);
}
.section__title {
  margin-bottom: var(--space-9);
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--weight-bold);
}

/* Banded sections: full-width darker paper (same as the footer), so the page
   alternates surfaces instead of the footer being the only change. */
.section--band {
  position: relative;
  isolation: isolate;
  border-top: 0;
}
.section--band::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  background: var(--grain), var(--bg-secondary);
  border-block: 1px solid var(--border-default);
}
.section--band + .section { border-top: 0; }
.section--band .result,
.section--band .tags li { background: var(--bg-surface); }

/* ── Entries (experience, projects, education) ──── */
.entry {
  display: grid;
  grid-template-columns: var(--meta-col) minmax(0, 1fr);
  gap: var(--space-8);
}
.entry + .entry {
  margin-top: var(--space-9);
  padding-top: var(--space-9);
  border-top: 1px solid var(--border-subtle);
}
.entry__dates {
  font-size: var(--fs-body);
  line-height: var(--lh-h4);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}
.entry__place {
  margin-top: var(--space-1);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-tertiary);
}
.entry__title {
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: var(--weight-bold);
}
.entry__org {
  margin-top: var(--space-1);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  color: var(--text-secondary);
}
.entry__note {
  margin-top: var(--space-3);
  font-size: var(--fs-body);
  color: var(--text-secondary);
}
.entry__points {
  max-width: 68ch;
  margin-top: var(--space-4);
  padding-left: var(--space-6);
  color: var(--text-secondary);
}
.entry__points li { padding-left: var(--space-2); }
.entry__points li + li { margin-top: var(--space-3); }
.entry__points li::marker { color: var(--border-strong); }

/* ── About ──────────────────────────────────────── */
.about {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-11);
  align-items: start;
}
.about__text { max-width: 68ch; }
.about__text p { color: var(--text-secondary); }
.about__text p + p { margin-top: var(--space-5); }
.about__lede {
  margin-bottom: var(--space-6);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--weight-bold);
}
.about__text .about__lede { color: var(--text-primary); }
/* Facts card on its own: lay the four facts out side by side. */
.about--facts-only { grid-template-columns: 1fr; }
.about--facts-only .facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-6);
  padding: var(--space-7) var(--space-8);
}
.about--facts-only .facts__row { grid-template-columns: 1fr; gap: var(--space-2); padding-block: 0; }
.about--facts-only .facts__row + .facts__row { border-top: 0; padding-left: var(--space-6); border-left: 1px solid var(--border-subtle); }
.about--facts-only .facts dd { font-size: var(--fs-body-lg); line-height: var(--lh-body-lg); font-weight: var(--weight-medium); }
@media (max-width: 960px) {
  .about--facts-only .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-6); }
  .about--facts-only .facts__row:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 540px) {
  .about--facts-only .facts { grid-template-columns: 1fr; }
  .about--facts-only .facts__row + .facts__row { border-left: 0; padding-left: 0; border-top: 1px solid var(--border-subtle); padding-top: var(--space-5); }
}
.facts {
  margin: 0;
  padding: var(--space-6) var(--space-7);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-left: 4px solid var(--highlight-strong);
  border-radius: var(--radius-lg);
}
.facts__row { display: grid; grid-template-columns: 96px 1fr; gap: var(--space-4); padding-block: var(--space-3); }
.facts__row + .facts__row { border-top: 1px solid var(--border-subtle); }
.facts dt {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  line-height: var(--lh-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.facts dd { margin: 0; font-size: var(--fs-body); line-height: var(--lh-body); }

/* ── Focus areas: file folders with tabs ───────────── */
.files {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-7);
  padding: 0;
  list-style: none;
}
.file { display: flex; flex-direction: column; }
.file__tab {
  align-self: flex-start;
  margin-left: var(--space-5);
  padding: var(--space-2) var(--space-4);
  background: var(--highlight);
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-xl) 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  line-height: var(--lh-mono-sm);
  font-weight: var(--weight-bold);
  letter-spacing: .06em;
  color: var(--text-primary);
}
.file__body {
  flex: 1;
  padding: var(--space-7);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm) var(--radius-lg) var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.file__icon {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-5);
  padding: 8px;
  background: var(--highlight-subtle);
  border: 1px solid var(--highlight);
  border-radius: var(--radius-lg);
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), background-color .3s;
}
.file:hover .file__icon { transform: rotate(-6deg) scale(1.06); background: var(--highlight); }
@media (prefers-reduced-motion: reduce) { .file__icon { transition: none; } .file:hover .file__icon { transform: none; } }
.file__title {
  margin-bottom: var(--space-3);
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: var(--weight-bold);
}
.file__body p { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-secondary); }
.file__body { display: flex; flex-direction: column; }
.file__link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: var(--space-5);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--weight-medium);
  color: var(--accent-primary);
  text-decoration: none;
}
.file__link span { display: inline-block; transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.file__link:hover { color: var(--accent-hover); text-decoration: underline; }
.file__link:hover span { transform: translateX(3px); }

/* ── Skills by investigative phase ─────────────────── */
.phases {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-7);
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.phase { position: relative; padding-top: var(--space-6); border-top: 2px solid var(--text-primary); }
.phase:not(:last-child)::after {
  /* arrow on the rule, pointing to the next phase */
  content: "";
  position: absolute;
  top: -7px;
  right: calc(-1 * var(--space-7) / 2 - 6px);
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--text-primary);
  border-right: 2px solid var(--text-primary);
  transform: rotate(45deg);
}
.phase__num { font-family: var(--font-mono); font-size: var(--fs-mono-sm); line-height: var(--lh-mono-sm); color: var(--text-tertiary); }
.phase__name { margin-top: var(--space-2); font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--weight-bold); }
.phase__desc { margin: var(--space-2) 0 var(--space-5); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-secondary); }

/* ── Investigation board (Skills) ─────────────────
   Skill buttons trace red string to the evidence cards that back them up. */
.board__hint {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: fit-content;
  max-width: 100%;
  margin: calc(-1 * var(--space-5)) 0 var(--space-9);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-surface);
  border: 1px dashed var(--stamp-500);
  border-radius: var(--radius-lg);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  color: var(--text-secondary);
}
.board__hint strong { color: var(--text-primary); }
.board__hint-pin {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--stamp-500);
  box-shadow: 0 0 0 4px var(--stamp-50);
}
.board { position: relative; }
.tags li:has(> .tag-btn) { padding: 0; border: 0; background: none; }
.tag-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, opacity .2s, box-shadow .2s;
}
.tag-btn::before {
  /* small red pin: marks the tag as something you can trace */
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: var(--space-3);
  border-radius: 50%;
  background: var(--stamp-500);
  vertical-align: .15em;
}
.tag-btn:hover { border-color: var(--stamp-500); }
.tag-btn.is-active {
  background: var(--stamp-50);
  border-color: var(--stamp-500);
  box-shadow: 0 0 0 1px var(--stamp-500);
}
.board.is-tracing .tag-btn:not(.is-active) { opacity: .55; }
.board.is-tracing .tags li:not(:has(> .tag-btn)) { opacity: .55; }

.board__label {
  margin: var(--space-10) 0 var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  line-height: var(--lh-mono-sm);
  font-weight: var(--weight-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.evidence {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
  padding: 0;
  list-style: none;
}
.ev-card {
  display: grid;
  gap: var(--space-1);
  height: 100%;
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: opacity .25s, border-color .25s, transform .25s, box-shadow .25s;
}
.ev-card:hover { border-color: var(--border-strong); color: inherit; }
.ev-card__type {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.ev-card__title { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--weight-bold); }
.ev-card__sub { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); }
.board.is-tracing .ev-card { opacity: .35; }
.board.is-tracing .ev-card.is-linked {
  opacity: 1;
  border-color: var(--stamp-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.board__drawer {
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--stamp-500);
  border-left-width: 4px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: drawer-in .3s cubic-bezier(.2, .8, .2, 1);
}
@keyframes drawer-in { from { opacity: 0; transform: translateY(-6px); } }
.board__drawer-label {
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  line-height: var(--lh-mono-sm);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--stamp-500);
}
.board__drawer ul { display: grid; gap: var(--space-2); padding: 0; list-style: none; }
.board__drawer-link {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-2) 0;
  color: var(--text-primary);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.board__drawer-link:hover { color: var(--accent-primary); }
.board__drawer-type {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
@media (prefers-reduced-motion: reduce) { .board__drawer { animation: none; } }

.board__strings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}
.board__strings .string {
  fill: none;
  stroke: var(--stamp-500);
  stroke-width: 1.75;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 1px rgba(22, 24, 26, .25));
}
.board__strings .pin { fill: var(--stamp-500); stroke: var(--paper-50); stroke-width: 1.5; }
@media (prefers-reduced-motion: reduce) {
  .ev-card, .tag-btn { transition: none; }
}

/* ── Competition results ────────────────────────── */
.results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-7);
  padding: 0;
  list-style: none;
}
.result {
  padding: var(--space-7);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-top: 4px solid var(--highlight-strong);
  border-radius: var(--radius-lg);
}
.result__name {
  margin-bottom: var(--space-2);
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}
.result__headline {
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  line-height: var(--lh-mono-sm);
  font-weight: var(--weight-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-primary);
}
.result__detail {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

/* ── Tags ─────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}
.tags li {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}


/* ── Redaction lift ─────────────────────────────────
   Put .redact on any block element; it gets a black bar that lifts when an
   ancestor [data-redact-group] gets .redact-ready (see main.js).
   Bars only render when JS is running (html.js), so no-JS visitors see text. */
.redact { position: relative; overflow: hidden; }
.js .redact::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--text-primary);
  transform-origin: left;
}
.redact-ready .redact::after {
  animation: redact-lift 0.7s cubic-bezier(.7, 0, .2, 1) forwards;
}
.redact--delay-1::after { animation-delay: .15s; }
.redact--delay-2::after { animation-delay: .45s; }
@keyframes redact-lift { to { transform: scaleX(0); } }
/* Experience entries: the organization line is redacted until the entry
   scrolls in, then lifts once the entry has faded up. */
.entry__org.redact { width: fit-content; max-width: 100%; }
.entry .redact::after { animation-delay: .45s; }
@media (prefers-reduced-motion: reduce) {
  .js .redact::after { display: none; }
}

/* ── Reverse redaction ──────────────────────────────
   .redact-in: visible text that a black bar sweeps over, left to right, when
   its [data-redact-group] receives .redact-ready. With reduced motion the
   text simply shows as already redacted. */
.redact-in { position: relative; display: inline-block; }
.js .redact-in::after {
  content: "";
  position: absolute;
  inset: -1px -3px;
  border-radius: 1px;
  background: var(--text-primary);
  transform: scaleX(0);
  transform-origin: left;
}
.redact-ready .redact-in::after { animation: redact-draw .55s cubic-bezier(.7, 0, .2, 1) .35s forwards; }
@keyframes redact-draw { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .js .redact-in::after { transform: none; animation: none; }
}

/* ── Scroll reveal ──────────────────────────────────
   main.js adds .reveal to content blocks and .is-in as each scrolls into view. */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}
.reveal.is-in { opacity: 1; transform: none; }
@media print { .reveal { opacity: 1; transform: none; } }

/* ── Folder intro ───────────────────────────────────
   Plays only while html.intro-active is set (see intro.js / main.js).
   Layering: folder back (behind) → live page (#site-root) → folder front flap.
   The shrunk page is clipped to the folder window's shape and scaled to fit it,
   using geometry intro.js computes from the viewport. */
.intro-layer { display: none; }

html.intro-active { overflow: hidden; }
html.intro-active .intro-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
html.intro-active .intro-layer--back  { z-index: 5; }
html.intro-active .intro-layer--front { z-index: 20; }

html.intro-active #site-root {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  background: var(--bg-primary);
  transform-origin: 50% var(--intro-oy);
  transform: translateY(var(--intro-dy)) scale(var(--intro-s));
  clip-path: inset(0 var(--intro-cx) var(--intro-cb) var(--intro-cx) round var(--intro-r));
  opacity: 0;
  transition:
    transform .9s cubic-bezier(.65, 0, .35, 1),
    clip-path .9s cubic-bezier(.65, 0, .35, 1),
    opacity .3s ease .2s;
}
html.intro-active.stage-open #site-root { opacity: 1; }
html.intro-active.stage-expand #site-root {
  transform: translateY(0) scale(1);
  clip-path: inset(0 0 0 0 round 0);
}

/* Folder geometry: drawn at a 200x144 base size, then scaled to the window by
   --folder-scale (set in intro.js). Keep in sync with the constants there. */
.folder-scale { transform: scale(var(--folder-scale, 1)); }
.folder-stage {
  position: relative;
  width: 200px;
  height: 144px;
  perspective: 1000px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .4s ease, transform .4s ease;
}
html.stage-in .folder-stage { opacity: 1; transform: translateY(0); }
html.stage-expand .folder-stage { opacity: 0; transition: opacity .45s ease; }

.folder-paper {
  position: absolute;
  left: 10%;
  width: 80%;
  height: 78%;
  background: var(--paper-50);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
}
.folder-paper--1 { top: -6px;  transform: rotate(-3deg); }
.folder-paper--2 { top: -10px; transform: rotate(2deg); }

.folder-back {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 84%;
  background: var(--paper-300);
  border: 1px solid var(--border-strong);
  border-radius: 3px 5px 3px 3px;
  box-shadow: 0 24px 46px rgba(22, 24, 26, 0.16);
}
.folder-tab {
  position: absolute;
  top: -16px;
  left: 14px;
  width: 76px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-300);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: 4px 9px 0 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.folder-front {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 84%;
  background: var(--paper-200);
  border: 1px solid var(--border-strong);
  border-radius: 3px 5px 5px 5px;
  transform-origin: bottom center;
  transform: rotateX(0deg);
  transition: transform .55s cubic-bezier(.6, 0, .32, 1);
}
html.stage-open .folder-front { transform: rotateX(-122deg); }

/* ── Footer ─────────────────────────────────────────
   Brand column (name first, looping wordmark under it), two link columns,
   and a bottom bar. The wordmark is secondary to the name by design. */
.hs-footer {
  --hs-ink: var(--text-secondary);
  --hs-muted: var(--text-tertiary);
  --hs-accent: var(--accent-primary);
  --hs-hl: var(--highlight);
  --hs-font: var(--font-mono);
  --hs-size: var(--fs-h4);
  --hs-ease: cubic-bezier(.2, .8, .2, 1);

  background: var(--grain), var(--bg-secondary);
  border-top: 1px solid var(--border-default);
}
.hs-footer__inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding: var(--space-11) var(--space-8) var(--space-7);
}
.hs-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-9);
  padding-bottom: var(--space-10);
}
.hs-brand__name {
  margin-bottom: var(--space-3);
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.hs-brand__desc {
  max-width: 28rem;
  margin-top: var(--space-5);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}
.hs-brand__doc { margin-top: var(--space-5); font-size: var(--fs-body); line-height: var(--lh-body); }
.hs-brand__doc a { color: var(--accent-primary); font-weight: var(--weight-medium); }
.hs-brand__doc a:hover { color: var(--accent-hover); }
.hs-col__title {
  margin-bottom: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  line-height: var(--lh-mono-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.hs-col ul { display: grid; gap: var(--space-4); padding: 0; list-style: none; }
.hs-col a,
.hs-footer__bottom a {
  color: var(--text-secondary);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-decoration: none;
}
.hs-col a:hover,
.hs-footer__bottom a:hover { color: var(--accent-primary); text-decoration: underline; }
.hs-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding-top: var(--space-7);
  border-top: 1px solid var(--border-strong);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  color: var(--text-tertiary);
}
.hs-footer__bottom a { font-size: inherit; line-height: inherit; color: var(--text-tertiary); }

@media (max-width: 768px) {
  .hs-footer__inner { padding: var(--space-10) var(--space-6) var(--space-6); }
  .hs-footer__top { grid-template-columns: 1fr 1fr; gap: var(--space-8) var(--space-6); }
  .hs-brand { grid-column: 1 / -1; }
}

/* Footer wordmark (hutchins → hutchinsight → hutch insight → hutch in sight) */
.hs-mark {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font: 400 var(--hs-size)/1 var(--hs-font);
  color: var(--hs-ink);
  text-decoration: none;
}
.hs-mark:hover { color: var(--hs-ink); }
.hs-mark:focus-visible { outline: 2px solid var(--hs-accent); outline-offset: 6px; border-radius: var(--radius-sm); }
.hs-icon { position: relative; width: 1em; height: 1em; color: var(--hs-muted); }
.hs-icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .25s, transform .25s var(--hs-ease);
}
.hs-icon svg.is-active { opacity: 1; transform: scale(1); transition-delay: .2s; }
.hs-word { display: inline-flex; align-items: flex-end; user-select: none; -webkit-user-select: none; }
.hs-ch {
  display: inline-block;
  transition: margin-left .6s var(--hs-ease), background-size .45s var(--hs-ease), transform .5s var(--hs-ease), opacity .4s;
  /* Half-height marker, matching the hero highlights. It's a background on each
     letter, so adjacent highlighted letters join into one even swipe. */
  background: linear-gradient(var(--hs-hl), var(--hs-hl)) no-repeat;
  background-position: 0 82%;
  background-size: 100% 0;
}
.hs-ch.is-hi { background-size: 100% 46%; }
.hs-ext {
  display: inline-flex;
  overflow: hidden;
  max-width: 0;
  padding-bottom: .3em;
  margin-bottom: -.3em; /* room for the g descender inside the clip */
  transition: max-width .6s var(--hs-ease);
}
.hs-ext .hs-ch { transform: translateY(140%); opacity: 0; }
.hs-mark.is-joined .hs-ext { max-width: 3em; }
/* ".com" appears only on the domain stage, in a softer ink than the name. */
.hs-ext--tld .hs-ch { color: var(--hs-muted); }
.hs-mark.is-joined:not(.is-domain) .hs-ext--tld { max-width: 0; }
.hs-mark.is-joined:not(.is-domain) .hs-ext--tld .hs-ch { transform: translateY(140%); opacity: 0; }
.hs-mark.is-joined .hs-ext .hs-ch { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .hs-ch, .hs-ext, .hs-icon svg { transition: none !important; }
}

/* ── Contact ──────────────────────────────────────── */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-11);
  align-items: start;
}
.contact__lede {
  margin-bottom: var(--space-4);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--weight-bold);
}
.contact__text { max-width: 34rem; color: var(--text-secondary); }
.contact__text + .contact__text { margin-top: var(--space-4); }
.contact__links { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); padding: 0; list-style: none; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--weight-medium);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.pill:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.contact__card {
  position: relative;
  padding: var(--space-8);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
}
.contact-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.field { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.field__label {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  line-height: var(--lh-mono-sm);
  font-weight: var(--weight-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.field__input {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  font: inherit;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field__input--area { min-height: 160px; resize: vertical; }
.field__input:hover { border-color: var(--border-strong); }
.field__input:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--highlight-subtle);
}
.field__input[aria-invalid="true"] { border-color: var(--status-error); }
.field__error { min-height: var(--lh-body-sm); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--status-error); }
.contact-form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form__footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); margin-top: var(--space-3); }
.contact-form__submit[disabled] { opacity: .7; cursor: progress; }
.contact-form__status { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-secondary); }
.contact-form__status.is-error { color: var(--status-error); }

.contact-done { display: grid; justify-items: start; gap: var(--space-3); padding-block: var(--space-6); outline: none; }
.contact-done[hidden] { display: none; }
.contact-done__stamp {
  margin-bottom: var(--space-4);
  padding: var(--space-2) var(--space-5);
  border: 3px solid var(--stamp-500);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: var(--weight-bold);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--stamp-500);
  transform: rotate(-6deg);
}
.contact-done:not([hidden]) .contact-done__stamp { animation: stamp-in .45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-6deg) scale(1.8); }
  to   { opacity: 1; transform: rotate(-6deg) scale(1); }
}
.contact-done__title { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--weight-bold); }
.contact-done__text { color: var(--text-secondary); }
.contact-done__again { margin-top: var(--space-4); }
@media (prefers-reduced-motion: reduce) {
  .contact-done:not([hidden]) .contact-done__stamp { animation: none; }
}

/* ── Pin-and-ring cursor (assets/cursor.js) ─────────
   The native cursor is hidden only while cursor.js is active (mouse users),
   and stays normal in text fields. */
html.has-pin-cursor,
html.has-pin-cursor a,
html.has-pin-cursor button,
html.has-pin-cursor .tag-btn { cursor: none; }
html.has-pin-cursor input,
html.has-pin-cursor textarea,
html.has-pin-cursor select { cursor: text; }
.pc-dot,
.pc-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .2s;
}
.pc-dot.is-visible,
.pc-ring.is-visible { opacity: 1; }
.pc-dot {
  /* Whole-pixel box with a real border (not a shadow), so the pale outline
     is drawn inside the same box and stays centered on the pointer. */
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--stamp-500);
  border: 2px solid var(--paper-50);
}
.pc-ring {
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 1.5px solid var(--stamp-500);
  transition: opacity .2s, width .2s, height .2s, margin .2s, border-color .2s, background-color .2s;
}
.pc-ring.is-hover {
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-color: var(--highlight-strong);
  background: color-mix(in srgb, var(--highlight) 18%, transparent);
}
.pc-ring.is-down { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.pc-ring.is-hover.is-down { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
@media print { .pc-dot, .pc-ring { display: none; } }

/* ── Back to top ───────────────────────────────── */
.to-top {
  position: fixed;
  right: var(--space-7);
  bottom: var(--space-7);
  z-index: 40;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(.9);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s cubic-bezier(.2, .8, .2, 1), background-color .2s, color .2s;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--action-primary); border-color: var(--action-primary); color: var(--text-inverse); }
.to-top > svg { grid-area: 1 / 1; }
.to-top__ring {
  width: 48px;
  height: 48px;
  margin: -1px; /* sit over the border */
  transform: rotate(-90deg);
  fill: none;
  stroke-width: 3;
}
.to-top__track { stroke: transparent; }
.to-top__progress {
  stroke: var(--highlight-strong);
  stroke-linecap: round;
  stroke-dasharray: 132; /* ≈ 2πr, r = 21 */
  stroke-dashoffset: 132;
}
.to-top__arrow {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.to-top:hover .to-top__arrow { transform: translateY(-2px); }
@media (max-width: 768px) {
  .to-top { right: var(--space-5); bottom: var(--space-5); }
}
@media (prefers-reduced-motion: reduce) {
  .to-top, .to-top__arrow { transition: none; }
}

/* ── Tablet ─────────────────────────────────────── */
/* "Contact" in the nav duplicates the "Get in touch" button, so it only shows
   when the button is hidden (narrower screens). */
.site-nav__contact { display: none; }
@media (max-width: 960px) {
  .site-header__cta { display: none; }
  .site-nav__contact { display: inline; }
  /* Between phone and desktop widths the full link row can be wider than the
     header: let it shrink and scroll sideways instead of widening the page. */
  .site-header__inner { gap: var(--space-5); }
  .site-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding-inline: var(--space-3); }
  .results { grid-template-columns: 1fr; }
  .files, .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-9); }
  .evidence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phase:nth-child(2)::after { display: none; }
  .about { grid-template-columns: 1fr; gap: var(--space-8); }
  .contact { grid-template-columns: 1fr; gap: var(--space-9); }
}

/* ── Mobile ─────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --header-h: 104px; }
  .page, .site-header__inner { padding-inline: var(--space-6); }

  .site-header__inner {
    flex-wrap: wrap;
    height: auto;
    gap: var(--space-2);
    padding-block: var(--space-4) var(--space-2);
  }
  .site-nav {
    width: calc(100% + 2 * var(--space-6));
    margin: 0 calc(-1 * var(--space-6));
    padding: 0 var(--space-5) var(--space-2);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }

  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-9);
    padding-block: var(--space-10);
  }
  .hero__name { font-size: clamp(var(--fs-h1), 10vw, var(--fs-display)); line-height: 1.15; }
  .hero__photo { justify-self: start; max-width: 280px; }

  .section { padding-block: var(--space-10); }
  .section__title { margin-bottom: var(--space-8); }

  .entry { grid-template-columns: 1fr; gap: var(--space-3); }
  .files, .phases { grid-template-columns: 1fr; }
  .contact-form__row { grid-template-columns: 1fr; gap: 0; }
  .contact__card { padding: var(--space-6); }
  .phase::after { display: none; }
  .entry__meta { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); }
  .entry__place { margin-top: 0; }
}
