/* v8 "Soft Field" — v7 with a dots-only animated background. Based on v7 "Latent Paper": v3/v6 structure and colors, set in v2's Newsreader + IBM Plex Mono,
   with v2's figure plates. Plain CSS, no build step. */

/* ---------- Tokens ---------- */
:root {
  --bg: #f7f7f3;
  --bg-2: #efefe9;
  --surface: #fbfbf8;
  --text: #11151d;
  --text-2: #252b35;          /* reading text: darker than before so light mode doesn't look washed out */
  --muted: #4a5262;
  --line: rgba(17, 21, 29, .13);
  --line-2: rgba(17, 21, 29, .26);
  --w-read: 450;              /* Newsreader is thin at 400 on light backgrounds */
  --accent: #06716a;
  --accent-ink: #ffffff;
  --glow: rgba(6, 113, 106, .22);
  --g-node: #8f97a3;
  --art-ln: #5d6675;
  --art-faint: #bcc1c8;
  --art-node: #9aa1ab;
  --veil: rgba(247, 247, 243, .78);
  --halo: none;
  --halo-lg: none;
  --dot-glow: none;
  --shadow: 0 1px 0 rgba(17, 21, 29, .04), 0 24px 48px -32px rgba(17, 21, 29, .25);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131314; --bg-2: #18181a; --surface: #1d1d1f;          /* neutral charcoal, not blue */
    --text: #ecebe8; --text-2: #c4c2bd; --muted: #93918b; --w-read: 400;
    --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .15);
    --accent: #7fc4b5; --accent-ink: #102522; --glow: rgba(127, 196, 181, .16); /* muted sage-teal */
    --g-node: #8c8a85; --art-ln: #a5a39d; --art-faint: #3b3b3e; --art-node: #5e5d59;
    --veil: rgba(19, 19, 20, .8);
    --halo: none; --halo-lg: none; --dot-glow: none;          /* no neon glows */
    --shadow: 0 0 0 1px rgba(255, 255, 255, .03), 0 24px 48px -28px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131314; --bg-2: #18181a; --surface: #1d1d1f;          /* neutral charcoal, not blue */
  --text: #ecebe8; --text-2: #c4c2bd; --muted: #93918b; --w-read: 400;
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .15);
  --accent: #7fc4b5; --accent-ink: #102522; --glow: rgba(127, 196, 181, .16); /* muted sage-teal */
  --g-node: #8c8a85; --art-ln: #a5a39d; --art-faint: #3b3b3e; --art-node: #5e5d59;
  --veil: rgba(19, 19, 20, .8);
  --halo: none; --halo-lg: none; --dot-glow: none;          /* no neon glows */
  --shadow: 0 0 0 1px rgba(255, 255, 255, .03), 0 24px 48px -28px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

