/* ---------- Tokens ---------- */
:root {
  --navy: #04123f;
  --navy-2: #0a1a55;
  --ink: #111a36;
  --ink-soft: #2c3653;
  --paper: #f5f6fb;
  --paper-2: #ebeff7;
  --paper-3: #ffffff;
  --rule: #d6dceb;
  --rule-soft: #e6ebf4;
  --muted: #5a647f;
  --accent: #2c5dd6;
  --accent-2: #1f48b8;
  --accent-soft: #d6e1fb;
  --grid: 1100px;
  --grid-wide: 1340px;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 2px 6px -2px rgba(4, 18, 63, 0.10);
  --shadow-md: 0 12px 32px -16px rgba(4, 18, 63, 0.22);
  --shadow-lg: 0 24px 48px -20px rgba(4, 18, 63, 0.32);
  --serif: "IBM Plex Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: clip; }
body { overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 12px; top: 12px;
  background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 3px;
  font-family: var(--sans); font-size: 0.9rem;
  transform: translateY(-150%);
  transition: transform .15s;
  z-index: 100;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Focus states ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hero a:focus-visible, .footer a:focus-visible, .section-dark a:focus-visible { outline-color: #fff; }
.btn:focus-visible { outline-offset: 3px; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "onum" 1;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--navy);
  font-weight: 600;
  margin: 0;
  overflow-wrap: break-word;
  text-wrap: balance;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "lnum" 1;
}
h1 {
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
}
h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.85rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
}
h3 {
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  line-height: 1.22;
  letter-spacing: -0.012em;
}
h4 {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--sans);
}
p {
  margin: 0 0 1em;
  text-wrap: pretty;
}
p:last-child { margin-bottom: 0; }
em, i { font-style: italic; }
strong { font-weight: 600; color: var(--navy); }

.lede {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  line-height: 1.4;
  color: var(--ink-soft);
  text-wrap: pretty;
  letter-spacing: -0.005em;
}
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
  display: inline-block;
}
.serif-italic { font-style: italic; color: var(--navy); }

