/* Base reset: keeps spacing predictable across browsers. */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Viewport lock: each section fills one screen and navigation is handled by JS. */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Site theme: dark technical base with a bright cyan accent. */
body {
  --cyan: #13d8ff;
  --white: rgba(255, 255, 255, 0.89);
  --muted: rgba(255, 255, 255, 0.58);
  --panel: rgba(4, 7, 12, 0.72);
  --dash-line: rgba(255, 255, 255, 0.48);
  --dash-dense: repeating-linear-gradient(90deg, var(--dash-line) 0 7px, transparent 7px 12px);
  --dash-sparse: repeating-linear-gradient(90deg, var(--dash-line) 0 5px, transparent 5px 24px);
  font-family: Arial, Helvetica, sans-serif;
  background: #050608;
  color: var(--white);
}

/* Page shell: holds the full-screen sections in one absolute stage. */
.page-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Major section: hidden by default until JS marks it active or moving. */
.section {
  --section-base: #07090d;
  --section-accent: 19, 216, 255;
  --section-accent-soft: 255, 255, 255;
  --section-glow-x: 76%;
  --section-glow-y: 42%;
  --section-soft-x: 8%;
  --section-soft-y: 74%;
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(100vw, 0, 0);
  background:
    linear-gradient(rgba(255, 255, 255, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.034) 1px, transparent 1px),
    linear-gradient(135deg, transparent 49.5%, rgba(255, 255, 255, 0.034) 50%, transparent 50.5%),
    radial-gradient(circle at var(--section-glow-x) var(--section-glow-y), rgba(var(--section-accent), 0.105), transparent 28%),
    radial-gradient(circle at var(--section-soft-x) var(--section-soft-y), rgba(var(--section-accent-soft), 0.055), transparent 28%),
    var(--section-base);
  background-size: 14vw 22vh, 14vw 22vh, 22vw 22vw, auto, auto, auto;
  will-change: transform, opacity;
}

/* Section overlay: adds the subtle scanline and side-vignette texture. */
.section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.38), transparent 54%, rgba(0, 0, 0, 0.5)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 7px);
  pointer-events: none;
}

/* Current section: visible and interactive. */
.section.is-active {
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

/* Holding section: old page stays frozen beneath the incoming curtain. */
.section.is-holding {
  z-index: 2;
  opacity: 1;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
}

/* Covering section: incoming page sits above the held page. */
.section.is-covering {
  z-index: 4;
  opacity: 1;
  pointer-events: auto;
}

/* Offscreen helpers: JS uses these before starting the curtain animation. */
.section.from-left,
.section.is-covering.from-left {
  transform: translate3d(-100vw, 0, 0);
}

/* Offscreen helpers: matching start position for forward navigation. */
.section.from-right,
.section.is-covering.from-right {
  transform: translate3d(100vw, 0, 0);
}

/* No-transition helper: used only during instant route resets. */
.section.no-transition {
  transition: none;
}

/* Index page accent placement. */
#index {
  --section-base: #050608;
  --section-accent: 19, 216, 255;
  --section-glow-x: 76%;
  --section-glow-y: 44%;
  --section-soft-x: 7%;
  --section-soft-y: 72%;
}


/* About page accent placement. */
#about {
  --section-base: #070a10;
  --section-accent: 112, 205, 255;
  --section-glow-x: 24%;
  --section-glow-y: 68%;
  --section-soft-x: 82%;
  --section-soft-y: 32%;
}

/* Research page accent placement. */
#research {
  --section-base: #07090d;
  --section-accent: 19, 216, 255;
  --visual-cyan: 19, 216, 255;
  --section-glow-x: 75%;
  --section-glow-y: 45%;
  --section-soft-x: 6%;
  --section-soft-y: 72%;
}

/* Projects page accent placement. */
#projects {
  --section-base: #080c13;
  --section-accent: 92, 170, 255;
  --section-glow-x: 70%;
  --section-glow-y: 70%;
  --section-soft-x: 14%;
  --section-soft-y: 24%;
}

/* Life page accent placement. */
#life {
  --section-base: #0a0d16;
  --section-accent: 115, 205, 230;
  --section-glow-x: 34%;
  --section-glow-y: 36%;
  --section-soft-x: 86%;
  --section-soft-y: 78%;
}

/* Placeholder section word: used on simple sections like Projects. */
.section-label {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  font-size: 132px;
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.055);
  white-space: nowrap;
  user-select: none;
  transform: translate(-50%, -50%);
}

/* About stage: two-column research profile inspired by academic bio pages. */
.about-section {
  --about-accent: 112, 205, 255;
}

/* About shell: keeps the profile layout away from the fixed nav and counter. */
.about-shell {
  position: absolute;
  inset: 0;
  z-index: 3;
}

/* About kicker: small page label matching the technical section style. */
.about-kicker {
  position: absolute;
  left: 6vw;
  top: 17vh;
  z-index: 6;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.52);
  opacity: 0;
  transform: translateX(-28px);
}

/* About background word: quiet scale cue behind the profile content. */
.about-bg-title {
  position: absolute;
  left: 5.6vw;
  bottom: 8.5vh;
  z-index: 1;
  font-size: 118px;
  line-height: 0.82;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.045);
  pointer-events: none;
  user-select: none;
  opacity: 0;
}

/* About visual: rectangular portrait panel with no image cropping. */
.about-visual {
  position: absolute;
  left: 6vw;
  top: 19vh;
  z-index: 4;
  width: min(28vw, 448px);
  height: min(60vh, 580px);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 82px rgba(0, 0, 0, 0.48), 0 0 38px rgba(var(--about-accent), 0.12);
  opacity: 0;
  transform: translate3d(-36px, 0, 0);
}

/* About visual image: contains the full portrait without cropping. */
.about-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
}

/* About visual caption: identity label over the lower edge. */
.about-visual figcaption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  z-index: 2;
  padding: 14px 16px 15px;
  border-left: 3px solid rgba(var(--about-accent), 0.9);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.08));
  backdrop-filter: blur(3px);
}

.about-visual strong,
.about-visual span {
  display: block;
  letter-spacing: 0;
}

.about-visual strong {
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
}

.about-visual span {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  color: rgba(var(--about-accent), 0.86);
  text-transform: uppercase;
}

/* About copy: academic summary column. */
.about-copy {
  position: absolute;
  left: 35vw;
  top: 18vh;
  z-index: 4;
  width: min(48vw, 780px);
  color: rgba(255, 255, 255, 0.76);
  opacity: 0;
  transform: translate3d(34px, 0, 0);
}

.about-copy h2,
.about-copy p {
  letter-spacing: 0;
}

.about-copy h2 {
  margin: 0 0 22px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.88);
}

.about-copy p {
  margin: 0 0 19px;
  font-size: 18px;
  line-height: 1.58;
  font-weight: 500;
}

/* About topic tags: larger research-interest tags above the status chips. */
.about-topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 22px;
  padding-top: 18px;
  background-image: var(--dash-dense);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: left top;
}

.about-topic-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(var(--about-accent), 0.38);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: 0;
}

/* About tags: concise academic status keywords. */
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.about-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 7px 11px;
  border: 1px solid rgba(var(--about-accent), 0.34);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.about-section.is-active .about-kicker {
  animation: small-label-in 760ms cubic-bezier(0.22, 1, 0.36, 1) 170ms both;
}

.about-section.is-active .about-bg-title {
  animation: bg-title-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 220ms both;
}

.about-section.is-active .about-visual {
  animation: project-card-in 880ms cubic-bezier(0.22, 1, 0.36, 1) 240ms both;
}

.about-section.is-active .about-copy {
  animation: project-copy-in 860ms cubic-bezier(0.22, 1, 0.36, 1) 300ms both;
}

/* Projects stage: two-column project browser inspired by the research detail language. */
.projects-section {
  --project-accent: 92, 170, 255;
  --visual-cyan: 92, 170, 255;
}

/* Projects shell: isolates all project-specific layers. */
.projects-shell {
  position: absolute;
  inset: 0;
  z-index: 3;
  isolation: isolate;
}

/* Projects kicker: small page label above the left description. */
.projects-kicker {
  position: absolute;
  left: 6vw;
  top: 16.8vh;
  z-index: 8;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.42);
  opacity: 0;
  transform: translateX(-28px);
}

/* Projects background word: low-contrast anchor behind the selector. */
.projects-bg-title {
  position: absolute;
  left: 5.5vw;
  bottom: 9vh;
  z-index: 1;
  font-size: 128px;
  line-height: 0.8;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.056);
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transform: translateX(-38px);
}

/* Projects guide lines: structural rails behind the left content. */
.projects-lines {
  position: absolute;
  left: 6vw;
  top: 20.4vh;
  z-index: 2;
  width: 46vw;
  height: 58vh;
  pointer-events: none;
  opacity: 0.34;
}

