/* =========================================================
   Portfolio stylesheet — Navy & Sky
   Fonts: Playfair Display (headings) + Inter (text).

   CONTENTS
    0  Tokens & base ........ colours, sizes, resets, layout helpers
    1  Reveal ............... scroll-in animations (set up by motion.js)
    2  Navbar ............... top bar, glowing ocean pill, mobile menu button
    3  Hero ................. intro, framed portrait, summary figures
    4  Shared parts ......... buttons, cards, tags, logos, links
    5  Experience & Education timeline
    6  Gallery & lightbox ... Field & laboratory work
    7  Methods .............. Research Methods & Tools
    8  Certificates
    9  Community ............ memberships & voluntary experience
   10  Contact
   11  Footer & back-to-top
   12  Responsive ........... tablet and phone layouts
   13  Reduced motion ....... for visitors who turn animation off
   14  Publications ......... manuscripts, conference, posters
   ========================================================= */


/* ---------- 0. Tokens & base ---------- */

/* Colours, fonts, sizes and spacing used everywhere */
:root {
  color-scheme: light;
  --navy: #1B4769;
  --navy-deep: #10304A;
  --sky: #97BCD7;
  --sky-soft: #E3EEF6;
  --mist: #F4F8FB;
  --white: #FFFFFF;
  --ink: #13283B;
  --muted: #53697C;
  --line: #D6E3EE;

  /* Ocean blues: used by the gliding nav pill */
  --ocean-light: #5BB0E6;
  --ocean: #1F7AB8;
  --ocean-deep: #0F5C97;
  --ocean-abyss: #0A4376;

  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-h3: 1.25rem;
  --fs-h2: clamp(1.9rem, 1.3rem + 2.2vw, 2.75rem);

  --s-1: 0.5rem; --s-2: 1rem; --s-3: 1.5rem; --s-4: 2.25rem; --s-5: 3.5rem;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 48, 74, .05), 0 12px 28px -16px rgba(16, 48, 74, .2);
  --shadow-hover: 0 20px 40px -20px rgba(16, 48, 74, .38);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);   /* small overshoot, used by the nav pill */
  --t-fast: 160ms;
  --t-base: 320ms;
  --nav-h: 68px;
}

/* Resets */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

/* Page defaults */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  font-size: clamp(16px, 0.25vw + 15px, 18px);
  -webkit-text-size-adjust: 100%;
}
html.js { scroll-behavior: auto; }   /* motion.js does eased scrolling */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Headings, text, links, lists, images, buttons */
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); line-height: 1.15; text-wrap: balance; }
h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.015em; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--sky); color: var(--navy-deep); }

/* Keyboard focus ring (light on dark areas) */
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
.contact-section :focus-visible, .lightbox :focus-visible, footer :focus-visible { outline-color: var(--sky); }

/* Icons from the SVG sprite */
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }

/* Page width and section spacing */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--s-3); }
.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; }
.section-alt { background: var(--mist); }

/* "Skip to content" link for keyboard users */
.skip { position: absolute; left: var(--s-2); top: -100px; z-index: 3000; padding: .6rem 1rem; background: var(--navy); color: #fff; border-radius: var(--radius-sm); }
.skip:focus { top: var(--s-2); }

/* Section title block: heading, sky underline bar, subtext */
.section-header { max-width: 46rem; margin: 0 auto var(--s-5); text-align: center; }
.section-header h2::after { content: ''; display: block; width: 56px; height: 5px; margin: var(--s-2) auto 0; background: var(--sky); border-radius: 3px; }
.section-subtext { margin: var(--s-2) auto 0; color: var(--muted); max-width: 60ch; }


/* ---------- 1. Reveal (only when motion.js sets .js) ---------- */

/* Elements fade and rise into view */
.js [data-reveal] { opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity 700ms var(--ease), transform 700ms var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Stagger: 2nd, 3rd, 4th, 5th item in a grid arrives a little later */
.cards-grid > :nth-child(2), .skills-grid > :nth-child(2), .cert-groups > :nth-child(2), .contact-grid > :nth-child(2) { --i: 1; }
.cards-grid > :nth-child(3), .skills-grid > :nth-child(3), .cert-groups > :nth-child(3), .contact-grid > :nth-child(3) { --i: 2; }
.skills-grid > :nth-child(4), .contact-grid > :nth-child(4) { --i: 3; }
.contact-grid > :nth-child(5) { --i: 4; }

/* Section headings: words slide up from a mask */
.w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .14em; margin-bottom: -.14em; }
.w > span { display: inline-block; transform: translate3d(0, 108%, 0); transition: transform 800ms var(--ease); transition-delay: calc(var(--wi, 0) * 50ms); }
.is-visible .w > span, .w.is-visible > span, [data-split].is-visible .w > span { transform: none; }


/* ---------- 2. Navbar ---------- */

/* Sticky top bar with scroll-progress line */
.navbar { position: sticky; top: 0; z-index: 1000; min-height: var(--nav-h); display: flex; align-items: center; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color var(--t-base), box-shadow var(--t-base); }
.navbar.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 24px -12px rgba(27,71,105,.2); }
.navbar::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--navy); transform: scaleX(var(--progress, 0)); transform-origin: 0 50%; }
@supports (animation-timeline: scroll()) {
  @keyframes drawX { to { transform: scaleX(1); } }
  .navbar::after { transform: scaleX(0); animation: drawX linear both; animation-timeline: scroll(root block); }
}