code { font-family: var(--mono); font-size: 0.92em; background: var(--paper-2); padding: 2px 5px; border-radius: 3px; }
.section-dark code { background: rgba(255,255,255,0.10); color: #e7ecff; }

a { text-decoration: none; }
.prose { line-height: 1.6; }
.prose p { color: var(--ink-soft); }
.prose strong { color: var(--navy); }
.prose a {
  color: var(--accent);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft));
  transition: background-size .25s var(--ease-out), color .15s;
}
.prose a:hover {
  color: var(--accent-2);
  background-image: linear-gradient(var(--accent), var(--accent));
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--grid); margin: 0 auto; padding: 0 32px; }
.wrap-wide { max-width: var(--grid-wide); margin: 0 auto; padding: 0 32px; }
.section { padding: 128px 0; }
.section-tight { padding: 80px 0; }
.section-dark {
  background:
    radial-gradient(80% 60% at 10% 0%, rgba(44, 93, 214, 0.20), transparent 60%),
    var(--navy);
  color: #f0f4ff;
}
.section-dark h1, .section-dark h2, .section-dark h3 { color: #fff; }
.section-soft { background: var(--paper-2); }

hr.rule { border: 0; height: 1px; background: var(--rule); margin: 32px 0; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.nav.is-scrolled {
  border-bottom-color: var(--rule);
  box-shadow: 0 1px 0 rgba(4, 18, 63, 0.04), 0 8px 24px -16px rgba(4, 18, 63, 0.18);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 32px; max-width: var(--grid-wide); margin: 0 auto; }
.nav-brand { font-family: var(--serif); font-weight: 600; color: var(--navy); font-size: 1.02rem; display: flex; align-items: center; gap: 12px; letter-spacing: -0.005em; }
.nav-brand svg { width: 26px; height: 26px; transition: transform .4s var(--ease-out); }
.nav-brand:hover svg { transform: rotate(-12deg); }
.nav-links { display: flex; gap: 28px; font-family: var(--sans); font-size: 0.92rem; color: var(--navy); font-weight: 500; }
.nav-links a {
  padding: 8px 0;
  position: relative;
  color: var(--ink-soft);
  transition: color .2s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--navy); }
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 0; right: 0;
  height: 1px;
  background: var(--navy);
  opacity: 0;
  transform: scaleY(0.6);
  transform-origin: bottom;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.nav-links a:hover::after, .nav-links a.is-active::after {
  opacity: 0.55;
  transform: scaleY(1);
}
.nav-links a.is-active::after { opacity: 0.8; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--navy); cursor: pointer; border-radius: var(--radius-sm); }
.nav-toggle:hover { background: var(--paper-2); }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; flex-direction: column; gap: 0; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 8px 24px 16px; }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .nav-links a:last-child { border-bottom: 0; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(120% 80% at 100% 100%, rgba(44, 93, 214, 0.22), transparent 60%),
    radial-gradient(80% 60% at 0% 0%, rgba(199, 210, 245, 0.10), transparent 55%),
    var(--navy);
  color: #e7ecff;
  position: relative;
  overflow: hidden;
  padding: 144px 0 128px;
}
.hero h1 { color: #fff; max-width: 18ch; letter-spacing: -0.025em; }
.hero p.tagline {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
  color: rgba(199, 210, 245, 0.9);
  margin-top: 16px;
  letter-spacing: -0.005em;
}
.hero .lede { color: rgba(212, 220, 246, 0.92); }
.hero .venn-deco {
  position: absolute; right: -32px; bottom: -32px; width: clamp(320px, 44vw, 600px); opacity: 0.9;
  pointer-events: none;
  animation: ventle 18s ease-in-out infinite alternate;
}
.hero .venn-deco .venn circle { stroke-width: 1.2; }
.hero .venn-deco .venn line { stroke-width: 1.2; opacity: 1; }
@keyframes ventle {
  0%   { transform: translate3d(0, 0, 0) rotate(0); }
  100% { transform: translate3d(-8px, -6px, 0) rotate(-3deg); }
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; font-family: var(--sans); font-size: 0.92rem; color: #c7d2f5; }
.hero-meta .pill {
  border: 1px solid rgba(199, 210, 245, 0.28);
  background: rgba(199, 210, 245, 0.04);
  padding: 7px 14px; border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0;
}
.hero-cta { margin-top: 44px; display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 500;
  padding: 13px 22px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent;
  letter-spacing: -0.005em;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
  will-change: transform;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: #fff; color: var(--navy);
  box-shadow: 0 1px 0 rgba(4, 18, 63, 0.04), 0 4px 12px -6px rgba(4, 18, 63, 0.24);
}
.btn-primary:hover { background: var(--accent-soft); color: var(--accent-2); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.32); }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.06); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }

/* ---------- Venn Mark ---------- */
.venn { width: 100%; height: auto; }
.venn circle { fill: none; stroke: currentColor; stroke-width: 1.4; }
.venn .center { fill: var(--accent-soft); stroke: none; }
.venn-deco .venn circle { stroke: rgba(199, 210, 245, 0.7); }
.venn-deco .venn .center { fill: rgba(199, 210, 245, 0.35); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 26px 26px 24px;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .2s;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--rule));
}
/* When the card-media is a saturated logo (Static / Loom / Emojio), the soft drop
   shadow gets absorbed by the colored background. A thin navy ring lifts cleanly. */
.card.is-featured:has(.card-media--logo):hover {
  box-shadow: 0 0 0 1px var(--navy), 0 12px 32px -18px rgba(4, 18, 63, 0.28);
}

/* Card media: optional image at the top of a card */
.card-media {
  margin: -26px -26px 6px;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--paper-2);
  position: relative;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s var(--ease-out);
}
.card:hover .card-media img {
  transform: scale(1.04);
}
.card-media--logo {
  background: var(--paper-2);
}
.card-media--logo img {
  object-fit: contain;
  padding: 22px;
}
.card:hover .card-media--logo img {
  transform: scale(1.06);
}
.card-media--ink {
  background:
    radial-gradient(80% 60% at 20% 20%, rgba(44, 93, 214, 0.32), transparent 60%),
    var(--navy);
}
.card.is-featured .card-media {
  background: #fff;
}