/* Individual project guide line. */
.projects-lines span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Guide line positions. */
.projects-lines span:nth-child(1) {
  top: 0;
}

.projects-lines span:nth-child(2) {
  top: 52%;
}

.projects-lines span:nth-child(3) {
  bottom: 0;
}

/* Active project text block on the left. */
.project-copy {
  position: absolute;
  left: 9.2vw;
  top: 23.1vh;
  z-index: 9;
  width: min(36vw, 560px);
  opacity: 0;
  transform: translateX(-34px);
}

/* Small active project category label. */
.project-copy-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: rgba(var(--project-accent), 0.92);
}

/* Active project title. */
.project-copy-title {
  margin: 0;
  font-size: 38px;
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.24), 0 14px 34px rgba(0, 0, 0, 0.48);
}

/* Active project description. */
.project-copy-description {
  width: min(28vw, 440px);
  margin-top: 12px;
  padding-top: 13px;
  background-image: var(--dash-dense);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: left top;
  font-size: 15px;
  line-height: 1.58;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.76);
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.44);
}

/* Active project outputs. */
.project-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
  width: min(28vw, 440px);
}

/* Individual output chip. */
.project-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.28);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 8px) 100%, 0 100%, 0 7px);
  font-size: 9px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
}

/* Triangle selector: three clipped blocks arranged as the clickable project map. */
.project-selector {
  position: absolute;
  left: 6vw;
  bottom: 14vh;
  z-index: 10;
  width: min(38vw, 610px);
  height: min(28vh, 260px);
}

/* Project block button. */
.project-card {
  position: absolute;
  width: 46%;
  min-width: 214px;
  height: 39%;
  min-height: 86px;
  padding: 14px 18px 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.015) 58%),
    rgba(3, 7, 13, 0.76);
  clip-path: polygon(11% 0, 100% 0, 100% 80%, 89% 100%, 0 100%, 0 20%);
  color: rgba(255, 255, 255, 0.76);
  text-align: left;
  font: inherit;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(-48px, 18px, 0);
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease, filter 180ms ease;
}

/* Project block placement: top-left vertex. */
.project-card:nth-child(1) {
  left: 0;
  top: 0;
}

/* Project block placement: right vertex. */
.project-card:nth-child(2) {
  right: 0;
  top: 28%;
}

/* Project block placement: lower-left vertex. */
.project-card:nth-child(3) {
  left: 7%;
  bottom: 0;
}

/* Project block glow and scanline accents. */
.project-card::before,
.project-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

/* Project block subtle diagonal texture. */
.project-card::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 22%, transparent 80%, rgba(255, 255, 255, 0.07)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 7px);
  opacity: 0.52;
}

/* Project block active accent edge. */
.project-card::after {
  left: 0;
  right: 34%;
  bottom: 0;
  height: 3px;
  background: rgba(var(--project-accent), 0);
  transition: right 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

/* Project interaction state. */
.project-card:hover,
.project-card:focus-visible,
.project-card.is-active {
  border-color: rgba(var(--project-accent), 0.74);
  color: rgba(255, 255, 255, 0.92);
  background:
    linear-gradient(135deg, rgba(var(--project-accent), 0.2), rgba(255, 255, 255, 0.022) 58%),
    rgba(4, 9, 17, 0.86);
  filter: saturate(1.12);
  transform: translate3d(0, 0, 0);
}

/* Project active accent edge reveal. */
.project-card:hover::after,
.project-card:focus-visible::after,
.project-card.is-active::after {
  right: 0;
  background: rgba(var(--project-accent), 0.92);
  box-shadow: 0 0 18px rgba(var(--project-accent), 0.32);
}

/* Project block index. */
.project-card-index {
  position: relative;
  z-index: 2;
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: rgba(var(--project-accent), 0.82);
}

/* Project block title. */
.project-card-title {
  position: relative;
  z-index: 2;
  display: block;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: currentColor;
  white-space: nowrap;
}

/* Project block subtitle. */
.project-card-meta {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 7px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* Right-side media frame for the selected project. */
.project-media-frame {
  position: absolute;
  right: 15vw;
  top: 20vh;
  z-index: 7;
  width: min(42vw, 742px);
  height: min(58vh, 562px);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 30%, rgba(var(--project-accent), 0.08)),
    rgba(2, 5, 10, 0.82);
  clip-path: polygon(6% 0, 100% 0, 100% 84%, 91% 100%, 0 100%, 0 12%);
  box-shadow: 0 28px 88px rgba(0, 0, 0, 0.5), 0 0 42px rgba(var(--project-accent), 0.13);
  opacity: 0;
  transform: translate3d(50px, 0, 0);
}

/* Media frame overlays. */
.project-media-frame::before,
.project-media-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

/* Media scanline overlay. */
.project-media-frame::before {
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 17%, transparent 84%, rgba(255, 255, 255, 0.09)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 8px),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.45) 100%);
  mix-blend-mode: screen;
}

/* Media accent edge. */
.project-media-frame::after {
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  height: 4px;
  background: linear-gradient(90deg, rgba(var(--project-accent), 0.95), transparent 78%);
}

/* Selected media image. */
.project-media-image {
  display: block;
  width: 100%;
  height: 100%;
  padding: 20px;
  object-fit: contain;
  opacity: 0;
  filter: saturate(0.96) contrast(1.05) brightness(0.92);
  transform: scale(1);
  transition: opacity 220ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1), filter 220ms ease;
}

/* Loaded image state. */
.project-media-frame.has-image .project-media-image {
  opacity: 0.92;
}

/* Image switching feedback. */
.project-media-frame.is-visual-switching .project-media-image {
  opacity: 0.36;
  transform: scale(1.015) translateX(10px);
}

/* Never show the previous project while the selected image is loading. */
.project-media-frame.is-image-pending .project-media-image {
  opacity: 0;
}

/* Empty project media state. */
.project-media-frame.is-placeholder .project-media-image {
  opacity: 0;
}

/* Placeholder content inside the media frame. */
.project-media-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 11% 14%;
  background:
    radial-gradient(circle at 66% 40%, rgba(var(--project-accent), 0.12), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 18px);
  color: rgba(255, 255, 255, 0.72);
  transition: opacity 180ms ease, transform 220ms ease;
}

/* Hide placeholder once an image exists. */
.project-media-frame.has-image .project-media-placeholder {
  opacity: 0;
  transform: translateX(22px);
}

/* Placeholder label. */
.project-placeholder-label {
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: rgba(var(--project-accent), 0.86);
}

/* Placeholder title. */
.project-placeholder-title {
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
}

/* Placeholder note. */
.project-media-placeholder small {
  width: min(28vw, 430px);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.55);
}

/* Media caption overlay. */
.project-media-caption {
  display: none;
}

/* Media caption kicker. */
.project-media-kicker {
  display: block;
  margin-bottom: 5px;
  font-size: 8px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.66);
}

/* Media caption title. */
.project-media-title {
  display: block;
  font-size: 15px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.84);
}

/* Projects active entry: reveal the small label. */
.projects-section.is-active .projects-kicker {
  animation: small-label-in 760ms ease-out 120ms both;
}

/* Projects active entry: reveal the background word. */
.projects-section.is-active .projects-bg-title {
  animation: bg-title-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 420ms both;
}

/* Projects active entry: reveal the selected project copy. */
.projects-section.is-active .project-copy {
  animation: project-copy-in 820ms cubic-bezier(0.22, 1, 0.36, 1) 220ms both;
}

/* Projects active entry: draw the guide rules. */
.projects-section.is-active .projects-lines span {
  animation: page-rule-in 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Projects active entry: guide line stagger. */
.projects-section.is-active .projects-lines span:nth-child(1) {
  animation-delay: 160ms;
}

.projects-section.is-active .projects-lines span:nth-child(2) {
  animation-delay: 260ms;
}

.projects-section.is-active .projects-lines span:nth-child(3) {
  animation-delay: 360ms;
}

/* Projects active entry: reveal project blocks. */
.projects-section.is-active .project-card {
  animation: project-card-in 820ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Projects active entry: project block stagger. */
.projects-section.is-active .project-card:nth-child(1) {
  animation-delay: 340ms;
}

.projects-section.is-active .project-card:nth-child(2) {
  animation-delay: 460ms;
}

.projects-section.is-active .project-card:nth-child(3) {
  animation-delay: 580ms;
}

/* Projects active entry: reveal media frame. */
.projects-section.is-active .project-media-frame {
  animation: project-media-in 920ms cubic-bezier(0.22, 1, 0.36, 1) 340ms both;
}

/* Projects hold state: keep content visible while another section covers it. */
.projects-section.is-holding .projects-kicker,
.projects-section.is-holding .projects-bg-title,
.projects-section.is-holding .project-copy,
.projects-section.is-holding .project-card,
.projects-section.is-holding .project-media-frame {
  opacity: 1;
  animation: none;
  transform: none;
}

/* Projects hold state: keep guide rules drawn. */
.projects-section.is-holding .projects-lines span {
  animation: none;
  transform: scaleX(1);
}

/* Top navigation bar: fixed above all page transitions. */
.nav {
  --nav-divider-offset: -104px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  height: 104px;
  display: flex;
  align-items: flex-start;
  padding: 0 76px 0 38px;
  overflow: hidden;
  background: transparent;
}

/* Navigation glass: lightly tinted at the top, fully transparent at the bottom. */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 10, 13, 0.36) 0%, rgba(8, 10, 13, 0.14) 52%, rgba(8, 10, 13, 0) 100%);
  backdrop-filter: blur(18px) saturate(1.14);
  -webkit-backdrop-filter: blur(18px) saturate(1.14);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.68) 56%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.68) 56%, transparent 100%);
}

