/* ===================================================
   TOKENS & RESET
   =================================================== */
:root {
  --teal:        #37000B;
  --teal-dark:   #210007;
  --teal-light:  #F2E4E6;
  --teal-xlight: #FAF5F5;

  --ink:         #14100F;
  --ink-soft:    #3C2E30;
  --muted:       #8A7478;
  --rule:        rgba(55,0,11,.07);
  --white:       #FDFBF7;
  --off-white:   #F5EEE3;

  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'EB Garamond', Georgia, serif;
  --font-mono:   'DM Mono', 'Courier New', monospace;

  --radius-sm:   6px;
  --radius:      14px;
  --radius-lg:   24px;

  --shadow-sm:   0 2px 8px rgba(55,0,11,.06), 0 1px 2px rgba(55,0,11,.04);
  --shadow:      0 6px 28px rgba(55,0,11,.09), 0 2px 6px rgba(55,0,11,.05);
  --shadow-lg:   0 20px 64px rgba(55,0,11,.13), 0 6px 20px rgba(55,0,11,.07);

  --nav-h:       56px;
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --spring:      cubic-bezier(0.32, 0.72, 0, 1);
  --transition:  0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1.1rem + 2rem);
}

body {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--white);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a  { color: inherit; text-decoration: none; }

/* ===================================================
   GRAIN OVERLAY
   =================================================== */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.08 0 0 0 0 0.04 0 0 0 0 0.05 0 0 0 0.038 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ===================================================
   DECORATIVE ORNAMENTS
   =================================================== */
.ornament {
  position: fixed;
  pointer-events: none;
  color: var(--teal);
  opacity: 0.09;
  z-index: 3;
}

.ornament-1 {
  top: 0;
  right: 0;
  width: 140px;
  height: 140px;
  animation: ornament-float 9s ease-in-out infinite;
}

.ornament-2 {
  bottom: 20%;
  left: 1.75rem;
  width: 46px;
  height: 46px;
  animation: ornament-float 7s ease-in-out infinite reverse;
}

.ornament-3 {
  top: 44%;
  right: 2rem;
  width: 20px;
  height: 88px;
  animation: ornament-float 11s ease-in-out infinite;
}

@keyframes ornament-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

[data-theme="dark"] .ornament { opacity: 0.06; }

@media (max-width: 860px) { .ornament { display: none; } }

/* ===================================================
   SKIP LINK & FOCUS
   =================================================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: .45rem 1rem;
  background: var(--teal);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; outline: none; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}


/* ===================================================
   LAYOUT
   =================================================== */

.container {
  width: min(100%, 1100px);
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 6vw, 4rem);
}

.narrow { max-width: 820px; }

.section {
  padding-block-start: .9rem;
  padding-block-end: .9rem;
  position: relative;
  border-radius: var(--radius-lg);
  transition:
    padding-block-end 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.3s ease,
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.section:hover {
  box-shadow:
    0 0 0 1.5px rgba(55, 0, 11, 0.15),
    0 12px 48px -4px rgba(55, 0, 11, 0.22),
    0 4px 12px -2px rgba(55, 0, 11, 0.12);
}

.section.expanded {
  padding-block-end: clamp(3rem, 6vw, 5rem);
}

/* Collapse/expand content */
.section-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.section.expanded .section-content {
  grid-template-rows: 1fr;
}

.section-content-inner {
  overflow: hidden;
  padding-top: 2rem;
}


.section-light {
  background-color: var(--off-white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.34 0 0 0 0 0.24 0 0 0 0 0.14 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23p)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}
.section-white {
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.34 0 0 0 0 0.24 0 0 0 0 0.14 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23p)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}
.section-teal { background: var(--teal); color: var(--white); }

/* Connect section — always expanded */
#connect { padding-block-end: clamp(3rem, 6vw, 5rem); }
#connect .section-content { grid-template-rows: 1fr; }
#connect .section-title { cursor: default; pointer-events: none; }
#connect .section-title::after { display: none !important; }