/* Brand name on the left */
.nav-container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--s-3); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.nav-brand { padding-bottom: 2px; font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; color: var(--navy); white-space: nowrap; background: linear-gradient(var(--sky), var(--sky)) 0 100% / 0 2px no-repeat; transition: background-size 380ms var(--ease); }
.nav-brand:hover { background-size: 100% 2px; }

/* Links sit in a recessed track (inset shadow, so the pill looks raised above it). A soft blue light follows
   the cursor along the track, and one glassy ocean-blue pill glides between the links with a slight spring. */
.nav-links { display: flex; align-items: center; position: relative; padding: 4px; background: linear-gradient(180deg, #E4EDF5 0%, #F5F9FC 100%); border-radius: 999px; box-shadow: inset 0 2px 5px rgba(16,48,74,.14), inset 0 0 0 1px var(--line), 0 1px 0 #fff; }
.nav-links::before { content: ''; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none; opacity: 0; background: radial-gradient(150px circle at var(--gx, 50%) var(--gy, 50%), rgba(91,176,230,.34), transparent 70%); transition: opacity var(--t-base); }
.nav-links:hover::before { opacity: 1; }
.nav-links a { position: relative; z-index: 1; display: block; padding: .5rem clamp(.55rem, .9vw, .9rem); font-size: var(--fs-sm); font-weight: 500; color: var(--muted); border-radius: 999px; transition: color var(--t-base), text-shadow var(--t-base), scale 200ms var(--ease); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--navy); }
/* the link that currently sits on top of the pill turns white (set by motion.js) */
.nav-links a.is-lit { color: #fff; text-shadow: 0 1px 2px rgba(4, 30, 60, .55); }
.nav-links a:active { scale: .95; }

/* The pill: deep ocean blue, smooth (no stripes), with a soft sheen on top, a faint blue light rising from the bottom,
   a dark outline, and a pulsing blue halo around it. */
.nav-indicator { position: absolute; top: 50%; left: 0; z-index: 0; height: var(--h, 34px); width: var(--w, 0); overflow: hidden; isolation: isolate; border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.2) 0%, rgba(255,255,255,0) 60%),
    radial-gradient(85% 95% at 50% 125%, rgba(70,165,225,.55), rgba(70,165,225,0) 70%),
    linear-gradient(180deg, #0F6DB5 0%, #0A518F 48%, #052F5A 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -6px 10px -6px rgba(2,20,45,.65), 0 0 0 1px rgba(4,40,80,.85), 0 4px 8px -3px rgba(4,35,70,.55), 0 0 18px 3px rgba(40,140,210,.65);
  transform: translate3d(var(--x, 0), -50%, 0); opacity: 0; pointer-events: none;
  transition: transform 520ms var(--spring), width 520ms var(--spring), scale 200ms var(--ease), opacity var(--t-base), filter var(--t-base);
  animation: pillGlow 3s ease-in-out infinite; }
.nav-indicator.is-on { opacity: 1; }
.nav-links:hover .nav-indicator { filter: saturate(1.15) brightness(1.08); }
.nav-links:has(a:active) .nav-indicator { scale: .94; }

@keyframes pillGlow {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -6px 10px -6px rgba(2,20,45,.65), 0 0 0 1px rgba(4,40,80,.85), 0 4px 8px -3px rgba(4,35,70,.55), 0 0 18px 3px rgba(40,140,210,.65); }
  50%      { box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -6px 10px -6px rgba(2,20,45,.6),  0 0 0 1px rgba(4,40,80,.85), 0 4px 8px -3px rgba(4,35,70,.55), 0 0 32px 8px rgba(70,170,235,.85); }
}