/* Typographic title-card variant for projects without a strong photo asset */
.card-media--type {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 28px;
  background:
    linear-gradient(135deg, var(--paper-2) 0%, color-mix(in srgb, var(--paper-2) 70%, #fff) 100%);
  position: relative;
}
.card-media--type::before,
.card-media--type::after {
  content: "";
  position: absolute;
  background: var(--accent-soft);
  opacity: 0.55;
}
.card-media--type::before {
  top: 14px; left: 14px;
  width: 26px; height: 1.5px;
}
.card-media--type::after {
  bottom: 14px; right: 14px;
  width: 26px; height: 1.5px;
}
.card-media-title {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--navy);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
  max-width: 14ch;
}
.card-media--ink .card-media-title {
  color: #fff;
}
.card-media--type.card-media--ink {
  background:
    radial-gradient(80% 60% at 30% 20%, rgba(44, 93, 214, 0.32), transparent 60%),
    var(--navy);
}
.card-media--type.card-media--ink::before,
.card-media--type.card-media--ink::after {
  background: rgba(199, 210, 245, 0.4);
}
.card .tag {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.card h3 {
  font-size: 1.22rem;
  letter-spacing: -0.012em;
  line-height: 1.2;
}
.card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}
.card .meta {
  margin-top: auto;
  padding-top: 12px;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.card.is-featured {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 55%, #fff), #fff 75%);
  border-color: color-mix(in srgb, var(--accent) 18%, var(--rule));
}
.card a.stretched::after { content: ""; position: absolute; inset: 0; }

/* ---------- Project detail ---------- */
.project-hero {
  background:
    linear-gradient(180deg, var(--paper-2) 0%, color-mix(in srgb, var(--paper-2) 50%, var(--paper)) 100%);
  padding: 120px 0 96px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.project-hero .eyebrow { margin-bottom: 18px; }
.project-hero h1 { max-width: 18ch; }
.project-hero .lede { max-width: 60ch; margin-top: 20px; color: var(--ink-soft); }
.project-meta {
  display: flex; flex-wrap: wrap; gap: 28px 40px;
  margin-top: 40px;
  font-family: var(--sans); font-size: 0.94rem;
  color: var(--ink-soft);
}
.project-meta div { max-width: 30ch; }
.project-meta div span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 6px;
}

/* Project hero stat — single hero number with a phrase of context */
.project-hero-stat {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--rule);
  max-width: 64ch;
}
.project-hero-stat-num {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5.2vw, 4.4rem);
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.022em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "kern" 1, "lnum" 1, "tnum" 1;
  margin: 0 0 10px;
}
.project-hero-stat-lbl {
  font-family: var(--sans);
  font-size: 0.96rem;
  color: var(--ink-soft);
  line-height: 1.5;
  letter-spacing: 0.005em;
  max-width: 56ch;
}
@media (max-width: 600px) {
  .project-hero-stat { margin-top: 28px; padding-top: 20px; }
  .project-hero-stat-num { font-size: clamp(2.1rem, 9vw, 3.2rem); }
  .project-hero-stat-lbl { font-size: 0.9rem; }
}

.pis { display: grid; grid-template-columns: 1fr; gap: 36px; }
@media (min-width: 860px) { .pis { grid-template-columns: repeat(3, 1fr); gap: 48px; } }
.pis-block {
  border-top: 2px solid var(--navy);
  padding-top: 22px;
  position: relative;
}
.pis-block::before {
  content: ""; position: absolute; top: -2px; left: 0;
  width: 36px; height: 2px; background: var(--accent);
}
.pis-block h3 {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 14px;
}
.pis-block p { color: var(--ink); line-height: 1.55; }

/* ---------- Pull quote ---------- */
.pullquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2.1vw, 1.55rem);
  line-height: 1.4;
  color: var(--navy);
  border-left: 2px solid var(--accent);
  padding: 6px 0 6px 24px;
  margin: 36px 0;
  max-width: 56ch;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}
