:root {
  color-scheme: light;
  --background: #f8f3e8;
  --text: #282824;
  --secondary: #565650;
  --muted: #73736b;
  --accent: #9a4d30;
  --line: #cecec5;
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #141513;
  --text: #efeee8;
  --secondary: #b9bab2;
  --muted: #92948a;
  --accent: #d89770;
  --line: #4f5149;
}

* { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--background);
  color: var(--text);
}

main {
  width: min(100% - 112px, 880px);
  margin: clamp(90px, 19vh, 184px) auto 64px;
}

.profile {
  display: grid;
  grid-template-columns: minmax(0, 560px) 200px;
  justify-content: space-between;
  gap: 56px;
  align-items: start;
}

h1 {
  margin: -5px 0 26px;
  font-size: 34px;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -1.1px;
}

.period { color: var(--accent); }

.focus {
  margin: 0 0 34px;
  font-family: "Cormorant Garamond", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: clamp(36px, 4.7vw, 54px);
  font-weight: 500;
  font-style: italic;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.biography {
  max-width: 530px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--secondary);
}

.biography p { margin: 0 0 18px; }
.biography strong { font-weight: 500; color: var(--text); }

.profile-image {
  display: block;
  width: 168px;
  height: 168px;
  margin-top: 5px;
  object-fit: cover;
  border-radius: 6px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin-top: 29px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  color: var(--text);
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.social-links svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  opacity: 0.55;
}

a:hover { color: var(--accent); text-decoration-color: currentColor; }

.highlights-page { margin-top: clamp(64px, 10vh, 104px); }
.highlights-page .highlights { margin-top: 0; }
.highlights-header { margin-bottom: 44px; }
.highlights-header h1 { margin: 30px 0 0; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  color: var(--secondary);
  font-size: 14px;
  text-decoration: none;
}

.back-link:hover { color: var(--accent); }

.highlight-list { display: grid; gap: 36px; }

.highlight {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 30px;
  align-items: center;
}

.research-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
}

.particle-canvas {
  position: absolute;
  inset: -30px;
  width: calc(100% + 60px);
  height: calc(100% + 60px);
  pointer-events: none;
  visibility: hidden;
}

.research-visual[data-particles="active"] .particle-canvas { visibility: visible; }
:root[data-motion] .research-visual[data-particles="active"] img { animation-play-state: paused; }

.research-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: var(--motion-animation, research-float) var(--float-duration, 8s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
  animation-play-state: paused;
}

.research-visual[data-illustration="vision"] { --motion-animation: research-look; --float-duration: 11s; --float-delay: -1s; }
.research-visual[data-illustration="control"] { --motion-animation: research-control; --float-duration: 9s; --float-delay: -2.5s; }
.research-visual[data-illustration="control"] img { transform-origin: 40% 82%; }
.research-visual[data-illustration="dreaming"] { --motion-animation: research-dream; --float-duration: 10s; --float-delay: -6s; }
.research-visual[data-illustration="collaboration"] { --motion-animation: research-breathe; --float-duration: 8.5s; --float-delay: -4s; }
.research-visual[data-illustration="rna"] { --motion-animation: research-helix; --float-duration: 12s; --float-delay: -7s; }

:root[data-motion="running"] .research-visual img { animation-play-state: running; }
:root[data-motion="running"] .research-visual[data-in-view="false"] img { animation-play-state: paused; }

@keyframes research-float {
  0%, 100% { transform: translateY(3px) rotate(-0.7deg); }
  50% { transform: translateY(-4px) rotate(0.7deg); }
}

@keyframes research-look {
  0%, 100% { transform: translate(-2px, 1px) rotate(-0.7deg); }
  50% { transform: translate(2px, -1px) rotate(0.7deg); }
}

@keyframes research-control {
  0%, 100% { transform: rotate(-1.8deg); }
  50% { transform: translateY(-2px) rotate(1.8deg); }
}

@keyframes research-dream {
  0%, 100% { transform: translate(-2px, 4px) rotate(-1deg); }
  50% { transform: translate(2px, -5px) rotate(1deg); }
}

@keyframes research-breathe {
  0%, 100% { transform: translateY(2px) scale(0.985); }
  50% { transform: translateY(-2px) scale(1.015); }
}

@keyframes research-helix {
  0%, 100% { transform: perspective(600px) rotateY(-12deg) rotate(-1deg) translateY(2px); }
  50% { transform: perspective(600px) rotateY(12deg) rotate(1deg) translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .research-visual img { animation: none; transform: none; }
  .particle-canvas { display: none; }
}

.highlight h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 550;
  line-height: 1.5;
  letter-spacing: -0.2px;
}

.highlight h2 sub { font-size: 0.65em; }

.highlight-copy > p {
  margin: 9px 0 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--secondary);
}

.highlight-details {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

.highlight-details a {
  color: var(--secondary);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}

.highlight-details a:hover { color: var(--accent); text-decoration-color: currentColor; }

.highlight-copy > .publication-citation { font-size: 13px; color: var(--muted); }

.profile-aside { min-width: 0; }

.profile-quote {
  margin: 28px 0 0;
}

.profile-quote::before {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  margin-bottom: 14px;
  background: var(--accent);
}

.profile-quote blockquote { margin: 0; }
.profile-quote p {
  margin: 0;
  font-family: "Cormorant Garamond", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--secondary);
  text-wrap: pretty;
}

.profile-quote figcaption {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--muted);
}

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(100% - 112px, 880px);
  margin: auto auto 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
}

.home-page .home-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(44px, 6vw, 88px);
  row-gap: 16px;
  width: min(100% - 112px, 1200px);
  margin: clamp(100px, 20vh, 200px) auto 30px;
}

