/* ==========================================================================
   Andrew Spencer — site styles
   Palette taken from the wave-field colormap: deep cobalt to cyan to sodium.
   ========================================================================== */
@font-face { font-family: "Archivo"; src: url(assets/fonts/archivo-latin-wdth-normal.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Literata"; src: url(assets/fonts/literata-latin-opsz-normal.woff2) format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url(assets/fonts/literata-latin-opsz-italic.woff2) format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
:root {
  --ink: #0a1a44;
  --ink-deep: #071334;
  --panel: #0f235a;
  --panel-hi: #163071;
  --line: rgba(170, 195, 255, 0.16);
  --line-hi: rgba(170, 195, 255, 0.36);
  --text: #eaf0ff;
  --muted: #a6b5dd;
  --cyan: #63e6f2;
  --blue: #3a6cf0;
  --sun: #ffc94a;
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Literata", ui-serif, Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font: 400 1rem/1.55 var(--sans); font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
::selection { background: var(--sun); color: var(--ink); }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--sun); color: var(--ink); padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-hi); background: transparent; color: var(--text);
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
.btn:hover { border-color: var(--text); background: rgba(234, 240, 255, .06); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.btn-primary:hover { background: #ffd877; border-color: #ffd877; }
.btn-small { min-height: 36px; padding: 0 16px; font-size: .9rem; }
.btn-large { min-height: 54px; padding: 0 28px; font-size: 1.05rem; }
.text-link { color: var(--muted); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-hi); text-underline-offset: 4px; transition: color .2s, text-decoration-color .2s; }
.text-link:hover { color: var(--text); text-decoration-color: var(--sun); }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { background: rgba(10, 26, 68, .78); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-color: var(--line); }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-variation-settings: "wdth" 112; letter-spacing: -.01em; }
.mark img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px var(--cyan), 0 0 0 4px rgba(99, 230, 242, .14); transition: box-shadow .25s; }
.mark:hover img { box-shadow: 0 0 0 1.5px var(--sun), 0 0 0 5px rgba(255, 201, 74, .18); }
.topbar nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 28px); }
.topbar nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem; transition: color .2s; }
.topbar nav a:hover { color: var(--text); }
@media (max-width: 640px) {
  .mark span { display: none; }
  .topbar nav a[href="#about"], .topbar nav a[href="#services"] { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; align-items: center;
  padding: 120px var(--gutter) 96px;
  background: radial-gradient(120% 90% at 68% 50%, #10276a 0%, var(--ink) 58%);
  touch-action: pan-y;
}
#field { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.hero-copy { position: relative; max-width: 600px; pointer-events: none; }
.hero-copy a, .hero-copy button { pointer-events: auto; }
.hero-kicker { color: var(--cyan); font-weight: 600; font-size: 1rem; margin-bottom: 18px; }
.hero h1 {
  font-size: clamp(3.4rem, 9.2vw, 8.6rem); line-height: .86; font-weight: 800;
  font-variation-settings: "wdth" 125; letter-spacing: -.035em; margin-left: -.04em;
}
.hero h1 span { display: block; }
.hero h1 span + span { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.hero-lede { margin-top: 28px; font: 400 clamp(1.08rem, 1.5vw, 1.25rem)/1.6 var(--serif); color: #d7e0fb; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 32px; }
.hero-note {
  position: absolute; right: var(--gutter); bottom: 28px; max-width: 360px;
  font-size: .84rem; line-height: 1.5; color: var(--muted);
  padding-left: 14px; border-left: 2px solid var(--sun);
}
.hero-note strong { color: var(--text); font-weight: 600; }
.hero-note p { margin: 0; }
.note-points { display: none; }
.points-mode .note-field { display: none; }
.points-mode .note-points { display: block; }
.field-toggle {
  margin-top: 10px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-hi);
  background: rgba(10, 26, 68, .6); color: var(--text); font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.field-toggle:hover { border-color: var(--sun); }
.field-toggle[aria-pressed="true"] { background: var(--sun); color: var(--ink); border-color: var(--sun); }
.hero-note em { font-style: normal; opacity: .8; }
.hint-touch { display: none; }
@media (hover: none) { .hint-pointer { display: none; } .hint-touch { display: inline; } }
@media (max-width: 900px) {
  .hero { align-items: start; padding-top: calc(min(92vw, 54svh) + 110px); padding-bottom: 48px; }
  .hero-note { position: relative; inset: auto; max-width: none; margin-top: 36px; }
}
.card:focus-visible { outline-offset: 4px; }
@media (max-width: 360px) { .hero h1 { font-size: 2.85rem; } }
@media (prefers-reduced-motion: reduce) { .hero-note .hint-pointer, .hero-note .hint-touch { display: none; } }

/* Page-load: one orchestrated reveal of the hero copy. */
@media (prefers-reduced-motion: no-preference) {
  .hero-kicker, .hero h1 span, .hero-lede, .hero-copy .hero-actions, .hero-note { animation: rise .9s var(--ease) both; }
  .hero h1 span:nth-child(1) { animation-delay: .08s; }
  .hero h1 span:nth-child(2) { animation-delay: .16s; }
  .hero-lede { animation-delay: .28s; }
  .hero-copy .hero-actions { animation-delay: .36s; }
  .hero-note { animation-delay: .9s; }
  #field { animation: fade 1.6s ease both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Sections ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 140px) var(--gutter) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); font-weight: 800; font-variation-settings: "wdth" 118; letter-spacing: -.03em; line-height: .95; }
.section-head p { color: var(--muted); font: 400 1.06rem/1.65 var(--serif); max-width: 36em; }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; } }

/* ---------- Bento cards ---------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(220px, auto); gap: 16px; }
.card {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 26px 26px 72px; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  transition: transform .35s var(--ease), border-color .25s, background .25s;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(99, 230, 242, .14), transparent 60%);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-hi); background: var(--panel-hi); }
.card:hover::before { opacity: 1; }
.card:active { transform: translateY(-1px) scale(.99); }
.card-meta { color: var(--cyan); font-size: .86rem; font-weight: 600; }
.card-title { font-size: clamp(1.35rem, 2vw, 1.7rem); font-weight: 700; font-variation-settings: "wdth" 108; line-height: 1.1; letter-spacing: -.015em; max-width: 16ch; }
.card-text { color: var(--muted); font-size: .98rem; line-height: 1.55; max-width: 34ch; }
.card-open {
  position: absolute; left: 26px; bottom: 22px; display: inline-flex; align-items: center; gap: 8px;
  font-size: .88rem; font-weight: 600; color: var(--text);
}
.card-open::before {
  content: ""; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-hi);
  background: no-repeat center/12px linear-gradient(var(--text), var(--text)) , no-repeat center/1.5px 12px linear-gradient(var(--text), var(--text));
  background-size: 12px 1.5px, 1.5px 12px;
  transition: transform .35s var(--ease), background-color .25s, border-color .25s;
}
.card:hover .card-open::before { transform: rotate(90deg); background-color: var(--sun); border-color: var(--sun);
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)); }

.card-waves { grid-column: span 3; grid-row: span 2; border-radius: 30px; min-height: 520px; }
.card-nimrod, .card-creative { grid-column: span 3; }
.card-teaching, .card-ions, .card-now { grid-column: span 2; }
.card-now { background: transparent; border-style: dashed; }
.card-now:hover { background: rgba(255, 201, 74, .05); border-color: var(--sun); }
.card-now .card-meta { color: var(--sun); }
@media (max-width: 1000px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-waves { grid-column: span 2; grid-row: auto; min-height: 480px; }
  .card-nimrod, .card-creative, .card-teaching, .card-ions { grid-column: span 1; }
  .card-now { grid-column: span 2; }
}
@media (max-width: 620px) {
  .bento { grid-template-columns: 1fr; }
  .card-waves, .card-nimrod, .card-creative, .card-teaching, .card-ions, .card-now { grid-column: auto; }
}

/* Card art */
.card-art { position: absolute; z-index: -1; pointer-events: none; }
.art-figure { right: -12%; bottom: -14%; width: 78%; aspect-ratio: 1; transition: transform .8s var(--ease); }
.art-figure img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-hi), 0 30px 80px -20px rgba(99, 230, 242, .35); }
.card-waves:hover .art-figure { transform: rotate(-8deg) scale(1.04); }
@media (max-width: 1000px) { .art-figure { width: 62%; right: -8%; bottom: -16%; } }
@media (max-width: 620px) { .art-figure { width: 86%; right: -24%; bottom: -26%; opacity: .7; } .card-waves { min-height: 440px; } }

.art-contours { right: -18px; bottom: -4px; width: 44%; opacity: .5; }
.card-nimrod .card-text { max-width: 30ch; }
.art-contours .contours ellipse { fill: none; stroke: var(--cyan); stroke-width: 1.1; transform-origin: 112px 60px; transition: transform .7s var(--ease); }
.art-contours .contours ellipse:nth-child(odd) { stroke: var(--blue); }
.art-contours .axis { stroke: var(--line-hi); fill: none; }
.card-nimrod:hover .contours ellipse:nth-child(2) { transform: translateX(-6px) scale(1.04); }
.card-nimrod:hover .contours ellipse:nth-child(3) { transform: translateX(-12px) scale(1.08); }
.card-nimrod:hover .contours ellipse:nth-child(4) { transform: translateX(-18px) scale(1.12); }
.card-nimrod:hover .contours ellipse:nth-child(5) { transform: translateX(-24px) scale(1.2); }

.art-pages { right: 26px; bottom: 22px; width: 130px; height: 96px; }
.art-pages i {
  --i: 0; position: absolute; right: 0; bottom: 0; width: 84px; height: 62px; border-radius: 4px 10px 10px 4px;
  background: #e9efff; border: 1px solid #b8c6ee; transform-origin: 0% 100%;
  transform: translateX(calc(var(--i) * -6px)) rotate(calc(var(--i) * -1deg));
  transition: transform .5s var(--ease); transition-delay: calc(var(--i) * 40ms);
}
.art-pages i::after { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); left: calc(14px + var(--i) * 12px); bottom: calc(8px + var(--b, 0px)); }
.art-pages i:nth-child(1) { --i: 4; --b: 0px; } .art-pages i:nth-child(2) { --i: 3; --b: 26px; } .art-pages i:nth-child(3) { --i: 2; --b: 36px; }
.art-pages i:nth-child(4) { --i: 1; --b: 26px; } .art-pages i:nth-child(5) { --i: 0; --b: 0px; }
.card-creative:hover .art-pages i { transform: translateX(calc(var(--i) * -22px)) rotate(calc(var(--i) * -7deg)); }