.pullquote cite {
  display: block;
  margin-top: 14px;
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ---------- Image blocks ---------- */
.fig { margin: 0; }
.fig img {
  width: 100%; height: auto;
  border: 1px solid var(--rule);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.fig figcaption {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.4;
  max-width: 60ch;
}

/* Image placeholder — shown when the <img> inside fails to load.
   Drop a real file at the path shown to replace the placeholder. */
.fig[data-empty] {
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(45deg,
      var(--paper-3) 0 14px,
      var(--paper-2) 14px 28px);
  border: 1.5px dashed var(--rule);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  overflow: hidden;
  padding: 16px;
}
.fig[data-empty]::before {
  content: "Drop image at " attr(data-empty);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--paper);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  max-width: 90%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fig[data-empty="square"],
.fig.fig-square[data-empty] { aspect-ratio: 1 / 1; min-height: 280px; }
.fig[data-empty="portrait"],
.fig.fig-portrait[data-empty] { aspect-ratio: 3 / 4; min-height: 320px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.gallery img { aspect-ratio: 4/3; object-fit: cover; }

.split { display: grid; gap: 36px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1.2fr; gap: 56px; } }
.split.is-reverse > :first-child { order: 2; }
@media (max-width: 859px) { .split.is-reverse > :first-child { order: initial; } }

.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin: 32px 0; }
.metric {
  background: #fff;
  border: 1px solid var(--rule);
  padding: 22px;
  border-radius: var(--radius);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .2s;
}
.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--rule));
}
.metric .num {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "kern" 1, "lnum" 1, "tnum" 1;
  display: block;
}
.metric .lbl { font-family: var(--sans); font-size: 0.86rem; color: var(--muted); margin-top: 8px; line-height: 1.4; display: block; }

/* ---------- Throughlines (About) ---------- */
.throughlines { display: grid; grid-template-columns: 1fr; gap: 36px; }
@media (min-width: 860px) { .throughlines { grid-template-columns: repeat(3, 1fr); } }
.throughline {
  border-top: 2px solid var(--navy);
  padding-top: 24px;
  position: relative;
}
.throughline::before {
  content: ""; position: absolute; top: -2px; left: 0;
  width: 36px; height: 2px; background: var(--accent);
}
.throughline h3 {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  font-size: 1.18rem;
  letter-spacing: -0.012em;
}
.throughline-icon { color: var(--accent); width: 22px; height: 22px; flex-shrink: 0; }
.throughline p { color: var(--ink-soft); line-height: 1.55; }

/* ---------- Beliefs (About) ---------- */
.beliefs {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.belief {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 36px 48px;
  align-items: start;
}
.belief h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.18rem;
  color: var(--navy);
  letter-spacing: -0.014em;
  line-height: 1.22;
  text-wrap: balance;
  margin: 0;
}
.belief p {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
  text-wrap: pretty;
}
@media (max-width: 720px) {
  .belief {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 18px 0;
  }
}

/* ---------- Quote wall ---------- */
.quotes { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 860px) { .quotes { grid-template-columns: repeat(2, 1fr); } }
.quote-card {
  background: #fff;
  border: 1px solid var(--rule);
  padding: 24px;
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .25s var(--ease-out);
}
.quote-card:hover {
  border-color: color-mix(in srgb, var(--accent) 18%, var(--rule));
  box-shadow: var(--shadow-sm);
}
.quote-card p {
  font-size: 0.98rem;
  color: var(--ink);
  line-height: 1.55;
  margin: 0;
  font-style: italic;
}
.quote-card .who {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
  font-style: normal;
}

