/*
  Daniel Sheedy Portfolio — Version 1.0
  Core layout and components. The public palette uses warm white, grey, gold,
  and red. Mathematical and article-specific styles live in math-blog.css.
*/

:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-2: #ece9e2;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --surface-2: #eeeae2;
  --text: #2b2926;
  --muted: #5f5b55;
  --faint: #6f6962;
  --line: rgba(70, 63, 55, 0.15);
  --line-strong: rgba(70, 63, 55, 0.29);
  --red: #8f1d2c;
  --red-strong: #731522;
  --red-fill: #8f1d2c;
  --red-fill-hover: #731522;
  --gold: #b38a2e;
  --gold-strong: #896314;
  --grey: #6b665f;
  --accent: var(--red);
  --accent-2: var(--gold);
  --accent-3: var(--grey);
  --success: #376849;
  --warning: #8a6418;
  --danger: #9b2735;
  --shadow: 0 18px 44px rgba(57, 47, 38, 0.10);
  --shadow-soft: 0 8px 22px rgba(57, 47, 38, 0.07);
  --radius: 8px;
  --radius-small: 5px;
  --shell: min(1120px, calc(100% - 40px));
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #211f1c;
  --bg-2: #292622;
  --surface: rgba(48, 44, 39, 0.94);
  --surface-solid: #302c27;
  --surface-2: #39342e;
  --text: #f7f3ea;
  --muted: #c4bdb1;
  --faint: #a9a195;
  --line: rgba(235, 226, 210, 0.14);
  --line-strong: rgba(235, 226, 210, 0.28);
  --red: #e18a91;
  --red-strong: #f0a2a8;
  --red-fill: #a63c48;
  --red-fill-hover: #92303b;
  --gold: #d0ad55;
  --gold-strong: #e1c270;
  --grey: #b9b1a5;
  --success: #77b38a;
  --warning: #e0bc67;
  --danger: #ef8892;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.30);
  --shadow-soft: 0 9px 24px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% -8%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 0.9em; }
svg:not(mjx-container svg) {
  width: 1.12em;
  height: 1.12em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--gold) 35%, transparent); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.noscript-note { padding: 2rem; font-family: var(--font); }
.shell { width: var(--shell); margin-inline: auto; }
.section { position: relative; padding: 82px 0; }
.section-compact { padding-top: 46px; padding-bottom: 78px; }
.section-tint {
  background: color-mix(in srgb, var(--surface-2) 46%, transparent);
  border-block: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 14px;
  transform: translateY(-160%);
  padding: 9px 13px;
  border-radius: var(--radius-small);
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus { transform: translateY(0); }

/* Header and navigation */
.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.header-row {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
}
.brand img { width: 40px; height: 40px; }
.brand span { display: grid; line-height: 1.17; }
.brand strong { font-size: 0.95rem; letter-spacing: 0.01em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 0.68rem; letter-spacing: 0.02em; }
.desktop-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.desktop-nav a,
.mobile-nav a,
.footer-links a {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}
.desktop-nav a {
  position: relative;
  padding: 10px 9px 9px;
}
.desktop-nav a::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: 4px;
  left: 9px;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--red);
  transition: transform 0.18s ease;
}
.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active { color: var(--text); }
.desktop-nav a:hover::after,
.desktop-nav a.active::after { transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: 7px; }
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.icon-button:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.menu-toggle { display: none; }
.mobile-nav { border-top: 1px solid var(--line); padding: 8px 0 13px; }
.mobile-nav .shell { display: grid; }
.mobile-nav a { padding: 11px 3px; border-bottom: 1px solid var(--line); }
.mobile-nav a:last-child { border-bottom: 0; }

/* Type and controls */
.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 0.71rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.eyebrow-line { display: flex; align-items: center; gap: 9px; }
.eyebrow-line::before { content: ""; width: 27px; height: 2px; background: var(--gold); }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 15%, transparent);
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.17s ease, border-color 0.17s ease, background 0.17s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--red-fill); color: #fff; border-color: var(--red-fill); }
.button-primary:hover { background: var(--red-fill-hover); border-color: var(--red-fill-hover); }
.button-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.button-secondary:hover { border-color: var(--gold); }
.button svg,
.text-link svg { width: 1em; height: 1em; }
.text-link { display: inline-flex; align-items: center; gap: 7px; color: var(--red); font-weight: 780; }
.text-link:hover { color: var(--red-strong); }
.hero-actions,
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* Home */
.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 32px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(color-mix(in srgb, var(--line) 58%, transparent) 1px, transparent 1px);
  background-size: 100% 32px;
  opacity: 0.25;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(310px, 0.68fr);
  gap: 66px;
  align-items: center;
}
.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.75rem, 6.1vw, 5.15rem);
  line-height: 1.01;
  letter-spacing: -0.052em;
}
.hero-intro {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.55vw, 1.14rem);
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; color: var(--faint); font-size: 0.79rem; }
.hero-note {
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.hero-note-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero-note-profile { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; padding: 19px 0; }
.hero-note-profile img { width: 76px; height: 76px; object-fit: cover; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); }
.hero-note-profile strong,
.hero-note-profile span { display: block; }
.hero-note-profile strong { line-height: 1.25; }
.hero-note-profile span { margin-top: 4px; color: var(--muted); font-size: 0.78rem; }
.hero-note dl { margin: 0 0 18px; }
.hero-note dl > div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.hero-note dt { color: var(--faint); font-size: 0.72rem; }
.hero-note dd { margin: 0; font-size: 0.78rem; font-weight: 720; }
.hero-note .text-link { font-size: 0.76rem; }
.proof-grid {
  position: relative;
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-small);
  background: var(--surface);
}
.proof-item { display: grid; gap: 2px; padding: 18px 20px; border-right: 1px solid var(--line); }
.proof-item:last-child { border-right: 0; }
.proof-item strong { font-size: 1.03rem; }
.proof-item span { color: var(--muted); font-size: 0.73rem; }