/* Mobile menu button (three bars that turn into an X) */
.nav-toggle { display: none; width: 48px; height: 48px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: none; border: 0; border-radius: var(--radius-sm); }
.nav-toggle span { width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform var(--t-base) var(--ease), opacity var(--t-fast); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ---------- 3. Hero (left-aligned, light, framed portrait) ---------- */

/* Entrance animation for the text */
@keyframes riseIn { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }

/* Hero layout: text left, portrait right */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(2.5rem, 6vw, 5rem) 0 0; background: var(--white); color: var(--ink); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); grid-template-areas: "text image"; align-items: center; column-gap: clamp(2rem, 5vw, 4.5rem); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.hero-text { grid-area: text; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }

/* Portrait: the plain rounded photo, made interactive. On a mouse it tilts toward the cursor, lifts, and a soft
   light follows the pointer across it (see motion.js). Phones and touch screens just show the photo.
   Change --focus to move the crop (x y). */
.hero-image { --focus: 50% 18%; grid-area: image; justify-self: end; width: min(100%, 440px); margin: 0; perspective: 1000px; animation: riseIn 800ms var(--ease) 120ms both; }
.tilt { position: relative; overflow: hidden; border-radius: 10px; background: var(--sky-soft); box-shadow: 0 14px 30px -14px rgba(16,48,74,.4); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--sc, 1)); transition: transform 600ms var(--ease), box-shadow 600ms var(--ease); will-change: transform; }
.tilt.is-tracking { transition: transform 140ms ease-out, box-shadow 400ms var(--ease); box-shadow: 0 30px 55px -22px rgba(16,48,74,.6), 0 0 36px -8px rgba(40,140,210,.45); }
.profile-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: var(--focus); transform: scale(1); transition: transform 900ms var(--ease); }
.tilt.is-tracking .profile-img { transform: scale(1.04); }
.glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(280px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.3), rgba(255,255,255,0) 65%); transition: opacity 400ms var(--ease); }
.tilt.is-tracking .glare { opacity: 1; }

/* Hero text: university line, name, role, bio, goal, buttons */
.hero-text > * { animation: riseIn 700ms var(--ease) both; }
.hero-affil { margin-bottom: var(--s-2); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); animation-delay: 160ms; }
.hero-text h1 { max-width: 14ch; font-size: clamp(2.2rem, 1.1rem + 3.2vw, 3.4rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; color: var(--navy); animation-delay: 230ms; }
.subtitle { margin-top: var(--s-2); max-width: none; font-family: var(--font-head); font-style: italic; font-size: clamp(1.1rem, 1rem + .6vw, 1.35rem); font-weight: 400; color: var(--muted); animation-delay: 300ms; }
.bio { margin-top: var(--s-3); max-width: 58ch; color: var(--ink); animation-delay: 370ms; }
.direction { margin-top: var(--s-3); max-width: 54ch; padding-left: var(--s-2); border-left: 2px solid var(--navy); color: var(--navy); font-weight: 500; animation-delay: 430ms; }
.hero-actions { margin-top: var(--s-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); animation-delay: 490ms; }
.hero-actions .view-link { padding: .6rem .1rem; }

/* Hero buttons: solid navy and a quiet outline */
.hero .btn { border-radius: 8px; }
.hero .btn-primary { background: var(--navy); color: #fff; }
.hero .btn-primary:hover { background: var(--navy-deep); }
.hero .btn-ghost { border-color: var(--line); color: var(--navy); }
.hero .btn-ghost:hover { border-color: var(--navy); color: var(--navy); background: var(--mist); }
.hero :focus-visible { outline-color: var(--navy); }

/* Summary figures: a quiet ruled row, no card */
.stats-row { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); animation: riseIn 700ms var(--ease) 560ms both; }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; align-items: flex-start; text-align: left; padding: var(--s-3) var(--s-3) var(--s-3) 0; gap: .35rem; }
.stat + .stat { padding-left: var(--s-3); border-left: 1px solid var(--line); }
.stat-num { font-family: var(--font-head); font-size: 2.1rem; font-weight: 600; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat-label { font-size: var(--fs-sm); font-weight: 500; line-height: 1.4; color: var(--muted); }

/* Extra space between the hero and the first section */
.hero + .section { padding-top: clamp(4.5rem, 9vw, 7.5rem); }


/* ---------- 4. Shared parts ---------- */

/* Buttons (colours are for dark areas; the hero overrides them above) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 50px; padding: .75rem 1.75rem; font-size: var(--fs-sm); font-weight: 600; border: 1.5px solid transparent; border-radius: 999px; translate: var(--tx, 0) var(--ty, 0); transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-base) var(--ease), translate 180ms ease-out; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--sky); color: var(--navy-deep); }
.btn-primary:hover { background: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { border-color: var(--sky); color: var(--sky); }

/* Cards: white panel, lifts on hover, soft light follows the cursor */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--s-3); }
.card { position: relative; isolation: isolate; padding: var(--s-4); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base); }
.card::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(151,188,215,.28), transparent 65%); transition: opacity var(--t-base); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--navy); }
  .card:hover::after { opacity: 1; }
}
.card h3 { margin-bottom: .5rem; }
.card-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: var(--s-3); color: var(--navy); background: var(--sky); border-radius: 14px; }

