:root {
  --bg: #07101d;
  --bg-soft: #0b1727;
  --surface: rgba(14, 28, 46, .72);
  --surface-solid: #0e1c2e;
  --surface-2: #12243a;
  --line: rgba(173, 206, 230, .16);
  --line-strong: rgba(173, 206, 230, .28);
  --text: #eef7fb;
  --muted: #b8cad5;
  --faint: #8ca1ae;
  --accent: #70e1ea;
  --accent-2: #9f8cff;
  --accent-3: #ffb47d;
  --shadow: 0 30px 80px rgba(0, 0, 0, .32);
  --radius: 24px;
  --radius-sm: 15px;
  --shell: min(1180px, calc(100% - 40px));
}

html[data-theme="light"] {
  --bg: #f7fafc;
  --bg-soft: #e8f0f5;
  --surface: rgba(255, 255, 255, .94);
  --surface-solid: #ffffff;
  --surface-2: #eaf2f7;
  --line: rgba(10, 43, 61, .18);
  --line-strong: rgba(10, 43, 61, .31);
  --text: #071c29;
  --muted: #324f5f;
  --faint: #536b78;
  --accent: #006f7c;
  --accent-2: #5d47c2;
  --accent-3: #a64a14;
  --shadow: 0 25px 62px rgba(28, 58, 74, .15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
section[id] { scroll-margin-top: 108px; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 11% 10%, rgba(112, 225, 234, .09), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(159, 140, 255, .10), transparent 30rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 74%);
  z-index: -2;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
img { max-width: 100%; display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: rgba(112, 225, 234, .28); color: var(--text); }
.shell { width: var(--shell); margin-inline: auto; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 999; padding: 10px 14px; background: var(--text); color: var(--bg); border-radius: 10px; }
.skip-link:focus { top: 16px; }
.ambient { position: fixed; width: 32rem; height: 32rem; filter: blur(90px); opacity: .11; border-radius: 999px; pointer-events: none; z-index: -1; }
.ambient-a { background: var(--accent); top: 25%; left: -18rem; }
.ambient-b { background: var(--accent-2); top: 55%; right: -20rem; }

.site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid transparent; transition: .25s ease; }
.site-header.scrolled { border-color: var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(18px); }
.nav { height: 84px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 12px; background: linear-gradient(145deg, rgba(112,225,234,.16), rgba(159,140,255,.08)); font-weight: 850; letter-spacing: -.03em; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.18; }
.brand-copy strong { font-size: .96rem; }
.brand-copy small { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links > a { position: relative; font-size: .88rem; color: var(--muted); transition: color .24s ease, transform .24s ease; }
.nav-links > a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -9px; height: 2px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), transparent 82%); transform: scaleX(0); transform-origin: left; opacity: 0; transition: transform .28s ease, opacity .28s ease; }
.nav-links > a:hover, .nav-links > a.active { color: var(--text); transform: translateY(-1px); }
.nav-links > a:hover::after, .nav-links > a.active::after { transform: scaleX(1); opacity: 1; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; cursor: pointer; }
.icon-button svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }
.theme-toggle .moon { display: none; }
html[data-theme="light"] .theme-toggle .sun { display: none; }
html[data-theme="light"] .theme-toggle .moon { display: block; }