/* ---------- Awards list ---------- */
.awards { display: grid; grid-template-columns: 1fr; gap: 36px; }
@media (min-width: 720px) { .awards { grid-template-columns: repeat(3, 1fr); } }
.awards h4 { margin-bottom: 18px; color: var(--navy); }
.award-item { padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
.award-item:first-child { padding-top: 0; }
.award-item:last-child { border-bottom: 0; }
.award-item .title { font-weight: 600; color: var(--navy); font-size: 1rem; line-height: 1.3; }
.award-item .sub { font-family: var(--sans); font-size: 0.84rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* ---------- Footer ---------- */
.footer {
  background:
    radial-gradient(70% 60% at 100% 0%, rgba(44, 93, 214, 0.18), transparent 60%),
    var(--navy);
  color: #c7d2f5;
  padding: 88px 0 52px;
  margin-top: 120px;
}
.footer h2 { color: #fff; margin-bottom: 18px; letter-spacing: -0.018em; }
.footer p { color: rgba(199, 210, 245, 0.85); }
.footer .footer-grid { display: grid; gap: 36px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer .footer-grid { grid-template-columns: 1.4fr 1fr; gap: 48px; } }
.footer a {
  color: #fff;
  background-image: linear-gradient(rgba(255,255,255,0.3), rgba(255,255,255,0.3));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-image .2s;
}
.footer a:hover { background-image: linear-gradient(#fff, #fff); }
.footer .colophon {
  margin-top: 72px;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: rgba(199, 210, 245, 0.55);
  letter-spacing: 0.005em;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin-bottom: 10px; line-height: 1.4; }

/* ---------- Availability banner ---------- */
.avail {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(108, 240, 154, 0.08);
  color: #d4e9da;
  padding: 7px 16px 7px 14px; border-radius: 999px;
  font-family: var(--sans); font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  border: 1px solid rgba(108, 240, 154, 0.22);
}
.avail .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6cf09a;
  box-shadow: 0 0 0 4px rgba(108, 240, 154, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(108, 240, 154, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(108, 240, 154, 0.10); }
}

/* ---------- Photo grid (About) ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: 32px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; border: 1px solid var(--rule); }
.photo-grid figcaption { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin-top: 8px; }

/* ---------- Page header (non-hero pages) ---------- */
.page-header { padding: 112px 0 48px; }
.page-header .eyebrow { margin-bottom: 14px; }
.page-header h1 { max-width: 22ch; letter-spacing: -0.025em; }
.page-header p {
  color: var(--ink-soft);
  max-width: 60ch;
  margin-top: 20px;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* ---------- Misc ---------- */
.kicker {
  font-family: var(--serif);
  font-style: italic;
  color: var(--navy);
  font-size: 1.08rem;
  letter-spacing: -0.005em;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list .tag { background: var(--paper-3); border: 1px solid var(--rule); padding: 4px 10px; border-radius: 999px; font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }

.back-link {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  transition: color .15s, gap .2s var(--ease-out);
}
.back-link:hover { color: var(--accent-2); gap: 10px; }

/* Breadcrumb — Home link, separator(s), current page name on one line.
   Used on every page except the home page. */
.breadcrumb {
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  margin: 0;
}
.breadcrumb a,
.breadcrumb [aria-current="page"],
.breadcrumb .sep {
  display: inline-block;
  line-height: 1.4;
}
.breadcrumb a {
  color: var(--accent);
  transition: color .15s;
}
.breadcrumb a:hover { color: var(--accent-2); }
.breadcrumb .sep {
  color: var(--muted);
  opacity: 0.55;
  user-select: none;
}
.breadcrumb [aria-current="page"] {
  color: var(--ink-soft);
}
.breadcrumb.on-dark a { color: rgba(199, 210, 245, 0.95); }
.breadcrumb.on-dark a:hover { color: #fff; }
.breadcrumb.on-dark .sep,
.breadcrumb.on-dark [aria-current="page"] { color: rgba(199, 210, 245, 0.65); }

/* ---------- Small-screen overrides ---------- */
@media (max-width: 600px) {
  h1 { font-size: clamp(1.7rem, 5.6vw, 4.6rem); }
  .hero { padding: 96px 0 80px; }
  .hero h1, .project-hero h1, .page-header h1 { max-width: 100%; }
  .hero .venn-deco { width: clamp(180px, 50vw, 280px); right: -30px; bottom: -30px; opacity: 0.45; }
  .hero-meta { gap: 10px; margin-top: 28px; }
  .hero-meta .pill { font-size: 0.82rem; padding: 5px 12px; }
  .hero-cta { margin-top: 32px; gap: 10px; }
  .hero-cta .btn { padding: 11px 18px; }
  .section { padding: 80px 0; }
  .section-tight { padding: 56px 0; }
  .project-hero { padding: 80px 0 64px; }
  .page-header { padding: 80px 0 36px; }
  .project-meta { gap: 18px; margin-top: 28px; }
  .footer { padding: 64px 0 40px; margin-top: 80px; }
  .nav-inner { padding: 12px 22px; }
  .wrap { padding: 0 22px; }
  .wrap-wide { padding: 0 22px; }
  .pis { gap: 28px; }
  .pis-block { padding-top: 18px; }
  .throughlines { gap: 28px; }
  .project-hero .lede { font-size: 1.02rem; }
  .pullquote { padding-left: 16px; }
  .quote-card, .card { padding: 24px; }
  .metric-row { gap: 14px; }
  .metric { padding: 20px; }
  .metric .num { font-size: 1.65rem; }
}

@media (max-width: 480px) {
  .nav-brand span { display: none; }
  .nav-brand svg { width: 30px; height: 30px; }
}

/* ---------- Card "Try it" link (sibling of .meta on cards) ---------- */
.card-meta-row {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.card-try {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color .15s;
}
.card-try:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.card-try:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- AI-assisted badge ---------- */
.ai-badge {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sans); font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  cursor: help;
  vertical-align: middle;
  appearance: none;
  transition: color .2s, border-color .2s, background .2s;
}
.ai-badge svg { opacity: 0.85; }
.ai-badge:hover {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 90%, transparent);
}
.ai-badge:hover svg { opacity: 1; }
.ai-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-badge svg { width: 12px; height: 12px; }
.ai-badge-tip {
  position: absolute; left: 50%; top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
  background: var(--navy); color: #fff;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 400;
  letter-spacing: 0; text-transform: none;
  padding: 8px 12px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 10;
  box-shadow: 0 8px 24px -8px rgba(0, 13, 61, 0.4);
}
.ai-badge-tip::before {
  content: ""; position: absolute;
  bottom: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: var(--navy);
}
.ai-badge:hover .ai-badge-tip,
.ai-badge:focus .ai-badge-tip,
.ai-badge:focus-visible .ai-badge-tip,
.ai-badge.is-active .ai-badge-tip,
.ai-badge:active .ai-badge-tip {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.ai-badge.is-corner {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  font-size: 0.66rem;
  padding: 3px 8px 3px 6px;
}
.ai-badge.is-corner .ai-badge-tip {
  left: auto; right: 0;
  transform: translateX(0) translateY(-4px);
}
.ai-badge.is-corner .ai-badge-tip::before {
  left: auto; right: 14px;
  transform: translateX(0);
}
.ai-badge.is-corner:hover .ai-badge-tip,
.ai-badge.is-corner:focus .ai-badge-tip,
.ai-badge.is-corner:focus-visible .ai-badge-tip,
.ai-badge.is-corner.is-active .ai-badge-tip,
.ai-badge.is-corner:active .ai-badge-tip {
  transform: translateX(0) translateY(0);
}
.ai-badge--dark {
  color: #d4e0fb;
  background: rgba(212, 224, 251, 0.14);
  border-color: rgba(212, 224, 251, 0.35);
}
.ai-badge--dark .ai-badge-tip {
  background: #fff; color: var(--navy);
}
.ai-badge--dark .ai-badge-tip::before {
  border-bottom-color: #fff;
}

/* ---------- AI brief trigger (in nav) ---------- */
.ai-brief-trigger {
  appearance: none;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 20px;
  transition: background .2s, border-color .2s, color .2s, transform .12s var(--ease);
  white-space: nowrap;
  order: 1;
}
.nav-links { order: 2; }
.nav-toggle { order: 3; }
.ai-brief-trigger:hover {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent-2);
}
.ai-brief-trigger:active { transform: translateY(1px); }
.ai-brief-trigger svg {
  width: 12px; height: 12px;
  opacity: 0.85;
}
.ai-brief-trigger:hover svg { opacity: 1; }
.ai-brief-trigger-label { line-height: 1; }

@media (max-width: 720px) {
  .ai-brief-trigger { padding: 6px 8px; margin-right: 10px; gap: 5px; font-size: 0.7rem; }
}
@media (max-width: 480px) {
  .ai-brief-trigger {
    padding: 6px;
    margin-right: 8px;
    width: 30px; height: 30px;
    justify-content: center;
    gap: 0;
  }
  .ai-brief-trigger-label { display: none; }
  .ai-brief-trigger svg { width: 13px; height: 13px; }
}

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 18, 63, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease);
}
.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--paper);
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  /* fixed height + cap so the modal doesn't jitter when intros/preview swap on tab change */
  height: 720px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.98);
  transition: transform .25s var(--ease-out);
}
.modal-backdrop.is-open .modal { transform: translateY(0) scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--rule);
  background: #fff;
  flex-shrink: 0;
}
.modal-header h2 {
  font-size: 1.2rem;
  margin: 0;
  letter-spacing: -0.014em;
}
.modal-header .eyebrow { display: block; margin-bottom: 2px; }
.modal-close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.modal-close:hover {
  color: var(--navy);
  border-color: var(--navy);
  background: var(--paper-2);
}
.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.modal-tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 12px 14px 10px;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--sans);
  text-align: left;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: color .15s;
  border-radius: 0;
  margin-bottom: -1px;
}
.modal-tab:hover { color: var(--ink); }
.modal-tab .modal-tab-key {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: inherit;
}
.modal-tab .modal-tab-sub {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.modal-tab.is-active {
  color: var(--navy);
}
.modal-tab.is-active .modal-tab-sub { color: var(--accent); }
.modal-tab.is-active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.modal-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 2px;
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* allow children (preview) to scroll, not push the modal */
}
.modal-intro {
  font-family: var(--serif);
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 14px;
  max-width: 64ch;
}
.modal-intro strong { color: var(--navy); }
.modal-preview {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-soft);
  /* fixed height so the preview never grows/shrinks on tab switch — content scrolls internally */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0;
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap; /* never wrap — wrapping would change actions row height */
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--rule);
  background: #fff;
  flex-shrink: 0;
}
.modal-actions .meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-actions .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions .btn { padding: 10px 18px; font-size: 0.9rem; }
.btn-dark.is-copied {
  background: #2ea860;
}

