:root {
  --ink: #0a0a0a;
  --ink-light: #141414;
  --muted: #888888;
  --line: rgba(255, 255, 255, 0.08);
  --paper: #0a0a0a;
  --panel: #111111;
  --aqua: #21b8b2;
  --amber: #d39d3d;
  --red: #ba423d;
  --shadow: 0 32px 96px rgba(0, 0, 0, 0.5);
  --serif-en: "Libre Baskerville", "Playfair Display", Georgia, serif;
  --sans-cn: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: #e8e8e8;
  background: var(--paper);
  font-family: var(--sans-cn);
  font-size: 15.5px;
  line-height: 1.6;
  font-variant-numeric: lining-nums tabular-nums;
  overflow-x: hidden;
  transition: color 0.35s ease, background 0.35s ease;
}

.brand span,
.brand strong,
.eyebrow,
.hero-name-en,
.hero-title,
.hero-scroll,
.section-kicker,
.quick-profile > .reveal::after {
  font-family: var(--serif-en);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

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

/* ===== Scroll-triggered animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===== Header ===== */
.site-header {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 28px);
  height: 72px;
  padding: 0 clamp(20px, 4vw, 56px);
  color: white;
  background: transparent;
  transition: background 0.4s var(--ease-out-quart), backdrop-filter 0.4s var(--ease-out-quart);
}

.site-header.scrolled {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-12px);
  animation: fadeInDown 0.8s var(--ease-out-expo) 0.2s forwards;
}

.brand span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  transition: border-color 0.3s ease, transform 0.3s var(--ease-spring);
}

.brand:hover span {
  border-color: var(--aqua);
  transform: scale(1.08);
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: clamp(18px, 3vw, 34px);
  margin-left: auto;
}

.nav-links a {
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-8px);
  animation: fadeInDown 0.7s var(--ease-out-expo) forwards;
  position: relative;
  padding-bottom: 4px;
}

.nav-links a:nth-child(1) { animation-delay: 0.3s; }
.nav-links a:nth-child(2) { animation-delay: 0.4s; }
.nav-links a:nth-child(3) { animation-delay: 0.5s; }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--aqua);
  transition: width 0.3s var(--ease-out-expo);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  opacity: 1;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  color: white;
  background: var(--ink);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: clamp(84px, 10vh, 118px) clamp(18px, 4vw, 58px) clamp(56px, 7vh, 86px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(33, 184, 178, 0.06);
}

.hero-marquee {
  position: absolute;
  z-index: 1;
  inset: clamp(84px, 10vh, 118px) clamp(18px, 4vw, 58px) clamp(56px, 7vh, 86px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 20px);
  overflow: hidden;
  border-radius: 26px;
  opacity: 0.63;
  pointer-events: none;
  transform: rotate(-2deg) scale(1.05);
  mask-image: linear-gradient(to bottom, transparent 0, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 12%, black 88%, transparent 100%);
}

.marquee-col {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vw, 20px);
  min-width: 0;
  will-change: transform;
}

.marquee-col .marquee-item {
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  background-position: center;
  background-size: cover;
  filter: brightness(1.18) saturate(1.08) contrast(1.02);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.hero-scrim {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 100%;
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.54) 72%),
    linear-gradient(180deg, rgba(10, 10, 10, 0.52), rgba(10, 10, 10, 0.08) 45%, var(--paper) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.44), rgba(0, 0, 0, 0.04) 50%, rgba(0, 0, 0, 0.44));
  pointer-events: none;
}

.hero-content {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: flex;
  width: min(860px, calc(100% - 40px));
  flex-direction: column;
  align-items: center;
  padding: 0;
  text-align: center;
  transform: translate(-50%, -50%);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--aqua);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.5s forwards;
}

.hero h1 {
  margin: 0;
  font-family: "ZCOOL XiaoWei", "PingFang SC", "Microsoft YaHei", serif;
  font-size: clamp(64px, 10vw, 148px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -1.5px;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1s var(--ease-out-expo) 0.6s forwards;
}

.hero-name-mark {
  width: min(560px, 82vw);
}

.hero-name-mark span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero-name-mark img {
  width: 100%;
  height: auto;
  margin-inline: auto;
  filter: drop-shadow(0 20px 44px rgba(0, 0, 0, 0.28));
  user-select: none;
}

.hero-name-en {
  width: max-content;
  margin: 20px auto 0;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.045);
  font-size: clamp(12px, 1.05vw, 15px);
  font-weight: 700;
  letter-spacing: 3.6px;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(18px);
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.72s forwards;
}

