:root {
  --bg: #0c1016;
  --bg-soft: #111720;
  --surface: rgba(255,255,255,.026);
  --surface-hover: rgba(255,255,255,.038);
  --line: rgba(196, 205, 221, .105);
  --line-strong: rgba(196, 205, 221, .18);
  --text: #f5f4f7;
  --text-soft: #bcb9c4;
  --text-muted: #888591;
  --accent: #c3a6ff;
  --accent-strong: #aa84f3;
  --accent-soft: rgba(195, 166, 255, .10);
  --accent-softer: rgba(195, 166, 255, .065);
  --max-width: 1080px;
  --radius: 17px;
  --ease-out: cubic-bezier(.2,.72,.2,1);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
::selection { color: #fff; background: rgba(195,166,255,.30); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 100; top: 10px; left: 10px; padding: 9px 13px;
  border-radius: 9px; color: #090b10; background: #fff; transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.page-shell { width: min(calc(100% - 32px), var(--max-width)); margin: 0 auto; }

.site-header {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(calc(100% - 32px), var(--max-width));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(15,20,28,.78);
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px;
  border: 1px solid rgba(195,166,255,.25); background: var(--accent-softer); color: var(--accent);
  font-size: 10px; font-weight: 750; letter-spacing: .06em;
}
.brand-name { color: var(--text-soft); font-size: 13px; font-weight: 600; }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a {
  position: relative;
  color: var(--text-soft); text-decoration: none; font-size: 12px; font-weight: 600;
  transition: color 160ms ease, transform 160ms var(--ease-out), text-shadow 160ms ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(195,166,255,.45), var(--accent), rgba(195,166,255,.45));
  box-shadow: 0 0 10px rgba(195,166,255,.28);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms var(--ease-out);
}
.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="true"] {
  color: #fff;
  text-shadow: 0 0 14px rgba(195,166,255,.18);
}
.site-nav a:hover { transform: translateY(-1px); }
.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a[aria-current="true"]::after { transform: scaleX(1); }
.menu-toggle {
  display: none; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line);
  border-radius: 11px; background: rgba(255,255,255,.018); color: #fff;
}
.menu-toggle span:not(.sr-only) { display: block; width: 17px; height: 2px; border-radius: 999px; background: currentColor; }
.menu-toggle span + span { margin-top: 4px; }