.art-equation { right: 22px; bottom: 16px; font: italic 300 2.4rem/1 var(--serif); color: var(--cyan); opacity: .35; transition: opacity .3s, transform .5s var(--ease); }
.art-equation sub { font-size: .5em; }
.card-teaching:hover .art-equation { opacity: .75; transform: translateY(-4px); }

.art-particles { right: 0; bottom: 0; width: 60%; height: 55%; }
.art-particles i { position: absolute; left: var(--x); top: var(--y); width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); opacity: .45; }
.art-particles i:nth-child(3n) { background: var(--sun); }
@media (prefers-reduced-motion: no-preference) {
  .card-ions:hover .art-particles i { animation: drift 1.6s linear infinite; animation-delay: calc(var(--d) * -1); }
}
@keyframes drift { from { transform: translateX(-30px); opacity: 0; } 30% { opacity: .8; } to { transform: translateX(60px); opacity: 0; } }

/* ---------- Publications ---------- */
.timeline-strip { margin: 0 0 28px; padding: 18px 20px 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--ink-deep); }
#strip { width: 100%; height: 96px; overflow: visible; }
#strip .axis, #strip .tick { stroke: var(--line-hi); }
#strip text { fill: var(--muted); font: 500 12px var(--sans); text-anchor: middle; }
#strip .pub circle { stroke: var(--ink-deep); stroke-width: 2; transition: r .2s, opacity .2s; cursor: pointer; }
#strip .pub .ring { fill: none; stroke: var(--sun); stroke-width: 1.5; }
#strip .pub-computing circle:not(.ring) { fill: var(--cyan); }
#strip .pub-plasma circle:not(.ring) { fill: var(--blue); }
#strip .pub-theory circle:not(.ring) { fill: #c9b3ff; }
#strip .pub:hover circle:not(.ring), #strip .pub:focus-visible circle:not(.ring) { r: 9; }
#strip .pub:focus-visible { outline: none; }
#strip .pub:focus-visible .ring, #strip .pub:focus-visible circle { stroke: var(--sun); }
#strip .pub.dim { opacity: .18; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 6px; font-size: .85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend .ring-key i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--sun); display: inline-block; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-computing { background: var(--cyan); } .dot-plasma { background: var(--blue); } .dot-theory { background: #c9b3ff; }