/* Animated navigation divider: slides down off index, slides up when returning. */
.nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.32);
  opacity: 1;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  transition: transform 720ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease;
}

body.is-index-page .nav::after {
  opacity: 0;
  transform: translate3d(0, var(--nav-divider-offset), 0);
}

/* Logo: simple text mark in the upper-left corner. */
.site-logo {
  position: relative;
  z-index: 1;
  padding-top: 31px;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.86);
  user-select: none;
}

/* Nav links: centered route controls for the five major sections. */
.nav-links {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 66px;
  padding-top: 0;
  transform: translateX(-50%);
}

/* Individual nav link: bold text button with cyan active state. */
.nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  transition: color 180ms ease, transform 180ms ease;
}

/* Nav interaction state: shows the current section. */
.nav a:hover,
.nav a.active {
  color: rgba(19, 216, 255, 0.86);
  transform: translateY(-2px);
}

/* Scroll hint: decorative helper on catalog-style pages. */
.scroll-hint {
  position: fixed;
  bottom: 34px;
  left: 50%;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: rgba(255, 255, 255, 0.56);
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 180ms ease;
  animation: scroll-hint-drop 2.1s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  will-change: opacity, transform;
}

/* Scroll hint arrow: follows the text as one animated unit. */
.scroll-hint::after {
  content: "";
  width: 13px;
  height: 13px;
  border-right: 4px solid rgba(255, 255, 255, 0.38);
  border-bottom: 4px solid rgba(255, 255, 255, 0.38);
  margin-top: -3px;
  transform: rotate(45deg);
  transform-origin: center;
}

/* Footer progress: small fallback page count in the lower-right corner. */
.progress {
  position: fixed;
  right: 76px;
  bottom: 28px;
  z-index: 80;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.58);
  pointer-events: none;
  transition: opacity 180ms ease;
}

/* Detail mode cleanup: hide footer helpers while the return/progress UI is shown. */
body.research-detail-open .progress,
body.research-detail-open .scroll-hint {
  opacity: 0;
}

body.research-detail-open .scroll-hint {
  animation: none;
}

/* Fixed section counter: created by JS so it stays above sliding pages. */
.section-side-stage {
  --side-accent: 19, 216, 255;
  position: fixed;
  top: 0;
  right: 1.75vw;
  bottom: 0;
  z-index: 88;
  width: 7.6vw;
  min-width: 90px;
  color: rgba(255, 255, 255, 0.76);
  pointer-events: none;
}

/* Fixed counter rule: the vertical line beside the number. */
.section-side-rule {
  position: absolute;
  left: -1.25vw;
  top: 9vh;
  bottom: 9vh;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.44) 20%, rgba(255, 255, 255, 0.44) 80%, transparent);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 420ms ease, transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-index-page .section-side-rule {
  opacity: 0;
  transform: translateY(-24px);
}

/* Fixed counter viewport: clips the entering and leaving number labels. */
.section-side-viewport {
  position: absolute;
  left: 0;
  top: 45.5vh;
  width: 100%;
  height: 128px;
  overflow: hidden;
}

/* Fixed counter label: one number/title group. */
.section-side-label {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  opacity: 1;
  transform: none;
}

/* Counter number row: wraps the large current number and total. */
.section-side-main {
  display: block;
  transform: translate3d(0, 0, 0);
  transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1), opacity 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Counter current number. */
.section-side-label strong {
  display: inline-block;
  font-size: 54px;
  line-height: 0.8;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(var(--label-accent, var(--side-accent)), 0.86);
  text-shadow: 0 0 14px rgba(var(--label-accent, var(--side-accent)), 0.24);
}

/* Counter total text. */
.section-side-label span {
  margin-left: 4px;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.52);
}

/* Counter section title. */
.section-side-label small {
  display: block;
  margin-top: 4px;
  padding-left: 2px;
  font-size: 8px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.46);
  text-transform: uppercase;
  transition: transform 860ms cubic-bezier(0.22, 1, 0.36, 1), opacity 860ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Counter entering label: kept hidden until the old label is removed. */
.section-side-label.is-entering {
  opacity: 0;
}

/* Counter active entering label: starts its visible motion. */
.section-side-label.is-entering.is-current {
  opacity: 1;
}

/* Counter forward entry: number begins below the viewport. */
.section-side-label.enter-forward .section-side-main {
  opacity: 0;
  transform: translate3d(0, 76px, 0);
}

/* Counter forward entry: subtitle begins below the number. */
.section-side-label.enter-forward small {
  opacity: 0;
  transform: translate3d(0, 44px, 0);
}

/* Counter forward visible state. */
.section-side-label.enter-forward.is-current .section-side-main,
.section-side-label.enter-forward.is-current small {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Counter backward entry: number begins above the viewport. */
.section-side-label.enter-backward .section-side-main {
  opacity: 0;
  transform: translate3d(0, -76px, 0);
}

/* Counter backward entry: subtitle begins above the number. */
.section-side-label.enter-backward small {
  opacity: 0;
  transform: translate3d(0, -44px, 0);
}

/* Counter backward visible state. */
.section-side-label.enter-backward.is-current .section-side-main,
.section-side-label.enter-backward.is-current small {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Counter leaving upward: used when moving forward. */
.section-side-label.is-leaving-up .section-side-main {
  opacity: 0;
  transform: translate3d(0, -76px, 0);
  transition-duration: 680ms;
}

/* Counter subtitle leaving upward. */
.section-side-label.is-leaving-up small {
  opacity: 0;
  transform: translate3d(0, -48px, 0);
  transition-duration: 610ms;
  transition-delay: 70ms;
}

/* Counter leaving downward: used when moving backward. */
.section-side-label.is-leaving-down .section-side-main {
  opacity: 0;
  transform: translate3d(0, 76px, 0);
  transition-duration: 680ms;
}

/* Counter subtitle leaving downward. */
.section-side-label.is-leaving-down small {
  opacity: 0;
  transform: translate3d(0, 48px, 0);
  transition-duration: 610ms;
  transition-delay: 70ms;
}

/* Research stage: isolates z-index layers inside the research section. */
.research-section,
.research-catalog,
.research-detail {
  isolation: isolate;
}

/* Research catalog: menu layer shown before a topic is opened. */
.research-catalog {
  position: absolute;
  inset: 0;
  z-index: 3;
}

/* Research kicker: small page label above the topic list. */
.research-kicker {
  position: absolute;
  left: 6vw;
  top: 17vh;
  z-index: 6;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.52);
  opacity: 0;
  transform: translateX(-28px);
}

/* Research background word: large low-contrast label near the bottom-left. */
.research-bg-title {
  position: absolute;
  left: 6vw;
  bottom: 10vh;
  z-index: 1;
  font-size: 118px;
  line-height: 0.8;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.065);
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transform: translateX(-38px);
}

/* Research menu: the five clickable research topics. */
.research-menu {
  position: relative;
  z-index: 9;
  width: min(46vw, 700px);
  margin-left: 6vw;
  padding-top: 24vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Research item: one full-width topic row. */
.research-item {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 42px;
  padding: 0 26px 0 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  font: inherit;
  cursor: pointer;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transform: translateX(-70px);
}

/* Research item rule: pale baseline under each topic. */
.research-item::before {
  content: "";
  position: absolute;
  left: 0;
  right: 12%;
  bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.56);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Research item accent: cyan line that expands on hover or selection. */
.research-item::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 260ms ease;
}

/* Research item title: uppercase topic text. */
.research-title {
  position: relative;
  z-index: 11;
  display: block;
  margin-left: 0;
  font-size: 26px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.26), 0 10px 28px rgba(0, 0, 0, 0.42);
  transform: translateX(-16px);
  transition: color 220ms ease, margin-left 260ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms ease;
}