/* Shared sections and cards */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(280px, 0.42fr);
  gap: 48px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 34px;
}
.section-head.single { display: block; max-width: 780px; }
.section-head h2,
.page-hero h1,
.contact-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 4.1vw, 3.35rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
}
.section-head p,
.page-hero .lead { margin: 0; color: var(--muted); }
.section-head.single p:last-child { max-width: 680px; margin-top: 15px; }
.pillar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.pillar-card,
.value-card,
.principle-card,
.capability-group,
.level-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.pillar-card { min-height: 222px; display: flex; flex-direction: column; padding: 23px; }
.pillar-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line));
  border-radius: var(--radius-small);
  background: color-mix(in srgb, var(--gold) 8%, var(--surface));
  color: var(--red);
  font-family: var(--serif);
  font-weight: 900;
}
.pillar-card h3 { margin: auto 0 7px; font-size: 1.16rem; }
.pillar-card p,
.value-card p,
.principle-card p,
.capability-group p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.project-card { min-width: 0; }
.project-card-link {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.project-card-link:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.project-visual {
  position: relative;
  height: 168px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--red) 9%, transparent), transparent 36%),
    linear-gradient(145deg, color-mix(in srgb, var(--gold) 11%, var(--surface-2)), var(--surface));
}
.project-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.22;
}
.project-card-body { flex: 1; display: flex; flex-direction: column; padding: 20px; }
.project-meta,
.project-footer { display: flex; justify-content: space-between; gap: 10px; color: var(--faint); font-size: 0.67rem; letter-spacing: 0.07em; text-transform: uppercase; }
.project-card h3 { margin: 15px 0 8px; font-size: 1.15rem; line-height: 1.22; letter-spacing: -0.022em; }
.project-card p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.project-footer { align-items: center; margin-top: auto; padding-top: 20px; letter-spacing: 0; text-transform: none; }

/* Project card diagrams */
.visual-symbol { position: absolute; z-index: 2; top: 24px; left: 25px; color: var(--red); font: 700 2.65rem var(--serif); }
.visual-line { position: absolute; z-index: 2; right: 28px; bottom: 53px; left: 28px; height: 3px; background: var(--gold); }
.visual-line.short { right: 42%; bottom: 37px; background: var(--red); }
.visual-group,
.visual-stack { position: absolute; z-index: 2; display: flex; gap: 8px; }
.visual-group { top: 45px; left: 31px; }
.visual-stack { right: 31px; bottom: 41px; flex-direction: column; }
.visual-group i,
.visual-stack i { display: block; width: 25px; height: 25px; border: 2px solid var(--red); border-radius: 50%; }
.visual-stack i { width: 76px; height: 13px; border-color: var(--gold); border-radius: 2px; }
.visual-arrow { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; color: var(--grey); font-size: 2rem; }
.flask { position: absolute; z-index: 2; left: 31px; bottom: 24px; color: var(--red); font-size: 4.4rem; }
.orbit,
.ai-ring { position: absolute; z-index: 2; border: 1px solid var(--gold); border-radius: 50%; }
.orbit { width: 122px; height: 122px; top: 22px; right: 26px; }
.visual-check { position: absolute; z-index: 2; left: 29px; top: 24px; color: var(--red); font-size: 3rem; }
.visual-bars,
.analysis-bars { position: absolute; z-index: 2; right: 29px; bottom: 28px; display: flex; align-items: end; gap: 9px; height: 93px; }
.visual-bars i,
.analysis-bars i { width: 16px; background: var(--gold); }
.visual-bars i:nth-child(1), .analysis-bars i:nth-child(1) { height: 35%; }
.visual-bars i:nth-child(2), .analysis-bars i:nth-child(2) { height: 72%; background: var(--red); }
.visual-bars i:nth-child(3), .analysis-bars i:nth-child(3) { height: 53%; }
.analysis-bars i:nth-child(4) { height: 88%; background: var(--red); }
.chess-piece { position: absolute; z-index: 2; left: 28px; top: 18px; color: var(--red); font-size: 5rem; }
.chess-grid,
.sheet-grid { position: absolute; z-index: 1; inset: 24px 27px 24px 45%; border: 1px solid var(--line-strong); background-image: linear-gradient(var(--line-strong) 1px, transparent 1px), linear-gradient(90deg, var(--line-strong) 1px, transparent 1px); background-size: 22px 22px; }
.graph-axis { position: absolute; z-index: 2; inset: 26px; border-bottom: 2px solid var(--grey); border-left: 2px solid var(--grey); }
.graph-curve { position: absolute; z-index: 3; width: 73%; height: 62%; top: 25px; left: 48px; border-top: 4px solid var(--red); border-radius: 50%; transform: rotate(-15deg); }
.ai-core { position: absolute; z-index: 4; inset: 0; display: grid; place-items: center; color: var(--red); font-weight: 900; font-size: 1.7rem; }
.ai-ring { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.ring-one { width: 90px; height: 90px; }
.ring-two { width: 139px; height: 139px; border-color: var(--red); }
.analysis-line { position: absolute; z-index: 3; left: 22px; right: 22px; top: 59px; height: 3px; transform: rotate(-8deg); background: var(--red); }
.sim-grid { position: absolute; z-index: 2; inset: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sim-grid i { border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--gold) 17%, transparent); }
.sim-grid i:nth-child(2n) { background: color-mix(in srgb, var(--red) 10%, transparent); }
.monitor { position: absolute; z-index: 2; width: 84px; height: 55px; border: 3px solid var(--grey); border-radius: 3px; background: var(--surface-solid); }
.monitor::after { content: ""; position: absolute; width: 26px; height: 3px; left: 26px; bottom: -11px; background: var(--grey); }
.monitor.one { top: 33px; left: 27px; }
.monitor.two { top: 58px; left: 50%; transform: translateX(-50%); border-color: var(--red); }
.monitor.three { top: 33px; right: 27px; border-color: var(--gold); }
.game-ship { position: absolute; z-index: 2; left: 50%; bottom: 24px; transform: translateX(-50%); color: var(--red); font-size: 2.6rem; }
.game-equation { position: absolute; z-index: 2; top: 31px; left: 50%; transform: translateX(-50%); color: var(--text); font: 700 1.6rem var(--serif); }
.sheet-formula { position: absolute; z-index: 3; left: 25px; top: 24px; color: var(--red); font: italic 700 2.6rem var(--serif); }