.page-section {
  position: relative;
  min-height: 100svh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 96px 0 72px;
  isolation: isolate;
}
.page-section::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  pointer-events: none;
  border-top: 1px solid rgba(255,255,255,.028);
  background: linear-gradient(180deg, var(--section-top, rgba(195,166,255,.055)) 0%, rgba(12,16,22,0) 42%, var(--section-bottom, rgba(255,255,255,.008)) 100%);
}
.hero { --section-top: rgba(195,166,255,.075); --section-bottom: rgba(108,127,175,.018); }
#about { --section-top: rgba(132,108,184,.048); --section-bottom: rgba(68,83,111,.016); }
#projects { --section-top: rgba(195,166,255,.067); --section-bottom: rgba(83,103,151,.020); }
#toolkit { --section-top: rgba(118,98,159,.045); --section-bottom: rgba(60,79,104,.018); }
#experience { --section-top: rgba(161,132,218,.050); --section-bottom: rgba(74,81,111,.016); }
#contact { --section-top: rgba(195,166,255,.062); --section-bottom: rgba(12,16,22,0); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 64px;
  align-items: center;
}
.eyebrow, .section-kicker {
  margin: 0; color: var(--accent); font-size: 18px; font-weight: 750;
  text-transform: uppercase; letter-spacing: .145em;
}
.hero h1 {
  margin: 12px 0 0;
  font-size: clamp(46px, 6.2vw, 70px);
  line-height: .98;
  letter-spacing: -.052em;
}
.hero-role { margin: 10px 0 0; color: #e0dce7; font-size: 19px; }
.hero-intro { max-width: 600px; margin: 18px 0 0; color: var(--text-soft); font-size: 16px; line-height: 1.72; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.button {
  display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 17px;
  border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 700; text-decoration: none;
  transition: transform 180ms var(--ease-out), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.button:hover, .button:focus-visible { transform: translateY(-2px); }
.button--primary { color: #111019; background: #c3a6ff; box-shadow: 0 7px 22px rgba(195,166,255,.12); }
.button--primary:hover { background: #ceb6ff; box-shadow: 0 10px 26px rgba(195,166,255,.18); }
.button--secondary { color: var(--text-soft); border-color: var(--line-strong); background: rgba(255,255,255,.012); }
.button--secondary:hover { color: #fff; border-color: rgba(195,166,255,.30); background: var(--accent-softer); }

.hero-photo-wrap { display: flex; justify-content: flex-end; }
.hero-photo-card {
  width: min(100%, 280px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(195,166,255,.18);
  box-shadow: 0 16px 42px rgba(0,0,0,.22);
  transition: transform 280ms var(--ease-out), border-color 280ms ease, box-shadow 280ms ease;
}
.hero-photo-card:hover { transform: translateY(-3px) scale(1.012); border-color: rgba(195,166,255,.30); box-shadow: 0 20px 48px rgba(0,0,0,.27); }
.hero-photo { width: 100%; height: 100%; object-fit: cover; }

.section-head { margin-bottom: 28px; }
.section-head--gallery { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-grid--about { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
p { color: var(--text-soft); }
.lead { margin-top: 0; color: #e8e4ed; font-size: 17px; line-height: 1.72; }
.section-grid--about p { max-width: 520px; }

.card, .toolkit-group, .timeline-item, .contact-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.021), rgba(255,255,255,.009));
}

/* Horizontal project gallery. Add as many .project-card elements as you like. */
.project-gallery {
  display: flex;
  gap: 16px;
  width: calc(100vw - max(32px, calc((100vw - var(--max-width)) / 2)));
  max-width: calc(100vw - max(16px, calc((100vw - var(--max-width)) / 2)));
  margin-right: calc(50% - 50vw);
  padding: 2px max(18px, calc((100vw - var(--max-width)) / 2)) 18px 2px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(195,166,255,.24) transparent;
}
.project-gallery::-webkit-scrollbar { height: 6px; }
.project-gallery::-webkit-scrollbar-track { background: transparent; }
.project-gallery::-webkit-scrollbar-thumb { background: rgba(195,166,255,.20); border-radius: 999px; }
.project-gallery:focus-visible { outline: 1px solid rgba(195,166,255,.32); outline-offset: 5px; border-radius: 14px; }
.project-card {
  flex: 0 0 clamp(300px, 34vw, 370px);
  scroll-snap-align: start;
  overflow: hidden;
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(195,166,255,.22);
  background: linear-gradient(180deg, rgba(195,166,255,.035), rgba(255,255,255,.012));
  box-shadow: 0 15px 36px rgba(0,0,0,.14);
}
.project-preview {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #11151d;
}
.project-preview img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 420ms var(--ease-out), filter 420ms ease;
}
.project-card:hover .project-preview img { transform: scale(1.025); filter: saturate(1.05) brightness(1.03); }
.project-card-body { padding: 17px 18px 18px; }
.card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 9px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px;
  background: var(--accent-softer); border: 1px solid rgba(195,166,255,.14);
  color: #d9cee9; font-size: 11px; font-weight: 600;
}
.muted { color: var(--text-muted); font-size: 11px; }
.card h3, .toolkit-group h3, .timeline-item h3 { margin: 12px 0 8px; color: var(--text); font-size: 20px; letter-spacing: -.025em; }
.card p, .timeline-item p, .contact-block p { margin: 0; line-height: 1.62; }
.card-links { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 14px; }
.card-links a { text-decoration: none; color: #ddd3ed; font-size: 13px; font-weight: 600; transition: color 160ms ease, transform 160ms var(--ease-out); }
.card-links a:hover { color: #fff; transform: translateY(-1px); }

.gallery-controls { display: flex; gap: 7px; }
.gallery-button {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text-soft);
  background: rgba(255,255,255,.015); cursor: pointer;
  transition: transform 160ms var(--ease-out), color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.gallery-button:hover, .gallery-button:focus-visible {
  color: #fff; transform: translateY(-1px); border-color: rgba(195,166,255,.25); background: var(--accent-softer);
}

.toolkit-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.toolkit-group {
  padding: 17px;
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease;
}
.toolkit-group:hover {
  transform: translateY(-3px);
  border-color: rgba(195,166,255,.20);
  background: linear-gradient(180deg, rgba(195,166,255,.028), rgba(255,255,255,.011));
}
.toolkit-group h3 { margin: 0 0 13px; font-size: 17px; }
.tool-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.tool-list li {
  display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: center;
  min-height: 23px; color: var(--text-soft); font-size: 13px; line-height: 1.35;
  transition: color 160ms ease, transform 160ms var(--ease-out);
}
.tool-list li:hover { color: #f3eef8; transform: translateX(2px); }
.tool-logo, .tool-badge { width: 18px; height: 18px; }
.tool-logo { border-radius: 3px; }
.tool-logo--matplotlib { transform: scale(1.12); }
.tool-badge {
  display: inline-grid; place-items: center; border-radius: 4px; background: var(--accent-softer);
  border: 1px solid rgba(195,166,255,.14); color: var(--accent); font-size: 7px; line-height: 1;
  font-weight: 750; letter-spacing: .02em;
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
  padding-left: 0;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14px;
  width: 1px;
  background: linear-gradient(180deg, rgba(195,166,255,.30), rgba(195,166,255,.12));
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  transition: transform 220ms var(--ease-out), background 220ms ease;
}
.timeline-item:hover {
  transform: translateX(2px);
  background: transparent;
}
.timeline-node {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}
.timeline-node::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #121722;
  border: 2px solid rgba(197,171,255,.82);
  box-shadow: 0 0 0 5px #0d121b;
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}
.timeline-item:hover .timeline-node::before {
  transform: scale(1.06);
  border-color: rgba(217,198,255,.95);
  box-shadow: 0 0 0 5px #0d121b, 0 0 0 7px rgba(195,166,255,.08);
}
.timeline-content {
  min-width: 0;
  padding: 15px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.010));
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease;
}
.timeline-item:hover .timeline-content {
  transform: translateY(-2px);
  border-color: rgba(195,166,255,.18);
  background: linear-gradient(180deg, rgba(195,166,255,.024), rgba(255,255,255,.012));
}
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
}
.timeline-date,
.timeline-org {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.4;
  text-transform: uppercase;
}
.timeline-org::before {
  content: "•";
  margin-right: 10px;
  color: rgba(195,166,255,.55);
}
.timeline-item h3 { margin: 0 0 6px; }
.timeline-description { margin: 0; }

.contact-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.021), rgba(255,255,255,.009));
}

/* Horizontal project gallery. Add as many .project-card elements as you like. */
.project-gallery {
  display: flex;
  gap: 16px;
  width: calc(100vw - max(32px, calc((100vw - var(--max-width)) / 2)));
  max-width: calc(100vw - max(16px, calc((100vw - var(--max-width)) / 2)));
  margin-right: calc(50% - 50vw);
  padding: 2px max(18px, calc((100vw - var(--max-width)) / 2)) 18px 2px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(195,166,255,.24) transparent;
}
.project-gallery::-webkit-scrollbar { height: 6px; }
.project-gallery::-webkit-scrollbar-track { background: transparent; }
.project-gallery::-webkit-scrollbar-thumb { background: rgba(195,166,255,.20); border-radius: 999px; }
.project-gallery:focus-visible { outline: 1px solid rgba(195,166,255,.32); outline-offset: 5px; border-radius: 14px; }
.project-card {
  flex: 0 0 clamp(300px, 34vw, 370px);
  scroll-snap-align: start;
  overflow: hidden;
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(195,166,255,.22);
  background: linear-gradient(180deg, rgba(195,166,255,.035), rgba(255,255,255,.012));
  box-shadow: 0 15px 36px rgba(0,0,0,.14);
}
.project-preview {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #11151d;
}
.project-preview img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 420ms var(--ease-out), filter 420ms ease;
}
.project-card:hover .project-preview img { transform: scale(1.025); filter: saturate(1.05) brightness(1.03); }
.project-card-body { padding: 17px 18px 18px; }
.card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 9px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px;
  background: var(--accent-softer); border: 1px solid rgba(195,166,255,.14);
  color: #d9cee9; font-size: 11px; font-weight: 600;
}
.muted { color: var(--text-muted); font-size: 11px; }
.card h3, .toolkit-group h3, .timeline-item h3 { margin: 12px 0 8px; color: var(--text); font-size: 20px; letter-spacing: -.025em; }
.card p, .timeline-item p, .contact-block p { margin: 0; line-height: 1.62; }
.card-links { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 14px; }
.card-links a { text-decoration: none; color: #ddd3ed; font-size: 13px; font-weight: 600; transition: color 160ms ease, transform 160ms var(--ease-out); }
.card-links a:hover { color: #fff; transform: translateY(-1px); }

.gallery-controls { display: flex; gap: 7px; }
.gallery-button {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text-soft);
  background: rgba(255,255,255,.015); cursor: pointer;
  transition: transform 160ms var(--ease-out), color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.gallery-button:hover, .gallery-button:focus-visible {
  color: #fff; transform: translateY(-1px); border-color: rgba(195,166,255,.25); background: var(--accent-softer);
}

.toolkit-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.toolkit-group {
  padding: 17px;
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease;
}
.toolkit-group:hover {
  transform: translateY(-3px);
  border-color: rgba(195,166,255,.20);
  background: linear-gradient(180deg, rgba(195,166,255,.028), rgba(255,255,255,.011));
}
.toolkit-group h3 { margin: 0 0 13px; font-size: 17px; }
.tool-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.tool-list li {
  display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: center;
  min-height: 23px; color: var(--text-soft); font-size: 13px; line-height: 1.35;
  transition: color 160ms ease, transform 160ms var(--ease-out);
}
.tool-list li:hover { color: #f3eef8; transform: translateX(2px); }
.tool-logo, .tool-badge { width: 18px; height: 18px; }
.tool-logo { border-radius: 3px; }
.tool-logo--matplotlib { transform: scale(1.12); }
.tool-badge {
  display: inline-grid; place-items: center; border-radius: 4px; background: var(--accent-softer);
  border: 1px solid rgba(195,166,255,.14); color: var(--accent); font-size: 7px; line-height: 1;
  font-weight: 750; letter-spacing: .02em;
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
  padding-left: 0;
  --timeline-line-left: 13px;
  --timeline-line-top: 14px;
  --timeline-line-bottom: 14px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: var(--timeline-line-left);
  top: var(--timeline-line-top);
  bottom: var(--timeline-line-bottom);
  width: 1px;
  background: linear-gradient(180deg, rgba(195,166,255,.28), rgba(195,166,255,.10));
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  transition: transform 220ms var(--ease-out), background 220ms ease;
}
.timeline-item:hover {
  transform: translateX(2px);
  background: transparent;
}
.timeline-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}
.timeline-node::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(203,182,255,.98), rgba(182,155,247,.98));
  border: 2px solid rgba(255,255,255,.10);
  box-shadow: 0 0 0 5px rgba(15, 20, 30, .98), 0 0 0 6px rgba(195,166,255,.08);
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease, filter 180ms ease;
}
.timeline-item:hover .timeline-node::before {
  transform: scale(1.06);
  box-shadow: 0 0 0 5px rgba(15, 20, 30, .98), 0 0 0 7px rgba(195,166,255,.11);
  filter: brightness(1.03);
}
.timeline-content {
  min-width: 0;
  padding: 15px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.010));
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease;
}
.timeline-item:hover .timeline-content {
  transform: translateY(-2px);
  border-color: rgba(195,166,255,.18);
  background: linear-gradient(180deg, rgba(195,166,255,.024), rgba(255,255,255,.012));
}
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
}
.timeline-date,
.timeline-org {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.4;
  text-transform: uppercase;
}
.timeline-org::before {
  content: "•";
  margin-right: 10px;
  color: rgba(195,166,255,.55);
}
.timeline-item h3 { margin: 0 0 6px; }
.timeline-description { margin: 0; }