/* Research item interaction: slide the title and reveal the cyan rule. */
.research-item:hover .research-title,
.research-item:focus-visible .research-title,
.research-item.is-hovered .research-title,
.research-item.is-selected .research-title {
  color: rgba(255, 255, 255, 0.86);
  margin-left: 30px;
}

/* Research item active underline. */
.research-item:hover::after,
.research-item:focus-visible::after,
.research-item.is-hovered::after,
.research-item.is-selected::after {
  width: 88%;
}

/* Research guide lines: long horizontal rules behind the catalog. */
.research-lines {
  position: absolute;
  left: 6vw;
  top: 20.5vh;
  z-index: 2;
  width: 52vw;
  height: 58vh;
  pointer-events: none;
  opacity: 0.36;
}

/* Individual research guide line. */
.research-lines span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.26);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Top guide line position. */
.research-lines span:nth-child(1) {
  top: 0;
}

/* Middle guide line position. */
.research-lines span:nth-child(2) {
  top: 50%;
}

/* Bottom guide line position. */
.research-lines span:nth-child(3) {
  bottom: 0;
}

/* Research dot-cloud graphic: technical particle decoration on the catalog page. */
.research-graphic {
  position: absolute;
  right: 10vw;
  top: 21.5vh;
  z-index: 2;
  width: min(47vw, 820px);
  aspect-ratio: 1.36;
  opacity: 0;
  pointer-events: none;
  transform: translateX(42px) scale(0.96);
}

/* Research dot cloud canvas. */
.research-dot-cloud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  filter: blur(var(--dot-blur, 0px)) drop-shadow(0 0 14px rgba(var(--section-accent), 0.14));
}

/* Hover preview: image card that follows the mouse behind the topic text. */
.research-hover-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 4;
  width: min(18vw, 260px);
  aspect-ratio: 4 / 3;
  opacity: 0;
  pointer-events: none;
  filter: saturate(0.96) contrast(1.08) brightness(0.92);
  transform: translate3d(var(--hover-x, 58vw), var(--hover-y, 40vh), 0) translate(-50%, -50%) scale(0.9);
  transition: opacity 180ms ease, transform 120ms linear;
  will-change: transform, opacity;
}

/* Hover preview visible state. */
.research-hover-preview.is-active {
  opacity: 0.84;
  transform: translate3d(var(--hover-x, 58vw), var(--hover-y, 40vh), 0) translate(-50%, -50%) scale(1);
}

/* Hover preview image-switch animation hook. */
.research-hover-preview.is-visual-switching .research-hover-frame {
  animation: hover-image-switch 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Hover preview frame: clipped image container. */
.research-hover-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.32);
  clip-path: polygon(8% 0, 100% 0, 100% 86%, 92% 100%, 0 100%, 0 13%);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.42), 0 0 30px rgba(var(--visual-cyan), 0.12);
}

/* Hover preview overlays: scanline and bottom accent. */
.research-hover-frame::before,
.research-hover-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* Hover preview scanline overlay. */
.research-hover-frame::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.11), transparent 18%, transparent 84%, rgba(255, 255, 255, 0.08)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 8px),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.35) 100%);
  mix-blend-mode: screen;
}

/* Hover preview bottom cyan accent. */
.research-hover-frame::after {
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(var(--visual-cyan), 0.92), transparent 72%);
}

/* Hover preview image. */
.research-hover-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: saturate(0.9) contrast(1.06) brightness(0.78);
  transform: scale(1.04);
  transition: opacity 100ms ease;
}

/* Hide the previous topic image while a first-time preview finishes decoding. */
.research-hover-preview.is-image-pending .research-hover-image {
  opacity: 0;
}

/* Hover preview caption plate. */
.research-hover-meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 11px;
  z-index: 5;
  padding: 8px 11px 9px;
  border-left: 3px solid rgba(var(--visual-cyan), 0.9);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.08));
  backdrop-filter: blur(3px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

/* Hover preview caption visible state. */
.research-hover-preview.is-active .research-hover-meta {
  opacity: 1;
  transform: translateY(0);
}

/* Small visual kicker text shared by hover and detail captions. */
.research-hover-kicker,
.research-detail-visual-kicker {
  display: block;
  margin-bottom: 5px;
  font-size: 8px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.66);
}

/* Visual title text shared by hover and detail captions. */
.research-hover-title,
.research-detail-visual-title {
  display: block;
  font-size: 14px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.84);
}

/* Research detail: full-screen topic view opened from the catalog. */
.research-detail {
  --highlight-left: 0%;
  --highlight-width: 20%;
  position: absolute;
  inset: 0;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(0 0 0 100%);
  transform: translateX(7vw);
}

/* Detail right rule: aligns the return button and progress system. */
.research-detail::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 10.5vw;
  width: 1px;
  background: rgba(255, 255, 255, 0.22);
}

/* Detail background word: low-contrast research label. */
.research-detail-bg {
  position: absolute;
  left: 6vw;
  bottom: 9.5vh;
  z-index: 1;
  font-size: 142px;
  line-height: 0.8;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.052);
  pointer-events: none;
  user-select: none;
}

/* Detail visual: clipped project image on the left side. */
.research-detail-visual {
  position: absolute;
  left: 12.8vw;
  top: 25.4vh;
  z-index: 4;
  width: min(36vw, 680px);
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(5, 8, 14, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  clip-path: polygon(7% 0, 100% 0, 100% 87%, 92% 100%, 0 100%, 0 12%);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.44), 0 0 32px rgba(var(--visual-cyan), 0.11);
  transform: translate3d(-32px, 0, 0);
}

/* Detail visual overlays: scanline and bottom accent. */
.research-detail-visual::before,
.research-detail-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* Detail visual scanline overlay. */
.research-detail-visual::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.11), transparent 18%, transparent 84%, rgba(255, 255, 255, 0.08)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.032) 0 1px, transparent 1px 8px),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.38) 100%);
  mix-blend-mode: screen;
}

/* Detail visual bottom cyan accent. */
.research-detail-visual::after {
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(var(--visual-cyan), 0.9), transparent 76%);
}

/* Detail image: fills the clipped visual frame. */
.research-detail-image {
  display: block;
  width: 100%;
  height: 100%;
  padding: 14px;
  object-fit: contain;
  opacity: 0.9;
  filter: saturate(0.96) contrast(1.04) brightness(0.9);
  transform: scale(1);
  transition: opacity 220ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1), filter 220ms ease;
}

/* Detail image switching: small feedback when changing research topics. */
.research-detail-visual.is-visual-switching .research-detail-image {
  opacity: 0.45;
  transform: scale(1.025) translateX(10px);
}

/* Never show the previous topic while the selected detail image is loading. */
.research-detail-visual.is-image-pending .research-detail-image {
  opacity: 0;
}

/* Motivation and Poster keep the original compact image layout. */
.research-section[data-visual-slug="motivation"] .research-detail-visual,
.research-section[data-visual-slug="poster-presentation"] .research-detail-visual {
  left: 16.7vw;
  top: 26.8vh;
  width: min(27.4vw, 486px);
  aspect-ratio: 4 / 3;
  background: var(--panel);
}

.research-section[data-visual-slug="motivation"] .research-detail-image,
.research-section[data-visual-slug="poster-presentation"] .research-detail-image {
  padding: 0;
  object-fit: cover;
  transform: scale(1.035);
}

.research-section[data-visual-slug="motivation"] .research-detail-visual.is-visual-switching .research-detail-image,
.research-section[data-visual-slug="poster-presentation"] .research-detail-visual.is-visual-switching .research-detail-image {
  transform: scale(1.075) translateX(12px);
}

.research-section[data-visual-slug="motivation"] .research-detail-copy,
.research-section[data-visual-slug="poster-presentation"] .research-detail-copy {
  left: 46.2vw;
  width: min(23.8vw, 430px);
  max-width: 430px;
}

/* Detail visual caption: label bar over the project image. */
.research-detail-visual-caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 6;
  padding: 12px 15px 13px;
  border-left: 3px solid rgba(var(--visual-cyan), 0.92);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.08));
  backdrop-filter: blur(3px);
}

/* Detail copy: title and description block on the right side of the image. */
.research-detail-copy {
  position: absolute;
  left: 52vw;
  top: 29.2vh;
  z-index: 5;
  width: min(25vw, 460px);
  max-width: 460px;
  opacity: 0;
  transform: translateX(42px);
}

.research-section[data-visual-slug="quantumchem200k"] .research-detail-copy,
.research-section[data-visual-slug="molecular-arena"] .research-detail-copy,
.research-section[data-visual-slug="raven"] .research-detail-copy {
  left: 50.6vw;
}

/* Detail title. */
.research-detail-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.24), 0 12px 32px rgba(0, 0, 0, 0.46);
}

/* Detail description with the dashed rule from the sample. */
.research-detail-description {
  width: 100%;
  margin-top: 14px;
  padding-top: 16px;
  background-image: var(--dash-dense);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: left top;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.76);
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