.process-grid { display: grid; grid-template-columns: repeat(5, 1fr); border-block: 1px solid var(--line-strong); }
.process-item { padding: 22px 18px; border-right: 1px solid var(--line); }
.process-item:last-child { border-right: 0; }
.process-item > span,
.principle-card > span { color: var(--gold-strong); font-size: 0.69rem; font-weight: 900; letter-spacing: 0.1em; }
.process-item h3 { margin: 13px 0 6px; font-size: 1rem; }
.process-item p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: center;
  padding: 32px;
  border: 1px solid var(--line-strong);
  border-left: 5px solid var(--red);
  border-radius: var(--radius);
  background: var(--surface);
}
.contact-copy > p:not(.eyebrow),
.contact-location { margin: 12px 0 0; color: var(--muted); }
.contact-location { font-size: 0.79rem; }
.contact-action { min-width: 270px; display: grid; gap: 10px; }
.contact-warning { display: grid; gap: 3px; padding: 12px; border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--line)); border-radius: var(--radius-small); background: color-mix(in srgb, var(--warning) 7%, var(--surface)); }
.contact-warning strong { color: var(--warning); font-size: 0.78rem; }
.contact-warning span { color: var(--muted); font-size: 0.7rem; }
.contact-email { color: var(--red); font-weight: 850; }