.archive-tools { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .92rem; font-weight: 500; cursor: pointer; transition: all .2s; }
.segmented button:hover { color: var(--text); border-color: var(--line-hi); }
.segmented button[aria-pressed="true"] { background: var(--text); color: var(--ink); border-color: var(--text); font-weight: 600; }
.search { position: relative; flex: 1 1 260px; max-width: 360px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.6; }
.search input { width: 100%; min-height: 44px; padding: 0 16px 0 42px; border-radius: 999px; border: 1px solid var(--line-hi); background: var(--ink-deep); color: var(--text); font: inherit; }
.search input::placeholder { color: #7f90bd; }
.search input:focus { outline: none; border-color: var(--sun); }
.paper-count { margin: 22px 0 6px; color: var(--muted); font-size: .9rem; }
.papers { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.paper {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 8px 24px; align-items: start;
  padding: 22px 14px; margin: 0 -14px; border-bottom: 1px solid var(--line);
  transition: background .25s;
}
.paper:hover { background: rgba(234, 240, 255, .04); }
.paper.flash { animation: flash 1.8s ease; }
@keyframes flash { 0%, 30% { background: rgba(255, 201, 74, .16); } }
.paper-year { font-weight: 700; font-variation-settings: "wdth" 115; color: var(--muted); font-size: 1.05rem; padding-top: 2px; }
.paper h3 { font: 500 1.12rem/1.4 var(--serif); }
.paper h3 a { text-decoration: none; background: linear-gradient(var(--sun), var(--sun)) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.paper h3 a:hover { background-size: 100% 1px; }
.paper-journal { margin-top: 6px; font-size: .92rem; color: var(--text); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.paper-authors { margin-top: 4px; font-size: .88rem; color: var(--muted); }
.paper-note { margin-top: 4px; font-size: .82rem; color: #8596c4; font-style: italic; }
.paper-authors strong { color: var(--text); font-weight: 600; }
.tag { font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--sun); color: var(--sun); }
.tag-open { border-color: var(--cyan); color: var(--cyan); }
.tag-thesis { border-color: #c9b3ff; color: #c9b3ff; }
.paper-links { display: flex; gap: 14px; padding-top: 3px; }
.paper-links a { font-size: .9rem; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-hi); text-underline-offset: 4px; }
.paper-links a:hover { color: var(--text); text-decoration-color: var(--sun); }
.empty { padding: 28px 0; color: var(--muted); }
@media (max-width: 700px) {
  .paper { grid-template-columns: 1fr; gap: 6px; }
  .paper-links { padding-top: 6px; }
}

/* ---------- Services ---------- */
.service-list { list-style: none; margin: 0 0 32px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.service-list li { padding: 24px 24px 8px 0; }
.service-list li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.service-list h3 { font-size: 1.12rem; font-weight: 700; font-variation-settings: "wdth" 108; margin-bottom: 8px; }
.service-list p { color: var(--muted); font-size: .97rem; line-height: 1.6; }
.availability { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; color: var(--text); font-family: var(--sans); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.availability i { width: 9px; height: 9px; border-radius: 50%; background: #5ee39b; box-shadow: 0 0 0 4px rgba(94, 227, 155, .18); }
@media (max-width: 1000px) { .service-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .service-list li:nth-child(3) { padding-left: 0; border-left: 0; } }
@media (max-width: 620px) { .service-list { grid-template-columns: 1fr; } .service-list li, .service-list li + li { padding: 20px 0 4px; border-left: 0; } .service-list li + li { border-top: 1px solid var(--line); } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.about-photo { position: sticky; top: 100px; }
.about-photo img { width: 100%; height: auto; border-radius: 26px; background: var(--panel); }
.about-photo::after { content: ""; position: absolute; inset: auto -14px -14px auto; width: 46%; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--sun); z-index: -1; }
.about-photo { isolation: isolate; }
.about-body h2 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); font-weight: 800; font-variation-settings: "wdth" 118; letter-spacing: -.03em; line-height: .95; margin-bottom: 28px; }
.prose p, .prose li { font: 400 1.08rem/1.72 var(--serif); color: #d5ddf7; }
.prose p + p { margin-top: 1em; }
.prose ul { padding-left: 1.2em; margin: 1.1em 0; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--sun); }
.prose h3 { font: 700 1.15rem/1.3 var(--sans); margin: 1.6em 0 .4em; }
.career { list-style: none; margin: 44px 0 0; padding: 0; border-left: 1px solid var(--line-hi); }
.career li { position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 2px 20px; padding: 0 0 22px 24px; }
.career li::before { content: ""; position: absolute; left: -5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); border: 1.5px solid var(--cyan); }
.career li:first-child::before { background: var(--sun); border-color: var(--sun); }
.when { color: var(--muted); font-size: .9rem; font-weight: 600; grid-row: span 2; padding-top: 1px; }
.what { font-weight: 700; font-size: 1.08rem; }
.where { color: var(--muted); font-size: .94rem; }
.toolkit { margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.toolkit div { background: var(--ink); padding: 16px 18px; }
.toolkit dt { color: var(--cyan); font-size: .84rem; font-weight: 600; margin-bottom: 4px; }
.toolkit dd { margin: 0; font-size: .96rem; }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { position: relative; top: 0; max-width: 420px; }
}
@media (max-width: 520px) {
  .career li { grid-template-columns: 1fr; }
  .when { grid-row: auto; }
  .toolkit { grid-template-columns: 1fr; }
}

/* ---------- Contact and footer ---------- */
.contact { max-width: var(--max); margin: clamp(96px, 12vw, 170px) auto 0; padding: 0 var(--gutter); }
.contact { display: grid; grid-template-columns: 1fr; gap: 32px; }
.contact .hero-actions { margin: 0; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.contact h2 { font-size: clamp(2rem, 4.6vw, 3.8rem); font-weight: 750; font-variation-settings: "wdth" 110; letter-spacing: -.025em; line-height: 1.02; max-width: 20ch; }
.footer { max-width: var(--max); margin: 96px auto 0; padding: 26px var(--gutter) 40px; display: flex; flex-wrap: wrap; gap: 12px 28px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.footer span { margin-right: auto; }
.footer a { text-decoration: none; } .footer a:hover { color: var(--text); }

/* ---------- Sheets (dialogs) ---------- */
.sheet {
  width: min(880px, calc(100vw - 24px)); max-height: calc(100svh - 32px); padding: clamp(28px, 4vw, 52px);
  border: 1px solid var(--line-hi); border-radius: 28px; background: #0d2054; color: var(--text);
  overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(4, 10, 30, .66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in .4s var(--ease); }
  .sheet[open]::backdrop { animation: fade .3s ease; }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
::view-transition-group(sheet) { animation-duration: .45s; animation-timing-function: var(--ease); }
::view-transition-old(sheet), ::view-transition-new(sheet) { height: 100%; object-fit: cover; }
.sheet-small { width: min(520px, calc(100vw - 24px)); }
.sheet-close { position: sticky; top: 0; float: right; margin: -14px -14px 0 12px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-hi); background: #0d2054; cursor: pointer; display: grid; place-items: center; z-index: 2; transition: background .2s, transform .3s var(--ease); }
.sheet-close:hover { background: var(--panel-hi); transform: rotate(90deg); }
.sheet-close svg { width: 18px; height: 18px; stroke: var(--text); stroke-width: 1.8; }
.sheet-meta { color: var(--cyan); font-weight: 600; font-size: .92rem; }
.sheet h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; font-variation-settings: "wdth" 112; letter-spacing: -.025em; margin: 10px 0 22px; }
.sheet .hero-actions { margin-top: 28px; }
.sheet-note { margin-top: 24px; font-size: .85rem; color: var(--muted); }
.sheet-figure { margin: 26px 0; }
.sheet-figure a { display: block; background: #fff; border-radius: 16px; padding: 12px; cursor: zoom-in; }
.sheet-figure img { width: 100%; height: auto; }
.sheet-figure figcaption { margin-top: 10px; font-size: .9rem; color: var(--muted); }


/* Contact form */
.contact-form { display: grid; gap: 14px; margin-top: 22px; }
.field { display: grid; gap: 6px; }
.field span { font-size: .9rem; font-weight: 600; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-hi);
  background: var(--ink-deep); color: var(--text); font: 400 1rem/1.5 var(--sans); resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255, 201, 74, .18); }
.field [aria-invalid="true"] { border-color: #ff8a7a; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile { min-height: 65px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.form-actions .btn:disabled { opacity: .6; cursor: progress; }
.form-status { font-size: .92rem; color: var(--muted); }
.form-status.is-error { color: #ffb4a8; }
.contact-sent h2 { color: var(--text); }
body.cv-page .field span { color: #33447a; }
body.cv-page .field input, body.cv-page .field textarea { background: #f4f7fd; color: #0f1d44; border-color: #b6c2e3; }
body.cv-page .form-status.is-error { color: #b42318; }

/* ==========================================================================
   Secondary pages: figures and CV
   ========================================================================== */
.page { max-width: 1100px; margin: 0 auto; padding: 40px var(--gutter) 80px; }
.page-back { display: inline-flex; margin-bottom: 40px; }
.page h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 800; font-variation-settings: "wdth" 118; letter-spacing: -.03em; line-height: .95; }
.page .lede { margin-top: 20px; max-width: 40em; font: 400 1.08rem/1.7 var(--serif); color: #d5ddf7; }
.published-figure { margin: 48px 0 0; }
.published-figure a { display: block; background: #fff; border-radius: 20px; padding: clamp(10px, 2vw, 24px); cursor: zoom-in; }
.published-figure img { width: 100%; height: auto; }
.published-figure figcaption { margin-top: 14px; max-width: 46em; color: var(--muted); font-size: .98rem; line-height: 1.6; }
.published-figure h2 { color: var(--text); font-size: 1.25rem; margin-bottom: 6px; }
.figure-credit { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; line-height: 1.7; max-width: 52em; }
.figure-credit a { color: var(--text); }

/* CV: a light, print-first document */
html:has(body.cv-page) { color-scheme: light; background: #eef2fb; }
body.cv-page { background: #eef2fb; color: #0f1d44; color-scheme: light; }
.cv { max-width: 860px; margin: 0 auto; padding: 32px var(--gutter) 80px; }
.cv-controls { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-bottom: 44px; font-size: .95rem; }
.cv-controls a, .cv-controls button { color: #33447a; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #b6c2e3; }
.cv-controls a:hover, .cv-controls button:hover { color: #0f1d44; text-decoration-color: #0f1d44; }
.cv-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; padding-bottom: 26px; border-bottom: 2px solid #0f1d44; }
.cv h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 800; font-variation-settings: "wdth" 120; letter-spacing: -.03em; line-height: .95; }
.cv-role { margin-top: 10px; font: 400 1.1rem var(--serif); color: #33447a; }
.cv-links { display: flex; flex-direction: column; gap: 4px; text-align: right; font-size: .92rem; }
.cv-links a, .cv-links button { color: #0f1d44; background: none; border: 0; padding: 0; text-align: right; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #b6c2e3; font: inherit; }
.cv section { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px 28px; padding: 26px 0; border-bottom: 1px solid #cfd8ee; }
.cv h2 { font-size: .98rem; font-weight: 700; color: #2a55d6; padding-top: 3px; }
.cv h3 { font-size: 1.04rem; font-weight: 700; display: flex; justify-content: space-between; gap: 16px; }
.cv h3 + p, .cv h3 + ul { margin-top: 4px; }
.cv .entry + .entry { margin-top: 18px; }
.cv-dates { font-weight: 500; color: #5a6894; white-space: nowrap; font-size: .92rem; }
.cv p, .cv li { font: 400 .98rem/1.6 var(--serif); color: #24335e; }
.cv ul { margin: 0; padding-left: 1.1em; }
.cv li { margin: .2em 0; }
.cv ol.cv-pubs { margin: 0; padding-left: 1.4em; }
.cv ol.cv-pubs li { margin-bottom: .6em; }
.cv ol.cv-pubs a { color: inherit; text-decoration-color: #b6c2e3; text-underline-offset: 3px; }
.cv-footnote { margin-top: 28px; font-size: .82rem; color: #5a6894; }
@media (max-width: 640px) {
  .cv-head { grid-template-columns: 1fr; } .cv-links { text-align: left; } .cv-links a, .cv-links button { text-align: left; }
  .cv section { grid-template-columns: 1fr; }
}
body.cv-page .sheet { background: #fff; color: #0f1d44; border-color: #cfd8ee; }
body.cv-page .sheet-close { background: #fff; border-color: #cfd8ee; }
body.cv-page .sheet-close svg { stroke: #0f1d44; }
body.cv-page body.cv-page .btn { color: #0f1d44; border-color: #b6c2e3; }
body.cv-page .btn-primary { background: #0f1d44; color: #fff; border-color: #0f1d44; }
body.cv-page .sheet p { color: #33447a; }
@media print {
  @page { margin: 16mm 14mm; }
  body.cv-page, html:has(body.cv-page) { background: #fff; }
  .cv { padding: 0; max-width: none; }
  .cv-controls, .no-print, dialog, .cv-links button { display: none !important; }
  .cv section { display: block; break-inside: auto; padding: 10px 0; }
  .cv section > h2 { margin-bottom: 6px; font-size: 11pt; }
  .cv .entry, .cv li, .cv h2, .cv h3 { break-inside: avoid; }
  .cv h2 { break-after: avoid; }
  .cv-head { padding-bottom: 14px; }
  .cv h1 { font-size: 26pt; }
  .cv h3 { font-size: 10.5pt; }
  .cv .entry + .entry { margin-top: 10px; }
  .cv li { margin: .1em 0; }
  .cv ol.cv-pubs li { margin-bottom: .3em; }
  .cv a { text-decoration: none; }
  .cv p, .cv li { font-size: 10pt; }
}