/* ===================================================
   TYPOGRAPHY
   =================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(3rem, 6.5vw, 5.8rem); font-style: italic; font-weight: 500; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); font-style: normal; font-weight: 500; }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); }
h4 { font-size: .95rem; font-family: var(--font-sans); font-weight: 600; font-style: normal; letter-spacing: -0.01em; line-height: 1.4; }

p { color: var(--ink-soft); text-wrap: pretty; }

.section-title {
  color: var(--ink);
  margin-bottom: 0;
  padding-top: .85rem;
  border-top: 1px solid rgba(55,0,11,.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.section.expanded .section-title:not(.section-title--light) {
  color: var(--teal);
}


/* Expand button — injected via JS */
.expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1.5px solid rgba(55,0,11,.3);
  border-radius: 9999px;
  background: var(--off-white);
  cursor: pointer;
  color: var(--teal);
  transition: border-color var(--transition), background var(--transition);
  pointer-events: none; /* title handles the click */
}

.expand-btn svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.section.expanded .expand-btn svg {
  transform: rotate(180deg);
}

.section-title::after { display: none; }

.section-title--light {
  color: var(--white);
  border-top-color: rgba(255,255,255,.15);
}

.section-sub {
  color: var(--muted);
  font-size: .9rem;
  font-style: italic;
  margin-top: 0;
  margin-bottom: 1.25rem;
}
.section-sub--light { color: rgba(255,255,255,.55); }

.connect-sub-tagline {
  font-size: clamp(.95rem, 1.35vw, 1.05rem);
  color: rgba(255,255,255,.7);
  line-height: 1.8;
  max-width: 700px;
  margin-top: .25rem;
  margin-bottom: 2rem;
  font-style: normal;
  text-wrap: pretty;
}

.text-link {
  color: var(--teal);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.text-link:hover { border-color: var(--teal); }

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .72rem 1.75rem;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

/* Directional hover overlay — MOTION_INTENSITY 6 */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.13);
  pointer-events: none;
  translate: var(--slide-x, -110%) var(--slide-y, 0%);
  transition: translate 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn.is-hovered::after { translate: 0% 0%; }

.btn-primary {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: rgba(55,0,11,.15);
}
.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-2px);
}

.btn-white {
  background: var(--white);
  color: var(--teal-dark);
  border-color: rgba(255,255,255,.5);
  font-weight: 600;
}
.btn-white:hover {
  background: var(--teal-light);
  border-color: var(--teal-light);
  transform: translateY(-2px);
}

.btn:active { transform: translateY(1px) scale(0.97); box-shadow: none !important; }

/* ===================================================
   NAVIGATION — centered floating pill
   =================================================== */
.nav {
  position: fixed;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  height: var(--nav-h);
  width: max-content;
  max-width: calc(100% - 2rem);
  background: rgba(253,251,247,.82);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(55,0,11,.09);
  border-radius: 9999px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 4px 24px -4px rgba(55,0,11,.08);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  background: rgba(253,251,247,.97);
  border-color: rgba(55,0,11,.15);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 8px 32px -6px rgba(55,0,11,.12);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  padding-inline: 1.5rem;
}

.nav-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
  padding-right: 1.5rem;
  border-right: 1px solid rgba(55,0,11,.1);
  margin-right: .25rem;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: 0;
  padding-left: 1rem;
  border-left: 1px solid rgba(55,0,11,.1);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: clamp(.5rem, 1.2vw, 1.2rem);
  align-items: center;
  padding-right: 1rem;
}

.nav-links a {
  font-size: .83rem;
  font-weight: 500;
  color: var(--muted);
  padding: .2rem 0;
  position: relative;
  transition: color var(--transition);
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--teal);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: .3rem;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ===================================================
   HERO
   =================================================== */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--nav-h) + 1.1rem + 1.5rem);
  background-color: var(--white);
  background-image:
    linear-gradient(rgba(55,0,11,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55,0,11,.03) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.34 0 0 0 0 0.24 0 0 0 0 0.14 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23p)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 55% 65% at 85% 50%, var(--teal-xlight) 0%, transparent 70%);
  background-size: 60px 60px, 60px 60px, 200px 200px, 100% 100%;
  background-repeat: repeat, repeat, repeat, no-repeat;
}

.hero-inner {
  flex: 1;
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: 2.5rem;
}

/* Text: left */
.hero-text { flex: 1; order: 1; }