/* General page layouts */
.page-hero { position: relative; overflow: hidden; padding: 86px 0 66px; border-bottom: 1px solid var(--line); }
.page-hero::after {
  content: attr(data-watermark);
  position: absolute;
  z-index: -1;
  right: 4vw;
  bottom: -0.24em;
  color: color-mix(in srgb, var(--gold) 8%, transparent);
  font-size: clamp(6rem, 18vw, 15rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
}
.page-hero-content { max-width: 900px; }
.page-hero .lead { max-width: 760px; margin-top: 20px; font-size: 1.03rem; }
.story-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(250px, 0.55fr); gap: 68px; align-items: start; }
.story-copy h2 { margin: 0 0 22px; font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -0.04em; }
.story-copy p { color: var(--muted); }
.story-copy p:first-of-type { color: var(--text); font-size: 1.04rem; }
.story-aside { position: sticky; top: 92px; display: grid; }
.fact-card { padding: 15px 0; border-bottom: 1px solid var(--line); }
.fact-card:first-child { border-top: 3px solid var(--gold); }
.fact-card small,
.fact-card strong { display: block; }
.fact-card small { color: var(--faint); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.fact-card strong { margin-top: 5px; font-size: 0.92rem; }
.values-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.value-card { min-height: 180px; padding: 22px; border-top: 3px solid var(--gold); }
.value-card:nth-child(2n) { border-top-color: var(--red); }
.value-card h3 { margin: 0 0 28px; font-size: 1.1rem; }
.timeline { border-top: 1px solid var(--line-strong); }
.timeline-item { display: grid; grid-template-columns: 155px 1fr; gap: 32px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.timeline-period { color: var(--gold-strong); font-size: 0.76rem; font-weight: 850; }
.timeline-kind { margin: 0 0 5px; color: var(--red); font-size: 0.67rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.timeline-item h3 { margin: 0; font-size: 1.16rem; }
.timeline-item h4 { margin: 4px 0 8px; color: var(--muted); font-size: 0.85rem; }
.timeline-item p:last-child { margin: 0; color: var(--muted); }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.recognition-card,
.privacy-card { padding: 27px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.recognition-card { border-top: 4px solid var(--gold); }
.privacy-card { border-top: 4px solid var(--red); }
.recognition-card h2,
.privacy-card h2 { margin: 0; font-size: 1.65rem; }
.recognition-card ul,
.privacy-card ul,
.check-list { list-style: none; margin: 20px 0 0; padding: 0; }
.recognition-card li,
.privacy-card li,
.check-list li { position: relative; padding: 8px 0 8px 21px; color: var(--muted); border-top: 1px solid var(--line); }
.recognition-card li::before,
.privacy-card li::before,
.check-list li::before { content: "•"; position: absolute; left: 2px; color: var(--red); font-weight: 900; }
.capability-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.capability-group { padding: 22px; }
.capability-group h3 { margin: 0 0 14px; font-size: 1rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud span,
#project-tools span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 0.69rem; }
.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.level-card { padding: 21px; border-top: 3px solid var(--gold); }
.level-card strong,
.level-card span { display: block; }
.level-card strong { font-size: 1rem; }
.level-card span { margin-top: 5px; color: var(--muted); font-size: 0.8rem; }
.teaching-overview { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: 62px; align-items: start; }
.teaching-overview h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.07; letter-spacing: -0.045em; }
.check-list { margin-top: 0; columns: 2; column-gap: 34px; }
.check-list li { break-inside: avoid; font-size: 0.84rem; }
.principles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.principle-card { min-height: 225px; padding: 22px; }
.principle-card h3 { margin: 32px 0 8px; font-size: 1.08rem; }

/* Search and archive controls */
.work-toolbar,
.blog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  cursor: pointer;
}
.filter-button:hover,
.filter-button.active { border-color: var(--red-fill); background: var(--red-fill); color: #fff; }
.search-box { min-width: 270px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--surface); }
.search-box svg { flex: 0 0 auto; color: var(--faint); }
.search-box input { width: 100%; min-height: 39px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.work-status,
.blog-status { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 17px; color: var(--muted); font-size: 0.78rem; }
.empty-state { padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }

/* Project detail */
.project-hero { padding: 46px 0 62px; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 35px; color: var(--faint); font-size: 0.72rem; }
.breadcrumb a:hover { color: var(--red); }
.project-hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.78fr); gap: 55px; align-items: center; }
.project-kickers { display: flex; flex-wrap: wrap; gap: 7px; }
.project-kickers span { padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-small); color: var(--muted); font-size: 0.66rem; letter-spacing: 0.07em; text-transform: uppercase; }
.project-kickers span:first-child { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); color: var(--red); }
.project-hero h1 { margin: 20px 0 14px; font-size: clamp(2.4rem, 5.4vw, 4.6rem); line-height: 1; letter-spacing: -0.052em; }
.project-strapline { max-width: 740px; margin: 0; color: var(--muted); font-size: 1.04rem; }
.project-hero-visual .project-visual { height: 300px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.project-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; }
.project-fact { padding: 13px 0; border-top: 1px solid var(--line-strong); }
.project-fact small,
.project-fact strong { display: block; }
.project-fact small { color: var(--faint); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; }
.project-fact strong { margin-top: 4px; font-size: 0.82rem; }
#project-tools { margin-top: 16px; }
.project-content-grid { display: grid; grid-template-columns: 175px minmax(0, 760px); gap: 65px; justify-content: center; align-items: start; }
.project-aside { position: sticky; top: 94px; }
.project-aside p { margin: 0 0 11px; color: var(--faint); font-size: 0.67rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.project-aside nav { display: grid; border-top: 1px solid var(--line-strong); }
.project-aside a { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.77rem; }
.project-aside a:hover { color: var(--red); }
.case-section { padding: 0 0 60px; scroll-margin-top: 95px; }
.case-section + .case-section { padding-top: 55px; border-top: 1px solid var(--line); }
.case-section h2 { margin: 0 0 20px; font-size: clamp(1.8rem, 3.4vw, 2.65rem); line-height: 1.08; letter-spacing: -0.04em; }
.case-section > p { color: var(--muted); }
.case-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.case-box { padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.case-box h3 { margin: 0 0 10px; font-size: 0.95rem; }
.case-box p,
.case-box ul { margin: 0; color: var(--muted); font-size: 0.87rem; }
.case-box ul { padding-left: 1.15rem; }
.evidence-list { display: grid; gap: 8px; margin-top: 18px; }
.evidence-item { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); }
.evidence-item div { display: grid; gap: 2px; }
.evidence-item span { color: var(--muted); font-size: 0.72rem; }
.evidence-status { white-space: nowrap; color: var(--red) !important; font-weight: 780; }
.next-box { padding: 22px; border-left: 4px solid var(--gold); background: var(--surface); color: var(--muted); }

/* Résumé */
.cv-toolbar { width: min(900px, calc(100% - 36px)); display: flex; justify-content: flex-end; margin: 26px auto 12px; }
.cv-paper { width: min(900px, calc(100% - 36px)); margin: 0 auto 60px; padding: 56px 60px; background: #fff; color: #2b2926; border: 1px solid #d7d1c7; box-shadow: var(--shadow); }
.cv-header { display: grid; grid-template-columns: 1fr auto; gap: 25px; padding-bottom: 24px; border-bottom: 4px solid #8f1d2c; }
.cv-header h1 { margin: 0; font-size: 2.75rem; letter-spacing: -0.05em; }
.cv-header p { margin: 5px 0 0; color: #5f5b55; }
.cv-monogram { width: 70px; height: 70px; display: grid; place-items: center; border: 2px solid #b38a2e; color: #8f1d2c; font-weight: 900; }
.cv-section { padding: 24px 0; border-bottom: 1px solid #d7d1c7; }
.cv-section:last-of-type { border-bottom: 0; }
.cv-section > h2 { margin: 0 0 13px; color: #8f1d2c; font-size: 0.78rem; letter-spacing: 0.11em; text-transform: uppercase; }
.cv-section p,
.cv-section ul { color: #514d47; }
.cv-section ul { margin: 0; padding-left: 1.1rem; }
.cv-entry { padding: 0 0 18px; margin: 0 0 18px; border-bottom: 1px solid #e5e0d8; }
.cv-entry:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.cv-entry-head { display: flex; justify-content: space-between; gap: 15px; }
.cv-entry h3 { margin: 0; font-size: 1rem; }
.cv-entry h4 { margin: 3px 0 8px; color: #6b665f; font-size: 0.8rem; }
.cv-entry-head span { color: #8f6b18; font-size: 0.75rem; font-weight: 800; }
.cv-entry p { margin: 0; font-size: 0.86rem; }
.cv-skills { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cv-skill-group h3 { margin: 0 0 4px; font-size: 0.86rem; }
.cv-skill-group p { margin: 0; font-size: 0.78rem; }
.cv-note { margin: 23px 0 0; padding-top: 16px; border-top: 1px solid #d7d1c7; color: #6b665f; font-size: 0.72rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line-strong); background: color-mix(in srgb, var(--bg-2) 70%, var(--bg)); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 60px; padding: 42px 0 30px; }
.footer-brand { margin-bottom: 15px; }
.footer-note,
.footer-grid p { max-width: 620px; margin: 0; color: var(--muted); font-size: 0.75rem; }
.footer-label { margin-bottom: 10px !important; color: var(--text) !important; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-links { min-width: 280px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.footer-links a { padding: 4px 0; }
.footer-links a:hover { color: var(--red); }
.footer-base { display: flex; justify-content: space-between; gap: 18px; padding: 15px 0 23px; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.69rem; }

.reveal { opacity: 0; transform: translateY(13px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 1050px) {
  .desktop-nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .pillar-grid,
  .values-grid,
  .principles-grid { grid-template-columns: 1fr 1fr; }
  .project-grid { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: repeat(3, 1fr); }
  .process-item:nth-child(3) { border-right: 0; }
  .process-item:nth-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .process-item:nth-child(4) { border-left: 1px solid var(--line); }
}

@media (max-width: 780px) {
  :root { --shell: min(100% - 28px, 1120px); }
  .section { padding: 66px 0; }
  .section-compact { padding-top: 32px; }
  .header-row { min-height: 64px; }
  .brand small { display: none; }
  .hero { padding-top: 56px; }
  .hero-grid,
  .section-head,
  .story-grid,
  .teaching-overview,
  .split-grid,
  .project-hero-grid,
  .project-content-grid,
  .case-two-col,
  .contact-panel { grid-template-columns: 1fr; }
  .hero-grid { gap: 38px; }
  .hero-note { max-width: 520px; }
  .proof-grid { grid-template-columns: 1fr 1fr; }
  .proof-item:nth-child(2) { border-right: 0; }
  .proof-item:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .section-head { gap: 16px; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .process-item { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .process-item:nth-child(2n) { border-right: 0; }
  .process-item:last-child { border-bottom: 0; }
  .story-aside,
  .project-aside { position: static; }
  .story-aside { grid-template-columns: 1fr 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 7px; }
  .capability-grid,
  .level-grid { grid-template-columns: 1fr 1fr; }
  .check-list { columns: 1; }
  .work-toolbar,
  .blog-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { min-width: 0; }
  .project-aside nav { display: flex; flex-wrap: wrap; gap: 4px 15px; border-top: 0; }
  .project-aside a { border-bottom: 0; }
  .project-hero-visual .project-visual { height: 250px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-links { min-width: 0; }
  .footer-base { flex-direction: column; }
  .cv-paper { padding: 40px 34px; }
  .cv-header { grid-template-columns: 1fr; }
  .cv-monogram { display: none; }
}

@media (max-width: 540px) {
  .header-tools { margin-left: auto; }
  .hero h1 { font-size: clamp(2.45rem, 11.8vw, 3.25rem); line-height: 0.97; }
  .proof-grid,
  .pillar-grid,
  .project-grid,
  .values-grid,
  .principles-grid,
  .process-grid,
  .story-aside,
  .capability-grid,
  .level-grid,
  .cv-skills { grid-template-columns: 1fr; }
  .proof-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .proof-item:last-child { border-bottom: 0; }
  .process-item,
  .process-item:nth-child(3),
  .process-item:nth-child(4) { border-right: 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .process-item:last-child { border-bottom: 0; }
  .project-visual { height: 154px; }
  .project-facts { grid-template-columns: 1fr; }
  .evidence-item { align-items: flex-start; flex-direction: column; }
  .contact-panel { padding: 23px; }
  .contact-action { min-width: 0; }
  .work-status,
  .blog-status { flex-direction: column; gap: 3px; }
  .cv-paper { width: 100%; margin-bottom: 0; padding: 28px 21px; border: 0; box-shadow: none; }
  .cv-toolbar { justify-content: stretch; }
  .cv-toolbar .button { width: 100%; }
}

/* Version 1.0 accessibility and route-state refinements */
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.icon-button { width: 42px; height: 42px; }
.filter-button { min-height: 36px; }
.filter-button[aria-pressed="true"] { border-color: var(--red-fill); background: var(--red-fill); color: #fff; }
.search-box:focus-within { border-color: var(--gold-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.search-box input:focus-visible { outline: 0; }
.post-tags a { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-family: var(--font); font-size: 0.68rem; }
.post-tags a:hover { border-color: var(--red); color: var(--red); }
.post-toc a[aria-current="location"] { color: var(--red); font-weight: 800; border-left-color: var(--gold); }
.mobile-nav-open { overflow: hidden; }
.mathjax-unavailable .tex2jax_process { font-family: var(--serif); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  body[data-page="cv"] { background: #fff; }
  body[data-page="cv"] [data-site-header],
  body[data-page="cv"] [data-site-footer],
  .cv-toolbar { display: none !important; }
  .cv-paper { width: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; }
  @page { size: A4; margin: 15mm; }
}


/* Controlled offline update notice */
.site-update-notice {
  position: fixed;
  z-index: 120;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(420px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--gold);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}
.site-update-notice strong,
.site-update-notice span { display: block; }
.site-update-notice span { margin-top: 3px; color: var(--muted); font-size: .82rem; line-height: 1.4; }
@media (max-width: 560px) {
  .site-update-notice { grid-template-columns: 1fr auto; }
  .site-update-notice .button { grid-column: 1 / -1; grid-row: 2; }
}
@media print { .site-update-notice { display: none !important; } }

/* Interactive project links retained and refined in v1.0 */
.project-card-interactive { cursor: default; }
.project-card-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: auto; padding-top: 18px; }
.project-card-actions .button { min-height: 40px; padding: 8px 12px; font-size: .76rem; }
.project-visual-image { padding: 0; overflow: hidden; background: var(--surface-2); }
.project-visual-image img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.project-primary-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.evidence-item a:first-child { font-weight: 820; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--gold) 60%, transparent); text-underline-offset: 3px; }
.evidence-status.is-open { display: inline-flex; align-items: center; gap: 4px; color: var(--red); font-weight: 850; }
.home-tool-grid:has(.tool-card:only-child) { grid-template-columns: minmax(0, 720px); }
@media (max-width: 620px) { .project-card-actions { grid-template-columns: 1fr; align-items: start; } }

/* Version 1.0 mathematics-library previews */
.home-mathematics-section { position: relative; overflow: hidden; }
.home-mathematics-section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .25;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px; mask-image: linear-gradient(90deg, #000, transparent 88%);
}
.home-mathematics-section > .shell { position: relative; }
.home-math-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line-strong); background: var(--surface); }
.home-math-card { min-width: 0; border-right: 1px solid var(--line); }
.home-math-card:last-child { border-right: 0; }
.home-math-card a { height: 100%; display: grid; grid-template-rows: auto 126px 1fr; color: inherit; }
.home-math-card-head { display: flex; justify-content: space-between; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: .62rem; font-weight: 760; letter-spacing: .05em; text-transform: uppercase; }
.home-math-card-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-math-card-head b { color: var(--gold-strong); font-weight: 820; white-space: nowrap; }
.home-math-equation { min-width: 0; display: grid; place-items: center; overflow: auto hidden; padding: 17px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 65%, var(--surface)); }
.home-math-equation mjx-container { margin: 0 !important; font-size: 1.08rem !important; }
.home-math-card-copy { display: grid; align-content: start; gap: 8px; padding: 18px; }
.home-math-card-copy h3 { margin: 0; font-size: .94rem; line-height: 1.3; }
.home-math-card-copy p { margin: 0 0 5px; color: var(--muted); font-size: .72rem; line-height: 1.55; }
.home-math-card-copy .text-link { margin-top: auto; }
.home-math-card:hover .home-math-equation { background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
@media (max-width: 1020px) { .home-math-grid { grid-template-columns: 1fr 1fr; } .home-math-card:nth-child(2) { border-right: 0; } .home-math-card:nth-child(-n + 2) { border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .home-math-grid { grid-template-columns: 1fr; } .home-math-card { border-right: 0; border-bottom: 1px solid var(--line); } .home-math-card:last-child { border-bottom: 0; } .home-math-card a { grid-template-rows: auto 112px 1fr; } }

/* Version 1.0 global portfolio search */
.global-search-button svg { width: 18px; height: 18px; }
.global-search-dialog {
  width: min(760px, calc(100vw - 28px));
  max-width: none;
  max-height: min(760px, calc(100vh - 42px));
  margin: max(20px, 8vh) auto auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--red);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-solid) 98%, transparent);
  color: var(--text);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(24px);
}
.global-search-dialog::backdrop { background: color-mix(in srgb, #171410 54%, transparent); backdrop-filter: blur(4px); }
.global-search-shell { min-height: 310px; max-height: calc(100vh - 48px); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.global-search-head { min-height: 66px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 32px; gap: 11px; align-items: center; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.global-search-head > span { display: grid; place-items: center; color: var(--muted); }
.global-search-head > span svg { width: 19px; height: 19px; }
.global-search-head input { min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; color: var(--text); font: 700 clamp(0.94rem, 2vw, 1.08rem)/1.2 var(--font); }
.global-search-head input::placeholder { color: var(--faint); font-weight: 600; }
.global-search-head > button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 1.25rem; cursor: pointer; }
.global-search-head > button:hover { background: var(--surface-2); color: var(--text); }
kbd { min-width: 23px; display: inline-grid; place-items: center; padding: 3px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); color: var(--muted); font: 0.65rem/1.15 ui-monospace, SFMono-Regular, Consolas, monospace; }
.global-search-summary { min-height: 34px; display: flex; align-items: center; padding: 7px 18px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 0.69rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.global-search-results { min-height: 0; overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.global-search-result { display: grid; grid-template-columns: 94px minmax(0, 1fr) minmax(70px, auto) 22px; gap: 12px; align-items: center; min-height: 70px; padding: 10px 12px; border: 1px solid transparent; border-radius: 5px; color: var(--text); }
.global-search-result + .global-search-result { border-top-color: var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.global-search-result.is-selected { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); background: color-mix(in srgb, var(--gold) 7%, var(--surface-2)); }
.global-search-kind { color: var(--red); font-size: 0.61rem; font-weight: 880; letter-spacing: 0.08em; text-transform: uppercase; }
.global-search-copy { min-width: 0; display: grid; gap: 4px; }
.global-search-copy strong { overflow: hidden; font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.global-search-copy small { overflow: hidden; color: var(--muted); font-size: 0.72rem; line-height: 1.42; text-overflow: ellipsis; white-space: nowrap; }
.global-search-copy mark { border-radius: 2px; background: color-mix(in srgb, var(--gold) 27%, transparent); color: inherit; }
.global-search-meta { overflow: hidden; max-width: 150px; color: var(--faint); font-size: 0.65rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.global-search-arrow { color: var(--faint); font-size: 0.82rem; }
.global-search-dialog footer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--faint); font-size: 0.64rem; }
.global-search-dialog footer span { display: inline-flex; align-items: center; gap: 4px; }
.global-search-dialog footer span:last-child { margin-left: auto; }
.global-search-empty { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 34px; text-align: center; }
.global-search-empty strong { font-size: 1rem; }
.global-search-empty span { max-width: 450px; color: var(--muted); font-size: 0.8rem; }
.global-search-empty a { margin-top: 6px; color: var(--red); font-size: 0.78rem; font-weight: 800; }
body.global-search-open { overflow: hidden; }

@media (max-width: 700px) {
  .global-search-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); margin: 8px auto; }
  .global-search-shell { max-height: calc(100vh - 16px); }
  .global-search-head { grid-template-columns: 22px minmax(0, 1fr) 30px; padding-inline: 12px; }
  .global-search-head > kbd { display: none; }
  .global-search-result { grid-template-columns: minmax(0, 1fr) 22px; gap: 6px 10px; min-height: 79px; }
  .global-search-kind { grid-column: 1; grid-row: 1; }
  .global-search-copy { grid-column: 1; grid-row: 2; }
  .global-search-meta { display: none; }
  .global-search-arrow { grid-column: 2; grid-row: 1 / span 2; }
  .global-search-dialog footer span:not(:last-child) { display: none; }
  .global-search-dialog footer span:last-child { margin-left: 0; }
}

/* Version 1.0 homepage — intent-led portfolio entry point */
.home-hero {
  padding: clamp(62px, 8vw, 108px) 0 36px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 88% 14%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 29rem),
    radial-gradient(circle at 8% 88%, color-mix(in srgb, var(--red) 6%, transparent), transparent 26rem);
}
.home-hero::before {
  background-image:
    linear-gradient(color-mix(in srgb, var(--line) 56%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 42%, transparent) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: .32;
  mask-image: linear-gradient(90deg, #000, #000 72%, transparent 100%);
}
.home-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(340px, .86fr);
  gap: clamp(44px, 6.5vw, 86px);
  align-items: center;
}
.home-hero-copy { min-width: 0; }
.home-hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(3rem, 6.5vw, 5.65rem);
  line-height: .98;
  letter-spacing: -.058em;
}
.home-hero-intro {
  max-width: 760px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.55vw, 1.16rem);
  line-height: 1.72;
}
.home-hero-command {
  max-width: 690px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-top: 24px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-strong);
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
}
.home-hero-command > span { color: var(--red); font-size: 1.15rem; text-align: center; }
.home-hero-command p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.55; }
.home-hero-command strong { color: var(--text); }
.home-hero-command kbd { min-width: 22px; padding: 2px 5px; }
.home-portfolio-index {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-solid) 95%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.home-portfolio-index > header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 56%, var(--surface));
}
.home-portfolio-index > header > div { display: grid; gap: 2px; }
.home-portfolio-index > header span { color: var(--faint); font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.home-portfolio-index > header strong { font-family: var(--serif); font-size: 1.28rem; }
.home-portfolio-index > nav { display: grid; }
.home-portfolio-index > nav a {
  min-height: 76px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .16s ease, padding-left .16s ease;
}
.home-portfolio-index > nav a:hover { padding-left: 22px; background: color-mix(in srgb, var(--gold) 7%, var(--surface)); }
.home-index-number { color: var(--faint); font: 760 .62rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.home-portfolio-index > nav a > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.home-portfolio-index > nav strong { font-size: .8rem; }
.home-portfolio-index > nav small { overflow: hidden; color: var(--muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.home-portfolio-index > nav b { color: var(--red); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; }
.home-portfolio-index > footer {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) 34px;
  gap: 11px;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface);
}
.home-portfolio-index > footer img { width: 43px; height: 43px; object-fit: cover; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); }
.home-portfolio-index > footer div { min-width: 0; display: grid; gap: 2px; }
.home-portfolio-index > footer strong { font-size: .75rem; }
.home-portfolio-index > footer span { overflow: hidden; color: var(--muted); font-size: .63rem; text-overflow: ellipsis; white-space: nowrap; }
.home-portfolio-index > footer a { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--red); }
.home-proof-grid { margin-top: clamp(42px, 6vw, 68px); }
.home-proof-grid .proof-item { min-height: 86px; align-content: center; }
.home-proof-grid .proof-item strong { color: var(--red); font-family: var(--serif); font-size: 1.32rem; }

.home-pathways-section { padding-top: 90px; }
.home-pathway-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.home-pathway-card {
  min-height: 278px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(20px, 2.4vw, 28px);
  border-right: 1px solid var(--line);
  color: var(--text);
  transition: background .18s ease, transform .18s ease;
}
.home-pathway-card:nth-child(1),
.home-pathway-card:nth-child(2) { grid-column: span 3; }
.home-pathway-card:nth-child(n + 3) { grid-column: span 2; border-top: 1px solid var(--line); }
.home-pathway-card:nth-child(2),
.home-pathway-card:nth-child(5) { border-right: 0; }
.home-pathway-card:hover { background: color-mix(in srgb, var(--gold) 6%, var(--surface-solid)); }
.home-pathway-card > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--red);
  font: 760 .65rem ui-monospace, SFMono-Regular, Consolas, monospace;
}
.home-pathway-card > div { display: grid; gap: 8px; }
.home-pathway-card > div > p:first-child { margin: 0; color: var(--red); font-size: .62rem; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.home-pathway-card h3 { margin: 0; font-size: clamp(1.1rem, 2vw, 1.38rem); }
.home-pathway-card > div > p:last-child { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.62; }
.home-pathway-card > b { margin-top: auto; color: var(--faint); font-size: .68rem; }
.home-pathway-card.is-mathematics { background: color-mix(in srgb, var(--gold) 5%, var(--surface)); }
.home-pathway-card.is-tools { border-left: 3px solid var(--red); }

.home-workbench-section { overflow: hidden; }
.home-workbench-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; align-items: stretch; }
.home-workbench-grid > div { min-width: 0; }
.home-workbench-card {
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}
.home-workbench-tool { display: grid; grid-template-columns: minmax(230px, .88fr) minmax(0, 1.12fr); }
.home-workbench-visual {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}
.home-workbench-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .35s ease; }
.home-workbench-visual:hover img { transform: scale(1.015); }
.home-workbench-visual > span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 3px;
  background: rgba(28, 25, 22, .84);
  color: #fff;
  font-size: .64rem;
  font-weight: 780;
}
.home-workbench-copy { min-width: 0; display: flex; flex-direction: column; padding: clamp(22px, 3vw, 34px); }
.home-workbench-kicker { display: flex; justify-content: space-between; gap: 14px; color: var(--faint); font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.home-workbench-kicker span { color: var(--red); }
.home-workbench-copy h3 { margin: 22px 0 11px; font-size: clamp(1.35rem, 2.5vw, 2rem); line-height: 1.1; }
.home-workbench-copy > p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.66; }
.home-workbench-copy dl { display: grid; gap: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.home-workbench-copy dl div { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.home-workbench-copy dt { color: var(--faint); font-size: .63rem; font-weight: 800; text-transform: uppercase; }
.home-workbench-copy dd { margin: 0; color: var(--muted); font-size: .67rem; line-height: 1.5; }
.home-workbench-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: auto; padding-top: 24px; }
.home-workbench-actions .button { min-height: 41px; }
.home-workbench-actions .text-link { font-size: .72rem; }
.home-workbench-math { display: grid; grid-template-rows: auto minmax(170px, auto) 1fr; }
.home-workbench-math > header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.home-workbench-math > header > div { display: flex; gap: 10px; }
.home-workbench-math > header span,
.home-workbench-math > header b,
.home-workbench-math > header small { color: var(--faint); font-size: .61rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.home-workbench-math > header span { color: var(--red); }
.home-workbench-formula {
  min-width: 0;
  min-height: 190px;
  display: grid;
  place-items: center;
  overflow: auto hidden;
  padding: 26px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 45%, transparent) 1px, transparent 1px),
    color-mix(in srgb, var(--gold) 5%, var(--surface-solid));
  background-size: 30px 30px;
}
.home-workbench-formula mjx-container { margin: 0 !important; font-size: clamp(1.28rem, 2.8vw, 1.85rem) !important; }
.home-workbench-label { margin: 0 !important; color: var(--red) !important; font-size: .62rem !important; font-weight: 820; letter-spacing: .07em; text-transform: uppercase; }
.home-workbench-lesson-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.home-workbench-lesson-parts span { padding: 5px 7px; border: 1px solid var(--line); color: var(--faint); font-size: .61rem; }

.home-teaching-section { overflow: hidden; }
.home-teaching-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(250px, .58fr) minmax(270px, .62fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: stretch;
}
.home-teaching-grid > div:first-child { align-self: center; }
.home-teaching-grid h2 { max-width: 640px; margin: 0; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.05; letter-spacing: -.045em; }
.home-teaching-lead { max-width: 680px; margin: 20px 0 0; color: var(--muted); }
.home-teaching-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 28px; }
.home-teaching-levels { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); background: var(--surface); }
.home-teaching-levels article { min-height: 136px; display: grid; align-content: center; gap: 6px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.home-teaching-levels article:nth-child(2n) { border-right: 0; }
.home-teaching-levels article:nth-last-child(-n + 2) { border-bottom: 0; }
.home-teaching-levels strong { color: var(--red); font-family: var(--serif); font-size: 1.24rem; }
.home-teaching-levels span { color: var(--muted); font-size: .68rem; line-height: 1.45; }
.home-teaching-practices { border: 1px solid var(--line-strong); background: var(--surface-solid); }
.home-teaching-practices header { display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.home-teaching-practices header span,
.home-teaching-practices header b { color: var(--faint); font-size: .6rem; letter-spacing: .06em; text-transform: uppercase; }
.home-teaching-practices header b { color: var(--red); }
.home-teaching-practices ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.home-teaching-practices li { position: relative; padding: 12px 16px 12px 34px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .69rem; line-height: 1.45; }
.home-teaching-practices li:last-child { border-bottom: 0; }
.home-teaching-practices li::before { content: "✓"; position: absolute; left: 16px; color: var(--gold-strong); font-weight: 840; }

.home-math-strands {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 15px;
  scrollbar-width: thin;
}
.home-math-strands a {
  min-width: 150px;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
}
.home-math-strands a:hover { border-color: var(--gold-strong); background: var(--surface-solid); }
.home-math-strands strong { color: var(--red); font-family: var(--serif); font-size: 1.05rem; }
.home-math-strands span { color: var(--muted); font-size: .63rem; white-space: nowrap; }
.home-math-card-type { color: var(--red); font-size: .58rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.home-math-card-copy p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.home-section-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 28px; }
.home-project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-method-section .process-grid { margin-top: 34px; }

@media (max-width: 1120px) {
  .home-hero-grid { grid-template-columns: 1fr minmax(320px, .75fr); gap: 38px; }
  .home-workbench-grid { grid-template-columns: 1fr; }
  .home-workbench-tool { grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); }
  .home-workbench-visual { min-height: 390px; }
  .home-teaching-grid { grid-template-columns: 1fr 1fr; }
  .home-teaching-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .home-hero-grid { grid-template-columns: 1fr; }
  .home-portfolio-index { max-width: 680px; }
  .home-pathway-grid { grid-template-columns: 1fr 1fr; }
  .home-pathway-card,
  .home-pathway-card:nth-child(1),
  .home-pathway-card:nth-child(2),
  .home-pathway-card:nth-child(n + 3) { grid-column: auto; border-top: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .home-pathway-card:nth-child(2n) { border-right: 0; }
  .home-pathway-card:nth-last-child(-n + 2) { border-bottom: 0; }
  .home-pathway-card:nth-child(5) { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
}
@media (max-width: 760px) {
  .home-workbench-tool { grid-template-columns: 1fr; }
  .home-workbench-visual { min-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .home-teaching-grid { grid-template-columns: 1fr; }
  .home-teaching-grid > div:first-child { grid-column: auto; }
  .home-project-grid { grid-template-columns: 1fr; }
  .home-proof-grid { grid-template-columns: 1fr 1fr; }
  .home-proof-grid .proof-item:nth-child(2) { border-right: 0; }
  .home-proof-grid .proof-item:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .home-hero { padding-top: 54px; }
  .home-hero h1 { font-size: clamp(2.75rem, 14vw, 4.1rem); }
  .home-hero-command { grid-template-columns: 28px 1fr; }
  .home-portfolio-index > nav a { grid-template-columns: 25px minmax(0, 1fr); }
  .home-portfolio-index > nav b { display: none; }
  .home-pathway-grid { grid-template-columns: 1fr; }
  .home-pathway-card,
  .home-pathway-card:nth-child(2n),
  .home-pathway-card:nth-child(5) { grid-column: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .home-pathway-card:last-child { border-bottom: 0; }
  .home-pathway-card { min-height: 235px; }
  .home-proof-grid { grid-template-columns: 1fr; }
  .home-proof-grid .proof-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .home-proof-grid .proof-item:last-child { border-bottom: 0; }
  .home-teaching-levels { grid-template-columns: 1fr; }
  .home-teaching-levels article { min-height: 92px; border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .home-teaching-levels article:last-child { border-bottom: 0 !important; }
  .home-workbench-formula { min-height: 150px; padding: 18px; }
  .home-workbench-actions { align-items: stretch; }
  .home-workbench-actions .button { width: 100%; }
}

/* Version 1.0 catalogue systems: live metrics, reading routes, collections, and tool purposes */
.catalogue-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  width: min(860px, 100%);
  margin-top: clamp(28px, 5vw, 46px);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}
.catalogue-metrics article {
  min-width: 0;
  padding: 18px 20px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
}
.catalogue-metrics strong,
.catalogue-metrics span { display: block; }
.catalogue-metrics strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.catalogue-metrics span {
  margin-top: 7px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.35;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.reading-route-grid,
.portfolio-collection-grid,
.tool-purpose-grid,
.article-standard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}
.reading-route-card,
.portfolio-collection-card,
.tool-purpose-card,
.article-standard-grid article {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
}
.reading-route-card,
.portfolio-collection-card {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 24px;
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.reading-route-card:hover,
.portfolio-collection-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}
.reading-route-symbol {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--accent);
  background: var(--paper-raised);
  font-family: var(--font-display);
  font-size: 1.22rem;
}
.reading-route-card > strong,
.portfolio-collection-card > strong {
  color: var(--faint);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.reading-route-card h3,
.portfolio-collection-card h3,
.tool-purpose-card h3,
.article-standard-grid h3 {
  margin: 10px 0 9px;
  font-size: 1.18rem;
  line-height: 1.18;
  letter-spacing: -.025em;
}
.reading-route-card p,
.portfolio-collection-card p,
.tool-purpose-card p,
.article-standard-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}
.reading-route-card small,
.portfolio-collection-card small {
  display: block;
  margin-top: 18px;
  color: var(--faint);
  font-size: .72rem;
  line-height: 1.5;
}
.reading-route-card b,
.portfolio-collection-card b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 24px;
  color: var(--accent);
  font-size: .78rem;
}
.reading-route-card b svg,
.portfolio-collection-card b svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.portfolio-collection-card > span {
  position: absolute;
  top: 20px;
  right: 22px;
  color: color-mix(in srgb, var(--accent) 48%, transparent);
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}
.portfolio-collection-card { padding-top: 74px; }
.article-standard-grid article {
  min-height: 230px;
  padding: 24px;
}
.article-standard-grid article > span {
  display: inline-block;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.4rem;
}
.tool-purpose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-purpose-card {
  display: flex;
  flex-direction: column;
  min-height: 400px;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
}
.tool-purpose-number {
  position: absolute;
  right: 20px;
  top: 17px;
  color: color-mix(in srgb, var(--accent) 26%, transparent);
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.7rem);
  line-height: 1;
}
.tool-purpose-card .eyebrow { position: relative; z-index: 1; padding-right: 70px; }
.tool-purpose-card h3 {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin-top: 34px;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
}
.tool-purpose-card > p { max-width: 660px; }
.tool-purpose-card ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 22px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}
.tool-purpose-card li {
  position: relative;
  padding-left: 17px;
  color: var(--muted);
  font-size: .8rem;
}
.tool-purpose-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 6px;
  height: 6px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}
.tool-purpose-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: auto;
}
.blog-standard-section { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

@media (max-width: 980px) {
  .catalogue-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reading-route-grid,
  .portfolio-collection-grid,
  .article-standard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tool-purpose-grid { grid-template-columns: 1fr; }
  .tool-purpose-card { min-height: 0; }
}
@media (max-width: 560px) {
  .catalogue-metrics,
  .reading-route-grid,
  .portfolio-collection-grid,
  .article-standard-grid { grid-template-columns: 1fr; }
  .catalogue-metrics article { padding: 16px 18px; }
  .reading-route-card,
  .portfolio-collection-card { min-height: 0; }
  .reading-route-card b,
  .portfolio-collection-card b { margin-top: 24px; }
  .tool-purpose-card ul { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .reading-route-card,
  .portfolio-collection-card { transition: none; }
}
