/* ==========================================================
   Riaz Bhanbhro — personal academic website
   Palette inspired by soil strata: clay, sand, river-teal, ink.
   ========================================================== */
:root {
  --bg: #f2f6f5;
  --bg-2: #e3ecea;
  --surface: #ffffff;
  --ink: #0f2233;
  --ink-2: #2c4256;
  --muted: #5d7183;
  --line: #d3e0dd;
  --clay: #e06a1f;
  --clay-2: #f2913f;
  --sand: #f0b429;
  --teal: #1f8a70;
  --teal-2: #34b38a;
  --plum: #2b4c7e;
  --hero-bg: #133a55;
  --hero-ink: #eef5f4;
  --hero-grad: linear-gradient(160deg, #1a4d72 0%, #133a55 48%, #0f3d47 100%);
  --shadow: 0 1px 2px rgba(27, 26, 46, .06), 0 12px 32px -12px rgba(27, 26, 46, .18);
  --radius: 18px;
  --maxw: 1200px;
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1620; --bg-2: #0f2130; --surface: #122636; --ink: #e8f1f0; --ink-2: #c3d3d6;
    --muted: #8ea3b0; --line: #1f3a4c; --clay: #ff9a4d; --clay-2: #ffb877; --sand: #ffd166;
    --teal: #4fcf9f; --teal-2: #7de0b9; --plum: #8fb0e0; --hero-bg: #0e2a40; --hero-grad: linear-gradient(160deg, #12344f 0%, #0e2a40 50%, #0b2b30 100%);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -16px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1620; --bg-2: #0f2130; --surface: #122636; --ink: #e8f1f0; --ink-2: #c3d3d6;
    --muted: #8ea3b0; --line: #1f3a4c; --clay: #ff9a4d; --clay-2: #ffb877; --sand: #ffd166;
    --teal: #4fcf9f; --teal-2: #7de0b9; --plum: #8fb0e0; --hero-bg: #0e2a40; --hero-grad: linear-gradient(160deg, #12344f 0%, #0e2a40 50%, #0b2b30 100%);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -16px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
::selection { background: var(--sand); color: #1b1a2e; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* grain overlay */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- Progress bar ---------------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60;
  background: linear-gradient(90deg, #1d6fa3, #1f8a70, #f0b429, #e06a1f); }

/* ---------------- Nav ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .35s, box-shadow .35s, color .35s;
  color: var(--hero-ink);
}
.nav.solid, .nav.light-page {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line); color: var(--ink);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; }
.brand-mark { width: 42px; height: 42px; display: block; flex: none; filter: drop-shadow(0 6px 14px rgba(15, 60, 90, .35)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand-text { font-family: var(--serif); font-size: 19px; letter-spacing: -.01em; }
.brand-text small { display: block; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .65; margin-top: -2px; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; font-size: 14.5px; font-weight: 600; padding: 8px 12px; border-radius: 999px;
  opacity: .82; transition: opacity .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; transition: transform .2s, background .2s;
}
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); transform: rotate(-12deg); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
@media (max-width: 1020px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); color: var(--ink); padding: 12px 16px 20px; box-shadow: 0 20px 40px -20px rgba(0,0,0,.35);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .25s ease;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { display: block; padding: 12px 14px; font-size: 16px; }
}

/* ---------------- Buttons & chips ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px;
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; border: 0;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background .25s; font-family: var(--sans);
}
.btn svg { width: 18px; height: 18px; transition: transform .25s; }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--clay); color: #fff; box-shadow: 0 10px 30px -10px var(--clay); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px var(--clay); }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 35%, transparent); }
.btn-ghost:hover { background: color-mix(in srgb, currentColor 8%, transparent); transform: translateY(-2px); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chip-btn { cursor: pointer; transition: .2s; font-family: var(--sans); }
.chip-btn:hover { border-color: var(--clay); color: var(--clay); }
.chip-btn.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-btn .count { opacity: .6; font-weight: 700; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; background: var(--hero-grad); color: var(--hero-ink);
  overflow: hidden; display: flex; align-items: center; padding: 120px 0 200px;
  isolation: isolate;
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; z-index: -1; animation: float 14s ease-in-out infinite; }
.hero-glow.g1 { width: 520px; height: 520px; background: #2a7fc0; top: -140px; right: -80px; }
.hero-glow.g2 { width: 420px; height: 420px; background: #1f8a70; bottom: 40px; left: -120px; animation-delay: -5s; }
.hero-glow.g3 { width: 300px; height: 300px; background: #f2913f; top: 30%; left: 40%; opacity: .22; animation-delay: -9s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-40px) scale(1.08); } }
#contours { position: absolute; inset: 0; z-index: -1; opacity: .35; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 64px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } .hero { padding-top: 110px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sand);
}
.hero .eyebrow { color: #ffd166; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
.hero h1 {
  font-size: clamp(54px, 8.6vw, 116px); font-weight: 500; letter-spacing: -.035em; line-height: .95; margin: 22px 0 22px;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line span { display: inline-block; transform: translateY(105%); animation: rise 1s cubic-bezier(.2,.8,.2,1) forwards; }
.hero h1 .line:nth-child(2) span { animation-delay: .12s; }
.hero h1 em {
  font-style: italic; font-weight: 400;
  background: linear-gradient(100deg, #ffd166 5%, #ff9a4d 60%, #f2913f 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes rise { to { transform: none; } }
.hero-lede { font-size: clamp(18px, 2vw, 21px); max-width: 600px; color: rgba(246,241,231,.82); }
.rotator { display: inline-block; color: #fff; font-weight: 700; border-bottom: 2px solid #ff9a4d; min-width: 1ch; }
.rotator::after { content: "|"; margin-left: 2px; color: #f0c46b; animation: blink 1s steps(1) infinite; font-weight: 400; }
@keyframes blink { 50% { opacity: 0; } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero .btn-ghost { color: var(--hero-ink); }
.creds { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.creds span {
  font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); color: rgba(246,241,231,.9);
}
.fade-up { opacity: 0; transform: translateY(18px); animation: fadeUp .9s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* portrait */
.portrait { position: relative; justify-self: center; width: min(246px, 60vw); }
.portrait-frame {
  position: relative; border-radius: 220px 220px 28px 28px; overflow: hidden; aspect-ratio: 577 / 640;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.7); transform-style: preserve-3d; transition: transform .2s ease-out;
  background: #1b3a52;
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: saturate(.95) contrast(1.03); }
.portrait-frame::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, transparent 60%, rgba(10,30,45,.5)); pointer-events: none;
}
.portrait-ring {
  position: absolute; inset: -18px; border-radius: 240px 240px 40px 40px; border: 1.5px dashed rgba(240,196,107,.45);
  pointer-events: none;
}
.badge-orbit {
  position: absolute; width: 130px; height: 130px; right: -34px; top: 40px; animation: spin 22s linear infinite;
}
.badge-orbit text { font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .1em; fill: #f0c46b; text-transform: uppercase; }
.badge-core {
  position: absolute; right: -34px; top: 40px; width: 130px; height: 130px; display: grid; place-items: center; pointer-events: none;
}
.badge-core span { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: #e06a1f; color: #fff; font-family: var(--serif); font-size: 20px; font-weight: 700; box-shadow: 0 10px 24px -8px #e06a1f; }
@keyframes spin { to { transform: rotate(360deg); } }
/* funding badge: small, solid (readable), sits below the photo edge — never over the face */
.float-card {
  position: absolute; left: -26px; bottom: -22px; padding: 8px 14px; border-radius: 12px;
  background: #0f2f45; border: 1px solid rgba(240,196,107,.35); color: rgba(238,245,244,.85);
  font-size: 11px; line-height: 1.3; box-shadow: 0 12px 26px -12px rgba(0,0,0,.6);
  animation: bob 6s ease-in-out infinite;
}
.float-card b { display: block; font-family: var(--serif); font-size: 17px; color: #f0c46b; }
@keyframes bob { 50% { transform: translateY(-10px); } }
@media (max-width: 600px) { .float-card { left: -8px; } .badge-orbit, .badge-core { right: -10px; } }

/* strata waves at hero bottom */
.strata { position: absolute; left: 0; right: 0; bottom: -1px; height: 200px; pointer-events: none; }
.strata svg { position: absolute; bottom: 0; width: 200%; height: 100%; }
.strata .s1 { animation: drift 26s linear infinite; }
.strata .s2 { animation: drift 34s linear infinite reverse; }
.strata .s3 { animation: drift 42s linear infinite; }
.strata .s4 { animation: drift 60s linear infinite reverse; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.scroll-hint {
  position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: rgba(246,241,231,.6); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-hint i { width: 22px; height: 36px; border: 1.5px solid rgba(246,241,231,.45); border-radius: 12px; position: relative; }
.scroll-hint i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; background: #f0c46b; border-radius: 2px; transform: translateX(-50%); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 1; top: 7px; } 100% { opacity: 0; top: 20px; } }
@media (max-height: 760px), (max-width: 900px) { .scroll-hint { display: none; } }

/* ---------------- Sections ---------------- */
section { position: relative; }
.section { padding: 120px 0; }
@media (max-width: 700px) { .section { padding: 84px 0; } }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 56px; }
@media (max-width: 800px) { .section-head { grid-template-columns: 1fr; gap: 16px; } }
.section-head h2 { font-size: clamp(38px, 5vw, 64px); font-weight: 500; letter-spacing: -.03em; margin-top: 14px; }
.section-head h2 em { font-style: italic; color: var(--clay); font-weight: 400; }
.section-head p { color: var(--muted); font-size: 18px; margin: 0; max-width: 520px; }
.section-alt { background: var(--bg-2); }
.kicker { font-family: var(--sans); font-size: 12.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------------- Stats ---------------- */
.stats { margin-top: -1px; background: var(--bg); padding: 40px 0 0; }
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.stat { padding: 30px 22px; border-right: 1px solid var(--line); position: relative; }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--serif); font-size: clamp(32px, 3.4vw, 46px); font-weight: 500; letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.stat b sup { font-size: .5em; color: var(--clay); margin-left: 2px; }
.stat > span { display: block; margin-top: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.stat::before { content: ""; position: absolute; left: 22px; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c, var(--clay)); }
@media (max-width: 1000px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } .stat:nth-child(3) { border-right: 0; } .stat:nth-child(-n+3) { border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } .stat { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); } .stat:nth-child(2n) { border-right: 0 !important; } .stat:nth-last-child(-n+2) { border-bottom: 0; } }

/* ---------------- About ---------------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.about-text p { font-size: 18.5px; color: var(--ink-2); }
.about-text p:first-child::first-letter {
  float: left; font-family: var(--serif); font-size: 84px; line-height: .8; padding: 8px 12px 0 0; color: var(--clay); font-weight: 600;
}
.about-text strong { color: var(--ink); font-weight: 700; }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); align-self: start; }
.facts dl { margin: 0; display: grid; gap: 18px; }
.facts dt { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 600; line-height: 1.45; }
.profiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.profiles a { text-decoration: none; }
.profiles a.chip:hover { border-color: var(--teal); color: var(--teal); }

/* ---------------- Research strata ---------------- */
.strata-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .strata-grid { grid-template-columns: 1fr; } }
.borehole { position: relative; padding-left: 64px; }
.borehole::before { content: "DEPTH"; position: absolute; left: 0; top: -26px; font-size: 11px; font-weight: 800; letter-spacing: .16em; color: var(--muted); }
.layer {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  min-height: 84px; padding: 18px 24px; border: 0; cursor: pointer; text-align: left; color: #fff; font-family: var(--sans);
  background: var(--lc); transition: transform .35s cubic-bezier(.2,.8,.2,1), filter .3s, box-shadow .3s;
}
.layer:first-child { border-radius: 18px 18px 0 0; } .layer:last-child { border-radius: 0 0 18px 18px; }
.layer::before { /* texture */
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: .22; background-image: var(--tx); background-size: 22px 22px; pointer-events: none;
}
.layer::after { content: attr(data-depth); position: absolute; left: -58px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.layer .lname { position: relative; font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.2; }
.layer .lcount { position: relative; font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.18); white-space: nowrap; }
.layer:hover { filter: brightness(1.07); }
.layer.active { transform: translateX(18px); box-shadow: -8px 0 0 0 var(--ink), var(--shadow); z-index: 2; }
@media (max-width: 600px) { .borehole { padding-left: 0; } .borehole::before, .layer::after { display: none; } .layer.active { transform: translateX(8px); } .layer .lname { font-size: 18px; } }
.strata-detail {
  position: sticky; top: 100px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 36px;
  box-shadow: var(--shadow); min-height: 420px; overflow: hidden;
}
.strata-detail::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--dc, var(--clay)); transition: background .4s; }
.strata-detail .num { font-family: var(--serif); font-size: 15px; color: var(--muted); }
.strata-detail h3 { font-size: clamp(26px, 3vw, 34px); margin: 8px 0 16px; }
.strata-detail p { color: var(--ink-2); }
.strata-detail .kw { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 24px; }
.strata-detail .rel { border-top: 1px solid var(--line); padding-top: 18px; }
.strata-detail .rel h4 { font-family: var(--sans); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.strata-detail .rel li { font-size: 14.5px; margin-bottom: 8px; color: var(--ink-2); }
.strata-detail .rel ul { padding-left: 18px; margin: 0; }
.swap { animation: swap .45s cubic-bezier(.2,.8,.2,1); }
@keyframes swap { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- Marquee ---------------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); padding: 22px 0; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--serif); font-size: 26px; font-style: italic; color: var(--ink-2); white-space: nowrap; display: flex; align-items: center; gap: 48px; }
.marquee span::after { content: "✦"; font-style: normal; font-size: 16px; color: var(--clay); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------- Timeline ---------------- */
.tabs { display: inline-flex; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 40px; gap: 4px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; color: var(--muted); font: 700 14px var(--sans); padding: 10px 20px; border-radius: 999px; cursor: pointer; transition: .25s; }
.tab.active { background: var(--ink); color: var(--bg); }
.timeline { position: relative; padding-left: 40px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--clay), var(--sand)); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -36px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-2); border: 3px solid var(--clay); }
.tl-item.now::before { background: var(--clay); box-shadow: 0 0 0 6px color-mix(in srgb, var(--clay) 25%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--clay) 0%, transparent); } }
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow); transition: transform .3s; }
.tl-card:hover { transform: translateY(-3px); }
.tl-when { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--clay); }
.tl-card h3 { font-size: 23px; margin: 6px 0 4px; }
.tl-where { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.tl-card ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 15.5px; }
.tl-card li { margin-bottom: 4px; }
.tl-card li::marker { color: var(--teal); }