/* Photo: right, editorial frame */
.hero-photo-wrap {
  order: 2;
  flex-shrink: 0;
  /* Outer shell — warm cream bezel, hairline border, inset top highlight */
  background: var(--off-white);
  border: 1px solid rgba(55,0,11,.1);
  border-radius: 22px;
  padding: 8px;
  box-shadow:
    0 40px 90px rgba(55,0,11,.18),
    0 12px 28px rgba(55,0,11,.10),
    0 2px 6px rgba(55,0,11,.06),
    inset 0 1px 0 rgba(255,255,255,.9);
}

.hero-photo {
  /* Inner core — mathematically smaller radius than outer shell */
  width: clamp(220px, 24vw, 285px);
  height: clamp(275px, 30vw, 355px);
  border-radius: 15px;
  object-fit: cover;
  object-position: center 12%;
  display: block;
  /* Physical depth — inner top highlight simulates glass surface */
  box-shadow: inset 0 1px 3px rgba(255,255,255,.5);
}

.hero-eyebrow {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--teal);
  margin-bottom: .6rem;
}

.hero-rule {
  width: 2rem;
  height: 1px;
  background: var(--teal);
  opacity: 0.35;
  margin-bottom: .9rem;
}

.hero-credentials {
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: .3rem;
  margin-bottom: 1.1rem;
}

.hero h1 {
  color: var(--ink);
  margin-bottom: 1rem;
  line-height: 1.0;
  letter-spacing: -0.03em;
}

.hero-tagline {
  font-size: clamp(1rem, 1.35vw, 1.1rem);
  color: var(--ink-soft);
  max-width: 520px;
  margin-bottom: .75rem;
  line-height: 1.85;
}

