:root {
  color-scheme: light;
  --canvas: #f6f8fc;
  --surface: #ffffff;
  --ink: #172136;
  --body: #4c586e;
  --muted: #65758e;
  --accent: #366ee9;
  --line: #e7ecf4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; top: 12px; left: 16px; z-index: 10; padding: 12px 18px; border-radius: 12px; background: white; transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }

.gallery {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(520px, 680px) minmax(210px, 1fr);
  grid-template-rows: 1fr 1fr;
  column-gap: clamp(24px, 3.5vw, 68px);
  row-gap: 16px;
  align-items: center;
  width: min(100%, 1560px);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding: 48px clamp(24px, 3.4vw, 64px);
}
.gallery[data-mode="gallery"] {
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  padding-block: clamp(16px, 4dvh, 48px);
  overflow: clip;
}
.gallery::before {
  content: "";
  z-index: -1;
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 36%, #fff 0, #fafbfe 35%, #f3f6fb 100%);
}
.gallery::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 28px;
  pointer-events: none;
  opacity: .32;
  background-image: radial-gradient(#bccbe2 .7px, transparent .7px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at center, transparent 46%, #000 100%);
}
.profile-card {
  grid-column: 2;
  grid-row: 1 / 3;
  padding: 32px 42px 27px;
  position: relative;
  z-index: 1;
  border: 1px solid #e3e8f1;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 30px 65px -34px #687a9845, 0 4px 10px -6px #667b9a20;
}
.profile-card:focus { outline: none; }
.gallery[data-mode="gallery"] .profile-card {
  transform: scale(var(--profile-scale, 1));
  transform-origin: center;
}
.profile-header { text-align: center; }
.avatar {
  position: relative;
  width: 108px;
  height: 108px;
  overflow: hidden;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #eff3f9;
  box-shadow: 0 0 0 7px #f6f8fc;
}
.avatar img { display: block; position: absolute; max-width: none; width: 180%; height: 180%; left: -40%; top: -6%; object-fit: cover; }
h1 { margin: 0; font-size: clamp(34px, 3vw, 43px); font-weight: 680; line-height: 1.14; letter-spacing: -.045em; }
.profile-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; letter-spacing: -.015em; }
.profile-accent { display: block; width: 30px; height: 3px; margin: 23px auto 25px; border-radius: 2px; background: #86b4ff; }
.about-copy p { margin: 0 0 13px; color: var(--body); font-size: 15px; line-height: 1.75; letter-spacing: -.008em; }
.about-copy p:last-child { margin-bottom: 0; }
.about-copy a { color: #3d71d7; text-decoration: none; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.about-copy a:hover { text-decoration: underline; }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; column-gap: 25px; row-gap: 8px; margin-top: 24px; padding-top: 21px; border-top: 1px solid var(--line); }
.contact-links a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; font-size: 12px; font-weight: 500; text-decoration: none; color: #62728a; border-radius: 4px; transition: color 160ms ease; }
.contact-links a:hover { color: var(--accent); }
.contact-links svg { width: 17px; height: 17px; }

.gallery-page, .projects { display: contents; }
.page-controls, .projects-header { display: none; }
.project {
  position: relative;
  align-self: center;
  width: 100%;
  min-width: 0;
  padding: 16px 0 20px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.project-photonic { grid-column: 1; grid-row: 1; }
.project-agentic { grid-column: 3; grid-row: 1; }
.project-robotics { grid-column: 1; grid-row: 2; }
.project-next { grid-column: 3; grid-row: 2; }
.project-visual { display: block; position: relative; width: 100%; height: clamp(190px, 17.7vw, 275px); margin-bottom: 12px; }
.project-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1);
  transform-origin: center;
  filter: brightness(1) saturate(1) drop-shadow(0 0 1px #4a90ff00) drop-shadow(0 6px 8px #2b446b18);
  transition: transform 320ms cubic-bezier(.22, .61, .36, 1), filter 320ms ease;
}
.gallery[data-mode="gallery"] .project {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  min-height: 0;
  max-height: 410px;
}
.gallery[data-mode="gallery"] .project-visual { flex: 0 1 auto; min-height: 0; }
.gallery[data-mode="gallery"] .project-caption,
.gallery[data-mode="gallery"] .project-status { flex-shrink: 0; }
.project-caption { display: flex; align-items: baseline; gap: 10px; width: 100%; padding-inline: 7px; }
.project-number { flex-shrink: 0; font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; color: #65758e; transition: color 180ms ease; }
.project-name { min-width: 0; font-size: clamp(14px, 1.16vw, 18px); font-weight: 570; line-height: 1.4; letter-spacing: -.025em; transition: color 180ms ease; }
.project-name > span { display: inline-block; white-space: nowrap; }
.gallery[data-mode="gallery"] .project-name { white-space: nowrap; }
.project-status { display: flex; align-items: center; gap: 6px; margin: 6px 7px 0 32px; color: #67758a; font-size: 11px; line-height: 1.5; }
.status-dot { width: 3px; height: 3px; border-radius: 50%; background: #a8b5c8; }
.project-status-publications { align-items: flex-start; }
.project-status-publications .status-dot { flex-shrink: 0; margin-top: .6em; }
.project-references { min-width: 0; }
.project-references > span { white-space: nowrap; }
.project:focus-visible .project-visual img {
  transform: scale(var(--project-hover-scale, 1.045));
  filter: brightness(1.04) saturate(1.06) drop-shadow(0 0 1.2px #4a90ff99) drop-shadow(0 11px 12px #356fca40);
}
.project:focus-visible .project-name,
.project:focus-visible .project-number { color: var(--accent); }
.project:focus-visible { outline-offset: 5px; }
@media (hover: hover) and (pointer: fine) {
  .project:hover .project-visual img {
    transform: scale(var(--project-hover-scale, 1.045));
    filter: brightness(1.04) saturate(1.06) drop-shadow(0 0 1.2px #4a90ff99) drop-shadow(0 11px 12px #356fca40);
  }
  .project:hover .project-name,
  .project:hover .project-number { color: var(--accent); }
}

.project-notice {
  position: fixed;
  z-index: 5;
  bottom: var(--notice-bottom, calc(24px + env(safe-area-inset-bottom, 0px)));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 16px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 12px 12px 20px;
  border: 1px solid #e0e7f1;
  border-radius: 14px;
  background: white;
  box-shadow: 0 10px 40px #35466720;
  transform: translateX(-50%);
}
.project-notice[hidden] { display: none; }
.project-notice p { margin: 0; font-size: 13px; line-height: 1.6; color: #4c5f7b; }
.notice-close { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #8996aa; cursor: pointer; }
.notice-close:hover { color: var(--accent); background: #f3f6fc; }
.notice-close svg { width: 16px; height: 16px; }

@media (min-width: 1560px) {
  .gallery { column-gap: 66px; }
  .project-visual { height: 290px; }
}
@media (max-width: 880px) {
  .gallery { display: block; max-width: 640px; padding: 32px 24px 48px; }
  .gallery-page { display: block; }
  .profile-card { width: 100%; padding: 32px 36px 25px; }
  .projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 30px; row-gap: 12px; margin-top: 28px; scroll-margin-top: 28px; }
  .project { grid-column: auto; grid-row: auto; padding-block: 10px 17px; }
  .project-visual { height: 215px; margin-bottom: 8px; }
  .project-name { font-size: 14px; }
  .project-status { font-size: 11px; }
}
.page-controls .scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 7px 8px 7px 20px;
  border: 1px solid #ffffffd9;
  border-radius: 999px;
  background: #ffffffb8;
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 4px 20px #253e6812, 0 1px 3px #253e6810, inset 0 0 0 1px #fff5;
  color: #495b75;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -.015em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease, box-shadow 180ms ease;
}
.scroll-cue-arrow { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #eaf0fa; color: #5676a9; transition: transform 360ms ease; }
.scroll-cue-arrow svg { width: 18px; height: 18px; stroke-width: 1.8; }
.gallery[data-view="about"] .scroll-cue-arrow svg { animation: scroll-cue-nudge 2.2s cubic-bezier(.4,0,.2,1) .3s 2; }
.gallery[data-view="projects"] .scroll-cue-arrow { transform: rotate(180deg); }
.scroll-cue:hover { color: var(--accent); }
.scroll-cue:hover .scroll-cue-arrow { background: #e2ecff; color: var(--accent); }
@keyframes scroll-cue-nudge {
  0%, 20%, 75%, 100% { transform: translateY(-1px); }
  45%, 55% { transform: translateY(3px); }
}
@media (max-width: 520px) {
  .gallery { padding: 23px 18px 38px; }
  .profile-card { padding: 29px 25px 21px; border-radius: 23px; }
  .avatar { width: 94px; height: 94px; margin-bottom: 18px; }
  h1 { font-size: 34px; }
  .profile-subtitle { font-size: 13px; }
  .profile-accent { margin-top: 19px; margin-bottom: 23px; }
  .about-copy p { font-size: 13.5px; line-height: 1.8; }
  .contact-links { gap: 10px 17px; margin-top: 22px; padding-top: 16px; }
  .contact-links a { font-size: 11px; gap: 5px; }
  .contact-links svg { width: 15px; height: 15px; }
  .projects { gap: 10px 18px; margin-top: 24px; }
  .project-visual { height: 155px; }
  .project-caption { flex-wrap: wrap; gap: 0 6px; }
  .project-number { font-size: 10px; }
  .project-name { font-size: 12px; flex: 1; }
  .project-status { margin-top: 7px; margin-left: 20px; font-size: 10px; }
}
@media (max-width: 359px) {
  .gallery { padding-inline: 12px; }
  .profile-card { padding-inline: 20px; }
  .contact-links { column-gap: 12px; }
  .projects { grid-template-columns: 1fr; max-width: 235px; margin-inline: auto; }
  .project-visual { height: 210px; }
  .project-name { font-size: 15px; }
}
body.is-paged { overflow: hidden; }
.gallery[data-mode="paged"] {
  --page-footer-height: calc(clamp(76px, 11dvh, 88px) + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: none;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.gallery[data-mode="paged"]::after { inset: 16px; }
.gallery[data-mode="paged"] .gallery-page {
  position: absolute;
  inset: 0 0 var(--page-footer-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(12px, 2.5dvh, 20px) 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c9d4e5 transparent;
  perspective: 1600px;
  visibility: hidden;
  pointer-events: none;
}
.gallery[data-mode="paged"] .gallery-page[data-active="true"],
.gallery[data-mode="paged"] .gallery-page[data-leaving="true"] { visibility: visible; }
.gallery[data-mode="paged"] .gallery-page[data-active="true"] { pointer-events: auto; z-index: 1; }
.gallery[data-animating="true"] .gallery-page { pointer-events: none; }
.gallery-page:focus { outline: none; }
.gallery[data-mode="paged"] .profile-card {
  flex: 0 0 auto;
  width: min(100%, 592px);
  margin-block: auto;
  padding: 26px 36px 22px;
  transform-origin: center top;
  backface-visibility: hidden;
}
.gallery[data-mode="paged"] .avatar { width: 96px; height: 96px; margin-bottom: 14px; }
.gallery[data-mode="paged"][data-transition-axis="x"] .profile-card { transform-origin: left center; }
.gallery[data-mode="paged"] .profile-accent { margin-block: 18px 20px; }
.gallery[data-mode="paged"] .contact-links { margin-top: 20px; padding-top: 16px; }
.gallery[data-mode="paged"] .page-controls {
  position: absolute;
  z-index: 3;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--page-footer-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 20px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(#f6f8fc00, #f6f8fc 30%);
}
.page-position { display: flex; gap: 5px; }
.page-position span { width: 18px; height: 3px; border-radius: 3px; background: #dce3ef; transition: background-color 260ms ease; }
.gallery[data-view="about"] .page-position span:first-child,
.gallery[data-view="projects"] .page-position span:last-child { background: #80abef; }
.gallery[data-mode="paged"] .projects-header { display: block; flex-shrink: 0; width: min(100%, 600px); margin: 0 0 8px; text-align: center; }
.projects-header h2 { margin: 0; font-size: 29px; line-height: 1.2; font-weight: 620; letter-spacing: -.035em; }
.gallery[data-mode="paged"] .projects {
  flex: 1 0 auto;
  width: min(100%, 600px);
  max-width: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  gap: 12px 28px;
  margin: 0;
  perspective: 1200px;
}
.gallery[data-mode="paged"] .project { grid-column: auto; grid-row: auto; align-self: start; padding-block: 4px 10px; }
.gallery[data-mode="paged"] .project-visual { height: var(--project-art-height, clamp(104px, 24svh, 205px)); margin-bottom: 8px; }
.gallery[data-mode="paged"] .project-caption { gap: 7px; padding-inline: 0; }
.gallery[data-mode="paged"] .project-number { font-size: 10px; }
.gallery[data-mode="paged"] .project-name { font-size: clamp(12px, 2.5vw, 16px); }
.gallery[data-mode="paged"] .project-status { margin-left: 23px; font-size: 11px; }
@media (max-width: 520px) {
  .gallery[data-mode="paged"] .gallery-page { padding: 18px; }
  .gallery[data-mode="paged"] .profile-card { padding: 25px 25px 21px; }
  .gallery[data-mode="paged"] .avatar { width: 86px; height: 86px; }
  .gallery[data-mode="paged"] .projects { column-gap: 18px; }
  .gallery[data-mode="paged"] .project-visual { height: var(--project-art-height, clamp(104px, 19svh, 170px)); }
  .gallery[data-mode="paged"] .project-caption { min-height: 34px; gap: 0 6px; }
  .gallery[data-mode="paged"] .project-status { margin-left: 20px; font-size: 10px; }
  .projects-header h2 { font-size: 27px; }
}
@media (max-width: 359px) {
  .gallery[data-mode="paged"] .gallery-page { padding-inline: 12px; }
  .gallery[data-mode="paged"] .profile-card { padding-inline: 20px; }
}
@media (max-width: 319px) {
  .gallery[data-mode="paged"] .projects { grid-template-columns: minmax(0, 1fr); max-width: 280px; }
}
@media (max-width: 520px) and (max-height: 650px) {
  .gallery[data-mode="paged"] .gallery-page { padding-block: 12px; }
  .gallery[data-mode="paged"] .projects { row-gap: 8px; }
  .gallery[data-mode="paged"] .project-visual { height: var(--project-art-height, 104px); }
}
.gallery[data-mode="paged"]:is([data-about-density="compact"], [data-about-density="tight"]) .profile-card { padding-block: 18px; }
.gallery[data-mode="paged"]:is([data-about-density="compact"], [data-about-density="tight"]) .avatar { width: 72px; height: 72px; margin-bottom: 10px; }
.gallery[data-mode="paged"]:is([data-about-density="compact"], [data-about-density="tight"]) h1 { font-size: 32px; }
.gallery[data-mode="paged"]:is([data-about-density="compact"], [data-about-density="tight"]) .profile-accent { margin-block: 14px 16px; }
.gallery[data-mode="paged"]:is([data-about-density="compact"], [data-about-density="tight"]) .about-copy p { line-height: 1.65; margin-bottom: 10px; }
.gallery[data-mode="paged"]:is([data-about-density="compact"], [data-about-density="tight"]) .contact-links { margin-top: 14px; padding-top: 12px; }
.gallery[data-mode="paged"][data-about-density="tight"] .profile-card { padding: 12px 22px; }
.gallery[data-mode="paged"][data-about-density="tight"] .avatar { width: 54px; height: 54px; margin-bottom: 8px; }
.gallery[data-mode="paged"][data-about-density="tight"] h1 { font-size: 28px; }
.gallery[data-mode="paged"][data-about-density="tight"] .profile-subtitle { margin-top: 6px; font-size: 12px; line-height: 1.4; }
.gallery[data-mode="paged"][data-about-density="tight"] .profile-accent { height: 2px; margin-block: 10px 12px; }
.gallery[data-mode="paged"][data-about-density="tight"] .about-copy p { font-size: 12.5px; line-height: 1.6; margin-bottom: 9px; }
.gallery[data-mode="paged"][data-about-density="tight"] .contact-links { gap: 6px 14px; margin-top: 10px; padding-top: 8px; }
.gallery[data-mode="paged"][data-about-density="tight"] .contact-links a { min-height: 30px; font-size: 11px; }
.gallery[data-mode="paged"][data-about-density="tight"] .contact-links svg { width: 14px; height: 14px; }
.gallery[data-mode="paged"][data-about-density] .about-copy p:last-child { margin-bottom: 0; }

.gallery[data-mode="paged"]:where([data-about-layout="wide"]) .profile-card {
  display: grid;
  grid-template-columns: clamp(180px, 24vw, 280px) minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: clamp(24px, 3vw, 36px);
  width: min(100%, 1200px);
  padding-inline: 32px;
}
.gallery[data-mode="paged"]:where([data-about-layout="wide"]) .profile-header { grid-column: 1; grid-row: 1; align-self: end; }
.gallery[data-mode="paged"]:where([data-about-layout="wide"]) h1 { font-size: 38px; }
.gallery[data-mode="paged"]:where([data-about-layout="wide"]) .profile-subtitle { font-size: 14px; }
.gallery[data-mode="paged"]:where([data-about-layout="wide"]) .about-copy {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  padding-left: clamp(24px, 3vw, 36px);
  border-left: 1px solid var(--line);
}
.gallery[data-mode="paged"]:where([data-about-layout="wide"])[data-about-density] .contact-links {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.gallery[data-mode="paged"]:where([data-about-layout="wide"]) .contact-links a { justify-content: flex-start; min-height: 36px; padding: 5px 10px; border-radius: 10px; background: #f6f8fc; }
.gallery[data-mode="paged"]:where([data-project-layout="row"]) .projects-header { width: min(100%, 1400px); }
.gallery[data-mode="paged"]:where([data-project-layout="row"]) .projects { width: min(100%, 1400px); grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(12px, 2vw, 28px); }
.gallery[data-mode="paged"]:where([data-project-layout="row"]) .project-name { font-size: clamp(12px, 1.2vw, 16px); }
.gallery[data-mode="paged"]:where([data-project-layout="row"]) .project-visual { height: var(--project-art-height, clamp(104px, 40dvh, 240px)); }
@media (max-height: 600px) {
  .gallery[data-mode="paged"] .projects-header h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; scroll-behavior: auto !important; }
  .project { --project-hover-scale: 1; }
  .gallery[data-view="about"] .scroll-cue-arrow svg { animation: none; }
}