.hero {
  min-height: 670px;
  padding: 82px 0 96px;
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(290px, .62fr);
  align-items: center;
  gap: clamp(54px, 7vw, 104px);
}
.eyebrow, .kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .15em; font-size: .72rem; font-weight: 760; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.hero h1 {
  margin: 24px 0 14px;
  max-width: 850px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-weight: 510;
  font-size: clamp(4.25rem, 8.4vw, 8.1rem);
  line-height: .94;
  letter-spacing: -.068em;
  overflow: visible;
  padding-bottom: .08em;
}
.hero h1 span, .hero h1 em { display: block; }
.hero h1 em {
  margin-left: clamp(28px, 5vw, 76px);
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 62%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
  line-height: 1.04;
  padding: 0 .05em .24em 0;
  margin-bottom: -.12em;
  overflow: visible;
}
.hero-role {
  margin: 32px 0 9px;
  color: var(--text);
  font-size: clamp(1.08rem, 1.5vw, 1.3rem);
  font-weight: 720;
  letter-spacing: -.015em;
}
.hero-lead { max-width: 715px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.32vw, 1.16rem); }
.hero-actions, .contact-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.profile-links {
  max-width: 780px;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.profile-link {
  min-width: 0;
  min-height: 62px;
  padding: 10px 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.profile-link:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
}
.profile-link-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(112,225,234,.13), rgba(159,140,255,.08));
  color: var(--accent);
  font-size: .58rem;
  font-weight: 850;
  letter-spacing: -.02em;
}
.profile-link-mark-x { font-size: .8rem; }
.profile-link-mark-id { font-size: .68rem; letter-spacing: -.08em; }
.profile-link-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.16; }
.profile-link-copy strong { font-size: .72rem; }
.profile-link-copy small { margin-top: 4px; overflow: hidden; color: var(--faint); font-size: .55rem; white-space: nowrap; text-overflow: ellipsis; }
.profile-link-arrow { color: var(--faint); font-size: .68rem; transition: color .2s ease, transform .2s ease; }
.profile-link:hover .profile-link-arrow { color: var(--accent); transform: translate(1px, -1px); }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 0 20px; border-radius: 14px; font-weight: 760; font-size: .91rem; border: 1px solid var(--line-strong); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #06121b; background: linear-gradient(125deg, #82edf2, #9bc7ff 60%, #b09bff); border-color: transparent; box-shadow: 0 14px 34px rgba(74, 177, 196, .18); }
.button-ghost { background: var(--surface); }
.button-ghost:hover { border-color: var(--accent); }
.button-quiet { min-height: 50px; display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; color: var(--muted); font-size: .87rem; font-weight: 720; }
.button-quiet:hover { color: var(--text); }

.hero-details {
  max-width: 740px;
  margin-top: 44px;
  padding-top: 24px;
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 22px;
  border-top: 1px solid var(--line);
}
.hero-details > div { display: flex; flex-direction: column; gap: 4px; }
.hero-details span { color: var(--faint); font-size: .67rem; letter-spacing: .1em; text-transform: uppercase; }
.hero-details strong { font-size: .78rem; line-height: 1.4; }
.hero-details small { color: var(--muted); font-size: .72rem; line-height: 1.4; }

.profile-stack { width: min(100%, 390px); display: flex; flex-direction: column; align-items: flex-end; transform: translateY(-14px); }
.profile-ctf-mini {
  position: relative;
  z-index: 1;
  width: min(100%, 340px);
  margin-top: 12px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 12px 32px rgba(0,0,0,.07);
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.profile-ctf-mini:hover { transform: translateY(-2px); border-color: var(--line-strong); background: color-mix(in srgb, var(--surface-2) 88%, transparent); }
.profile-ctf-logo { position: relative; width: 43px; height: 43px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.profile-ctf-logo img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; background: #fff; }
.zenhack-fallback { color: #0b1720; font-size: .72rem; font-weight: 900; letter-spacing: -.04em; }
.profile-ctf-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.24; }
.profile-ctf-copy small { color: var(--accent); font-size: .57rem; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.profile-ctf-copy strong { margin-top: 2px; font-size: .76rem; }
.profile-ctf-copy > span { margin-top: 3px; color: var(--faint); font-size: .6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-ctf-arrow { color: var(--faint); font-size: .8rem; transition: color .2s ease, transform .2s ease; }
.profile-ctf-mini:hover .profile-ctf-arrow { color: var(--accent); transform: translate(1px, 2px); }

.hero-profile {
  position: relative;
  min-height: 570px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
}
.hero-profile::before {
  content: "";
  position: absolute;
  width: 310px;
  height: 310px;
  top: 12px;
  right: -78px;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(112,225,234,.025), 0 0 0 96px rgba(159,140,255,.018);
  pointer-events: none;
}
.profile-photo {
  position: relative;
  z-index: 2;
  width: 196px;
  aspect-ratio: .9;
  margin: 0 22px -30px 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 34px;
  background: var(--surface-solid);
  box-shadow: 0 22px 55px rgba(0,0,0,.24);
  transform: rotate(2deg);
}
.profile-photo::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.12); border-radius: inherit; pointer-events: none; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; transform: scale(1.01); }
.profile-card {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  padding: 48px 30px 28px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--surface-solid) 94%, transparent), color-mix(in srgb, var(--surface-2) 82%, transparent));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.profile-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.profile-kicker { color: var(--accent); font-size: .64rem; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.profile-status { color: var(--faint); font-size: .64rem; white-space: nowrap; }
.profile-status i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(112,225,234,.10); }
.profile-card h2 { margin: 18px 0 12px; font-family: ui-serif, Georgia, serif; font-size: 1.75rem; font-weight: 530; line-height: 1.08; letter-spacing: -.025em; }
.profile-card > p { margin: 0; color: var(--muted); font-size: .84rem; }
.profile-card > p strong { color: var(--text); }
.profile-divider { height: 1px; margin: 22px 0 18px; background: var(--line); }
.profile-card .profile-note { color: var(--faint); font-size: .75rem; line-height: 1.55; }