.hero-interests {
  font-family: 'JetBrains Mono', var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.hero-footer {
  border-top: 1px solid rgba(55,0,11,.07);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.2rem 2.5rem;
  border-left: 1px solid rgba(55,0,11,.07);
  gap: .25rem;
}

.hero-stat-num {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 500;
  font-size: 2.1rem;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-stat-label {
  font-family: var(--font-mono);
  font-size: .63rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ===================================================
   QUALIFICATIONS
   =================================================== */
.qual-cards {
  display: flex;
  flex-direction: column;
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
  gap: 0;
  overflow: visible;
}

.qual-category {
  font-family: var(--font-mono);
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  padding: 1.1rem 0 .35rem;
  background: transparent;
  border-top: 1px solid rgba(55,0,11,.08);
  margin-top: .25rem;
}

.qual-category:first-child {
  padding-top: 0;
  border-top: none;
  margin-top: 0;
}

.qual-card {
  background: transparent;
  border: none;
  border-top: 1px solid rgba(55,0,11,.05);
  border-radius: 0;
  padding: .6rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0;
  box-shadow: none;
  transition: background var(--transition);
}

.qual-card:last-child { border-bottom: 1px solid rgba(55,0,11,.05); }
.qual-card:hover { background: none; box-shadow: none; }
.qual-card:hover .qual-institution { color: var(--teal); }

.qual-card-main {
  flex: 1;
  transition: transform var(--transition);
}

.qual-card:hover .qual-card-main {
  transform: translateX(4px);
}

.qual-institution {
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .1rem;
  transition: color var(--transition);
}

.qual-title {
  font-family: var(--font-sans);
  font-size: .83rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin: 0;
}

.qual-years {
  font-size: .7rem;
  font-weight: 600;
  color: var(--teal);
  white-space: nowrap;
  letter-spacing: .04em;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  background: var(--teal-xlight);
  padding: .18rem .6rem;
  border-radius: 9999px;
  border: 1px solid rgba(55,0,11,.08);
}

/* ===================================================
   EXPERIENCE
   =================================================== */
.experience-columns {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.exp-column-title {
  font-family: var(--font-mono);
  font-size: .6rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  border-bottom: 1px solid rgba(55,0,11,.1);
  padding-bottom: .5rem;
  margin-bottom: 0;
}

.exp-card {
  background: transparent;
  border-radius: 0;
  padding: .85rem 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(55,0,11,.06);
  box-shadow: none;
  transition: background var(--transition), transform var(--transition);
}

.exp-card:hover {
  background: none;
  box-shadow: none;
  transform: translateX(3px);
}

.exp-card:hover h4 { color: var(--teal); }

.exp-card:last-child { border-bottom: none; }

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .4rem;
}

.exp-header h4 {
  color: var(--ink);
  line-height: 1.35;
  transition: color var(--transition);
}

.exp-org {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .08rem;
  margin-bottom: 0;
}

.exp-date {
  font-size: .74rem;
  font-weight: 600;
  color: var(--teal);
  white-space: nowrap;
  background: var(--teal-xlight);
  padding: .2rem .6rem;
  border-radius: 9999px;
  border: 1px solid rgba(55,0,11,.08);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.exp-card p {
  font-size: .83rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .65rem;
}

.tag-list li {
  font-family: var(--font-mono);
  font-size: .63rem;
  font-weight: 400;
  color: var(--muted);
  background: var(--off-white);
  border: 1px solid rgba(55,0,11,.07);
  border-radius: 9999px;
  padding: .15rem .65rem;
}

/* ===================================================
   PUBLICATIONS
   =================================================== */
.pub-list {
  background: none;
  border: none;
  border-top: 1px solid rgba(55,0,11,.08);
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: visible;
}

.pub-item {
  display: flex;
  gap: 1.5rem;
  padding: .9rem 0;
  background: transparent;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(55,0,11,.06);
  transition: background var(--transition);
  box-shadow: none;
}

.pub-item:hover { background: none; }
.pub-item--preprint { opacity: .7; }

.pub-year {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: .72rem;
  font-weight: 500;
  color: var(--teal);
  width: 52px;
  flex-shrink: 0;
  padding-top: .2rem;
  letter-spacing: .04em;
}

.pub-body {
  flex: 1;
  transition: transform var(--transition);
}

.pub-item:hover .pub-body {
  transform: translateX(4px);
}

.pub-citation {
  font-size: .92rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.pub-citation strong { color: var(--ink); }

.pub-doi {
  display: inline-block;
  font-size: .82rem;
  color: var(--teal);
  word-break: break-all;
  transition: opacity var(--transition);
}
.pub-doi:hover { opacity: .65; }

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .65rem;
}

.pub-tag {
  font-family: var(--font-mono);
  font-size: .63rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-xlight);
  padding: .15rem .6rem;
  border-radius: 9999px;
  border: 1px solid rgba(55,0,11,.08);
}

.pub-tag--muted {
  color: var(--muted);
  background: var(--off-white);
}

/* ===================================================
   MEDIA
   =================================================== */
.media-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 72px;
  background: var(--teal-xlight);
  border-radius: var(--radius);
  border: 1px solid rgba(55,0,11,.06);
  margin-bottom: .85rem;
  color: var(--teal);
  opacity: 0.65;
  transition: opacity var(--transition), background var(--transition), transform var(--transition);
  text-decoration: none;
}

.media-thumb:hover { opacity: 1; background: var(--teal-light); transform: scale(1.03); }

.media-thumb svg { width: 26px; height: 26px; }

.media-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid rgba(55,0,11,.08);
}

/* media items reuse .exp-card; ensure last one has a bottom border in this context */
.media-list .exp-card { border-bottom: 1px solid rgba(55,0,11,.06); }
.media-list .exp-card:last-child { border-bottom: none; }

.media-watch {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .55rem;
  font-size: .83rem;
  font-weight: 600;
  color: var(--teal);
  transition: gap var(--transition), opacity var(--transition);
}
.media-watch:hover { gap: .65rem; opacity: .7; }

/* ===================================================
   SOCIAL LINKS
   =================================================== */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.25rem;
  border: 1.5px solid rgba(55,0,11,.12);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: transparent;
  transition: color var(--transition), border-color var(--transition),
              background var(--transition), transform var(--transition);
}

.social-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.social-link:hover {
  color: var(--teal);
  border-color: var(--teal);
  background: var(--teal-xlight);
  transform: translateY(-2px);
}

/* ===================================================
   CONNECT / FORM
   =================================================== */
.connect-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
  max-width: 600px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.form-group label {
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
}

.form-group input,
.form-group textarea {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  border: 1.5px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.09);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255,255,255,.3);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.14);
  box-shadow: 0 0 0 3px rgba(237, 227, 230, 0.12);
}

.form-group input.invalid,
.form-group textarea.invalid {
  border-color: rgba(255, 110, 110, .55);
}

.form-error {
  display: block;
  font-size: .73rem;
  color: rgba(255, 160, 160, .9);
  line-height: 1.4;
  min-height: 0;
}

.form-error:empty { display: none; }


