/* ============= Google Fonts ============ */
@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

/* ============= Design Tokens ============ */
:root {
  /* --- Light theme --- */
  --body-color: #fbfbfc;
  --primary-color: #12161c;
  --p-color: #4b5563;
  /* Dark enough to clear 4.5:1 on both --body-color and --surface */
  --muted-color: #606a76;

  --surface: #f3f4f7;
  --surface-solid: #ffffff;
  --surface-border: #e3e6ea;
  --input-color: #ffffff;
  --input-hover: #f7f8fa;

  /* teal-700, not teal-600 — the lighter teal only reaches 3.6:1 as text on
     white and 3.7:1 behind white button labels, both short of AA */
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-2: #6366f1;
  --accent-soft: rgba(15, 118, 110, 0.09);
  --on-accent: #ffffff;

  --glow-1: rgba(13, 148, 136, 0.16);
  --glow-2: rgba(99, 102, 241, 0.13);
  --dot-color: rgba(18, 22, 28, 0.14);

  --font-display: "Sora", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --shell: 1120px;
  /* Height of the logo/nav row alone (sticky shrinks it via the modifier below) */
  --nav-h: 76px;
  /* Total fixed-header height (nav row + sequence ticker). Static fallback for
     first paint; script.js measures the real rendered height and overwrites
     this every time the header's content or sticky state changes. */
  --header-h: 116px;
  /* Height of the fixed footer sequence ticker. Static fallback for first
     paint; script.js measures the real rendered height and overwrites this. */
  --footer-ticker-h: 40px;
}

/* ========== Dark Theme ======== */
body.dark-theme {
  --body-color: #0b0f14;
  --primary-color: #e6ebf1;
  --p-color: #98a3b0;
  --muted-color: #8b95a3;

  --surface: #141a21;
  --surface-solid: #141a21;
  --surface-border: #232b34;
  --input-color: #10161c;
  --input-hover: #182028;

  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-2: #818cf8;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --on-accent: #06231f;

  --glow-1: rgba(45, 212, 191, 0.13);
  --glow-2: rgba(129, 140, 248, 0.12);
  --dot-color: rgba(230, 235, 241, 0.13);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--body-color);
  color: var(--p-color);
  overflow-x: hidden;
  line-height: 1.7;
  transition: background 0.35s ease, color 0.35s ease;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

p {
  color: var(--p-color);
}

strong {
  color: var(--primary-color);
  font-weight: 600;
}

em {
  font-style: italic;
}

::selection {
  background: var(--accent-soft);
  color: var(--primary-color);
}

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

/* ---- Backdrop: dot lattice + soft glows ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 85% 60% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 85% 60% at 50% 0%, #000 0%, transparent 78%);
  opacity: 0.75;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(620px circle at 12% -4%, var(--glow-1), transparent 62%),
    radial-gradient(560px circle at 92% 6%, var(--glow-2), transparent 60%);
}

/* ============= Utilities ============ */
.skip-link {
  position: absolute;
  top: -60px;
  left: 1rem;
  z-index: 2000;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: top 0.25s ease;
}
.skip-link:focus {
  top: 1rem;
}

.gradient-text {
  background: linear-gradient(96deg, var(--primary-color) 8%, var(--accent) 58%, var(--accent-2) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============= Reveal Animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============= Scroll Progress ============ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.1s linear;
}

/* ============= Header ============ */
/* Column stack: sequence ticker on top, logo/nav row underneath — both ride
   along together since the whole header is fixed to the viewport top. */
#site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Same box as `section` below, so the logo shares the body copy's left edge */
.header__inner {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 6%;
  height: var(--nav-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: height 0.3s ease;
}

#site-header.sticky {
  background: color-mix(in srgb, var(--body-color) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--surface-border);
}

#site-header.sticky .header__inner {
  height: 64px;
}

/* fallback for browsers without color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  #site-header.sticky {
    background: var(--body-color);
  }
}

.logo {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--primary-color);
  white-space: nowrap;
}
.logo span {
  color: var(--accent);
}

.nav-container {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* ---- Navbar with sliding pill ---- */
.nav-wrap {
  position: relative;
}

.nav-pill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 34px;
  width: 0;
  transform: translate(0, -50%);
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid transparent;
  transition: width 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
.nav-pill.ready {
  opacity: 1;
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}

.navbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link a {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--p-color);
  border-radius: 999px;
  transition: color 0.25s ease;
}
.nav-link a:hover {
  color: var(--primary-color);
}
.nav-link.active-link a {
  color: var(--accent);
  font-weight: 600;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  width: 38px;
  border-radius: 10px;
  font-size: 1.2rem;
  color: var(--primary-color);
  border: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.icon-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--surface-border);
}

#menu-icon {
  display: none;
}

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(6, 10, 14, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ============= Section Shell ============ */
section {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 7rem 6% 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.eyebrow--center {
  text-align: center;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(1.95rem, 4.2vw, 2.7rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 2.6rem;
}
.title--hero {
  text-align: left;
  font-size: clamp(2.4rem, 5.4vw, 3.5rem);
  margin-bottom: 0.5rem;
  padding-bottom: 0.1em;
}

.subtitle {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: -0.3px;
  margin: 3.2rem 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.subtitle i {
  color: var(--accent);
  font-size: 1.35rem;
}

.lede {
  max-width: 780px;
  margin: 0 auto 2.8rem;
  text-align: center;
  font-size: 1.05rem;
}

/* ============= Hero ============ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 4rem;
  min-height: 100vh;
  padding-top: calc(var(--header-h) + 4rem);
  padding-bottom: 3rem;
}

.hero__role {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.hero__tagline {
  max-width: 46ch;
  font-size: 1.02rem;
  margin-bottom: 2rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 1.8rem;
  font-size: 0.86rem;
  color: var(--muted-color);
}
.hero__meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.hero__meta i {
  color: var(--accent);
  font-size: 1rem;
}

/* ---- Portrait ---- */
.hero__portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.portrait-frame {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
  border-radius: 28% 28% 28% 28% / 28%;
  padding: 6px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
}
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: inherit;
  border: 1px dashed var(--surface-border);
  z-index: -1;
}

.portrait-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  background: var(--surface);
}

.portrait-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--p-color);
}
.portrait-badge .dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============= Sequence Ticker ============ */
.seq-strip {
  overflow: hidden;
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
  background: var(--surface);
  padding: 0.55rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

/* Fixed to the bottom of the viewport, mirroring #site-header, so the page
   is framed by a ticker on both edges regardless of scroll position. */
.ticker-footer {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1000;
}

.seq-strip__track {
  display: flex;
  width: max-content;
  animation: seq-scroll 700s linear infinite;
}

.seq {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 2px;
  color: var(--muted-color);
  white-space: nowrap;
}
.seq b {
  color: var(--accent);
  font-weight: 500;
}

@keyframes seq-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============= Two-part Section Layout ============ */
.in-line-link {
  color: var(--accent);
  font-weight: 500;
  transition: color 0.25s ease;
}

.section-container {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
  gap: 3rem;
}
.section-container--reverse {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
}

.prose p {
  margin-bottom: 1.15rem;
}
.prose p:last-child {
  margin-bottom: 0;
}

.section__pic-container {
  align-self: center;
}
.section__pic-container--sticky {
  /* start (not center) so the grid area stays taller than the item — sticky has
     nothing to travel within otherwise */
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 2rem);
}

.side-pic {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  background: var(--surface);
}

/* ============= Timeline ============ */
.timeline {
  position: relative;
  padding-left: 1.9rem;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  bottom: 0.55rem;
  left: 5px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--surface-border));
}

.timeline__item {
  position: relative;
  padding-bottom: 2rem;
}
.timeline__item:last-child {
  padding-bottom: 0;
}
.timeline__item::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: calc(-1.9rem + 1px);
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: var(--body-color);
  border: 2px solid var(--accent);
}

.timeline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  margin-bottom: 0.25rem;
}

.timeline__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-color);
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

.timeline__org {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--p-color);
  margin-bottom: 0.35rem;
}

.timeline__note {
  font-size: 0.87rem;
  color: var(--muted-color);
}

.timeline--flush {
  padding-left: 1.7rem;
}

/* ============= Feature Card ============= */
.feature-card {
  padding: 2rem 2.2rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-left: 3px solid var(--accent);
  margin-bottom: 1.6rem;
}

.feature-card__badge {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.feature-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.4px;
  color: var(--primary-color);
  margin-bottom: 0.9rem;
}

.feature-card__body {
  max-width: 78ch;
  margin-bottom: 1.4rem;
}

/* ============= Aim Cards ============= */
.aim-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
}

.aim-card {
  display: flex;
  flex-direction: column;
  padding: 1.8rem;
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.aim-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--surface-border));
  transform: translateY(-3px);
}

.aim-card__num {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  margin-bottom: 0.9rem;
}