/* Detail arrow: shared button base for previous/next topic controls. */
.detail-arrow {
  position: absolute;
  top: 50vh;
  z-index: 12;
  width: 80px;
  height: 96px;
  border: 0;
  background: transparent;
  color: white;
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

/* Detail arrow icon: uses the provided image asset. */
.detail-arrow span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 66px;
  height: 66px;
  background: url("assets/arrow_button.png") center / contain no-repeat;
}

/* Previous arrow placement. */
.detail-arrow-left {
  left: 5.2vw;
}

/* Next arrow placement. */
.detail-arrow-right {
  right: 18.2vw;
}

/* Previous arrow direction. */
.detail-arrow-left span {
  transform: translate(-50%, -50%) scaleX(-1);
}

/* Next arrow direction. */
.detail-arrow-right span {
  transform: translate(-50%, -50%);
}

/* Arrow hover movement. */
.detail-arrow:hover {
  opacity: 1;
}

/* Previous arrow hover offset. */
.detail-arrow-left:hover {
  transform: translateX(-5px);
}

/* Next arrow hover offset. */
.detail-arrow-right:hover {
  transform: translateX(5px);
}

/* Detail progress line: grey rail across the lower screen. */
.research-detail-line {
  position: absolute;
  left: 0;
  right: 10.5vw;
  bottom: 15.8vh;
  z-index: 4;
  height: 7px;
  background: rgba(255, 255, 255, 0.38);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Detail progress highlight: cyan segment for the current topic. */
.research-detail-line::after {
  content: "";
  position: absolute;
  left: var(--highlight-left);
  top: 0;
  width: var(--highlight-width);
  height: 7px;
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(19, 216, 255, 0.45);
  transition: left 320ms cubic-bezier(0.22, 1, 0.36, 1), width 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Detail progress hit area: invisible five-part navigation over the rail. */
.research-detail-progress {
  position: absolute;
  left: 0;
  right: 10.5vw;
  bottom: 13.85vh;
  z-index: 10;
  height: 56px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

/* Detail progress button: one invisible segment of the progress hit area. */
.research-progress-button {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* Detail progress hover feedback. */
.research-progress-button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 7px;
  background: rgba(255, 255, 255, 0);
  transition: background 180ms ease;
}

/* Detail progress hover/focus state. */
.research-progress-button:hover::after,
.research-progress-button:focus-visible::after {
  background: rgba(255, 255, 255, 0.15);
}

/* Detail progress keyboard focus ring. */
.research-progress-button:focus-visible {
  outline: 1px solid rgba(19, 216, 255, 0.7);
  outline-offset: -8px;
}

/* Return button: exits a research topic back to the catalog. */
.research-back {
  position: absolute;
  right: 0;
  bottom: calc(15.8vh - 23px);
  z-index: 11;
  width: 14.8vw;
  min-width: 214px;
  height: 46px;
  padding: 0 22px 0 62px;
  border: 0;
  background: rgb(104, 104, 104);
  color: rgba(255, 255, 255, 0.84);
  text-align: left;
  font: inherit;
  cursor: pointer;
  opacity: 0;
  transform: translateX(100%);
  transition: background 180ms ease;
}

/* Return button hover. */
.research-back:hover {
  background: rgb(124, 124, 124);
}

/* Return button arrow icon. */
.research-back-icon {
  position: absolute;
  left: 31px;
  top: 12px;
  width: 22px;
  height: 22px;
  background: url("assets/arrow_button.png") center / contain no-repeat;
  transform: scaleX(-1);
}

/* Return button label. */
.research-back-text {
  display: block;
  margin: 0;
  font-size: 13px;
  line-height: 46px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* Catalog active entry: reveal the small research label. */
.research-section.is-active .research-kicker {
  animation: small-label-in 560ms ease-out 120ms both;
}

/* Catalog active entry: reveal the background word. */
.research-section.is-active .research-bg-title {
  animation: bg-title-in 760ms cubic-bezier(0.22, 1, 0.36, 1) 520ms both;
}

/* Catalog active entry: reveal each topic row. */
.research-section.is-active .research-item {
  animation: research-item-in 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Catalog active entry: reveal each row baseline. */
.research-section.is-active .research-item::before {
  animation: item-rule-in 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Catalog active entry: settle each row title. */
.research-section.is-active .research-title {
  animation: item-title-in 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Catalog active entry: reveal guide lines. */
.research-section.is-active .research-lines span {
  animation: page-rule-in 820ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Catalog active entry: reveal the dot-cloud graphic. */
.research-section.is-active .research-graphic {
  animation: graphic-in 820ms cubic-bezier(0.22, 1, 0.36, 1) 420ms both;
}

/* Research topic stagger: first row timing. */
.research-section.is-active .research-item:nth-child(1),
.research-section.is-active .research-item:nth-child(1)::before,
.research-section.is-active .research-item:nth-child(1) .research-title {
  animation-delay: 100ms;
}

/* Research topic stagger: second row timing. */
.research-section.is-active .research-item:nth-child(2),
.research-section.is-active .research-item:nth-child(2)::before,
.research-section.is-active .research-item:nth-child(2) .research-title {
  animation-delay: 220ms;
}

/* Research topic stagger: third row timing. */
.research-section.is-active .research-item:nth-child(3),
.research-section.is-active .research-item:nth-child(3)::before,
.research-section.is-active .research-item:nth-child(3) .research-title {
  animation-delay: 340ms;
}

/* Research topic stagger: fourth row timing. */
.research-section.is-active .research-item:nth-child(4),
.research-section.is-active .research-item:nth-child(4)::before,
.research-section.is-active .research-item:nth-child(4) .research-title {
  animation-delay: 460ms;
}

/* Research topic stagger: fifth row timing. */
.research-section.is-active .research-item:nth-child(5),
.research-section.is-active .research-item:nth-child(5)::before,
.research-section.is-active .research-item:nth-child(5) .research-title {
  animation-delay: 580ms;
}

/* Guide line stagger: first line timing. */
.research-section.is-active .research-lines span:nth-child(1) {
  animation-delay: 180ms;
}

/* Guide line stagger: second line timing. */
.research-section.is-active .research-lines span:nth-child(2) {
  animation-delay: 300ms;
}

/* Guide line stagger: third line timing. */
.research-section.is-active .research-lines span:nth-child(3) {
  animation-delay: 420ms;
}

/* Detail mode: disable catalog clicks once topic view opens. */
.research-section.is-detail .research-catalog {
  pointer-events: none;
}

/* Detail mode: hide guide lines while the detail layout is active. */
.research-section.is-detail:not(.is-returning) .research-lines,
.research-section.is-detail:not(.is-returning) .research-lines span {
  visibility: hidden;
  opacity: 0;
  animation: none;
  transform: scaleX(0);
}

/* Detail mode: keep the menu container still while each row exits in sequence. */
.research-section.is-detail:not(.is-returning) .research-menu {
  animation: none;
}

/* Detail mode: each catalog row wipes away from right to left in order. */
.research-section.is-detail:not(.is-returning) .research-item {
  animation: catalog-item-out-left 620ms linear both;
}

/* Detail mode: each row baseline collapses with its parent row. */
.research-section.is-detail:not(.is-returning) .research-item::before {
  animation: catalog-rule-out-left 620ms linear both;
}

/* Detail mode: each row title drifts left with its parent row. */
.research-section.is-detail:not(.is-returning) .research-title {
  animation: catalog-title-out-left 620ms linear both;
}

/* Detail mode row exit stagger: first row. */
.research-section.is-detail:not(.is-returning) .research-item:nth-child(1),
.research-section.is-detail:not(.is-returning) .research-item:nth-child(1)::before,
.research-section.is-detail:not(.is-returning) .research-item:nth-child(1) .research-title {
  animation-delay: 0ms;
}

/* Detail mode row exit stagger: second row. */
.research-section.is-detail:not(.is-returning) .research-item:nth-child(2),
.research-section.is-detail:not(.is-returning) .research-item:nth-child(2)::before,
.research-section.is-detail:not(.is-returning) .research-item:nth-child(2) .research-title {
  animation-delay: 80ms;
}

/* Detail mode row exit stagger: third row. */
.research-section.is-detail:not(.is-returning) .research-item:nth-child(3),
.research-section.is-detail:not(.is-returning) .research-item:nth-child(3)::before,
.research-section.is-detail:not(.is-returning) .research-item:nth-child(3) .research-title {
  animation-delay: 160ms;
}

/* Detail mode row exit stagger: fourth row. */
.research-section.is-detail:not(.is-returning) .research-item:nth-child(4),
.research-section.is-detail:not(.is-returning) .research-item:nth-child(4)::before,
.research-section.is-detail:not(.is-returning) .research-item:nth-child(4) .research-title {
  animation-delay: 240ms;
}

/* Detail mode row exit stagger: fifth row. */
.research-section.is-detail:not(.is-returning) .research-item:nth-child(5),
.research-section.is-detail:not(.is-returning) .research-item:nth-child(5)::before,
.research-section.is-detail:not(.is-returning) .research-item:nth-child(5) .research-title {
  animation-delay: 320ms;
}

/* Detail mode: fade the catalog decorations away. */
.research-section.is-detail:not(.is-returning) .research-kicker,
.research-section.is-detail:not(.is-returning) .research-bg-title,
.research-section.is-detail:not(.is-returning) .research-graphic {
  animation: fade-out-left 760ms cubic-bezier(0.76, 0, 0.24, 1) both;
}

/* Detail mode: reveal the full detail layer. */
.research-section.is-detail:not(.is-returning) .research-detail {
  pointer-events: auto;
  animation: detail-in-right 980ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}

/* Detail mode: reveal the image frame. */
.research-section.is-detail:not(.is-returning) .research-detail-visual {
  animation: research-detail-visual-in 760ms cubic-bezier(0.22, 1, 0.36, 1) 330ms both;
}

/* Detail mode: reveal the copy block. */
.research-section.is-detail:not(.is-returning) .research-detail-copy {
  animation: detail-copy-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 620ms both;
}

/* Detail mode: reveal the progress rail. */
.research-section.is-detail:not(.is-returning) .research-detail-line {
  animation: page-rule-in 980ms cubic-bezier(0.22, 1, 0.36, 1) 520ms both;
}

/* Detail mode: reveal the arrows. */
.research-section.is-detail:not(.is-returning) .detail-arrow-left,
.research-section.is-detail:not(.is-returning) .detail-arrow-right {
  animation: detail-arrow-in 780ms cubic-bezier(0.22, 1, 0.36, 1) 650ms both;
}

/* Detail mode: reveal the return button. */
.research-section.is-detail:not(.is-returning) .research-back {
  animation: back-button-in 780ms cubic-bezier(0.22, 1, 0.36, 1) 720ms both;
}

/* Detail text refresh: title animation when switching topics. */
.research-detail.is-text-entering .research-detail-title {
  animation: detail-text-title-in 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Detail text refresh: description animation when switching topics. */
.research-detail.is-text-entering .research-detail-description {
  animation: detail-text-description-in 840ms cubic-bezier(0.22, 1, 0.36, 1) 110ms both;
}

/* Returning state: fade away the detail layer. */
.research-section.is-detail.is-returning .research-detail {
  pointer-events: none;
  animation: detail-fade-away 520ms ease-out both;
}

/* Returning state: fade the detail image away instead of dropping to its base hidden state. */
.research-section.is-detail.is-returning .research-detail-visual {
  opacity: 1;
  animation: research-detail-visual-out 480ms ease-out both;
}

/* Returning state: move the detail text out while the catalog returns. */
.research-section.is-detail.is-returning .research-detail-copy {
  opacity: 1;
  transform: translateX(0);
  animation: detail-copy-out 460ms ease-out both;
}

/* Returning state: collapse the detail progress line with a fade. */
.research-section.is-detail.is-returning .research-detail-line {
  opacity: 1;
  visibility: visible;
  transform: scaleX(1);
  animation: detail-line-out 420ms ease-out both;
}

/* Returning state: hide the invisible progress hit-area during the catalog replay. */
.research-section.is-detail.is-returning .research-detail-progress {
  opacity: 0;
  visibility: hidden;
  animation: none;
}

/* Returning state: fade the topic arrows out with the detail page. */
.research-section.is-detail.is-returning .detail-arrow-left,
.research-section.is-detail.is-returning .detail-arrow-right {
  opacity: 0.72;
  animation: detail-control-out 360ms ease-out both;
}

/* Returning state: slide the return button out after it is clicked. */
.research-section.is-detail.is-returning .research-back {
  opacity: 1;
  transform: translateX(0);
  animation: back-button-out 420ms ease-out both;
}

/* Returning state: keep the menu container still while each row re-enters. */
.research-section.is-detail.is-returning .research-menu {
  opacity: 1;
  clip-path: inset(0 0 0 0);
  transform: none;
  animation: none;
}

/* Returning state: replay the topic rows back in. */
.research-section.is-detail.is-returning .research-item {
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transform: translateX(-82px);
  animation: research-item-in 920ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Returning state: replay the topic baselines. */
.research-section.is-detail.is-returning .research-item::before {
  transform: scaleX(0);
  animation: item-rule-in 920ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Returning state: replay the topic titles. */
.research-section.is-detail.is-returning .research-title {
  transform: translateX(-16px);
  animation: item-title-in 920ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Returning state row entry stagger: first row. */
.research-section.is-detail.is-returning .research-item:nth-child(1),
.research-section.is-detail.is-returning .research-item:nth-child(1)::before,
.research-section.is-detail.is-returning .research-item:nth-child(1) .research-title {
  animation-delay: 120ms;
}

/* Returning state row entry stagger: second row. */
.research-section.is-detail.is-returning .research-item:nth-child(2),
.research-section.is-detail.is-returning .research-item:nth-child(2)::before,
.research-section.is-detail.is-returning .research-item:nth-child(2) .research-title {
  animation-delay: 240ms;
}

/* Returning state row entry stagger: third row. */
.research-section.is-detail.is-returning .research-item:nth-child(3),
.research-section.is-detail.is-returning .research-item:nth-child(3)::before,
.research-section.is-detail.is-returning .research-item:nth-child(3) .research-title {
  animation-delay: 360ms;
}

/* Returning state row entry stagger: fourth row. */
.research-section.is-detail.is-returning .research-item:nth-child(4),
.research-section.is-detail.is-returning .research-item:nth-child(4)::before,
.research-section.is-detail.is-returning .research-item:nth-child(4) .research-title {
  animation-delay: 480ms;
}

/* Returning state row entry stagger: fifth row. */
.research-section.is-detail.is-returning .research-item:nth-child(5),
.research-section.is-detail.is-returning .research-item:nth-child(5)::before,
.research-section.is-detail.is-returning .research-item:nth-child(5) .research-title {
  animation-delay: 600ms;
}

/* Returning state: replay the kicker. */
.research-section.is-detail.is-returning .research-kicker {
  animation: small-label-in 760ms ease-out 160ms both;
}

/* Returning state: replay the background title. */
.research-section.is-detail.is-returning .research-bg-title {
  animation: bg-title-in 900ms cubic-bezier(0.22, 1, 0.36, 1) 520ms both;
}

/* Returning state: replay guide lines. */
.research-section.is-detail.is-returning .research-lines,
.research-section.is-detail.is-returning .research-lines span {
  visibility: visible;
  opacity: 0.28;
  transform-origin: left center;
}

/* Returning state: line draw animation. */
.research-section.is-detail.is-returning .research-lines span {
  transform: scaleX(0);
  animation: page-rule-in 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Final catalog hold: prevent a second catalog reveal after RETURN completes. */
.research-section.is-active.is-return-complete:not(.is-detail) .research-kicker,
.research-section.is-holding:not(.is-detail) .research-kicker,
.research-section.is-active.is-return-complete:not(.is-detail) .research-bg-title,
.research-section.is-holding:not(.is-detail) .research-bg-title,
.research-section.is-active.is-return-complete:not(.is-detail) .research-menu,
.research-section.is-holding:not(.is-detail) .research-menu,
.research-section.is-active.is-return-complete:not(.is-detail) .research-item,
.research-section.is-holding:not(.is-detail) .research-item,
.research-section.is-active.is-return-complete:not(.is-detail) .research-title,
.research-section.is-holding:not(.is-detail) .research-title {
  opacity: 1;
  clip-path: inset(0 0 0 0);
  animation: none;
  transform: none;
}

/* Final catalog hold: keep baselines fully drawn. */
.research-section.is-active.is-return-complete:not(.is-detail) .research-item::before,
.research-section.is-holding:not(.is-detail) .research-item::before {
  animation: none;
  transform: scaleX(1);
}

/* Final catalog hold: keep guide lines fully drawn. */
.research-section.is-active.is-return-complete:not(.is-detail) .research-lines,
.research-section.is-holding:not(.is-detail) .research-lines,
.research-section.is-active.is-return-complete:not(.is-detail) .research-lines span,
.research-section.is-holding:not(.is-detail) .research-lines span {
  visibility: visible;
  opacity: 0.28;
  animation: none;
  transform: scaleX(1);
}

/* Final catalog hold: keep the dot-cloud graphic visible. */
.research-section.is-active.is-return-complete:not(.is-detail) .research-graphic,
.research-section.is-holding:not(.is-detail) .research-graphic {
  opacity: 0.88;
  animation: none;
  transform: translateX(0) scale(1);
}

/* Forward page leave: when Research moves to Projects/Life, rows exit one by one. */
.research-section.is-holding.hold-forward:not(.is-detail) .research-item {
  animation: catalog-item-out-left 500ms linear both;
}

/* Forward page leave: each row baseline collapses with its row. */
.research-section.is-holding.hold-forward:not(.is-detail) .research-item::before {
  animation: catalog-rule-out-left 500ms linear both;
}

/* Forward page leave: each row title slides left with its row. */
.research-section.is-holding.hold-forward:not(.is-detail) .research-title {
  animation: catalog-title-out-left 500ms linear both;
}

/* Forward page leave row stagger: first row. */
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(1),
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(1)::before,
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(1) .research-title {
  animation-delay: 0ms;
}

/* Forward page leave row stagger: second row. */
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(2),
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(2)::before,
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(2) .research-title {
  animation-delay: 60ms;
}

/* Forward page leave row stagger: third row. */
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(3),
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(3)::before,
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(3) .research-title {
  animation-delay: 120ms;
}

/* Forward page leave row stagger: fourth row. */
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(4),
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(4)::before,
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(4) .research-title {
  animation-delay: 180ms;
}

/* Forward page leave row stagger: fifth row. */
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(5),
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(5)::before,
.research-section.is-holding.hold-forward:not(.is-detail) .research-item:nth-child(5) .research-title {
  animation-delay: 240ms;
}

/* Detail hold: freeze the open topic view under an incoming major page. */
.research-section.is-holding.is-detail .research-detail,
.research-section.is-holding.is-detail .research-detail-visual,
.research-section.is-holding.is-detail .research-detail-copy,
.research-section.is-holding.is-detail .research-detail-title,
.research-section.is-holding.is-detail .research-detail-description,
.research-section.is-holding.is-detail .research-detail-line,
.research-section.is-holding.is-detail .research-detail-progress,
.research-section.is-holding.is-detail .detail-arrow-left,
.research-section.is-holding.is-detail .detail-arrow-right,
.research-section.is-holding.is-detail .research-back {
  opacity: 1;
  visibility: visible;
  animation: none;
}

/* Detail hold: keep held topic geometry steady. */
.research-section.is-holding.is-detail .research-detail,
.research-section.is-holding.is-detail .research-detail-visual,
.research-section.is-holding.is-detail .research-detail-copy,
.research-section.is-holding.is-detail .detail-arrow-left,
.research-section.is-holding.is-detail .detail-arrow-right,
.research-section.is-holding.is-detail .research-back {
  transform: none;
  clip-path: inset(0 0 0 0);
}

/* Detail hold: keep the held progress line fully drawn. */
.research-section.is-holding.is-detail .research-detail-line {
  transform: scaleX(1);
}

/* Curtain animation: forward navigation enters from the right. */
.section.is-covering.is-curtain-forward {
  animation: curtain-in-from-right 850ms linear both;
}

/* Curtain animation: backward navigation enters from the left. */
.section.is-covering.is-curtain-backward {
  animation: curtain-in-from-left 850ms linear both;
}

/* Curtain leading edge: shared glowing edge during major page switches. */
.section.is-covering.is-curtain-forward::after,
.section.is-covering.is-curtain-backward::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 70;
  width: 2px;
  pointer-events: none;
  opacity: 0;
  animation: curtain-edge-glow 850ms linear both;
}

/* Curtain leading edge for forward navigation. */
.section.is-covering.is-curtain-forward::after {
  left: 0;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: -20px 0 44px rgba(0, 0, 0, 0.58), 10px 0 28px rgba(var(--section-accent), 0.18);
}

/* Curtain leading edge for backward navigation. */
.section.is-covering.is-curtain-backward::after {
  right: 0;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 20px 0 44px rgba(0, 0, 0, 0.58), -10px 0 28px rgba(var(--section-accent), 0.18);
}

/* Animation: row reveal from left to right. */
@keyframes research-item-in {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateX(-70px);
  }

  45% {
    opacity: 1;
  }

  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
}

/* Animation: line grows horizontally. */
@keyframes item-rule-in {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* Animation: row text settles into place. */
@keyframes item-title-in {
  from {
    transform: translateX(-16px);
  }

  to {
    transform: translateX(0);
  }
}

/* Animation: generic horizontal rule draw. */
@keyframes page-rule-in {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* Animation: small label slides in. */
@keyframes small-label-in {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animation: scroll hint appears, drifts down slightly, then resets. */
@keyframes scroll-hint-drop {
  0% {
    opacity: 0;
    transform: translate3d(-50%, 0, 0);
  }

  18% {
    opacity: 0.58;
    transform: translate3d(-50%, 0, 0);
  }

  62% {
    opacity: 0.58;
    transform: translate3d(-50%, 10px, 0);
  }

  82%,
  92% {
    opacity: 0;
    transform: translate3d(-50%, 10px, 0);
  }

  100% {
    opacity: 0;
    transform: translate3d(-50%, 0, 0);
  }
}

/* Animation: large background word slides in. */
@keyframes bg-title-in {
  from {
    opacity: 0;
    transform: translateX(-38px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animation: project copy settles in from the left. */
@keyframes project-copy-in {
  from {
    opacity: 0;
    transform: translateX(-34px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animation: project selector blocks assemble into the triangle. */
@keyframes project-card-in {
  from {
    opacity: 0;
    transform: translate3d(-48px, 18px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Animation: right-side project media opens. */
@keyframes project-media-in {
  from {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
    transform: translate3d(50px, 0, 0);
  }

  to {
    opacity: 1;
    clip-path: polygon(6% 0, 100% 0, 100% 84%, 91% 100%, 0 100%, 0 12%);
    transform: translate3d(0, 0, 0);
  }
}

/* Animation: dot-cloud graphic appears. */
@keyframes graphic-in {
  from {
    opacity: 0;
    transform: translateX(42px) scale(0.96);
  }

  to {
    opacity: 0.88;
    transform: translateX(0) scale(1);
  }
}

/* Animation: one catalog row exits when detail opens. */
@keyframes catalog-item-out-left {
  from {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }

  to {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateX(-72px);
  }
}

/* Animation: one catalog row baseline collapses toward the left. */
@keyframes catalog-rule-out-left {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

/* Animation: one catalog row title moves left as its row is clipped away. */
@keyframes catalog-title-out-left {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-24px);
  }
}

/* Animation: catalog decoration fades away. */
@keyframes fade-out-left {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-56px);
  }
}

/* Animation: detail layer opens from the right. */
@keyframes detail-in-right {
  from {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
    transform: translateX(7vw);
  }

  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
}

/* Animation: detail image frame opens. */
@keyframes research-detail-visual-in {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translate3d(-32px, 0, 0);
  }

  to {
    opacity: 1;
    clip-path: polygon(7% 0, 100% 0, 100% 87%, 92% 100%, 0 100%, 0 12%);
    transform: translate3d(0, 0, 0);
  }
}

/* Animation: detail image frame fades/slides away when returning. */
@keyframes research-detail-visual-out {
  from {
    opacity: 1;
    clip-path: polygon(7% 0, 100% 0, 100% 87%, 92% 100%, 0 100%, 0 12%);
    transform: translate3d(0, 0, 0);
  }

  to {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translate3d(-24px, 0, 0);
  }
}

/* Animation: detail text block enters. */
@keyframes detail-copy-in {
  from {
    opacity: 0;
    transform: translateX(42px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animation: detail text block leaves on return. */
@keyframes detail-copy-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(34px);
  }
}

/* Animation: arrows fade into place. */
@keyframes detail-arrow-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 0.72;
    transform: translateY(0);
  }
}

/* Animation: arrows fade out on return. */
@keyframes detail-control-out {
  from {
    opacity: 0.72;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Animation: return button slides in from the right. */
@keyframes back-button-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animation: return button slides out after click. */
@keyframes back-button-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Animation: detail progress line fades and contracts on return. */
@keyframes detail-line-out {
  from {
    opacity: 1;
    transform: scaleX(1);
  }

  to {
    opacity: 0;
    transform: scaleX(0);
  }
}

/* Animation: detail title refresh. */
@keyframes detail-text-title-in {
  from {
    opacity: 0;
    filter: blur(2.5px);
    transform: translate3d(38px, 0, 0);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0);
  }
}

/* Animation: detail description refresh. */
@keyframes detail-text-description-in {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: translate3d(28px, 0, 0);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0);
  }
}

/* Animation: hover preview image switches. */
@keyframes hover-image-switch {
  from {
    opacity: 0.35;
    filter: blur(2px);
    transform: translate3d(18px, 0, 0) scale(0.985);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* Animation: detail fades away before returning to the catalog. */
@keyframes detail-fade-away {
  from {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translate3d(0, 0, 0);
  }

  to {
    opacity: 0;
    clip-path: inset(0 0 0 0);
    transform: translate3d(34px, 0, 0);
  }
}

/* Animation: incoming section moves from right to center. */
@keyframes curtain-in-from-right {
  from {
    transform: translate3d(100vw, 0, 0);
  }

  to {
    transform: translate3d(0, 0, 0);
  }
}

/* Animation: incoming section moves from left to center. */
@keyframes curtain-in-from-left {
  from {
    transform: translate3d(-100vw, 0, 0);
  }

  to {
    transform: translate3d(0, 0, 0);
  }
}

/* Animation: brief glow on the curtain edge. */
@keyframes curtain-edge-glow {
  0% {
    opacity: 0;
  }

  12% {
    opacity: 0.72;
  }

  78% {
    opacity: 0.5;
  }

  100% {
    opacity: 0;
  }
}

/* Responsive layout: compact navigation and simplified research layout. */
@media (max-width: 900px) {

  /* Mobile section label. */
  .section-label {
    font-size: 64px;
  }

  /* Mobile navigation height and padding. */
  .nav {
    --nav-divider-offset: -74px;
    height: 74px;
    padding: 0 22px;
  }

  /* Mobile logo. */
  .site-logo {
    padding-top: 22px;
    font-size: 22px;
  }

  /* Mobile nav links. */
  .nav-links {
    left: 55%;
    gap: 16px;
    padding-top: 0;
  }

  /* Mobile nav text. */
  .nav a {
    font-size: 11px;
  }

  /* Mobile fixed counter position. */
  .section-side-stage {
    right: 20px;
    width: 86px;
    min-width: 86px;
  }

  /* Mobile fixed counter rule. */
  .section-side-rule {
    left: -14px;
    top: 12vh;
    bottom: 16vh;
  }

  /* Mobile fixed counter viewport. */
  .section-side-viewport {
    top: auto;
    bottom: 22vh;
  }

  /* Mobile fixed counter number. */
  .section-side-label strong {
    font-size: 38px;
  }

  /* Mobile about layout. */
  .about-kicker {
    left: 7vw;
    top: 15vh;
    font-size: 14px;
  }

  .about-bg-title {
    left: 7vw;
    bottom: 8vh;
    font-size: 58px;
  }

  .about-visual {
    left: 7vw;
    top: 17vh;
    width: 62vw;
    height: 28vh;
  }

  .about-visual figcaption {
    left: 14px;
    right: 14px;
    bottom: 13px;
    padding: 10px 12px;
  }

  .about-visual strong {
    font-size: 16px;
  }

  .about-visual span {
    font-size: 9px;
  }

  .about-copy {
    left: 7vw;
    top: 49vh;
    width: 78vw;
  }

  .about-copy h2 {
    margin-bottom: 11px;
    font-size: 20px;
  }

  .about-topic-tags {
    gap: 6px;
    margin-bottom: 12px;
    padding-top: 10px;
  }

  .about-topic-tags span {
    min-height: 27px;
    padding: 6px 8px;
    font-size: 10px;
  }

  .about-copy p {
    margin-bottom: 10px;
    font-size: 12px;
    line-height: 1.42;
  }

  .about-tags {
    gap: 6px;
    margin-top: 13px;
  }

  .about-tags span {
    min-height: 24px;
    padding: 6px 8px;
    font-size: 9px;
  }

  /* Mobile catalog kicker. */
  .research-kicker {
    left: 7vw;
    top: 15vh;
  }

  /* Mobile catalog menu. */
  .research-menu {
    width: min(84vw, 620px);
    margin-left: 7vw;
    padding-top: 20vh;
  }

  /* Mobile topic title. */
  .research-title {
    font-size: 21px;
  }

  /* Mobile background title. */
  .research-bg-title,
  .research-detail-bg {
    left: 7vw;
    font-size: 58px;
  }

  /* Mobile dot-cloud decoration. */
  .research-graphic {
    right: -4vw;
    top: 30vh;
    width: 66vw;
    opacity: 0.18;
  }

  /* Mobile hides the cursor hover preview. */
  .research-hover-preview {
    display: none;
  }

  /* Mobile detail image. */
  .research-detail-visual {
    left: 11vw;
    top: 20vh;
    width: 78vw;
    opacity: 0.32;
  }

  /* Mobile detail copy. */
  .research-detail-copy {
    left: 11vw;
    top: 46vh;
    width: 76vw;
    max-width: 76vw;
  }

  /* Mobile detail title. */
  .research-detail-title {
    font-size: 28px;
  }

  /* Mobile detail description. */
  .research-detail-description {
    width: 76vw;
    font-size: 13px;
    line-height: 1.55;
  }

  /* Mobile detail right rule. */
  .research-detail::after {
    right: 0;
  }

  /* Mobile detail progress rail. */
  .research-detail-line {
    right: 0;
    bottom: 13.8vh;
  }

  /* Mobile progress button grid. */
  .research-detail-progress {
    right: 0;
    bottom: 11.85vh;
  }

  /* Mobile arrows. */
  .detail-arrow {
    top: 53vh;
    width: 58px;
    height: 76px;
  }

  /* Mobile arrow icon. */
  .detail-arrow span {
    width: 50px;
    height: 50px;
  }

  /* Mobile previous arrow. */
  .detail-arrow-left {
    left: 2vw;
  }

  /* Mobile next arrow. */
  .detail-arrow-right {
    right: 2vw;
  }

  /* Mobile return button. */
  .research-back {
    width: 178px;
    min-width: 178px;
    bottom: calc(13.8vh - 23px);
  }

  /* Mobile footer progress. */
  .progress {
    right: auto;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
  }

  /* Mobile hides the scroll hint. */
  .scroll-hint {
    display: none;
  }

  /* Mobile projects kicker. */
  .projects-kicker {
    left: 7vw;
    top: 13.5vh;
    font-size: 12px;
  }

  /* Mobile projects background word. */
  .projects-bg-title {
    left: 7vw;
    bottom: 9vh;
    font-size: 58px;
  }

  /* Mobile projects guide lines. */
  .projects-lines {
    left: 7vw;
    top: 17vh;
    width: 78vw;
    height: 66vh;
  }

  /* Mobile active project copy. */
  .project-copy {
    left: 7vw;
    top: 18vh;
    width: 73vw;
  }

  /* Mobile project category. */
  .project-copy-kicker {
    margin-bottom: 8px;
    font-size: 9px;
  }

  /* Mobile project title. */
  .project-copy-title {
    font-size: 27px;
  }

  /* Mobile project description. */
  .project-copy-description {
    width: 73vw;
    margin-top: 10px;
    padding-top: 12px;
    font-size: 12px;
    line-height: 1.45;
  }

  /* Mobile output chips. */
  .project-facts {
    gap: 6px;
    width: 74vw;
    margin-top: 10px;
  }

  /* Mobile individual output chip. */
  .project-facts span {
    min-height: 23px;
    padding: 0 8px;
    font-size: 8px;
  }

  /* Mobile selector becomes a compact row. */
  .project-selector {
    left: 7vw;
    right: 7vw;
    bottom: 37vh;
    width: auto;
    height: 72px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  /* Mobile project block reset. */
  .project-card,
  .project-card:nth-child(1),
  .project-card:nth-child(2),
  .project-card:nth-child(3) {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: auto;
    min-width: 0;
    height: 72px;
    min-height: 72px;
    padding: 11px 10px;
  }

  /* Mobile project block index. */
  .project-card-index {
    margin-bottom: 6px;
    font-size: 9px;
  }

  /* Mobile project block title. */
  .project-card-title {
    font-size: 15px;
    white-space: normal;
  }

  /* Mobile project block subtitle. */
  .project-card-meta {
    display: none;
  }

  /* Mobile media frame. */
  .project-media-frame {
    left: 7vw;
    right: 7vw;
    top: auto;
    bottom: 11vh;
    width: auto;
    height: 24vh;
  }

  /* Mobile media image padding. */
  .project-media-image {
    padding: 12px;
  }

  /* Mobile media placeholder. */
  .project-media-placeholder {
    padding: 12% 14%;
  }

  /* Mobile placeholder title. */
  .project-placeholder-title {
    font-size: 22px;
  }

  /* Mobile placeholder note. */
  .project-media-placeholder small {
    width: 58vw;
    font-size: 11px;
    line-height: 1.35;
  }

  /* Mobile media caption. */
  .project-media-caption {
    left: 15px;
    right: 15px;
    bottom: 13px;
    padding: 9px 12px 10px;
  }

  /* Mobile media caption title. */
  .project-media-title {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .nav::after,
  .section-side-rule {
    transition: none;
  }

  .scroll-hint {
    opacity: 0.68;
    transform: translateX(-50%);
    animation: none;
  }
}