/* Small rounded status label (e.g. "Active member") */
.status-tag { display: inline-block; margin-bottom: var(--s-2); padding: .25rem .8rem; font-size: .8rem; font-weight: 600; color: var(--navy); background: var(--sky-soft); border-radius: 999px; }

/* Underlined text link with arrow */
.view-link { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-sm); font-weight: 600; color: var(--navy); border-bottom: 1.5px solid var(--sky); transition: border-color var(--t-fast); }
.view-link:hover { border-bottom-color: var(--navy); }

/* Tags: used in Education coursework and Research Methods */
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { padding: .35rem .9rem; font-size: var(--fs-sm); font-weight: 500; color: var(--navy); background: var(--mist); border: 1px solid var(--line); border-radius: 999px; transition: background var(--t-fast), border-color var(--t-fast); }
.tag:hover { background: var(--sky); border-color: var(--sky); }

/* Logo tiles: normal, large and wide */
.logo { flex: none; width: 48px; height: 48px; padding: 4px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.logo-lg { width: 56px; height: 56px; padding: 6px; }
.logo-wide { width: 112px; height: 60px; padding: 4px 6px; }


/* ---------- 5. Experience & Education timeline ---------- */

/* Vertical line with a dot beside each entry */
.timeline { position: relative; max-width: 52rem; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s-3); padding-left: var(--s-4); }
.timeline::before { content: ''; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 2px; background: var(--line); }
.timeline-card { position: relative; padding: var(--s-3) var(--s-4); }
.timeline-card::before { content: ''; position: absolute; left: calc(-2.25rem - 1px); top: 30px; width: 16px; height: 16px; background: var(--navy); border: 3px solid var(--sky); border-radius: 50%; box-shadow: 0 0 0 3px var(--white); }
.section-alt .timeline-card::before { box-shadow: 0 0 0 3px var(--mist); }

/* Entry header: logo, title, institution, date badge */
.timeline-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.timeline-card .logo-lg { width: 64px; height: 64px; padding: 7px; }   /* a touch larger than other logos */
.timeline-title { flex: 1 1 14rem; min-width: 0; }
.timeline-title h3 { font-size: 1.2rem; margin: 0; }
.timeline-sub { font-size: var(--fs-sm); color: var(--muted); }
.date-badge { padding: .3rem .85rem; font-size: .8rem; font-weight: 600; white-space: nowrap; color: var(--navy); background: var(--sky); border-radius: 999px; }

/* Description and captioned details (Tools, Status, Group, GPA) */
.timeline-desc { margin-bottom: var(--s-2); }
.meta { display: flex; flex-wrap: wrap; gap: .5rem var(--s-4); margin-bottom: var(--s-2); font-size: var(--fs-sm); }
.meta dt { display: inline; font-weight: 600; color: var(--navy); }
.meta dt::after { content: ': '; }
.meta dd { display: inline; color: var(--muted); }

/* Short caption above the coursework tags */
.edu-label { margin-bottom: .5rem; font-size: var(--fs-sm); font-weight: 600; color: var(--navy); }