/* ---------------- Funding & awards ---------------- */
.fund-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; }
@media (max-width: 900px) { .fund-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; box-shadow: var(--shadow); }
.panel h3 { font-size: 24px; margin-bottom: 6px; }
.panel .sub { color: var(--muted); font-size: 15px; margin-bottom: 26px; }
.big-num { font-family: var(--serif); font-size: clamp(48px, 6vw, 72px); font-weight: 500; letter-spacing: -.03em; line-height: 1; color: var(--clay); }
.grant { margin-bottom: 22px; }
.grant-top { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; margin-bottom: 8px; }
.grant-top b { font-weight: 700; }
.grant-top span { color: var(--muted); font-size: 13.5px; }
.grant-amt { font-family: var(--serif); font-weight: 600; white-space: nowrap; }
.bar { height: 12px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gc, var(--clay)); transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.awards { list-style: none; margin: 0; padding: 0; }
.awards li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.awards li:last-child { border: 0; }
.awards .yr { font-family: var(--serif); font-size: 22px; color: var(--teal); font-weight: 600; }
.awards b { display: block; }
.awards span { color: var(--muted); font-size: 14.5px; }

/* ---------------- Publications ---------------- */
.pub-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 28px; }
.search { position: relative; flex: 1 1 280px; }
.search input {
  width: 100%; padding: 14px 18px 14px 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: 500 15.5px var(--sans); transition: border-color .2s, box-shadow .2s;
}
.search input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 4px color-mix(in srgb, var(--clay) 18%, transparent); }
.search svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-meta { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.yearbars { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin-bottom: 34px; padding-bottom: 22px; position: relative; }
.yearbars button { flex: 1; border: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--sand) 70%, transparent), color-mix(in srgb, var(--clay) 35%, transparent)); border-radius: 6px 6px 2px 2px; cursor: pointer; position: relative; min-height: 6px; transition: background .2s, height .6s cubic-bezier(.2,.8,.2,1); padding: 0; }
.yearbars button:hover, .yearbars button.active { background: var(--clay); }
.yearbars button:disabled { background: var(--line); cursor: default; }
.yearbars button span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-weight: 700; }
.yearbars button em { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-style: normal; font-weight: 800; color: var(--ink); opacity: 0; transition: .2s; }
.yearbars button:hover em, .yearbars button.active em { opacity: 1; }
@media (max-width: 600px) { .yearbars button span { font-size: 9px; } .yearbars button:nth-child(odd) span { display: none; } }
.pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pub {
  display: grid; grid-template-columns: 70px 1fr auto; gap: 20px; align-items: start; padding: 22px 24px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; transition: border-color .25s, transform .25s, box-shadow .25s;
}
.pub:hover { border-color: color-mix(in srgb, var(--clay) 50%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.pub-year { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--clay); }
.pub-title { font-weight: 700; font-size: 16.5px; line-height: 1.4; margin-bottom: 6px; }
.pub-authors { font-size: 14.5px; color: var(--muted); }
.pub-authors mark { background: none; color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-color: var(--sand); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pub-venue { font-size: 14.5px; font-style: italic; color: var(--ink-2); margin-top: 4px; }
.pub-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.type-tag { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.type-journal { background: color-mix(in srgb, var(--teal) 15%, transparent); color: var(--teal); }
.type-conference { background: color-mix(in srgb, var(--plum) 18%, transparent); color: var(--plum); }
.type-book { background: color-mix(in srgb, var(--sand) 25%, transparent); color: color-mix(in srgb, var(--sand) 60%, var(--ink)); }
.doi { font-size: 13px; font-weight: 700; color: var(--clay); text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.doi:hover { text-decoration: underline; }
.star { color: var(--sand); font-size: 13px; font-weight: 800; }
@media (max-width: 700px) { .pub { grid-template-columns: 1fr; gap: 8px; padding: 20px; } .pub-side { flex-direction: row; align-items: center; } }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 18px; }
.more-wrap { text-align: center; margin-top: 28px; }

/* ---------------- Teaching ---------------- */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .course-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .course-grid { grid-template-columns: 1fr; } }
.course {
  position: relative; padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; text-decoration: none; display: block;
}
.course:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.course .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--cc) 16%, transparent); color: var(--cc); margin-bottom: 18px; }
.course .ic svg { width: 24px; height: 24px; }
.course h3 { font-size: 21px; margin-bottom: 6px; }
.course p { font-size: 14.5px; color: var(--muted); margin: 0; }
.course .yrs { position: absolute; top: 22px; right: 22px; font-family: var(--serif); font-size: 40px; font-weight: 500; color: color-mix(in srgb, var(--cc) 35%, transparent); line-height: 1; }
.course .yrs small { font-size: 12px; font-family: var(--sans); font-weight: 700; display: block; text-align: right; color: var(--muted); }
.teach-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
@media (max-width: 800px) { .teach-row { grid-template-columns: 1fr; } }
.ring-wrap { display: flex; align-items: center; gap: 24px; }
.ring { width: 120px; height: 120px; flex: none; }
.ring circle { fill: none; stroke-width: 10; }
.ring .bg { stroke: var(--bg-2); }
.ring .fg { stroke: var(--teal); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-dasharray: 314; stroke-dashoffset: 314; transition: stroke-dashoffset 1.8s cubic-bezier(.2,.8,.2,1); }
.ring text { font-family: var(--serif); font-size: 26px; font-weight: 600; fill: var(--ink); }
.phd-list { list-style: none; padding: 0; margin: 0; }
.phd-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.phd-list li:last-child { border: 0; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; background: var(--sand); }
.dot.done { background: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 22%, transparent); }
.conf-list { list-style: none; padding: 0; margin: 0; }
.conf-list li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.conf-list li:last-child { border: 0; }
.conf-list b { font-family: var(--serif); color: var(--clay); }