.hero-title {
  width: min(620px, 92%);
  margin: 26px auto 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(15px, 1.55vw, 20px);
  line-height: 1.55;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.9s var(--ease-out-expo) 0.8s forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s var(--ease-out-expo) 1s forwards;
}

.primary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease;
}

.primary-action {
  color: var(--ink);
  background: white;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.25);
}

.ghost-action {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.ghost-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.hero-meta {
  position: absolute;
  z-index: 3;
  right: 50%;
  bottom: clamp(76px, 9vh, 112px);
  width: min(420px, calc(100% - 40px));
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  text-align: center;
  transform: translateX(50%) translateY(14px);
  animation: fadeInHeroMeta 0.9s var(--ease-out-expo) 1.1s forwards;
}

.hero-meta strong {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 700;
}

.hero-meta span {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12.5px;
}

/* Hero scroll indicator */
.hero-scroll {
  position: absolute;
  z-index: 3;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeIn 1s ease 1.6s forwards;
}

.hero-scroll::after {
  content: '';
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ===== Section commons ===== */
.section-kicker {
  margin: 0 0 14px;
  color: var(--aqua);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.quick-profile,
.works,
.experience,
.site-footer {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

/* ===== Quick Profile ===== */
.quick-profile {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(460px, 1.18fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: stretch;
  margin-top: 34px;
  margin-bottom: 34px;
  padding: clamp(34px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 8% 10%, rgba(33, 184, 178, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  overflow: hidden;
}

.quick-profile::before {
  content: "";
  position: absolute;
  top: clamp(34px, 5vw, 64px);
  bottom: clamp(34px, 5vw, 64px);
  left: calc(39% + clamp(12px, 2vw, 28px));
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.quick-profile > .reveal,
.profile-copy {
  position: relative;
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.quick-profile > .reveal {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
}

.quick-profile > .reveal::after {
  content: "CMF / Mobility / Industrial Design";
  display: block;
  margin-top: 42px;
  color: rgba(255, 255, 255, 0.32);
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.quick-profile h2,
.experience > .reveal h2,
.section-heading h2,
.site-footer h2 {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.5px;
  color: #f0f0f0;
}

.quick-profile h2 {
  max-width: 11.5em;
  margin-inline: auto;
  font-size: clamp(24px, 2.9vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.2px;
  text-align: center;
}

.profile-copy p {
  margin: 0;
  color: #b0b0b0;
  font-size: 15.5px;
  line-height: 1.7;
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 34px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-facts div {
  border-top: 0;
  padding: 14px 14px 16px 0;
  transition: border-color 0.3s ease;
}

.profile-facts div + div {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.profile-facts div:hover {
  border-color: var(--aqua);
}

.profile-facts dt {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.profile-facts dd {
  margin: 6px 0 0;
  font-weight: 700;
  font-size: 15px;
  color: #e0e0e0;
}

.profile-strengths {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.profile-strengths li {
  position: relative;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12.5px;
  line-height: 1.35;
}

.profile-strengths li::before {
  content: none;
}

/* ===== Works ===== */
.works {
  padding: 58px 0 110px;
}

.section-heading {
  display: grid;
  justify-items: center;
  gap: 22px;
  margin-bottom: 34px;
  padding-bottom: 0;
  border-bottom: 0;
  text-align: center;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.works-tools {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.carousel-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(8, 8, 8, 0.72);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.25s ease, transform 0.25s var(--ease-spring), border-color 0.25s ease;
}

.carousel-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-50%) scale(1.06);
}

.filter-tabs button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 9px 15px;
  color: #999;
  font-size: 13px;
  letter-spacing: 0.2px;
  transition: all 0.3s var(--ease-out-quart);
  cursor: pointer;
}

.filter-tabs button:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #ccc;
}

.filter-tabs button[aria-selected="true"] {
  border-color: transparent;
  color: var(--ink);
  background: white;
  box-shadow: 0 2px 12px rgba(255, 255, 255, 0.1);
}

.work-carousel-shell {
  position: relative;
  margin-inline: calc((100vw - min(1240px, calc(100vw - 40px))) / -2);
  padding-left: calc((100vw - min(1240px, calc(100vw - 40px))) / 2);
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0, black 6%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 6%, black 90%, transparent 100%);
}

.work-carousel-shell .carousel-button {
  position: absolute;
  z-index: 8;
  top: 50%;
  transform: translateY(-50%);
}

.work-carousel-prev {
  left: max(18px, calc((100vw - min(1240px, calc(100vw - 40px))) / 2 + 8px));
}

.work-carousel-next {
  right: max(18px, calc((100vw - min(1240px, calc(100vw - 40px))) / 2 + 8px));
}

.work-grid {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: calc((100vw - min(1240px, calc(100vw - 40px))) / 2);
  padding: 6px calc((100vw - min(1240px, calc(100vw - 40px))) / 2) 22px 0;
  scrollbar-width: none;
}

.work-grid::-webkit-scrollbar {
  display: none;
}

.work-card {
  flex: 0 0 clamp(300px, 32vw, 456px);
  position: relative;
  min-height: auto;
  aspect-ratio: 1.18 / 1;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  text-align: left;
  isolation: isolate;
  cursor: pointer;
  opacity: 0;
  transform: translateY(50px) scale(0.96);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo), box-shadow 0.4s ease;
  scroll-snap-align: start;
}

.work-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.7s var(--ease-out-expo), filter 0.5s ease;
}

.work-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0) 100%);
  transition: background 0.4s ease;
}

.work-card:hover img {
  filter: saturate(1.1) contrast(1.05);
  transform: scale(1.08);
}

.work-card:hover::after {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0.05) 100%);
}

.card-copy {
  position: absolute;
  z-index: 2;
  left: 18px;
  right: 18px;
  bottom: 18px;
  color: white;
  transform: translateY(0);
  transition: transform 0.4s var(--ease-out-expo);
}

.work-card:hover .card-copy {
  transform: translateY(-4px);
}

.card-copy span {
  display: inline-flex;
  margin-bottom: 9px;
  color: var(--aqua);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  opacity: 0.9;
}

.card-copy h3 {
  margin: 0;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.08;
  font-weight: 700;
}

.card-copy p {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out-expo);
}

.work-card:hover .card-copy p {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Experience ===== */
.experience {
  padding: 74px 0 96px;
  border-top: 1px solid var(--line);
}

.experience-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 36px;
}

.experience article {
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) minmax(320px, 1fr);
  gap: clamp(18px, 4vw, 54px);
  padding: 28px 30px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: transform 0.4s var(--ease-out-expo), border-color 0.3s ease, box-shadow 0.4s ease;
}

.experience article:hover {
  transform: translateY(-4px);
  border-color: rgba(33, 184, 178, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.experience span {
  grid-column: 1;
  grid-row: 1 / span 3;
  color: var(--aqua);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.experience h3 {
  grid-column: 2;
  margin: 10px 0 10px;
  font-size: 22px;
  font-weight: 700;
  color: #f0f0f0;
}

.experience p {
  grid-column: 2;
  margin: 0;
  color: #999;
  font-size: 15px;
  line-height: 1.6;
}

.experience-role {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.experience-points {
  grid-column: 2;
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.experience-points li {
  position: relative;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  line-height: 1.65;
}

.experience-points li::before {
  content: "";
  position: absolute;
  top: 0.78em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(33, 184, 178, 0.9);
}

/* ===== Footer ===== */
.site-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  padding: 70px 0 76px;
  border-top: 1px solid var(--line);
}

.site-footer p:last-child {
  width: min(520px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ===== Modal ===== */
.project-modal {
  width: min(1240px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #0f0f0f;
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  transition: opacity 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo), overlay 0.4s ease;
  overflow: hidden;
}

.project-modal[open] {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.project-modal::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-modal[open]::backdrop {
  opacity: 1;
}

.modal-close {
  position: absolute;
  z-index: 5;
  top: 16px;
  right: 16px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  font-size: 24px;
  backdrop-filter: blur(10px);
  transition: background 0.3s ease, transform 0.3s var(--ease-spring);
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1) rotate(90deg);
}

.modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: min(780px, calc(100vh - 24px));
}

.viewer {
  position: relative;
  display: grid;
  min-height: 520px;
  place-items: center;
  background: #080808;
  overflow: hidden;
}

.viewer img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 24px);
  object-fit: contain;
  transition: opacity 0.35s var(--ease-out-quart), transform 0.35s var(--ease-out-quart);
}

.viewer img.sliding-left {
  opacity: 0;
  transform: translateX(-30px);
}

.viewer img.sliding-right {
  opacity: 0;
  transform: translateX(30px);
}

.viewer-button {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: grid;
  width: 48px;
  height: 72px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.45);
  font-size: 40px;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 0.3s ease, transform 0.3s var(--ease-spring);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.viewer-button:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: translateY(-50%) scale(1.08);
}

.viewer-button.prev {
  left: 20px;
}

.viewer-button.next {
  right: 20px;
}

.project-info {
  padding: 48px 30px 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.modal-category {
  margin: 0 0 12px;
  color: var(--aqua);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.project-info h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  color: #f0f0f0;
}

.project-info > p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  line-height: 1.6;
  margin: 16px 0 0;
}

.modal-stats {
  display: grid;
  gap: 10px;
  margin: 28px 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.thumb-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}

.thumb-strip button {
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.3s var(--ease-spring);
}

.thumb-strip button:hover {
  transform: scale(1.04);
}

.thumb-strip button[aria-current="true"] {
  border-color: var(--aqua);
}

.thumb-strip img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.thumb-strip button:hover img {
  opacity: 0.85;
}

/* ===== Keyframes ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInHeroMeta {
  from {
    opacity: 0;
    transform: translateX(50%) translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateX(50%) translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scrollPulse {
  0%, 100% {
    opacity: 0.5;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.3);
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .site-header {
    height: 64px;
  }

  .nav-links {
    gap: 16px;
    margin-left: 0;
  }

  .hero {
    min-height: 100svh;
  }

  .hero::after {
    inset: 78px 16px 44px;
    border-radius: 22px;
  }

  .hero-marquee {
    inset: 78px 16px 44px;
    grid-template-columns: 1fr;
    opacity: 0.28;
    transform: rotate(-1deg) scale(1.04);
  }

  .hero-marquee .marquee-col:nth-child(n + 2) {
    display: none;
  }

  .hero-content {
    width: min(100% - 32px, 680px);
  }

  .hero-meta {
    right: 50%;
    bottom: 80px;
    width: min(420px, calc(100% - 32px));
  }

  .hero-scroll {
    display: none;
  }

  .quick-profile,
  .site-footer {
    display: block;
  }

  .quick-profile {
    padding: 34px 24px;
    margin-top: 24px;
    margin-bottom: 24px;
  }

  .quick-profile::before {
    display: none;
  }

  .profile-copy {
    margin-top: 28px;
  }

  .filter-tabs {
    justify-content: center;
    margin-top: 24px;
  }

  .works-tools {
    justify-items: center;
    margin-top: 20px;
  }

  .work-carousel-shell {
    margin-inline: -20px;
    padding-left: 20px;
    mask-image: linear-gradient(to right, black 0, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 0, black 88%, transparent 100%);
  }

  .work-carousel-shell .carousel-button {
    width: 42px;
    height: 42px;
  }

  .work-carousel-prev {
    left: 12px;
  }

  .work-carousel-next {
    right: 12px;
  }

  .work-grid {
    gap: 14px;
    scroll-padding-left: 20px;
    padding: 4px 20px 18px 0;
  }

  .work-card,
  .work-card:nth-child(n) {
    flex: 0 0 min(76vw, 360px);
    min-height: auto;
    aspect-ratio: 1.08 / 1;
  }

  .experience-list,
  .modal-layout {
    grid-template-columns: 1fr;
  }

  .experience article {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px;
  }

  .experience span,
  .experience h3,
  .experience p,
  .experience-points {
    grid-column: 1;
    grid-row: auto;
  }

  .project-info {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 40vh;
  }

  .viewer {
    min-height: 360px;
  }

  .thumb-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-col {
    will-change: auto;
  }
}

@media (max-width: 560px) {
  .nav-links a {
    font-size: 13px;
  }

  .brand strong {
    display: none;
  }

  .profile-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-strengths {
    gap: 8px;
  }

  .profile-facts div {
    padding: 13px 12px 14px 0;
  }

  .profile-facts div + div {
    padding-left: 0;
    border-left: 0;
  }

  .profile-facts div:nth-child(even) {
    padding-left: 12px;
    border-left: 1px solid var(--line);
  }

  .work-carousel-shell {
    margin-inline: -14px;
    padding-left: 14px;
  }

  .work-carousel-shell .carousel-button {
    width: 38px;
    height: 38px;
  }

  .work-grid {
    scroll-padding-left: 14px;
    padding-right: 14px;
  }

  .work-card,
  .work-card:nth-child(n) {
    flex-basis: min(82vw, 330px);
  }

  .quick-profile,
  .works,
  .experience,
  .site-footer {
    width: min(100% - 28px, 1240px);
  }

  .viewer {
    min-height: 280px;
  }

  .thumb-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .work-card {
    opacity: 1;
    transform: none;
  }
}