/* Supervisor box */
.supervisor { display: flex; gap: .9rem; padding: var(--s-2); margin-top: var(--s-2); background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.supervisor-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; color: var(--navy); background: var(--sky); border-radius: 50%; }
.supervisor-label { display: block; font-size: .8rem; color: var(--muted); }
.supervisor h4 { font-size: 1rem; font-weight: 600; }
.supervisor p { font-size: var(--fs-sm); color: var(--muted); }
.supervisor a { display: inline-block; margin-top: .25rem; font-size: var(--fs-sm); font-weight: 500; color: var(--navy); word-break: break-all; }
.supervisor a:hover { text-decoration: underline; }


/* ---------- 6. Gallery & lightbox (Field & laboratory work) ---------- */

/* Photo grid and photo tiles */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.gallery-item { margin: 0; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease); }
@media (hover: hover) and (pointer: fine) { .gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); } }
.image-wrapper { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; background: var(--sky-soft); border: 0; cursor: zoom-in; }
.image-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 800ms var(--ease); }
.image-wrapper::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(16,48,74,.45)); opacity: 0; transition: opacity var(--t-base); pointer-events: none; }
.image-wrapper:hover img, .image-wrapper:focus-visible img { transform: scale(1.05); }
.image-wrapper:hover::after, .image-wrapper:focus-visible::after { opacity: 1; }
.image-wrapper:focus-visible { outline-offset: -4px; }
.gallery-item figcaption { padding: var(--s-2) var(--s-3) var(--s-3); font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; color: var(--ink); }

/* Tile text shown when a photo fails to load */
.image-wrapper.is-broken { display: grid; place-items: center; padding: var(--s-3); color: var(--muted); font-size: var(--fs-sm); text-align: center; }
.image-wrapper.is-broken img { display: none; }
.image-wrapper.is-broken::before { content: attr(data-alt); }

/* Full-screen viewer: picture, caption, close / previous / next buttons */
.lightbox { position: fixed; inset: 0; z-index: 4000; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; padding: var(--s-3); background: rgba(10, 31, 50, .95); opacity: 0; transition: opacity 250ms ease; }
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lb-figure { grid-column: 2; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); min-width: 0; }
.lb-figure img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: var(--radius-sm); transition: opacity 200ms ease; }
.lb-figure img.is-swapping { opacity: 0; }
.lb-figure figcaption { max-width: 60ch; text-align: center; color: #fff; font-size: var(--fs-sm); }
.lb-btn { display: grid; place-items: center; width: 48px; height: 48px; font-size: 2rem; line-height: 1; color: var(--sky); background: rgba(151,188,215,.12); border: 1px solid rgba(151,188,215,.4); border-radius: 50%; transition: background var(--t-fast); }
.lb-btn:hover { background: rgba(151,188,215,.28); }
.lb-close { position: absolute; top: var(--s-2); right: var(--s-2); }
.lb-prev { grid-column: 1; grid-row: 1; justify-self: center; }
.lb-next { grid-column: 3; grid-row: 1; justify-self: center; }


/* ---------- 7. Methods (Research Methods & Tools) ---------- */

/* Four skill groups; the tags themselves are styled in "Shared parts" */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--s-3); }
.skill-group h3 { margin-bottom: var(--s-3); font-size: 1.15rem; }


/* ---------- 8. Certificates ---------- */

/* Three columns of course links */
.cert-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--s-4) var(--s-3); align-items: start; }
.cert-group h3 { margin-bottom: var(--s-2); font-size: 1.15rem; }
.cert-list { display: flex; flex-direction: column; gap: .75rem; }
.cert-list a { display: flex; align-items: center; gap: var(--s-2); padding: .85rem 1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base) var(--ease); }
.cert-list a:hover { border-color: var(--navy); box-shadow: var(--shadow-hover); transform: translateX(4px); }

/* Course name, issuer and the small arrow icon */
.cert-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cert-name { font-size: .95rem; font-weight: 600; line-height: 1.35; color: var(--navy); }
.cert-org { font-size: var(--fs-sm); color: var(--muted); }
.ext { color: var(--muted); transition: color var(--t-fast), transform var(--t-base) var(--ease); }
.cert-list a:hover .ext { color: var(--navy); transform: translate(2px, -2px); }


/* ---------- 9. Community (memberships & voluntary experience) ---------- */

/* Small centred headings: "Professional memberships", "Voluntary experience" */
.group-title { text-align: center; margin: var(--s-5) 0 var(--s-3); font-family: var(--font-body); font-size: var(--fs-base); font-weight: 700; letter-spacing: .02em; color: var(--navy); }
.group-title:first-of-type { margin-top: 0; }