.section { padding-block: 126px; }
.section-heading { display: grid; grid-template-columns: 1.25fr .75fr; align-items: end; gap: 70px; margin-bottom: 50px; }
.section-heading h2 { max-width: 800px; margin: 10px 0 0; font-family: ui-serif, Georgia, serif; font-size: clamp(2.4rem, 4.5vw, 4.25rem); font-weight: 520; line-height: 1.05; letter-spacing: -.045em; }
.section-heading > p { margin: 0 0 4px; color: var(--muted); font-size: .97rem; }
.research-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.research-card { position: relative; min-height: 390px; padding: 34px; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(155deg, var(--surface), rgba(100,140,170,.025)); transition: transform .25s ease, border-color .25s ease; }
.research-card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -120px; bottom: -130px; border-radius: 50%; background: var(--accent); opacity: .07; filter: blur(2px); }
.research-card:nth-child(2)::after, .research-card:nth-child(3)::after { background: var(--accent-2); }
.research-card:hover { transform: translateY(-5px); border-color: var(--line-strong); }
.research-card.feature { background: linear-gradient(145deg, rgba(23,66,82,.68), var(--surface)); }
.card-number { position: absolute; top: 22px; right: 26px; color: var(--faint); font-size: .75rem; letter-spacing: .12em; }
.research-icon { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 16px; background: rgba(112,225,234,.08); color: var(--accent); }
.research-icon svg { width: 25px; height: 25px; }
.card-label { margin: 24px 0 7px; color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.research-card h3, .teaching-card h3 { margin: 0; font-family: ui-serif, Georgia, serif; font-size: 2rem; font-weight: 550; line-height: 1.1; }
.research-card > p:not(.card-label), .teaching-card > p:not(.card-label), .service-feature > p { color: var(--muted); font-size: .91rem; }
.card-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; padding-top: 18px; }
.text-link { position: relative; z-index: 2; margin-top: 20px; color: var(--text); font-weight: 720; font-size: .83rem; }
.text-link span { color: var(--accent); margin-left: 4px; }

.publications-section, .service-section { background: color-mix(in srgb, var(--bg-soft) 80%, transparent); border-block: 1px solid var(--line); }
.publication-toolbar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 0 18px; border-bottom: 1px solid var(--line-strong); }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; background: transparent; color: var(--muted); cursor: pointer; font-size: .79rem; }
.filter.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.publication-count { color: var(--faint); font-size: .8rem; white-space: nowrap; }
.publication-list { display: grid; }
.publication { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 26px; align-items: center; min-height: 152px; padding: 28px 0; border-bottom: 1px solid var(--line); transition: opacity .2s ease, transform .2s ease; }
.publication.hidden { display: none; }
.pub-year { align-self: start; color: var(--accent); font-family: ui-serif, Georgia, serif; font-size: 1.6rem; }
.pub-meta { display: flex; gap: 8px; margin-bottom: 8px; }
.pub-meta span { color: var(--faint); text-transform: uppercase; letter-spacing: .11em; font-size: .64rem; }
.pub-meta span + span::before { content: "·"; margin-right: 8px; }
.pub-body h3 { margin: 0; max-width: 860px; font-family: ui-serif, Georgia, serif; font-size: clamp(1.15rem, 1.9vw, 1.5rem); font-weight: 530; line-height: 1.3; }
.pub-body p { margin: 10px 0 0; color: var(--muted); font-size: .82rem; }
.pub-body p strong { color: var(--text); }
.pub-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pub-link { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.pub-link:hover { transform: rotate(8deg); border-color: var(--accent); }
.pub-link.slides-link { color: #07121b; border-color: transparent; background: linear-gradient(125deg, #82edf2, #9bc7ff 60%, #b09bff); font-size: .72rem; }
.pub-link.slides-link:hover { transform: translateY(-2px); }
.pub-link.muted { color: var(--faint); }
.publication-thesis { align-items: start; }
.thesis-details { margin-top: 17px; padding: 14px 16px; display: grid; gap: 9px; border-left: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); background: color-mix(in srgb, var(--surface) 62%, transparent); }
.thesis-details p { margin: 0; color: var(--muted); font-size: .76rem; }
.thesis-details span { display: block; margin-bottom: 2px; color: var(--faint); font-size: .62rem; font-weight: 780; letter-spacing: .09em; text-transform: uppercase; }


.presentations-section[hidden], .presentations-nav[hidden], .courses-section[hidden], .courses-nav[hidden] { display: none !important; }
.presentation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.presentation-card {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--surface), rgba(100,140,170,.025));
  transition: transform .25s ease, border-color .25s ease;
}
.presentation-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.presentation-visual {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(112,225,234,.24), transparent 35%),
    radial-gradient(circle at 82% 78%, rgba(159,140,255,.24), transparent 38%),
    var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.presentation-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, opacity .35s ease; }