.contact-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.021), rgba(255,255,255,.009));
}

/* Horizontal project gallery. Add as many .project-card elements as you like. */
.project-gallery {
  display: flex;
  gap: 16px;
  width: calc(100vw - max(32px, calc((100vw - var(--max-width)) / 2)));
  max-width: calc(100vw - max(16px, calc((100vw - var(--max-width)) / 2)));
  margin-right: calc(50% - 50vw);
  padding: 2px max(18px, calc((100vw - var(--max-width)) / 2)) 18px 2px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(195,166,255,.24) transparent;
}
.project-gallery::-webkit-scrollbar { height: 6px; }
.project-gallery::-webkit-scrollbar-track { background: transparent; }
.project-gallery::-webkit-scrollbar-thumb { background: rgba(195,166,255,.20); border-radius: 999px; }
.project-gallery:focus-visible { outline: 1px solid rgba(195,166,255,.32); outline-offset: 5px; border-radius: 14px; }
.project-card {
  flex: 0 0 clamp(300px, 34vw, 370px);
  scroll-snap-align: start;
  overflow: hidden;
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(195,166,255,.22);
  background: linear-gradient(180deg, rgba(195,166,255,.035), rgba(255,255,255,.012));
  box-shadow: 0 15px 36px rgba(0,0,0,.14);
}
.project-preview {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #11151d;
}
.project-preview img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 420ms var(--ease-out), filter 420ms ease;
}
.project-card:hover .project-preview img { transform: scale(1.025); filter: saturate(1.05) brightness(1.03); }
.project-card-body { padding: 17px 18px 18px; }
.card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 9px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px;
  background: var(--accent-softer); border: 1px solid rgba(195,166,255,.14);
  color: #d9cee9; font-size: 11px; font-weight: 600;
}
.muted { color: var(--text-muted); font-size: 11px; }
.card h3, .toolkit-group h3, .timeline-item h3 { margin: 12px 0 8px; color: var(--text); font-size: 20px; letter-spacing: -.025em; }
.card p, .timeline-item p, .contact-block p { margin: 0; line-height: 1.62; }
.card-links { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 14px; }
.card-links a { text-decoration: none; color: #ddd3ed; font-size: 13px; font-weight: 600; transition: color 160ms ease, transform 160ms var(--ease-out); }
.card-links a:hover { color: #fff; transform: translateY(-1px); }

.gallery-controls { display: flex; gap: 7px; }
.gallery-button {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text-soft);
  background: rgba(255,255,255,.015); cursor: pointer;
  transition: transform 160ms var(--ease-out), color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.gallery-button:hover, .gallery-button:focus-visible {
  color: #fff; transform: translateY(-1px); border-color: rgba(195,166,255,.25); background: var(--accent-softer);
}

.toolkit-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.toolkit-group {
  padding: 17px;
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease;
}
.toolkit-group:hover {
  transform: translateY(-3px);
  border-color: rgba(195,166,255,.20);
  background: linear-gradient(180deg, rgba(195,166,255,.028), rgba(255,255,255,.011));
}
.toolkit-group h3 { margin: 0 0 13px; font-size: 17px; }
.tool-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.tool-list li {
  display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: center;
  min-height: 23px; color: var(--text-soft); font-size: 13px; line-height: 1.35;
  transition: color 160ms ease, transform 160ms var(--ease-out);
}
.tool-list li:hover { color: #f3eef8; transform: translateX(2px); }
.tool-logo, .tool-badge { width: 18px; height: 18px; }
.tool-logo { border-radius: 3px; }
.tool-logo--matplotlib { transform: scale(1.12); }
.tool-badge {
  display: inline-grid; place-items: center; border-radius: 4px; background: var(--accent-softer);
  border: 1px solid rgba(195,166,255,.14); color: var(--accent); font-size: 7px; line-height: 1;
  font-weight: 750; letter-spacing: .02em;
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
  padding-left: 4px;
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px 20px 18px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  transition: transform 220ms var(--ease-out), background 220ms ease;
}
.timeline-item:hover {
  transform: translateX(2px);
  background: transparent;
}
.timeline-node {
  position: relative;
  display: block;
  width: 28px;
  min-height: 100%;
}
.timeline-node::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(195,166,255,.65);
  background: #151923;
  box-shadow: 0 0 0 4px rgba(195,166,255,.07);
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease, border-color 180ms ease;
}
.timeline-item:not(:last-child) .timeline-node::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 13px;
  width: 1px;
  height: calc(100% + 14px);
  background: linear-gradient(180deg, rgba(195,166,255,.26), rgba(195,166,255,.08));
}
.timeline-item:hover .timeline-node::before {
  transform: scale(1.08);
  border-color: rgba(213,190,255,.9);
  box-shadow: 0 0 0 6px rgba(195,166,255,.10);
}
.timeline-content {
  min-width: 0;
  padding: 15px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.010));
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease;
}
.timeline-item:hover .timeline-content {
  transform: translateY(-2px);
  border-color: rgba(195,166,255,.18);
  background: linear-gradient(180deg, rgba(195,166,255,.024), rgba(255,255,255,.012));
}
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
}
.timeline-date,
.timeline-org {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.4;
  text-transform: uppercase;
}
.timeline-org::before {
  content: "•";
  margin-right: 10px;
  color: rgba(195,166,255,.55);
}
.timeline-item h3 { margin: 0 0 6px; }
.timeline-description { margin: 0; }