:root {
  --serif: Newsreader, "Iowan Old Style", "Palatino Linotype", Georgia, serif; /* everything you read */
  --display: var(--serif);
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;  /* labels, dates, stacks */
  --gutter: clamp(16px, 4.5vw, 56px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: var(--w-read) 1.125rem/1.65 var(--serif); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 600; color: var(--text); }
h1, h2, h3, .sec-title, .contact-title { font-family: var(--display); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[tabindex="-1"]:focus { outline: none; }
a[data-target] { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 50; padding: .6rem 1rem;
  background: var(--accent); color: var(--accent-ink); font: 500 .8rem var(--mono); border-radius: 6px;
}
.skip:focus { top: 16px; }

/* Underlined text link */
.ul {
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px; transition: background-size .35s var(--ease), color .2s;
}
.ul:hover { color: var(--accent); background-size: 100% 2px; }

/* ---------- Top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 20; height: 64px;
  display: flex; align-items: center; gap: 1.5rem; padding-inline: var(--gutter);
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
  /* solid by default (also without JS); JS adds .is-top while the page is scrolled to the very top */
  background: var(--veil); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
}
.bar.is-top { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.mark { display: inline-flex; align-items: center; gap: .65rem; font: 500 clamp(.76rem, .66rem + .22vw, .86rem)/1 var(--mono); letter-spacing: .02em; margin-right: auto; }
.mark svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mark svg circle { fill: var(--bg); }
.mark span { transition: opacity .3s, transform .3s var(--ease); }
.bar.is-top .mark span { opacity: 0; transform: translateX(-6px); }
.nav { display: flex; gap: clamp(1rem, 2vw, 2rem); font: 400 clamp(.74rem, .62rem + .25vw, .84rem)/1 var(--mono); }
.nav a { color: var(--muted); padding: .5rem 0; transition: color .2s; }
.nav a:hover, .nav a[aria-current] { color: var(--text); }
.nav a[aria-current] { box-shadow: 0 1px 0 var(--accent); }
.toggle {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.toggle:hover { border-color: var(--accent); color: var(--accent); }
.toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; grid-area: 1 / 1; }
.toggle .sun { display: none; }
.toggle[aria-pressed="true"] .sun { display: block; }
.toggle[aria-pressed="true"] .moon { display: none; }

/* ---------- Opening ---------- */
.intro {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(6.5rem, 13vh, 9.5rem) 0 clamp(7rem, 13vh, 9rem);   /* bottom: room for the "Projects" cue */
  border-bottom: 1px solid var(--line);
  /* the opening fills the first screen, its content centred, so Projects starts below the fold */
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
}
.intro > .intro-inner { width: 100%; }
/* small "Projects ↓" cue at the bottom of the opening */
.scroll-cue {
  position: absolute; left: 50%; bottom: clamp(1.4rem, 3.5vh, 2.4rem); transform: translateX(-50%);
  display: inline-flex; flex-direction: column; align-items: center; gap: .45rem;
  font: 500 .7rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  transition: color .2s;
}
.scroll-cue:hover { color: var(--accent); }
.scroll-cue svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; animation: cue-bob 2.4s var(--ease) infinite; }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); opacity: .65; } 50% { transform: translateY(5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue svg { animation: none; } }
@media (max-width: 899px), (max-height: 620px) { .intro { padding-bottom: clamp(3rem, 6vw, 5rem); } .scroll-cue { display: none; } } /* phones: the opening is already taller than the screen */
.field {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  color: var(--g-node); border: 0 solid var(--accent);
  opacity: 0; transition: opacity 1.6s ease;
}
.field.is-ready { opacity: 1; }
.intro::after { /* soft veil behind the text so the graph never fights it */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 60% at 22% 52%, color-mix(in srgb, var(--bg) 70%, transparent) 0%, transparent 75%),
    linear-gradient(to bottom, transparent 88%, var(--bg));
}
.intro-inner { display: grid; gap: 2.5rem; align-items: center; }
.name {
  font-size: clamp(2.4rem, 1.7rem + 2.2vw, 3.6rem);
  font-weight: 400; line-height: 1.08; letter-spacing: -.018em;
}
.role { margin-top: .55rem; font-size: clamp(1.15rem, 1rem + .5vw, 1.45rem); line-height: 1.35; color: var(--text-2); }
.bio { margin-top: clamp(1.3rem, 2.6vw, 1.8rem); max-width: 40em; }
.contact-title em { font-style: normal; color: inherit; }
/* text links with a small outline icon (Resume, GitHub, LinkedIn, Email) */
.ico-link { display: inline-flex; align-items: center; gap: .5rem; }
.ico-link svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); transition: color .2s; }
.ico-link:hover, .ico-link:hover svg { color: var(--accent); }
.ico-link:hover .ul { background-size: 100% 2px; }
@media (max-width: 420px) { ul.links { gap: .9rem 1.1rem; } .ico-link { gap: .4rem; } }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.8rem; font: 400 .8rem/1 var(--mono); }