.aim-card__title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--primary-color);
  margin-bottom: 0.8rem;
}

.aim-card p {
  font-size: 0.95rem;
}

/* ============= Tick list ============= */
.tick-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.tick-list li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.tick-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  height: 6px;
  width: 6px;
  border-radius: 2px;
  background: var(--accent);
}

/* ============= Chips ============= */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--p-color);
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
}
body.dark-theme .chip {
  background: var(--input-color);
}

.tag-soft {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.3px;
  color: var(--muted-color);
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  border: 1px solid var(--surface-border);
  margin-left: 0.15rem;
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  color: var(--muted-color);
  border: 1px solid var(--surface-border);
}
.badge--accent {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
}

/* ============= Skills Grid ============= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem;
}

.skill-group {
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
}
.skill-group:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.skill-group h4 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}
.skill-group h4 i {
  color: var(--accent);
  font-size: 1.2rem;
}

/* ============= Publications ============= */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pub-card {
  display: flex;
  gap: 1.4rem;
  padding: 1.5rem 1.7rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  transition: border-color 0.25s ease;
}
.pub-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--surface-border));
}
.pub-card--featured {
  border-left: 3px solid var(--accent);
}

.pub-year {
  flex-shrink: 0;
  min-width: 3.1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  padding-top: 0.15rem;
}

.pub-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--primary-color);
  margin-bottom: 0.45rem;
}

.pub-authors {
  font-size: 0.89rem;
  line-height: 1.6;
  margin-bottom: 0.3rem;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--muted-color);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
}
.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-family: var(--font-mono);
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.pub-links a:hover {
  border-bottom-color: var(--accent);
}

/* ============= Two Column ============= */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 3rem;
  align-items: start;
}

.stack-list {
  display: flex;
  flex-direction: column;
}
.stack-list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  font-size: 0.91rem;
  line-height: 1.65;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--surface-border);
}
.stack-list li:last-child {
  border-bottom: none;
}
.stack-year {
  flex-shrink: 0;
  min-width: 3.9rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--accent);
}

/* ============= Leadership ============= */
.lead-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
}

.lead-card {
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-top: 3px solid var(--accent);
}
.lead-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--primary-color);
  margin-bottom: 0.35rem;
}
.lead-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.lead-card p {
  font-size: 0.88rem;
}

/* ============= Contact ============= */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 1.6rem;
  align-items: start;
}

.contact-card {
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

.contact-card__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.7rem;
}

.contact-card__body {
  font-size: 0.93rem;
  margin-bottom: 1.6rem;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9rem;
}
.contact-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.contact-list i {
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1.6;
}
.contact-list a {
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  word-break: break-word;
}
.contact-list a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- Form ---- */
.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

.input-wrap {
  position: relative;
}
.input-wrap.w-100 {
  grid-column: 1 / -1;
}

.contact-input {
  width: 100%;
  padding: 1.5rem 2.8rem 0.7rem 1.1rem;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--primary-color);
  background: var(--input-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.22s ease, background 0.22s ease;
}
.contact-input:hover {
  background: var(--input-hover);
}
.contact-input:focus {
  border-color: var(--accent);
}

.input-wrap label {
  position: absolute;
  top: 50%;
  left: 1.1rem;
  transform: translateY(-50%);
  font-size: 0.94rem;
  color: var(--muted-color);
  pointer-events: none;
  transition: top 0.2s ease, font-size 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.form-icon {
  position: absolute;
  top: 50%;
  right: 1.05rem;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--muted-color);
  pointer-events: none;
  transition: color 0.22s ease;
}

textarea.contact-input {
  resize: vertical;
  min-height: 150px;
  line-height: 1.65;
}
.input-wrap--textarea label {
  top: 1.2rem;
  transform: none;
}
.input-wrap--textarea .form-icon {
  top: 1.3rem;
  transform: none;
}

/* Floating label — driven by :placeholder-shown-free approach via JS classes */
.input-wrap.is-filled label,
.input-wrap.is-focused label {
  top: 0.7rem;
  font-size: 0.68rem;
  transform: none;
  letter-spacing: 0.3px;
}
.input-wrap.is-focused label,
.input-wrap.is-focused .form-icon {
  color: var(--accent);
}

.contact-form button {
  grid-column: 1 / -1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============= Buttons ============= */
.btn-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.78rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.91rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--surface-border);
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============= Socials ============= */
.socials {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.6rem;
}
.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  width: 44px;
  border-radius: 11px;
  font-size: 1.35rem;
  color: var(--p-color);
  border: 1px solid var(--surface-border);
  transition: color 0.22s ease, border-color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}
.socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* ============= Footer ============= */
.site-footer {
  margin-top: 6rem;
  /* Bottom clears the fixed footer ticker so the copyright line isn't covered */
  padding: 2.6rem 6% calc(var(--footer-ticker-h) + 1.6rem);
  text-align: center;
  border-top: 1px solid var(--surface-border);
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}
.footer-socials a {
  color: var(--p-color);
  transition: color 0.22s ease;
}
.footer-socials a:hover {
  color: var(--accent);
}

.copyright {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--muted-color);
}

/* ============= Scroll Up ============= */
.scrollup {
  position: fixed;
  right: 22px;
  bottom: -25%;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  width: 42px;
  border-radius: 11px;
  font-size: 1.3rem;
  color: var(--on-accent);
  background: var(--accent);
  transition: bottom 0.4s ease, background 0.22s ease;
}
.scrollup:hover {
  background: var(--accent-hover);
}
.scrollup.show-scroll {
  bottom: calc(var(--footer-ticker-h) + 16px);
}

/* !================== Media Queries ============== */
@media screen and (max-width: 1080px) {
  .hero {
    gap: 2.5rem;
  }
  .lead-grid {
    grid-template-columns: 1fr;
  }
  .aim-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: calc(var(--header-h) + 2.5rem);
    gap: 2.5rem;
  }
  .hero__portrait {
    order: -1;
  }
  .title--hero {
    text-align: center;
  }
  .hero__tagline {
    margin-left: auto;
    margin-right: auto;
  }
  .btn-container,
  .socials,
  .hero__meta {
    justify-content: center;
  }
  .eyebrow {
    text-align: center;
  }
  .portrait-frame {
    width: min(72vw, 260px);
  }

  .section-container,
  .section-container--reverse {
    grid-template-columns: 1fr;
  }
  .section__pic-container {
    order: 2;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }
  .section__pic-container--sticky {
    position: static;
  }
  .skills-grid,
  .two-col,
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .two-col {
    gap: 0;
  }
}

/* The six-item nav needs ~840px of header room before the logo and the theme
   button start colliding, so the drawer takes over well above phone widths. */
@media screen and (max-width: 940px) {
  #menu-icon {
    display: inline-flex;
  }
  .nav-pill {
    display: none;
  }

  .navbar {
    position: fixed;
    top: 0;
    right: -100%;
    bottom: 0;
    z-index: 999;
    width: 74%;
    max-width: 300px;
    height: 100vh;
    /* Top clears the fixed header (nav row + ticker); bottom clears the fixed footer ticker */
    padding: calc(var(--header-h) + 24px) 32px calc(var(--footer-ticker-h) + 48px);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    background: var(--body-color);
    border-left: 1px solid var(--surface-border);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .navbar.open {
    right: 0;
  }
  .nav-link {
    width: 100%;
  }
  .nav-link a {
    display: block;
    width: 100%;
    padding: 0.7rem 0.5rem;
    font-size: 1.02rem;
    color: var(--primary-color);
  }
  .nav-link.active-link a {
    background: var(--accent-soft);
  }
}

@media screen and (max-width: 760px) {
  section {
    padding-top: 5.5rem;
  }
  .feature-card {
    padding: 1.5rem;
  }
  .pub-card {
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.4rem;
  }
  .contact-form,
  .contact-card {
    padding: 1.5rem;
  }
  .scrollup {
    display: none;
  }
  .timeline__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media screen and (max-width: 480px) {
  section,
  .header__inner {
    padding-left: 5%;
    padding-right: 5%;
  }
  .logo {
    font-size: 1.15rem;
  }
  .contact-form {
    grid-template-columns: 1fr;
  }
  .contact-form button {
    justify-self: stretch;
    justify-content: center;
  }
  .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .stack-list li {
    flex-direction: column;
    gap: 0.15rem;
  }
}

/* ============= Reduced Motion ============= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .seq-strip__track {
    animation: none;
  }
  .btn:hover,
  .socials a:hover,
  .aim-card:hover {
    transform: none;
  }
}

/* ============= Print ============= */
@media print {
  #site-header,
  .scrollup,
  .seq-strip,
  .scroll-progress,
  .contact-form,
  .nav-scrim,
  body::before,
  body::after {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  section {
    padding-top: 1.5rem;
    page-break-inside: avoid;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