.contact-block {
  width: 100%;
  max-width: 100%;
  padding: 22px;
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease;
}
.contact-block:hover { transform: translateY(-2px); border-color: rgba(195,166,255,.18); background: linear-gradient(180deg, rgba(195,166,255,.02), rgba(255,255,255,.01)); }

.site-footer {
  display: flex; justify-content: space-between; gap: 18px; padding: 22px 0 38px;
  border-top: 1px solid var(--line); color: var(--text-muted); font-size: 13px;
}
.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; transition: color 160ms ease; }
.site-footer a:hover { color: #fff; }

/* Scroll reveal */
.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms); will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 1040px) {
  .toolkit-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card { flex-basis: clamp(300px, 44vw, 360px); }
}

@media (max-width: 960px) {
  html { scroll-snap-type: none; }
  .page-section { min-height: auto; padding-top: 100px; padding-bottom: 70px; }
  .hero, .section-grid--about { grid-template-columns: 1fr; }
  .hero { gap: 32px; }
  .hero-photo-wrap { justify-content: flex-start; }
  .hero-photo-card { width: min(230px, 60vw); }
  .site-header { display: grid; grid-template-columns: 1fr auto; }
  .menu-toggle { display: grid; }
  .site-nav {
    position: absolute; top: calc(100% + 9px); left: 0; right: 0; display: grid; gap: 4px; padding: 9px;
    border: 1px solid var(--line); border-radius: 15px; background: rgba(17,23,32,.98);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .site-nav a { padding: 11px; border-radius: 10px; }
  .site-nav a::after { left: 11px; right: 11px; bottom: 6px; }
  .project-gallery {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    margin-right: calc(50% - 50vw);
    padding-right: 18px;
  }
  .project-card { flex-basis: min(82vw, 350px); }
}

@media (max-width: 640px) {
  .page-shell { width: min(calc(100% - 20px), var(--max-width)); }
  .site-header { width: calc(100% - 20px); }
  .hero h1 { font-size: clamp(40px, 13vw, 62px); }
  .hero-role { font-size: 18px; }
  .hero-intro, .lead { font-size: 16px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .button { width: 100%; }
  .toolkit-groups { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 28px 1fr; gap: 12px; }
  .timeline-content { padding: 14px 15px 15px; }
  .timeline-meta { gap: 6px; }
  .timeline-org::before { margin-right: 6px; }
  .hero-photo-card { width: min(210px, 62vw); }
  .gallery-controls { display: none; }
  .project-gallery { margin-left: 0; }
  .site-footer { flex-direction: column; }
}.timeline {
  position: relative;
  display: grid;
  gap: 14px;
  padding-left: 0;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14px;
  width: 2px;
  background: linear-gradient(180deg, rgba(195,166,255,.34), rgba(195,166,255,.16));
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  transition: transform 220ms var(--ease-out), background 220ms ease;
}
.timeline-item:hover {
  transform: translateX(2px);
  background: transparent;
}
.timeline-node {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}
.timeline-node::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c9b2ff;
  border: 2px solid rgba(226, 213, 255, .92);
  box-shadow: 0 0 12px rgba(195,166,255,.16);
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}
.timeline-item:hover .timeline-node::before {
  transform: scale(1.06);
  border-color: rgba(245, 239, 255, .96);
  background: #d8c4ff;
  box-shadow: 0 0 16px rgba(195,166,255,.22);
}
.timeline-content {
  min-width: 0;
  padding: 15px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.010));
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease;
}
.timeline-item:hover .timeline-content {
  transform: translateY(-2px);
  border-color: rgba(195,166,255,.18);
  background: linear-gradient(180deg, rgba(195,166,255,.024), rgba(255,255,255,.012));
}
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
}
.timeline-date,
.timeline-org {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.4;
  text-transform: uppercase;
}
.timeline-org::before {
  content: "•";
  margin-right: 10px;
  color: rgba(195,166,255,.55);
}
.timeline-item h3 { margin: 0 0 6px; }
.timeline-description { margin: 0; }