/* Profile card: portrait, degree and links */
.intro-card { display: grid; justify-items: center; gap: 1.2rem; text-align: center; }
.card-edu { font-size: .98rem; line-height: 1.5; font-style: italic; color: var(--muted); }
.icon-links { display: flex; justify-content: center; gap: .6rem; }
.icon-links a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: var(--text-2); transition: color .2s, transform .25s var(--ease); }
.icon-links a:hover { color: var(--accent); transform: translateY(-2px); }
.icon-links svg { width: 26px; height: 26px; fill: currentColor; }
/* Circular portrait with an orbit */
.portrait { position: relative; width: clamp(120px, 30vw, 172px); aspect-ratio: 1; flex: none; margin: 18px; }
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; filter: saturate(.9) contrast(1.02); }
.portrait::before, .portrait::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.portrait::before { inset: -7px; border: 1px solid var(--accent); }
.portrait::after { inset: -18px; border: 1px dashed var(--line-2); }
@media (min-width: 900px) {
  .intro-inner { grid-template-columns: minmax(0, 1fr) minmax(270px, 320px); gap: clamp(3rem, 6vw, 6rem); align-items: start; }
  .intro-text { padding-top: clamp(1.5rem, 3vw, 2.5rem); } /* name sits level with the portrait */
}

/* ---------- Sections ---------- */
.sec { padding-block: clamp(4rem, 8vw, 7rem); }
.label {
  display: flex; align-items: baseline; gap: .8rem;
  font: 500 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.label .z { color: var(--accent); text-transform: none; letter-spacing: 0; font-size: .95rem; }
.label sub { font-size: .62em; vertical-align: -.25em; line-height: 0; }
.sec-head { display: grid; gap: 1rem; margin-bottom: clamp(2.2rem, 4.5vw, 3.5rem); }
/* Section heading: icon + title, with a short accent rule that fades out */
.sec-h {
  position: relative; display: flex; align-items: center; gap: .75rem; padding-bottom: 1rem;
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); font-weight: 500; line-height: 1.2; letter-spacing: -.01em; color: var(--text);
}
.sec-h svg { width: .85em; height: .85em; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sec-h::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: min(15rem, 70%); height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent) 55%, transparent);
}
.sec-title {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); font-weight: 400; line-height: 1.25; letter-spacing: -.01em; max-width: 30ch; text-wrap: balance;
}
.more { margin-top: clamp(2.5rem, 5vw, 4rem); font: 400 .78rem/1 var(--mono); }

/* About */
.prose { display: grid; gap: .9em; max-width: 44em; font-size: clamp(1.05rem, .98rem + .2vw, 1.15rem); line-height: 1.62; color: var(--text-2); font-weight: var(--w-read); }
.prose strong { font-weight: 600; color: var(--text); }
.prose p:last-child { color: var(--text); }
/* "Read more": the rest of the bio unfolds (height via grid rows, paragraphs rise in one after another) */
.bio-more { display: grid; grid-template-rows: 1fr; align-self: start; transition: grid-template-rows .6s var(--ease); }
.more-inner { display: grid; gap: .9em; min-height: 0; overflow: hidden; }
.more-inner > * { transition: opacity .5s var(--ease), transform .6s var(--ease); }
.more-inner > :nth-child(2) { transition-delay: .06s; } .more-inner > :nth-child(3) { transition-delay: .12s; } .more-inner > :nth-child(4) { transition-delay: .18s; }
.bio.is-folded .bio-more { grid-template-rows: 0fr; }
.bio.is-folded .more-inner > * { opacity: 0; transform: translateY(10px); transition-delay: 0s; }
.more-toggle { margin-top: .1em; transition: margin .6s var(--ease); }
.bio.is-folded .more-toggle { margin-top: -.45em; }
.more-toggle button { border: 0; padding: 0 0 2px; color: var(--text); font: 500 .74rem/1.4 var(--mono); letter-spacing: .04em; cursor: pointer;
  background-color: transparent; }
.more-toggle button::after { content: "\2193"; display: inline-block; margin-left: .4em; transition: transform .4s var(--ease); }
.more-toggle button[aria-expanded="true"]::after { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .bio-more, .more-inner > * { transition: none; } }
.bio.no-anim .bio-more, .bio.no-anim .more-inner > * { transition: none; }