.presentation-visual-label { position: absolute; right: 16px; bottom: 15px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 9px; background: rgba(3,9,15,.78); color: #fff; font-size: .66rem; font-weight: 760; opacity: 0; transform: translateY(5px); transition: opacity .25s ease, transform .25s ease; }
a.presentation-visual:hover img { transform: scale(1.015); opacity: .88; }
a.presentation-visual:hover .presentation-visual-label, a.presentation-visual:focus-visible .presentation-visual-label { opacity: 1; transform: translateY(0); }

.presentation-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); }
.presentation-placeholder strong { font-family: ui-serif, Georgia, serif; font-size: 2.2rem; font-weight: 540; letter-spacing: -.05em; }
.presentation-placeholder span { color: var(--muted); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; }
.presentation-content { min-width: 0; padding: 28px; display: flex; flex-direction: column; }
.presentation-card h3 { margin: 0; font-family: ui-serif, Georgia, serif; font-size: clamp(1.42rem, 2.35vw, 1.95rem); font-weight: 540; line-height: 1.16; letter-spacing: -.028em; }
.presentation-context { margin-top: 18px; padding: 14px 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; border-block: 1px solid var(--line); }
.presentation-kind { width: fit-content; padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line)); border-radius: 999px; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: .61rem; font-weight: 790; letter-spacing: .08em; line-height: 1.25; text-transform: uppercase; white-space: nowrap; }
.presentation-context-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.presentation-context-copy strong { color: var(--text); font-size: .82rem; font-weight: 730; line-height: 1.45; }
.presentation-context-copy small { color: var(--faint); font-size: .7rem; line-height: 1.45; }
.presentation-description { margin: 14px 0 0; color: var(--muted); font-size: .86rem; }
.presentation-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: auto; padding-top: 24px; }
.presentation-action {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 720;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.presentation-action:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.presentation-action.primary { color: #06121b; border-color: transparent; background: linear-gradient(125deg, #82edf2, #9bc7ff 60%, #b09bff); }
.presentation-action.download { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.presentation-action.download:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 17%, var(--surface)); }

.teaching-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.teaching-card { min-height: 330px; padding: 30px; position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.teaching-card:nth-child(2) { transform: translateY(26px); }
.mini-index { position: absolute; top: 25px; right: 25px; color: var(--faint); font-size: .72rem; }
.teaching-card .place { margin-top: auto; padding-top: 20px; color: var(--faint); font-size: .75rem; }
.place-link { display: inline-flex; align-items: center; gap: 7px; width: fit-content; transition: color .2s ease; }
.place-link:hover { color: var(--accent); }
.place-link span { transition: transform .2s ease; }
.place-link:hover span { transform: translate(1px, -1px); }
.mentoring-panel { margin-top: 54px; padding: 34px 38px; display: grid; grid-template-columns: .65fr 1fr auto; align-items: center; gap: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(130deg, rgba(112,225,234,.08), rgba(159,140,255,.07)); }
.mentoring-panel h3 { margin: 7px 0 0; font-family: ui-serif, Georgia, serif; font-size: 1.8rem; }
.mentoring-panel > p { color: var(--muted); font-size: .86rem; }
.mentoring-tags { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }

.service-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.service-feature { min-height: 520px; padding: 42px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(40, 57, 91, .76), rgba(10, 27, 42, .82)); }
html[data-theme="light"] .service-feature { background: linear-gradient(145deg, #edf3ff, #eef9fa); }
.service-feature::before { content: ""; position: absolute; width: 330px; height: 330px; border: 1px solid rgba(112,225,234,.18); border-radius: 50%; right: -120px; bottom: -100px; box-shadow: 0 0 0 55px rgba(112,225,234,.035), 0 0 0 110px rgba(159,140,255,.025); }
.service-top { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.service-mark { margin: 52px 0 10px; font-family: ui-serif, Georgia, serif; font-size: clamp(4.5rem, 8vw, 7rem); line-height: .8; letter-spacing: -.06em; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; color: transparent; }
.service-feature h3 { max-width: 610px; margin: 25px 0 0; font-family: ui-serif, Georgia, serif; font-size: 2rem; font-weight: 520; line-height: 1.15; }
.service-link { position: relative; z-index: 2; width: fit-content; margin-top: 20px; display: inline-flex; align-items: center; gap: 9px; color: var(--accent); font-size: .76rem; font-weight: 760; letter-spacing: .03em; }
.service-link span { transition: transform .2s ease; }
.service-link:hover span { transform: translate(2px, -2px); }
.service-people { position: absolute; left: 42px; right: 42px; bottom: 35px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: .75rem; }
.service-timeline { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.timeline-item { min-height: 104px; padding: 23px 26px; display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item > span { color: var(--accent); font-family: ui-serif, Georgia, serif; font-size: 1.1rem; }
.timeline-item h3 { margin: 0; font-size: .9rem; }
.timeline-item p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.review-panel { margin-top: 20px; padding: 30px 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.journal-cloud { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

.experience-section { padding-bottom: 154px; }
.path-line { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line-strong); }
.path-line::before { content: ""; position: absolute; top: -3px; left: 0; width: 25%; height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.path-line article { position: relative; padding: 34px 30px 0 0; }
.path-line article::before { content: ""; position: absolute; top: -6px; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); }
.path-line article:first-child::before { border-color: var(--accent); box-shadow: 0 0 0 6px rgba(112,225,234,.09); }
.path-line span { color: var(--accent); font-size: .72rem; letter-spacing: .08em; }
.path-line h3 { margin: 12px 0 7px; max-width: 220px; font-size: .95rem; line-height: 1.4; }
.path-line p { margin: 0; color: var(--muted); font-size: .8rem; }
.path-line small { display: block; max-width: 220px; margin-top: 9px; color: var(--faint); font-size: .72rem; line-height: 1.45; }

.contact { position: relative; overflow: hidden; min-height: 490px; margin-bottom: 80px; padding: 66px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--line-strong); border-radius: 34px; background: linear-gradient(125deg, rgba(14,35,51,.92), rgba(35,30,70,.72)); box-shadow: var(--shadow); }
html[data-theme="light"] .contact { background: linear-gradient(125deg, #e6f7f8, #eeeafe); }
.contact h2 { max-width: 820px; margin: 12px 0 18px; font-family: ui-serif, Georgia, serif; font-size: clamp(2.3rem, 4.4vw, 4.4rem); font-weight: 520; line-height: 1.04; letter-spacing: -.045em; }
.contact > p { max-width: 700px; margin: 0; color: var(--muted); }
.contact-orb { position: absolute; width: 430px; height: 430px; right: -100px; top: 20px; border: 1px solid rgba(112,225,234,.22); border-radius: 50%; box-shadow: 0 0 0 70px rgba(112,225,234,.035), 0 0 0 140px rgba(159,140,255,.025); }
.footer { min-height: 130px; padding-block: 35px; display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 25px; border-top: 1px solid var(--line); }
.footer > div { display: flex; flex-direction: column; }
.footer > div span, .footer p, .footer a { color: var(--faint); font-size: .72rem; }
.footer p { text-align: center; }

.reveal {
  --reveal-y: 22px;
  opacity: 0;
  transform: translate3d(0, var(--reveal-y), 0) scale(.99);
  filter: blur(3px);
  transition: opacity .64s cubic-bezier(.22,.61,.36,1), transform .64s cubic-bezier(.22,.61,.36,1), filter .64s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform, filter;
}
.reveal.reveal-from-bottom { --reveal-y: 22px; }
.reveal.reveal-from-top { --reveal-y: -22px; }
.reveal.visible { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
.delay-1 { transition-delay: .08s; }
.delay-2 { transition-delay: .16s; }
.delay-3 { transition-delay: .24s; }
.section-focus { animation: sectionFocus .68s cubic-bezier(.22,.61,.36,1); }
@keyframes sectionFocus {
  0% { opacity: .62; transform: translateY(12px); filter: blur(2px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-top: 58px; }
  .profile-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-copy { max-width: 860px; }
  .hero-profile { min-height: 520px; max-width: 560px; width: 100%; margin-inline: auto; align-items: center; }
  .profile-stack { width: min(100%, 430px); align-items: center; transform: translateY(-4px); }
  .profile-ctf-mini { width: min(100%, 360px); align-self: center; }
  .ctf-layout { grid-template-columns: 1fr; }
  .hero-profile::before { right: 5%; }
  .profile-photo { align-self: flex-end; margin-right: 42px; }
  .profile-card { align-self: flex-start; }
  .section-heading { grid-template-columns: 1fr; gap: 24px; }
  .presentation-grid { grid-template-columns: 1fr; }
  .teaching-grid { grid-template-columns: 1fr 1fr; }
  .teaching-card:nth-child(2) { transform: none; }
  .teaching-card:last-child { grid-column: 1/-1; min-height: 260px; }
  .mentoring-panel { grid-template-columns: 1fr; }
  .mentoring-tags { flex-direction: row; flex-wrap: wrap; }
  .service-layout { grid-template-columns: 1fr; }
  .path-line { grid-template-columns: 1fr 1fr; gap: 38px 0; }
  .path-line::before { width: 50%; }
}

@media (max-width: 760px) {
  :root { --shell: min(100% - 28px, 1180px); }
  .nav { height: 70px; }
  .brand-copy small { display: none; }
  .menu-toggle { display: grid; }
  .nav-links { position: absolute; top: 70px; left: 14px; right: 14px; padding: 18px; display: none; flex-direction: column; align-items: stretch; gap: 3px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links > a { padding: 10px; }
  .nav-links > a::after { bottom: 3px; }
  .theme-toggle { margin-top: 6px; }
  .hero { min-height: auto; gap: 54px; padding: 58px 0 74px; }
  .hero h1 { font-size: clamp(4rem, 20vw, 6rem); }
  .hero h1 em { margin-left: 18px; }
  .hero-role { margin-top: 26px; }
  .hero-actions .button { width: 100%; }
  .profile-links { grid-template-columns: 1fr 1fr; margin-top: 20px; }
  .profile-link:last-child { grid-column: 1 / -1; }
  .button-quiet { width: auto; min-height: 38px; padding-left: 2px; }
  .hero-details { grid-template-columns: 1fr; gap: 14px; margin-top: 34px; }
  .hero-details > div { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
  .hero-details > div:last-child { border-bottom: 0; padding-bottom: 0; }
  .hero-profile { min-height: 520px; align-items: center; }
  .profile-stack { width: 100%; transform: none; }
  .profile-ctf-mini { width: 100%; }
  .ctf-feature { min-height: 0; padding: 25px; }
  .ctf-timeline { padding: 4px 22px 22px; }
  .ctf-timeline article { grid-template-columns: 58px minmax(0, 1fr); gap: 14px; padding: 23px 0; }
  .hero-profile::before { width: 260px; height: 260px; top: 12px; right: -54px; }
  .profile-photo { width: 154px; margin: 0 15px -23px 0; align-self: flex-end; border-radius: 27px; }
  .profile-card { width: 100%; padding: 42px 24px 24px; align-self: stretch; }
  .profile-card-top { align-items: flex-start; }
  .section { padding-block: 84px; }
  .research-grid, .teaching-grid { grid-template-columns: 1fr; }
  .teaching-card:last-child { grid-column: auto; }
  .publication-toolbar { align-items: flex-start; flex-direction: column; }
  .publication { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 13px; }
  .pub-actions { flex-direction: column; }
  .pub-link { width: 36px; height: 36px; }
  .pub-year { font-size: 1.2rem; }
  .service-feature { min-height: 580px; padding: 28px; }
  .service-people { left: 28px; right: 28px; }
  .path-line { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line-strong); padding-left: 24px; }
  .path-line::before { width: 5px; height: 25%; top: 0; left: -3px; }
  .path-line article { padding: 0 0 34px; }
  .path-line article::before { top: 4px; left: -30px; }
  .contact { padding: 38px 25px; min-height: 520px; margin-bottom: 48px; }
  .contact-actions .button { width: 100%; }
  .footer { grid-template-columns: 1fr; text-align: center; }
  .footer p { order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  .section-focus { animation: none; }
}


/* Capture the Flag experience */
.ctf-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 18px; }
.ctf-feature, .ctf-timeline { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-2) 82%, transparent)); }
.ctf-feature { min-height: 390px; padding: 32px; display: flex; flex-direction: column; }
.ctf-feature-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 32px; }
.ctf-feature-top > span { color: var(--faint); font-size: .68rem; }
.zenhack-brand { position: relative; width: 78px; height: 58px; padding: 7px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; transition: transform .2s ease, border-color .2s ease; }
.zenhack-brand:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.zenhack-brand img { position: absolute; inset: 7px; width: calc(100% - 14px); height: calc(100% - 14px); object-fit: contain; background: #fff; }
.zenhack-brand .zenhack-fallback { font-size: .9rem; }
.ctf-feature h3 { margin: 5px 0 13px; font-family: ui-serif, Georgia, serif; font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 530; line-height: 1; }
.ctf-feature > p:not(.card-label) { margin: 0; color: var(--muted); line-height: 1.72; }
.ctf-tags { margin: 24px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ctf-tags span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--surface-2) 74%, transparent); font-size: .68rem; }
.ctf-feature .presentation-action { width: fit-content; margin-top: auto; }
.ctf-timeline { padding: 12px 28px 24px; display: flex; flex-direction: column; }
.ctf-timeline article { flex: 1; padding: 28px 0; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 22px; border-bottom: 1px solid var(--line); }
.ctf-year { color: var(--accent); font-family: ui-serif, Georgia, serif; font-size: 1.28rem; }
.ctf-timeline h3 { margin: 4px 0 9px; font-family: ui-serif, Georgia, serif; font-size: 1.35rem; font-weight: 540; line-height: 1.15; }
.ctf-timeline p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.62; }
.ctf-program-link { align-self: flex-end; margin-top: 22px; color: var(--muted); font-size: .72rem; font-weight: 740; transition: color .2s ease, transform .2s ease; }
.ctf-program-link:hover { color: var(--accent); transform: translateX(2px); }

/* Open-source tools */
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tool-card { min-height: 100%; display: flex; flex-direction: column; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-2) 82%, transparent)); box-shadow: 0 20px 55px rgba(0,0,0,.08); transition: transform .2s ease, border-color .2s ease; }
.tool-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.tool-card.tool-feature { background: radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%), linear-gradient(145deg, var(--surface), var(--surface-2)); }
.tool-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.tool-mark { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--text); font-size: .78rem; font-weight: 850; letter-spacing: .08em; }
.tool-kind { color: var(--faint); font-size: .68rem; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; text-align: right; }
.tool-card h3 { margin: 0 0 12px; font-family: ui-serif, Georgia, serif; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 540; line-height: 1.12; letter-spacing: -.025em; }
.tool-card > p { margin: 0; color: var(--muted); line-height: 1.68; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.tool-tags span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--faint); font-size: .64rem; font-weight: 700; }
.tool-metrics { min-height: 24px; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.tool-metrics img { height: 21px; width: auto; border-radius: 4px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 24px; }
@media (max-width: 820px) { .tools-grid { grid-template-columns: 1fr; } }

@media (max-width: 1000px) {
  .ctf-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .ctf-feature { min-height: 0; padding: 25px; }
  .ctf-feature-top { margin-bottom: 24px; }
  .ctf-timeline { padding: 4px 22px 22px; }
  .ctf-timeline article { grid-template-columns: 58px minmax(0, 1fr); gap: 14px; padding: 23px 0; }
  .ctf-program-link { align-self: flex-start; }
}


/* Accessibility, mobile hero and component refinements — v20 */
.hero-heading { display: block; }
.hero-mobile-photo { display: none; }

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 11% 10%, rgba(0, 111, 124, .08), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(93, 71, 194, .08), transparent 30rem),
    var(--bg);
}
html[data-theme="light"] .site-header.scrolled {
  background: rgba(247, 250, 252, .94);
  border-color: var(--line-strong);
}
html[data-theme="light"] .profile-link,
html[data-theme="light"] .profile-ctf-mini,
html[data-theme="light"] .profile-card,
html[data-theme="light"] .presentation-card,
html[data-theme="light"] .teaching-card,
html[data-theme="light"] .service-timeline,
html[data-theme="light"] .review-panel,
html[data-theme="light"] .ctf-feature,
html[data-theme="light"] .ctf-timeline,
html[data-theme="light"] .tool-card {
  background-color: rgba(255, 255, 255, .96);
}
html[data-theme="light"] .research-card.feature {
  background: linear-gradient(145deg, #e2f2f4, #f3f0ff);
}
html[data-theme="light"] .presentation-visual {
  background:
    radial-gradient(circle at 18% 18%, rgba(0, 111, 124, .12), transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(93, 71, 194, .12), transparent 40%),
    #dce8ef;
}
html[data-theme="light"] .presentation-visual img {
  outline: 1px solid rgba(10, 43, 61, .12);
  outline-offset: -1px;
}
html[data-theme="light"] .presentation-visual-label {
  border-color: rgba(255,255,255,.75);
  background: rgba(7, 28, 41, .90);
}
html[data-theme="light"] .filter {
  background: rgba(255,255,255,.66);
}
html[data-theme="light"] .filter.active {
  background: var(--text);
  color: #fff;
}

/* Keep the workshop call-to-action and organiser line in normal flow */
.service-feature {
  display: flex;
  flex-direction: column;
}
.service-feature > * { position: relative; z-index: 1; }
.service-link { flex: 0 0 auto; }
.service-people {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  margin-top: auto;
  padding-top: 20px;
}

@media (max-width: 760px) {
  .hero { gap: 30px; padding-top: 34px; }
  .hero-heading {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
  }
  .hero-heading-copy { grid-column: 2; grid-row: 1; min-width: 0; }
  .hero-mobile-photo {
    grid-column: 1;
    grid-row: 1;
    display: block;
    width: 92px;
    aspect-ratio: .9;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: var(--surface-solid);
    box-shadow: 0 16px 38px rgba(0,0,0,.22);
    transform: rotate(-1.5deg);
  }
  .hero-mobile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
  .hero-heading .eyebrow { font-size: .59rem; line-height: 1.45; }
  .hero-heading h1 { margin: 12px 0 0; font-size: clamp(2.65rem, 12vw, 4rem); line-height: .92; letter-spacing: -.061em; }
  .hero-heading h1 em { margin-left: 0; padding-bottom: .18em; }
  .hero-role { margin-top: 24px; }

  .hero-profile { min-height: 0; margin-top: 0; }
  .hero-profile::before,
  .hero-profile .profile-photo { display: none; }
  .profile-stack { width: 100%; align-items: stretch; }
  .profile-card { padding: 25px 24px 24px; }
  .profile-ctf-mini { width: 100%; }

  .service-feature { min-height: 0; padding: 28px; }
  .service-mark { margin-top: 38px; }
  .service-link { margin-top: 22px; }
  .service-people { margin-top: 30px; padding-top: 18px; }
}

@media (max-width: 380px) {
  .hero-heading { grid-template-columns: 80px minmax(0, 1fr); gap: 11px; }
  .hero-mobile-photo { width: 80px; border-radius: 21px; }
  .hero-heading h1 { font-size: 2.42rem; }
  .hero-heading .eyebrow { font-size: .54rem; }
}


/* Title-first talk and course cards */
@media (max-width: 560px) {
  .presentation-context { grid-template-columns: 1fr; gap: 9px; }
}