.connect-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 200px;
}

.connect-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  color: var(--white);
  transition: background var(--transition), transform var(--transition);
}

.connect-item:hover {
  background: rgba(255,255,255,.18);
  transform: translateX(3px);
}

.connect-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .8;
}

/* ===================================================
   BACK TO TOP
   =================================================== */
.back-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: var(--teal);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.3s var(--ease-out),
    transform 0.3s var(--ease-out),
    background var(--transition);
  z-index: 90;
  box-shadow: 0 4px 16px rgba(55,0,11,.22);
}

.back-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-top:hover { background: var(--teal-dark); }
.back-top:active { transform: translateY(1px) scale(0.96); }
.back-top svg { width: 16px; height: 16px; pointer-events: none; }

/* ===================================================
   FOOTER
   =================================================== */
.footer {
  background: #120007;
  color: rgba(253,251,247,.28);
  padding-block: 1.5rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  text-align: center;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.footer-sep {
  margin: 0 .5rem;
  opacity: 0.4;
}

.footer-link {
  color: rgba(253,251,247,.28);
  transition: color var(--transition);
}

.footer-link:hover { color: rgba(253,251,247,.6); }

/* ===================================================
   LANGUAGE TOGGLE
   =================================================== */
.lang-toggle {
  background: none;
  border: 1.5px solid rgba(55,0,11,.1);
  border-radius: 9999px;
  height: 32px;
  padding: 0 .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .06em;
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition);
}

.lang-toggle:hover {
  color: var(--ink);
  border-color: var(--muted);
}

/* ===================================================
   THEME TOGGLE
   =================================================== */
.theme-toggle {
  background: none;
  border: 1.5px solid rgba(55,0,11,.1);
  border-radius: 9999px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition);
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--muted);
}

.theme-toggle svg { width: 14px; height: 14px; pointer-events: none; }

.icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: block; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 860px) {
  .connect-layout { grid-template-columns: 1fr; }
  .connect-links { flex-direction: row; flex-wrap: wrap; min-width: unset; }
  .connect-item { flex: 1; min-width: 140px; }
}