.modal-toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--navy);
  color: #fff;
  font-family: var(--sans); font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease-out);
  z-index: 300;
}
.modal-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .modal-backdrop { padding: 12px; }
  .modal { max-height: calc(100vh - 24px); border-radius: var(--radius); }
  .modal-header, .modal-actions { padding: 14px 18px; }
  .modal-tabs { padding: 0 18px; }
  .modal-tab { padding: 10px 10px 8px; }
  .modal-tab .modal-tab-key { font-size: 0.78rem; }
  .modal-tab .modal-tab-sub { font-size: 0.66rem; }
  .modal-body { padding: 16px 18px; }
  .modal-preview { font-size: 0.75rem; }
}

.affiliations { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 720px) { .affiliations { grid-template-columns: repeat(2, 1fr); } }
.affil {
  background: #fff;
  border: 1px solid var(--rule);
  padding: 26px;
  border-radius: var(--radius);
  transition: transform .25s var(--ease-out), border-color .2s, box-shadow .25s var(--ease-out);
}
.affil:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--rule));
  box-shadow: var(--shadow-sm);
}
.affil h3 { font-size: 1.18rem; margin-bottom: 4px; letter-spacing: -0.012em; }
.affil p { color: var(--muted); margin: 0 0 12px; font-size: 0.95rem; line-height: 1.5; }
.affil a { font-family: var(--sans); font-size: 0.86rem; color: var(--accent); font-weight: 500; }
.affil a:hover { color: var(--accent-2); }