/* Membership and volunteer cards */
.affil-card { display: flex; flex-direction: column; }
.affil-header { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); margin-bottom: var(--s-2); }
.affil-header h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: .35rem; }
.affil-header .status-tag { margin: 0; max-width: 100%; text-wrap: balance; }
.affil-desc { margin-bottom: var(--s-2); }
.affil-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin-top: auto; padding-top: var(--s-2); border-top: 1px solid var(--line); }


/* ---------- 10. Contact ---------- */

/* Navy band with faint ring pattern */
.contact-section { background: var(--navy); position: relative; isolation: isolate; }
.contact-section::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-radial-gradient(circle at 12% 110%, transparent 0 54px, rgba(151,188,215,.09) 54px 55px);
  -webkit-mask-image: radial-gradient(circle at 12% 110%, #000, transparent 60%);
          mask-image: radial-gradient(circle at 12% 110%, #000, transparent 60%); }
.contact-section h2 { color: #fff; }
.contact-section .section-subtext { color: rgba(255,255,255,.82); }

/* Contact rows: icon, label, value */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--s-2); }
.contact-row { display: flex; align-items: center; gap: var(--s-2); height: 100%; padding: var(--s-2) var(--s-3); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius); transition: background var(--t-base), border-color var(--t-base), transform var(--t-base) var(--ease); }
.contact-row:hover { background: rgba(255,255,255,.13); border-color: var(--sky); transform: translateY(-3px); }
.contact-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; color: var(--navy); background: var(--sky); border-radius: 14px; }
.contact-icon:has(img) { background: #fff; }
.contact-icon img { width: 28px; height: 28px; object-fit: contain; }
.contact-info { display: flex; flex-direction: column; min-width: 0; }
.contact-label { font-size: .8rem; color: var(--sky); }
.contact-value { font-weight: 600; color: #fff; overflow-wrap: anywhere; }


/* ---------- 11. Footer & back-to-top ---------- */

/* Footer bar: copyright and social icons */
footer { padding: var(--s-4) 0; background: var(--navy-deep); color: rgba(255,255,255,.75); }
.footer-content { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.footer-content p { font-size: var(--fs-sm); }
.footer-content strong { color: #fff; }
.footer-content p a { color: var(--sky); }
.footer-content p a:hover { text-decoration: underline; }
.footer-links { display: flex; gap: var(--s-1); }
.footer-links a { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; transition: background var(--t-fast); }
.footer-links a img { background: #fff; border-radius: 6px; padding: 2px; }
.footer-links a:hover { background: rgba(255,255,255,.12); }

/* Round "back to top" button, appears after scrolling */
.back-to-top { position: fixed; right: var(--s-3); bottom: var(--s-3); z-index: 900; display: grid; place-items: center; width: 50px; height: 50px; color: var(--sky); background: var(--navy); border: 1.5px solid var(--sky); border-radius: 50%; box-shadow: 0 14px 28px -12px rgba(16,48,74,.6); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity var(--t-base), transform var(--t-base) var(--ease), background var(--t-fast), color var(--t-fast); }
.back-to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { color: var(--navy); background: var(--sky); }


/* ---------- 12. Responsive (keep NAV_COLLAPSE in motion.js = 1000) ---------- */

/* Up to 1000px: nav links become a dropdown menu; the ocean pill slides up/down inside it */
@media (max-width: 1000px) {
  .nav-container { gap: 0; }
  .nav-toggle { display: flex; margin-left: auto; margin-right: -12px; }
  .nav-links::before { display: none; }
  .nav-indicator { top: 0; left: 0; animation: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -6px 10px -6px rgba(2,20,45,.65), 0 0 0 1px rgba(4,40,80,.85), 0 6px 14px -8px rgba(4,35,70,.7); transform: translate3d(var(--x, 0), var(--y, 0), 0); }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: var(--s-2) var(--s-3) var(--s-3); background: var(--white); border-radius: 0; box-shadow: inset 0 1px 0 var(--line), 0 20px 30px -16px rgba(27,71,105,.2);
    visibility: hidden; opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity 260ms var(--ease), transform 360ms var(--ease), visibility 0s linear 360ms; }
  .nav-links.open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }
  .nav-links a { padding: .85rem 1rem; font-size: var(--fs-base); border-radius: var(--radius-sm); opacity: 0; transform: translateY(-6px); transition: opacity 300ms var(--ease), transform 400ms var(--ease), color var(--t-base), background var(--t-fast), scale 200ms var(--ease); }
  .nav-links.open a { opacity: 1; transform: none; transition-delay: calc(var(--k, 0) * 30ms + 60ms), calc(var(--k, 0) * 30ms + 60ms), 0s, 0s, 0s; }
  .nav-links li:nth-child(2) { --k: 1; } .nav-links li:nth-child(3) { --k: 2; } .nav-links li:nth-child(4) { --k: 3; }
  .nav-links li:nth-child(5) { --k: 4; } .nav-links li:nth-child(6) { --k: 5; } .nav-links li:nth-child(7) { --k: 6; } .nav-links li:nth-child(8) { --k: 7; } .nav-links li:nth-child(9) { --k: 8; }
  .nav-links a[aria-current="page"] { color: var(--navy); }
  .nav-links a.is-lit { color: #fff; }
}

/* Up to 820px: portrait above text, 2-column gallery and stats, compact lightbox */
@media (max-width: 820px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; grid-template-areas: "image" "text"; row-gap: var(--s-5); }
  .hero-image { justify-self: start; width: min(82%, 340px); }
  .hero-text h1 { max-width: none; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: var(--s-2) var(--s-2) var(--s-2) 0; }
  .stat + .stat { padding-left: var(--s-2); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .lightbox { grid-template-columns: 1fr; padding: 64px var(--s-2) 80px; }
  .lb-figure { grid-column: 1; }
  .lb-prev, .lb-next { position: absolute; bottom: var(--s-2); grid-column: auto; }
  .lb-prev { left: calc(50% - 56px); } .lb-next { left: calc(50% + 8px); }
}

/* Up to 560px: single-column gallery, tighter cards and timeline */
@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .card { padding: var(--s-3); }
  .timeline { padding-left: var(--s-3); }
  .timeline-card { padding: var(--s-2) var(--s-3); }
  .timeline-card::before { left: calc(-1.5rem - 1px); }
  .timeline::before { left: 5px; }
  .back-to-top { right: var(--s-2); bottom: var(--s-2); }
}


/* ---------- 13. Reduced motion ---------- */

/* Turns animations off for visitors who ask for it */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .w > span { transform: none !important; }
}


/* ---------- 14. Publications ---------- */
/* Selectors are scoped to .pubs or use pub-/poster- names, so nothing else on the site is affected. */

/* Summary strip: 3 manuscripts, 3 posters, 1 presenting author */
.pubs-summary { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 44rem; margin: calc(var(--s-3) * -1) auto var(--s-5); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pubs-summary > div { display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-end; gap: .3rem; padding: var(--s-3) var(--s-2); text-align: center; }
.pubs-summary > div + div { border-left: 1px solid var(--line); }
.pubs-summary dd { font-family: var(--font-head); font-size: 2.1rem; font-weight: 600; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.pubs-summary dt { font-size: var(--fs-sm); font-weight: 500; line-height: 1.4; color: var(--muted); }

/* Group headings: title, small note, then a rule that fills the row */
.pubs-group + .pubs-group { margin-top: var(--s-5); }
.pubs-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem var(--s-2); margin-bottom: var(--s-3); }
.pubs-group-head::after { content: ''; flex: 1 1 3rem; height: 1px; background: var(--line); }
.pubs .pubs-group-title { margin: 0; font-size: 1.55rem; font-weight: 600; letter-spacing: -0.01em; }
.pubs-group-note { font-size: var(--fs-sm); color: var(--muted); }

/* Shared text: author list (your name highlighted), chips and cross-reference links */
.pubs .pub-authors { margin-top: var(--s-2); font-size: .95rem; font-weight: 600; line-height: 1.6; color: var(--ink); }
.pubs .me { font-weight: 700; color: var(--navy); background: linear-gradient(transparent 62%, rgba(151,188,215,.55) 62%); }
.pub-chip { display: inline-block; padding: .2rem .7rem; font-size: .8rem; font-weight: 600; color: var(--navy); background: var(--mist); border: 1px solid var(--line); border-radius: 999px; }
.pub-chip-status { background: var(--sky-soft); border-color: var(--sky); }
.pub-xref { font-size: var(--fs-sm); font-weight: 600; color: var(--navy); border-bottom: 1.5px solid var(--sky); transition: border-color var(--t-fast); }
.pub-xref:hover { border-bottom-color: var(--navy); }

/* Journal manuscripts: a navy spine carries the subject icon and the M-number that posters refer back to */
.pub-list { display: flex; flex-direction: column; gap: var(--s-3); }
.pub { display: grid; grid-template-columns: 84px minmax(0, 1fr); overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pub:hover { border-color: var(--navy); box-shadow: var(--shadow-hover); }
.pub-rail { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); padding: var(--s-4) var(--s-1); color: var(--sky); background: linear-gradient(180deg, var(--navy), var(--navy-deep)); }
.pub-rail .icon { width: 30px; height: 30px; stroke-width: 1.5; }
.pub-ref { font-family: var(--font-head); font-size: 1.15rem; font-style: italic; font-weight: 600; color: #fff; }

/* Manuscript text: type line, title, abstract, footer chips */
.pub-body { padding: var(--s-4); min-width: 0; }
.pub-type { font-size: var(--fs-sm); font-style: italic; color: var(--muted); }
.pub-title { margin-top: .4rem; font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
.pub-abstract { margin-top: var(--s-2); max-width: 70ch; font-size: .95rem; line-height: 1.75; color: var(--muted); }
.pub-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem var(--s-2); margin-top: var(--s-3); padding-top: var(--s-2); border-top: 1px solid var(--line); }
.pub-foot .pub-xref { margin-left: auto; }

/* Conference band: navy panel with the BSPST name, dates and venue */
.pubs-conf { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-3); padding: var(--s-3) var(--s-4); color: #fff; background: var(--navy); border-radius: var(--radius); }
.pubs-conf::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-radial-gradient(circle at 100% 0%, transparent 0 44px, rgba(151,188,215,.14) 44px 45px);
  -webkit-mask-image: radial-gradient(circle at 100% 0%, #000, transparent 65%);
          mask-image: radial-gradient(circle at 100% 0%, #000, transparent 65%); }
.pubs .pubs-conf-name { flex: 1 1 22rem; margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.35; color: #fff; }
.pubs-conf-facts { display: flex; flex-direction: column; gap: .15rem; font-size: var(--fs-sm); color: rgba(255,255,255,.85); }
.pubs-conf-facts li:first-child { font-weight: 600; color: var(--sky); }

/* Posters: the one where you present gets a navy top edge and a tinted panel */
.poster-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--s-3); align-items: stretch; }
.poster { display: flex; flex-direction: column; padding: var(--s-3); background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--sky); border-radius: var(--radius); box-shadow: var(--shadow); }
.poster:hover { border-color: var(--navy); box-shadow: var(--shadow-hover); }
.poster.is-presenting { border-top-color: var(--navy); background: linear-gradient(180deg, var(--sky-soft), var(--white) 55%); }
.poster-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-1); margin-bottom: var(--s-2); }
.poster-ref { font-family: var(--font-head); font-size: 1.15rem; font-style: italic; font-weight: 600; color: var(--navy); }
.poster-role { padding: .2rem .7rem; font-size: .8rem; font-weight: 600; color: var(--navy); background: var(--white); border: 1px solid var(--sky); border-radius: 999px; }
.poster.is-presenting .poster-role { color: #fff; background: var(--navy); border-color: var(--navy); }
.pubs .poster-title { margin: 0; font-size: 1.08rem; font-weight: 600; line-height: 1.35; }
.poster .pub-authors { margin-bottom: var(--s-2); font-size: .9rem; }
.poster-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem var(--s-2); margin-top: auto; padding-top: var(--s-2); border-top: 1px solid var(--line); }
.poster-presenter { font-size: var(--fs-sm); color: var(--muted); }

/* Publications on tablet and phone */
@media (max-width: 720px) {
  .pub { grid-template-columns: 1fr; }
  .pub-rail { flex-direction: row; justify-content: flex-start; padding: .7rem var(--s-3); }
  .pub-rail .icon { width: 24px; height: 24px; }
  .pub-body { padding: var(--s-3); }
  .pub-foot .pub-xref { margin-left: 0; }
  .pubs-conf { padding: var(--s-3); }
}
@media (max-width: 480px) {
  .pubs-summary dd { font-size: 1.7rem; }
  .pubs-summary > div { padding: var(--s-2) .4rem; }
}