/* Work */
.work { background: var(--bg-2); border-block: 1px solid var(--line); }
.projects { display: grid; gap: clamp(3.5rem, 7vw, 6rem); }
.project { display: grid; gap: 1.6rem; align-items: center; }
.project-media { margin: 0; min-width: 0; }
.project-art {
  position: relative; border-radius: 6px; overflow: hidden;
  display: grid; place-items: center; min-height: clamp(200px, 26vw, 340px); padding: clamp(1rem, 3vw, 2.2rem);
  background: var(--surface); /* plain panel, no dot grid */
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.project-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; font: 400 .7rem/1.4 var(--mono); color: var(--muted); letter-spacing: .02em; }
.idx { color: var(--accent); font-weight: 500; }
.project h3 {
  margin: .7rem 0 .6rem; font-size: clamp(1.4rem, 1.15rem + .8vw, 1.85rem); font-weight: 500; line-height: 1.2;
  letter-spacing: -.01em;
}
.project h3 a { display: inline; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size .4s var(--ease), color .2s; }
.project h3 a:hover { color: var(--accent); background-size: 100% 2px; }
.project h3 svg { display: inline-block; width: .5em; height: .5em; margin-left: .12em; vertical-align: .32em; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.project-desc { color: var(--text-2); max-width: 34em; font-size: clamp(1.08rem, 1rem + .25vw, 1.2rem); line-height: 1.55; }
.xref { font: 500 .8em var(--mono); color: var(--accent); }
.xref:hover { text-decoration: underline; }
.stack { margin-top: 1.1rem; font: 400 .68rem/1.7 var(--mono); color: var(--muted); }
@media (min-width: 900px) {
  .project { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 clamp(2rem, 4vw, 4rem); }
  .project-media { grid-column: 1 / span 6; }
  .project-text { grid-column: 8 / -1; }
  .project:nth-child(even) .project-media { grid-column: 7 / -1; grid-row: 1; }
  .project:nth-child(even) .project-text { grid-column: 1 / span 5; grid-row: 1; }
}

/* Figure plates (v2 line art; colors follow the theme) */
.plate { width: 100%; height: auto; color: var(--art-ln); transition: transform 1.2s var(--ease); }
.project:hover .plate { transform: scale(1.025); }
.plate .k, .plate .f, .plate .a { fill: none; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.plate .k { stroke: currentColor; }
.plate .f { stroke: var(--art-faint); }
.plate .a { stroke: var(--accent); stroke-width: 1.6; }
.plate .pg { fill: var(--surface); }
.plate .d { fill: var(--art-faint); }
.plate .a-d { fill: var(--accent); filter: var(--dot-glow); }
.plate .a-f { fill: var(--accent); opacity: .22; }
.plate .bead { fill: var(--surface); stroke: currentColor; stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.plate .bead-a { fill: var(--accent); stroke: var(--accent); }
.plate .node { fill: var(--surface); stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.plate .stop { fill: var(--surface); stroke: var(--accent); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.plate .p { fill: currentColor; opacity: .55; }
.plate .pa { fill: var(--accent); }
.plate text { font-family: var(--serif); fill: var(--muted); }
.plate .t { font-size: 15px; font-style: italic; }
.plate .ta { fill: var(--accent); }
.plate .s { text-anchor: start; }
.plate .tp { font: 600 11px var(--serif); letter-spacing: .1em; }
.plate .tm { font: 500 12px var(--mono); fill: currentColor; }
.plate .tn { font: 600 10px var(--mono); fill: var(--accent); }
.plate .tq { font: 500 italic 22px var(--serif); fill: var(--accent); }

/* Experience timeline */
.timeline { position: relative; }
.step { display: grid; grid-template-columns: minmax(0, 1fr); position: relative; padding: 0 0 3.2rem 2rem; }
.step::before { /* the glowing line */
  content: ""; position: absolute; left: 0; top: .5rem; bottom: -.5rem; width: 1px;
  background: linear-gradient(to bottom, var(--accent), color-mix(in srgb, var(--accent) 25%, transparent));
}
.step:last-child::before { background: linear-gradient(to bottom, var(--accent), transparent); bottom: 0; }
.step::after { /* node on the line */
  content: ""; position: absolute; left: -5px; top: .32rem; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--accent);
}
.when { font: 400 .72rem/1.6 var(--mono); color: var(--accent); margin-bottom: .6rem; letter-spacing: .02em; }
.what h3 { font-size: clamp(1.25rem, 1.1rem + .45vw, 1.5rem); font-weight: 500; line-height: 1.25; letter-spacing: -.005em; }
.where { margin: .45rem 0 .9rem; color: var(--muted); font-size: 1.05rem; font-style: italic; }
.what > p:not(.where):not(.stack):not(.note) { color: var(--text-2); max-width: 38em; }
.stack { margin-top: .9rem; }
.note { color: var(--text-2); font-size: .98rem; }
.timeline-edu .step::after { background: var(--accent); }
.timeline-edu .step { padding-bottom: 2.4rem; }
@media (min-width: 900px) {
  .timeline, #education .more { margin-left: 11rem; }
  .step { padding-left: 3rem; }
  .when { position: absolute; left: -11rem; top: .15rem; width: 9rem; text-align: right; margin: 0; }
}

/* Publications */
.pub { display: grid; gap: .8rem; padding-top: 2rem; border-top: 1px solid var(--line-2); }
.pub-year { font: 400 .72rem/1.6 var(--mono); color: var(--muted); }
.ref-n { color: var(--accent); margin-right: .35rem; }
.pub h3 { font-size: clamp(1.25rem, 1.08rem + .55vw, 1.55rem); font-weight: 500; line-height: 1.3; letter-spacing: -.005em; max-width: 34em; text-wrap: balance; }
.pub h3 a { transition: color .2s; }
.pub h3 a:hover { color: var(--accent); }
.pub-authors { margin-top: 1rem; color: var(--text-2); }
.pub-venue { color: var(--muted); }
.pub-links { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.6rem; margin-top: 1.4rem; font: 400 .72rem/1.4 var(--mono); }
.pub-links .ul { overflow-wrap: anywhere; }
.cite { font: inherit; color: var(--text); background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: .55rem .95rem; cursor: pointer; transition: border-color .2s, color .2s; }
.cite:hover { border-color: var(--accent); color: var(--accent); }
@media (min-width: 900px) { .pub { grid-template-columns: 11rem minmax(0, 1fr); gap: 0; } }


/* Contact */
.contact { padding-bottom: clamp(4rem, 8vw, 7rem); }
#experience { padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
#education { padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
#publications, .contact { padding-top: clamp(3rem, 6vw, 5rem); }
#publications .sec-head { margin-bottom: 2rem; }
.contact-title {
  margin-top: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); font-weight: 400; line-height: 1.25; letter-spacing: -.01em;
}
.contact-text { margin-top: .8rem; max-width: 42ch; font-size: clamp(1.05rem, 1rem + .25vw, 1.2rem); line-height: 1.6; color: var(--text-2); }
.email {
  display: inline-block; margin-top: 1.6rem; font: 400 clamp(.85rem, .78rem + .35vw, 1.05rem)/1.3 var(--mono); overflow-wrap: anywhere;
  padding-bottom: .4rem; border-bottom: 1px solid var(--accent); transition: color .2s, box-shadow .3s;
}
.email:hover { color: var(--accent); }
.contact .links { margin-top: 1.8rem; }
.foot { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 2rem; padding-block: 2rem 2.6rem; font: 400 .66rem/1.6 var(--mono); color: var(--muted); }

/* ---------- Scroll reveal (only when JS opts in, never for reduced motion) ---------- */
.reveal [data-reveal] { transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(28px); }
.reveal .project:not(.is-in) .project-art { transform: translateY(18px) scale(.985); }
.project-art { transition: transform 1.1s var(--ease); }

/* rule spans the content column only, not the gutters */
.foot::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--line); }
.stack .it { white-space: nowrap; }

@media (max-width: 600px) {
  .sec-title { max-width: none; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .bar.is-top .mark span { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- Project figure from a real image (e.g. PolyDatabase pipeline) ---------- */
/* No frame: the figure sits straight on the page. Clicking it opens the project's website. */
.project-art.has-photo { background: none; border: 0; box-shadow: none; border-radius: 0; padding: 0; min-height: 0; overflow: visible; }
.photo { display: block; width: 100%; border-radius: 6px; }
.photo img { display: block; width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.project:hover .photo img { transform: scale(1.015); }
/* Dark mode: the diagram has black text on a transparent background, so give it a soft light backing (no border) */
:root[data-theme="dark"] .photo { background: #e4e2dd; padding: clamp(.6rem, 1.6vw, 1rem); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .photo { background: #e4e2dd; padding: clamp(.6rem, 1.6vw, 1rem); } }

.project-links { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; margin-top: 1.1rem; font: 400 .78rem/1.4 var(--mono); }

/* Linked figures (e.g. the active-learning loop -> GitHub) */
.fig-link { display: block; width: 100%; }
.plate .ts { font: 400 10.5px var(--mono); fill: var(--muted); }
.plate .ts.acc { fill: var(--accent); }
.plate .al-runner { filter: var(--dot-glow); }
@media (prefers-reduced-motion: reduce) { .plate .al-runner { display: none; } }

/* System-diagram card (e.g. the active-learning workflow): a plain white card, like a printed diagram */
.project-art.is-card { background: #ffffff; border-color: transparent; padding: clamp(.9rem, 2.4vw, 1.8rem); }
:root[data-theme="dark"] .project-art.is-card { background: #e4e2dd; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .project-art.is-card { background: #e4e2dd; } }
.bbg { display: block; width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.project:hover .bbg { transform: scale(1.015); }
@media (prefers-reduced-motion: reduce) { .bbg .al-runner { display: none; } }

/* ---------- Experience: organization logo tiles ---------- */
.what-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .9rem; }
.what-head .where { margin: .2rem 0 0; }
.org-tile {
  flex: none; display: grid; place-items: center; width: 56px; height: 56px; padding: 9px;
  border-radius: 14px; background: #ffffff;
  box-shadow: 0 1px 2px rgba(17, 21, 29, .06), 0 6px 18px -8px rgba(17, 21, 29, .22);
  transition: transform .3s var(--ease);
}
.org-tile img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.step:hover .org-tile { transform: translateY(-2px); }
.org-lsu { background: #461d7c; padding: 0 9px; }          /* LSU purple, white wordmark */
.org-lsu img { width: 100%; filter: brightness(0) invert(1); }
.org-msu { padding: 8px; }
.org-orbbec { padding: 7px; }
/* line the timeline dot and the dates up with the middle of the tile */
@media (min-width: 900px) { /* desktop: dates sit beside the tile */
  .step::before { top: 28px; }
  .step::after { top: 23px; }
  .when { top: 20px; }
}
@media (max-width: 600px) { .org-tile { width: 48px; height: 48px; border-radius: 12px; } .org-lsu { padding: 0 7px; } }
/* Images that already read well on dark (e.g. app screenshots in phone frames): no light backing */
:root[data-theme="dark"] .photo.no-backing { background: none; padding: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .photo.no-backing { background: none; padding: 0; } }

/* ---------- Project slideshow (e.g. Mount Vernon: app screens + architecture) ---------- */
.carousel { width: 100%; }
.slides { display: grid; touch-action: pan-y; overflow: hidden; padding: 14px; margin: -14px; box-sizing: content-box; }
.slide {
  grid-area: 1 / 1; display: grid; place-items: center; min-width: 0;
  opacity: 0; visibility: hidden; transform: translateX(48px);
  transition: opacity .6s var(--ease), transform .8s var(--ease), visibility 0s linear .8s;
}
.slide { margin: 0; }
.slide.is-prev { transform: translateX(-48px); }
/* captioned slideshows (e.g. Orbbec RGB-D): the slides are cropped to one shape, the caption sits under each */
.carousel.has-captions .slides { aspect-ratio: auto; }
.carousel.has-captions .slide { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
/* an image on a figure card (card: true) keeps the card's padding in both themes */
:root .photo.slide-card { padding: clamp(.8rem, 2.2vw, 1.5rem); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .photo.slide-card { padding: clamp(.8rem, 2.2vw, 1.5rem); } }
.slide-cap { margin-top: .8rem; max-width: 62ch; font-size: .9rem; line-height: 1.55; color: var(--text-2); }
.cap-label { font: 500 .66rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); margin-right: .35rem; }
.slide.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .6s var(--ease), transform .8s var(--ease), visibility 0s; }
.carousel:not(.is-ready) .slide:not(:first-child), .carousel:not(.is-ready) .dots { display: none; } /* no JS: first slide only */
.slide .photo { width: 100%; }
.slide-card {
  display: block; width: 100%; padding: clamp(.8rem, 2.2vw, 1.5rem); border-radius: 12px;
  background: #ffffff; box-shadow: 0 1px 2px rgba(17, 21, 29, .05), 0 14px 34px -20px rgba(17, 21, 29, .35);
}
:root[data-theme="dark"] .slide-card { background: #e4e2dd; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slide-card { background: #e4e2dd; } }
.dots { display: flex; justify-content: center; gap: .2rem; margin-top: .8rem; }
.dot { display: grid; place-items: center; width: 30px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--line-2); transition: width .35s var(--ease), background .35s; }
.dot:hover::before { background: var(--muted); }
.dot[aria-selected="true"]::before { width: 24px; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .slide, .slide.is-active { transition: none; transform: none; } }

/* ---------- One frame for every project visual ----------
   Photos, diagrams and slideshow slides all sit in the same 16:10 box (contents scaled to fit, never cropped),
   so the projects line up and no single image dominates. */
.project-art:not(.has-photo), .photo, .slide-card {
  aspect-ratio: 16 / 10; min-height: 0;
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: stretch;
}
.project-art:not(.has-photo) > *, .fig-link > svg, .slide-card > svg, .photo > img { width: 100%; height: 100%; min-height: 0; }
.fig-link { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.photo > img { object-fit: contain; }

/* ---------- Licenses & certifications ---------- */
#certifications { padding-top: clamp(3rem, 6vw, 5rem); padding-bottom: clamp(2rem, 4vw, 3rem); }
#certifications .sec-head { margin-bottom: 2rem; }
.certs { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .certs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; } }
.cert {
  display: flex; flex-direction: column; gap: 1rem; padding: 1.4rem 1.4rem 1.3rem;
  border-radius: 14px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(17, 21, 29, .05), 0 14px 32px -24px rgba(17, 21, 29, .35);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.cert:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(17, 21, 29, .05), 0 20px 40px -24px rgba(17, 21, 29, .45); }
.cert-body { display: flex; flex-direction: column; flex: 1; }
.cert h3 { font-size: clamp(1.15rem, 1.05rem + .3vw, 1.3rem); font-weight: 500; line-height: 1.3; letter-spacing: -.005em; }
.cert .where { margin: .3rem 0 0; }
.cert-date { margin-top: .15rem; font: 400 .72rem/1.6 var(--mono); color: var(--muted); }
.cert-skills-label { color: var(--text-2); }
.cert-link {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .45rem; margin-top: auto;
  padding: .55rem .95rem; border-radius: 999px; border: 1px solid var(--line-2);
  font: 500 .74rem/1 var(--mono); color: var(--text); transition: border-color .2s, color .2s;
}
.cert .stack { margin: .55rem 0 1.15rem; }
.cert-link svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cert-link:hover { border-color: var(--accent); color: var(--accent); }
.org-deeplearning-ai { background: #ff4b5e; padding: 9px; }       /* DeepLearning.AI red, white mark */
.org-deeplearning-ai img { filter: brightness(0) invert(1); }
.org-ibm { padding: 0 4px; }
.org-google { padding: 12px; }