@media (max-width: 760px) {
  .experience-columns { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 680px) {
  /* Always expand sections on touch/mobile */
  .section { padding-block-end: clamp(2rem, 5vw, 3.5rem); }
  .section-content { grid-template-rows: 1fr; }
  .expand-btn { display: none; }

  .nav {
    top: .75rem;
    max-width: calc(100% - 1.5rem);
    padding-inline: 0;
  }

  .nav-name { display: none; }
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: calc(100% + .6rem);
    left: 0;
    right: 0;
    background: rgba(253,251,247,.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(55,0,11,.08);
    border-radius: var(--radius-lg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    border: none;
    font-size: 1rem;
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    color: var(--ink);
    transition: background var(--transition), color var(--transition);
  }

  .nav-links a::after { display: none; }

  .nav-links a:hover,
  .nav-links a.active {
    background: var(--teal-xlight);
    color: var(--teal);
    border-color: transparent;
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
    padding-top: 1.5rem;
    gap: 1.75rem;
  }

  .hero-photo-wrap { order: 1; }
  .hero-text { order: 2; }

  .hero-photo {
    width: clamp(180px, 60vw, 240px);
    height: clamp(220px, 74vw, 300px);
  }

  .hero-tagline { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-eyebrow { margin-inline: auto; }

  .hero-footer { justify-content: center; }
  .hero-stat { padding: 1rem 1.75rem; }

  .form-row { grid-template-columns: 1fr; }

  .pub-item {
    flex-direction: column;
    gap: .4rem;
    padding: .75rem 0;
  }
  .pub-year { width: auto; }

  .connect-links { flex-direction: column; }
  .connect-item { flex: none; }

  .qual-card { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .qual-years { align-self: flex-start; }
}

@media (max-width: 400px) {
  .exp-header { flex-direction: column; }
  .exp-date { align-self: flex-start; }
}

/* ===================================================
   DARK MODE
   =================================================== */
[data-theme="dark"] {
  --teal:        #EDE3E6;
  --teal-dark:   #D4CDD0;
  --teal-light:  #2A1218;
  --teal-xlight: #1C0C10;

  --ink:         #EDE3E6;
  --ink-soft:    #BFB0B4;
  --muted:       #8A7880;
  --rule:        rgba(237,227,230,.07);
  --white:       #0E0A0C;
  --off-white:   #160F12;
}

[data-theme="dark"] .nav {
  background: rgba(14,10,12,.8);
  border-color: rgba(237,227,230,.07);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 4px 24px -4px rgba(0,0,0,.3);
}
[data-theme="dark"] .nav.scrolled {
  background: rgba(14,10,12,.97);
  border-color: rgba(237,227,230,.12);
}

[data-theme="dark"] .nav-links {
  background: rgba(14,10,12,.98);
  border-color: rgba(237,227,230,.07);
}
[data-theme="dark"] .nav-controls {
  border-left-color: rgba(237,227,230,.1);
}
[data-theme="dark"] .expand-btn {
  border-color: rgba(237,227,230,.25);
  background: rgba(237,227,230,.06);
  color: #EDE3E6;
}

[data-theme="dark"] .footer {
  background: #050304;
  color: rgba(255,255,255,.22);
}

/* flat rows in dark mode — just adjust hairline border tones */
[data-theme="dark"] .qual-category,
[data-theme="dark"] .qual-card,
[data-theme="dark"] .qual-card:last-child,
[data-theme="dark"] .exp-column-title,
[data-theme="dark"] .exp-card,
[data-theme="dark"] .pub-list,
[data-theme="dark"] .pub-item,
[data-theme="dark"] .media-list,
[data-theme="dark"] .media-list .exp-card,
[data-theme="dark"] .section-title {
  border-color: rgba(237,227,230,.07);
}


[data-theme="dark"] .tag-list li {
  background: rgba(237,227,230,.06);
  border-color: rgba(237,227,230,.06);
  color: var(--muted);
}

[data-theme="dark"] .hero {
  background-color: var(--white);
  background-image:
    linear-gradient(rgba(237,227,230,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237,227,230,.02) 1px, transparent 1px),
    radial-gradient(ellipse 55% 65% at 85% 50%, var(--teal-xlight) 0%, transparent 70%);
  background-size: 60px 60px, 60px 60px, 100% 100%;
  background-repeat: repeat, repeat, no-repeat;
}

[data-theme="dark"] .hero-footer,
[data-theme="dark"] .hero-stat {
  border-color: rgba(237,227,230,.07);
}

[data-theme="dark"] .nav-name {
  border-color: rgba(237,227,230,.1);
}

[data-theme="dark"] .section-light,
[data-theme="dark"] .section-white { background-image: none; }

[data-theme="dark"] .section-teal {
  background: #1A0810;
  color: #EDE3E6;
}

[data-theme="dark"] .section:hover {
  box-shadow:
    0 0 0 1.5px rgba(237, 227, 230, 0.14),
    0 12px 48px -4px rgba(0, 0, 0, 0.5),
    0 4px 12px -2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .section-teal .section-title--light,
[data-theme="dark"] .section-teal .connect-item { color: #EDE3E6; }

[data-theme="dark"] .section-teal .section-sub--light { color: rgba(237,227,230,.6); }

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea { color: #EDE3E6; }

[data-theme="dark"] .btn-white {
  background: rgba(255,255,255,.08);
  color: #EDE3E6;
  border-color: rgba(255,255,255,.18);
}
[data-theme="dark"] .btn-white:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.32);
}


[data-theme="dark"] .hero-photo-wrap {
  background: #1C1014;
  border-color: rgba(237,227,230,.07);
  box-shadow:
    0 40px 90px rgba(0,0,0,.45),
    0 12px 28px rgba(0,0,0,.28),
    0 2px 6px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.06);
}

[data-theme="dark"] .social-link {
  border-color: rgba(237,227,230,.1);
}

[data-theme="dark"] .lang-toggle,
[data-theme="dark"] .theme-toggle {
  border-color: rgba(237,227,230,.1);
}

[data-theme="dark"] .back-top {
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}

[data-theme="dark"] .media-thumb {
  border-color: rgba(237,227,230,.06);
}

[data-theme="dark"] .grain-overlay {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.12 0 0 0 0 0.06 0 0 0 0 0.08 0 0 0 0.055 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===================================================
   SCROLL REVEAL — blur-fade-up
   =================================================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(6px);
  transition:
    opacity  0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    filter   0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