/* ---------------- Cards: blog & lectures ---------------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  text-decoration: none; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; cursor: pointer; text-align: left; font: inherit; color: inherit; padding: 0;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card-cover { aspect-ratio: 16 / 9; position: relative; overflow: hidden; background: var(--hero-bg); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card-cover img { transform: scale(1.05); }
.card-cover .gen { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-cover .gen-title { position: absolute; left: 20px; bottom: 16px; right: 20px; font-family: var(--serif); font-size: 22px; color: #fff; line-height: 1.15; font-style: italic; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 600; }
.card-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }
.card h3 { font-size: 22px; line-height: 1.2; }
.card p { font-size: 15px; color: var(--muted); margin: 0; }
.card .read { margin-top: auto; padding-top: 8px; font-weight: 800; font-size: 14px; color: var(--clay); display: inline-flex; align-items: center; gap: 6px; }
.card .read svg { width: 16px; height: 16px; transition: transform .25s; }
.card:hover .read svg { transform: translateX(4px); }
.split-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.split-head h3 { font-size: 30px; }
.link-arrow { font-weight: 800; color: var(--clay); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.link-arrow:hover { text-decoration: underline; }
.lec-card .card-body { padding-top: 24px; }
.lec-num { font-family: var(--serif); font-size: 46px; line-height: 1; font-weight: 500; color: color-mix(in srgb, var(--cc, var(--teal)) 70%, transparent); }
.lec-course { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cc, var(--teal)); }
.lec-assets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.lec-assets .chip { font-size: 12px; }
.lec-card { border-top: 4px solid var(--cc, var(--teal)); }

/* ---------------- Contact ---------------- */
.contact { background: var(--hero-grad); color: var(--hero-ink); overflow: hidden; isolation: isolate; }
.contact .hero-glow.g1 { top: auto; bottom: -200px; }
.contact h2 { font-size: clamp(44px, 7vw, 96px); font-weight: 400; letter-spacing: -.035em; line-height: 1; }
.contact h2 em { font-style: italic; color: #f0c46b; }
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: end; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact p { color: rgba(246,241,231,.75); font-size: 18px; max-width: 540px; margin-top: 22px; }
.mail-row { display: flex; flex-direction: column; gap: 12px; }
.mail {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-radius: 16px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #fff; text-decoration: none; transition: .25s;
}
.mail:hover { background: rgba(255,255,255,.1); border-color: #f0c46b; }
.mail small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .6; font-weight: 700; }
.mail b { font-size: 17px; word-break: break-all; }
.copy { flex: none; border: 0; background: rgba(255,255,255,.1); color: #fff; border-radius: 10px; padding: 8px 12px; font: 700 12px var(--sans); cursor: pointer; }
.copy:hover { background: #e06a1f; }
.contact .profiles { border-color: rgba(255,255,255,.14); }
.contact .chip { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.16); }
.contact .chip:hover { border-color: #f0c46b; color: #f0c46b; }

/* ---------------- Footer ---------------- */
footer { background: var(--hero-bg); color: rgba(246,241,231,.55); font-size: 14px; padding: 28px 0 36px; border-top: 1px solid rgba(255,255,255,.08); }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: rgba(246,241,231,.8); text-decoration: none; }
footer a:hover { color: #f0c46b; }
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--clay); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -8px var(--clay);
  opacity: 0; transform: translateY(20px); transition: .3s; pointer-events: none;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }

/* ---------------- Inner pages (blog / lectures) ---------------- */
.page-hero { background: var(--hero-grad); color: var(--hero-ink); padding: 150px 0 110px; position: relative; overflow: hidden; isolation: isolate; }
.page-hero h1 { font-size: clamp(48px, 7vw, 92px); font-weight: 400; letter-spacing: -.035em; margin-top: 16px; }
.page-hero h1 em { font-style: italic; color: #f0c46b; }
.page-hero p { color: rgba(246,241,231,.75); font-size: 19px; max-width: 620px; margin-top: 16px; }
.page-hero .strata { height: 90px; }
.crumb { font-size: 14px; color: rgba(246,241,231,.6); text-decoration: none; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.crumb:hover { color: #f0c46b; }

/* article */
.article { max-width: 760px; margin: 0 auto; }
.article-head { padding: 150px 0 40px; }
.article-head h1 { font-size: clamp(38px, 5.6vw, 64px); font-weight: 500; letter-spacing: -.03em; margin: 18px 0 18px; }
.article-cover { border-radius: 22px; overflow: hidden; margin-bottom: 40px; box-shadow: var(--shadow); }
.prose { font-size: 19px; line-height: 1.75; color: var(--ink-2); }
.prose h2 { font-size: 32px; margin: 1.8em 0 .5em; color: var(--ink); }
.prose h3 { font-size: 25px; margin: 1.6em 0 .4em; color: var(--ink); }
.prose a { color: var(--clay); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
.prose img { border-radius: 14px; margin: 1.5em auto; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--sand); font-family: var(--serif); font-style: italic; font-size: 23px; color: var(--ink); }
.prose code { font-size: .88em; background: var(--bg-2); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--hero-bg); color: #f3eee4; padding: 20px; border-radius: 14px; overflow-x: auto; font-size: 15px; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 1.5em 0; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--clay); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.5em 0; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 64px 0 100px; }
.post-nav a { padding: 22px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; background: var(--surface); transition: .25s; }
.post-nav a:hover { border-color: var(--clay); transform: translateY(-3px); }
.post-nav small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
.post-nav b { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.post-nav .next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: 1; } }

/* modal */
.modal { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 20px; background: rgba(8,22,34,.72); backdrop-filter: blur(6px); }
.modal.open { display: grid; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-box { width: min(980px, 100%); max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 22px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); animation: swap .35s cubic-bezier(.2,.8,.2,1); }
.modal-head { display: flex; justify-content: space-between; gap: 16px; padding: 24px 28px; border-bottom: 1px solid var(--line); align-items: start; }
.modal-head h3 { font-size: 26px; margin-top: 4px; }
.modal-body { padding: 24px 28px 30px; }
.embed { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 20px; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed.pdf { aspect-ratio: 4 / 3.4; background: var(--bg-2); }
.embed.html { aspect-ratio: auto; height: min(72vh, 760px); background: #fff; border: 1px solid var(--line); }
.modal-box:has(.embed.html) { width: min(1240px, 100%); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.modal-actions .btn { padding: 11px 18px; font-size: 14px; }
.modal .btn-ghost { color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; opacity: 0; transition: .3s; z-index: 90; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* course groups on lectures page */
.course-block { margin-bottom: 64px; }
.course-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.course-block-head h2 { font-size: clamp(28px, 3.6vw, 40px); }
.course-block-head span { color: var(--muted); font-weight: 700; font-size: 14px; }

/* dark mode: primary accent is light, so use dark text on it */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary, :root:not([data-theme="light"]) .to-top { color: #0a1620; } }
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .to-top { color: #0a1620; }

/* ---------------- Full-page lecture viewer ---------------- */
.viewer-body { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: var(--hero-bg); }
.viewer-body::after { display: none; }
.viewer-bar {
  flex: none; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 14px; color: #eef5f4;
  background: var(--hero-grad); border-bottom: 3px solid var(--cc, var(--clay)); position: relative; z-index: 2;
}
.viewer-back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.08); flex: none; }
.viewer-back:hover { background: rgba(255,255,255,.16); }
.viewer-back svg { width: 18px; height: 18px; }
.viewer-title { min-width: 0; flex: 1; line-height: 1.2; }
.viewer-title small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #ffd166; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-title b { display: block; font-family: var(--serif); font-weight: 600; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-actions { display: flex; gap: 6px; flex: none; }
.vbtn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #eef5f4; font: 700 13.5px var(--sans); text-decoration: none; cursor: pointer; }
.vbtn:hover { background: rgba(255,255,255,.12); }
.vbtn.primary { background: #e06a1f; border-color: #e06a1f; color: #fff; }
.vbtn.primary:hover { background: #f2913f; }
.viewer-stage { flex: 1; position: relative; background: #fff; }
.viewer-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-msg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; color: var(--ink); background: var(--bg); }
.viewer-msg a { color: var(--clay); margin-left: 6px; }
@media (max-width: 700px) {
  .viewer-back span, .vbtn span { display: none; }
  .viewer-title b { font-size: 15px; }
  .vbtn { padding: 8px 11px; }
}
.vbtn[hidden] { display: none; }

/* viewer: home logo, full-screen floating controls, QR overlay */
.viewer-home { flex: none; width: 36px; height: 36px; display: block; }
.viewer-home svg { width: 100%; height: 100%; display: block; }
.viewer-float {
  position: absolute; left: 14px; bottom: 14px; z-index: 5; display: none; gap: 6px; padding: 6px; border-radius: 999px;
  background: rgba(14, 42, 64, .82); backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0,0,0,.3);
  opacity: .35; transition: opacity .25s;
}
.viewer-float:hover, .viewer-float:focus-within { opacity: 1; }
body.is-full .viewer-float { display: flex; }
.vfloat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 0; background: transparent; color: #eef5f4; font: 700 13px var(--sans); text-decoration: none; cursor: pointer; }
.vfloat:hover { background: rgba(255,255,255,.14); }
.vfloat svg { width: 22px; height: 22px; }
.qr-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(8, 22, 34, .78); backdrop-filter: blur(6px); padding: 20px; }
.qr-card { background: #fff; color: #0f2233; border-radius: 24px; padding: 28px; width: min(440px, 100%); text-align: center; display: grid; gap: 10px; justify-items: center; box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); }
.qr-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #1f8a70; }
.qr-img { width: min(340px, 70vw); aspect-ratio: 1; display: grid; place-items: center; color: #5d7183; }
.qr-img svg { width: 100%; height: 100%; }
.qr-card b { font-family: var(--serif); font-size: 20px; }
.qr-card small { color: #5d7183; word-break: break-all; font-size: 12px; }
.new-badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #e06a1f; color: #fff; box-shadow: 0 4px 12px -4px #e06a1f; }
.chip-cv { background: var(--clay) !important; color: #fff !important; border-color: var(--clay) !important; }

/* signature ampersand — swirl "&" from Fraunces (SIL Open Font License), stored locally
   so every browser shows exactly the same shape: assets/fonts/rb-ampersand.* */
@font-face {
  font-family: "RB Ampersand";
  src: url("../assets/fonts/rb-ampersand.woff") format("woff"), url("../assets/fonts/rb-ampersand.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: block; unicode-range: U+0026;
}
.amp {
  font-family: "RB Ampersand", "Fraunces", Georgia, serif !important; font-style: normal !important; font-weight: 400;
  font-synthesis: none; font-variation-settings: normal; -webkit-text-fill-color: currentColor; color: var(--clay);
  display: inline-block; transform: translateY(.02em); padding: 0 .04em;
}
.hero .amp, .page-hero .amp, .contact .amp, .viewer-bar .amp, .layer .amp, .gen-title .amp,
.tab.active .amp { color: #ffd166; }
.hero h1 em .amp { -webkit-text-fill-color: #ffd166; }
.kicker .amp, .eyebrow .amp, .lec-course .amp, .tab .amp { font-size: 1.25em; line-height: 0; text-transform: none; letter-spacing: 0; }

.lname .amp, h3 .amp, h4 .amp, .viewer-title .amp { font-size: 1.15em; line-height: 0; }

/* ---------------- Institutions & partners strip ---------------- */
.affils { padding: 56px 0 8px; }
.affils-title {
  text-align: center; margin: 0 0 22px; font-size: 12.5px; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}
.affils-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 18px; }
.affil {
  display: grid; place-items: center; min-width: 132px; height: 72px; padding: 10px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s;
}
.affil:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--clay) 40%, var(--line)); }
.affil img { max-height: 46px; max-width: 150px; object-fit: contain; filter: grayscale(1); opacity: .72; transition: filter .3s, opacity .3s; }
.affil:hover img { filter: none; opacity: 1; }
.affil-name { display: grid; justify-items: center; text-align: center; line-height: 1.15; }
.affil-name b { font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: -.01em; color: var(--ink); }
.affil-name small { font-size: 10.5px; font-weight: 700; color: var(--muted); max-width: 150px; margin-top: 3px; }
.affil:hover .affil-name b { color: var(--clay); }
/* logos stay readable on dark mode: they sit on a light tile */
:root[data-theme="dark"] .affil.has-logo { background: #f2f6f5; }
@media (max-width: 560px) { .affil { min-width: 0; flex: 1 1 40%; height: 64px; } .affil-name b { font-size: 18px; } }

/* ---------------- News pill (top of home page) ---------------- */
.news-pill {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%; margin-bottom: 18px; padding: 6px 14px 6px 6px;
  border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #eef5f4;
  text-decoration: none; font-size: 14px; font-weight: 600; transition: background .25s, border-color .25s;
}
a.news-pill[href]:hover { background: rgba(255,255,255,.14); border-color: #f0c46b; }
.np-tag { flex: none; padding: 3px 10px; border-radius: 999px; background: #e06a1f; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.np-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-go { flex: none; color: #f0c46b; font-weight: 800; }
.np-in { animation: npIn .5s cubic-bezier(.2,.8,.2,1); }
@keyframes npIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------------- Testimonials ---------------- */
.tst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.tst { margin: 0; padding: 28px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px; position: relative; }
.tst::before { content: "\201C"; position: absolute; top: 6px; right: 22px; font-family: var(--serif); font-size: 84px; line-height: 1; color: color-mix(in srgb, var(--clay) 25%, transparent); }
.tst blockquote { margin: 0; font-family: var(--serif); font-size: 18.5px; line-height: 1.55; color: var(--ink); }
.tst figcaption { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.tst figcaption img, .tst-ini { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; }
.tst-ini { display: grid; place-items: center; background: color-mix(in srgb, var(--teal) 18%, transparent); color: var(--teal); font-weight: 800; }
.tst figcaption b { display: block; font-size: 15px; }
.tst figcaption small { display: block; font-size: 13px; color: var(--muted); }

/* ---------------- Gallery + photo viewer ---------------- */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gal-item { position: relative; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 18px; overflow: hidden; cursor: zoom-in; background: var(--bg-2); }
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.gal-item:hover img { transform: scale(1.06); }
.gal-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px; text-align: left; color: #fff; font-size: 13.5px; font-weight: 600; background: linear-gradient(transparent, rgba(8,22,34,.8)); opacity: 0; transform: translateY(8px); transition: .3s; }
.gal-item:hover .gal-cap, .gal-item:focus-visible .gal-cap { opacity: 1; transform: none; }
@media (hover: none) { .gal-cap { opacity: 1; transform: none; } }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(6,16,26,.92); display: grid; place-items: center; padding: 60px 70px; }
.lightbox[hidden] { display: none !important; }
.lightbox figure { margin: 0; display: grid; gap: 12px; justify-items: center; max-height: 100%; }
.lightbox img { max-width: min(1200px, 100%); max-height: calc(100vh - 160px); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox figcaption { color: #eef5f4; font-size: 15px; text-align: center; }
.lb-btn { position: absolute; border: 0; border-radius: 50%; width: 48px; height: 48px; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; font-size: 26px; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 16px; right: 16px; font-size: 20px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox { padding: 60px 12px; } .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; } }

/* "20+ years" badge on the photo */
.badge-core span { flex-direction: column; gap: 0; width: 70px; height: 70px; line-height: 1; font-size: 21px; }
.badge-core span { display: flex; align-items: center; justify-content: center; }
.badge-core small { display: block; font-family: var(--sans); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; opacity: .95; }

/* full-screen lecture: only a small transparent exit button, top-left */
.vexit {
  position: absolute; top: 10px; left: 10px; z-index: 6; display: none; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); cursor: pointer;
  background: rgba(15,30,45,.28); color: #fff; font: 700 12.5px var(--sans);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: .45; transition: opacity .25s, background .25s;
}
.vexit:hover, .vexit:focus-visible { opacity: 1; background: rgba(15,30,45,.75); }
body.is-full .vexit { display: inline-flex; }