.home-layout .introduction { grid-column: 2; grid-row: 1; }
.home-layout .profile-image { width: 128px; height: 128px; margin: 0 0 18px; }
.home-layout h1 { margin: 0 0 12px; font-size: 36px; letter-spacing: -1px; }
.home-layout .focus { font-size: clamp(26px, 2.2vw, 30px); line-height: 1.15; margin-bottom: 16px; }
.home-layout .biography { font-size: 15px; line-height: 1.55; }
.home-layout .biography p { margin-bottom: 10px; }
.home-layout .biography p:last-child { margin-bottom: 0; }
.home-layout .social-links { gap: 8px 22px; margin-top: 14px; }
.home-layout .social-links a { font-size: 14px; }
.home-layout .profile-quote {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  max-width: 560px;
  margin: 24px 0 0;
  text-align: center;
}
.home-layout .profile-quote::before { margin-left: auto; margin-right: auto; }
.home-layout .profile-quote p { font-size: 22px; line-height: 1.35; }
.home-layout .profile-quote figcaption { margin-top: 10px; }
.home-page footer { width: min(100% - 112px, 1200px); min-height: 52px; }

.drawing-gallery {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  min-width: 0;
  margin: 0;
}

.drawing-stage {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  background: var(--background);
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.drawing-stage img, .drawing-stage video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.drawing-stage video { visibility: hidden; }
.drawing-stage[data-surface="draw"] .drawing-forward,
.drawing-stage[data-surface="erase"] .drawing-reverse { visibility: visible; }
.drawing-stage[data-surface="loading"] .drawing-poster,
.drawing-stage[data-surface="draw"] .drawing-poster,
.drawing-stage[data-surface="erase"] .drawing-poster { visibility: hidden; }
:root[data-theme="dark"] .drawing-stage img,
:root[data-theme="dark"] .drawing-stage video { filter: invert(1); mix-blend-mode: screen; }

.drawing-caption {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .home-page .home-layout { width: calc(100% - 64px); column-gap: 36px; }
  .home-page footer { width: calc(100% - 64px); }
  .home-layout .social-links { gap: 8px 18px; }
}

@media (min-width: 1000px) and (max-height: 850px) {
  .home-page .home-layout { margin-top: clamp(72px, 14vh, 116px); margin-bottom: 18px; row-gap: 12px; }
  .home-layout .profile-quote p { font-size: 22px; }
}

@media (min-width: 1000px) and (max-width: 1100px) {
  .home-layout .social-links { column-gap: 12px; }
}

@media (max-width: 680px) {
  .home-page .home-layout {
    width: calc(100% - 48px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    gap: 32px;
    margin-top: 40px;
  }
  .home-layout .introduction { grid-column: 1; grid-row: 1; }
  .home-layout .profile-image { width: 112px; height: 112px; margin-bottom: 16px; }
  .home-layout h1 { font-size: 32px; }
  .home-layout .focus { font-size: clamp(25px, 6.5vw, 28px); }
  .drawing-gallery { grid-column: 1; grid-row: 2; width: 100%; max-width: 480px; justify-self: center; margin: 0; }
  .drawing-stage { aspect-ratio: 6 / 5; }
  .home-layout .profile-quote { grid-column: 1; grid-row: 3; max-width: 340px; margin-top: 0; }
  .home-page footer { width: calc(100% - 48px); }
}

.footer-credit {
  grid-column: 2;
  text-align: center;
  letter-spacing: 0.1px;
}
footer .theme-toggle { grid-column: 3; justify-self: end; }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 9px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.theme-window {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  overflow: hidden;
}

.theme-toggle svg {
  position: absolute;
  inset: 2px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  transition: transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-toggle .sun-core { fill: currentColor; fill-opacity: 0.12; }
.theme-toggle .theme-sun { transform: translateX(0); }
.theme-toggle .theme-moon { transform: translateX(32px); }
:root[data-theme="dark"] .theme-toggle .theme-sun,
:root .theme-toggle[data-preview="dark"] .theme-sun { transform: translateX(-32px); }
:root[data-theme="dark"] .theme-toggle .theme-moon,
:root .theme-toggle[data-preview="dark"] .theme-moon { transform: translateX(0); }
:root .theme-toggle[data-preview="light"] .theme-sun { transform: translateX(0); }
:root .theme-toggle[data-preview="light"] .theme-moon { transform: translateX(32px); }
.theme-toggle:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle svg { transition: none; }
}
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 2px;
}

@media (max-width: 680px) {
  main { width: calc(100% - 48px); margin-top: 56px; }
  .profile { grid-template-columns: 1fr; gap: 32px; }
  .profile-aside { display: contents; }
  .profile-image { grid-row: 1; width: 88px; height: 88px; margin-top: 0; }
  h1 { margin: 0 0 22px; font-size: 30px; letter-spacing: -0.9px; }
  .focus { font-size: clamp(30px, 9.6vw, 48px); line-height: 1.14; margin-bottom: 28px; }
  .biography { font-size: 16px; line-height: 1.8; }
  .social-links { gap: 12px 22px; margin-top: 25px; }
  .highlights-page { margin-top: 40px; }
  .highlight { grid-template-columns: 144px minmax(0, 1fr); gap: 22px; align-items: start; }
  .highlight-list { gap: 38px; }
  .profile-quote { max-width: 480px; margin: 4px 0 0; }
  .profile-quote p { font-size: 26px; }
  footer { width: calc(100% - 48px); }
}

@media (max-width: 520px) {
  .highlight { grid-template-columns: 1fr; gap: 18px; }
  .research-visual { width: 168px; }
}

@media (max-width: 360px) {
  .social-links { gap: 10px 17px; }
}