/* Final timeline refinement */
.timeline {
  position: relative;
  display: grid;
  gap: 14px;
  padding-left: 0;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 13px;
  width: 2px;
  background: linear-gradient(180deg, rgba(195,166,255,.34), rgba(195,166,255,.18));
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  transition: background 220ms ease;
}
.timeline-item:hover {
  transform: none;
  background: transparent;
}
.timeline-node {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -2px;
}
.timeline-node::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c8b0ff;
  border: 2px solid rgba(239,231,255,.92);
  box-shadow: 0 0 0 6px #0d121b, 0 0 14px rgba(195,166,255,.14);
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}
.timeline-item:hover .timeline-node::before {
  transform: scale(1.04);
  background: #d3bfff;
  border-color: rgba(249,245,255,.96);
  box-shadow: 0 0 0 6px #0d121b, 0 0 18px rgba(195,166,255,.20);
}
.timeline-content {
  min-width: 0;
  padding: 15px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.010));
  transition: transform 220ms var(--ease-out), border-color 220ms ease, background 220ms ease;
}
.timeline-item:hover .timeline-content {
  transform: translateY(-2px);
  border-color: rgba(195,166,255,.18);
  background: linear-gradient(180deg, rgba(195,166,255,.024), rgba(255,255,255,.012));
}
@media (max-width: 860px) {
  .timeline::before {
    top: 12px;
    bottom: 12px;
    left: 13px;
  }
  .timeline-item {
    grid-template-columns: 28px 1fr;
    gap: 12px;
  }
  .timeline-node {
    margin-top: -2px;
  }
  .timeline-content {
    padding: 14px 15px 15px;
  }
  .timeline-meta {
    gap: 6px;
  }
  .timeline-org::before {
    margin-right: 6px;
  }
}

/* Final gallery width alignment fix */
.project-gallery {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding: 2px 2px 18px 2px;
  box-sizing: border-box;
}

@media (max-width: 960px) {
  .project-gallery {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    padding-right: 2px;
  }
}

@media (max-width: 640px) {
  .project-gallery {
    margin-left: 0;
    margin-right: 0;
  }
}
