:root {
  --dark: #1e1e1e;
  --cream: #131318;
  --white: #15151c;
  --gray: #191920;
  --muted: #97939f;
  --accent: #b3a9e6;
  --text-dark: #eceaf2;
  --text-light: #ffffff;
  --surface: rgba(255, 255, 255, 0.045);
  --line: rgba(236, 234, 242, 0.14);
  --font-display: 'Archivo', 'Noto Sans SC', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  display: block !important;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: #0f0f15;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* Starfield background: deep gray sci-fi space */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 18% 8%, rgba(124, 108, 220, 0.10), transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 85%, rgba(72, 96, 178, 0.10), transparent 60%),
    radial-gradient(ellipse 40% 30% at 60% 40%, rgba(179, 169, 230, 0.05), transparent 65%),
    linear-gradient(180deg, #0d0d13 0%, #13131b 55%, #0d0d13 100%);
}

.starfield::before,
.starfield::after {
  content: '';
  position: absolute;
  inset: -60%;
  background-repeat: repeat;
}

.starfield::before {
  background-image:
    radial-gradient(1.6px 1.6px at 22px 34px, rgba(255, 255, 255, 0.9) 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 118px 66px, rgba(214, 210, 255, 0.75) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 186px 130px, rgba(255, 255, 255, 0.65) 50%, transparent 51%),
    radial-gradient(1px 1px at 74px 178px, rgba(255, 255, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 238px 214px, rgba(179, 169, 230, 0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 150px 240px, rgba(255, 255, 255, 0.5) 50%, transparent 51%);
  background-size: 260px 260px;
  animation: starTwinkle 7s ease-in-out infinite;
}

.starfield::after {
  background-image:
    radial-gradient(0.9px 0.9px at 40px 20px, rgba(255, 255, 255, 0.65) 50%, transparent 51%),
    radial-gradient(0.7px 0.7px at 96px 88px, rgba(214, 210, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 168px 52px, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(0.8px 0.8px at 210px 148px, rgba(179, 169, 230, 0.55) 50%, transparent 51%);
  background-size: 190px 190px;
  animation: starDrift 110s linear infinite;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes starDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-190px, -190px, 0); }
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 4vw;
  transition: background 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
  background: rgba(15, 15, 21, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

body.page-light .nav-logo {
  color: var(--text-dark);
}

body.page-light .nav-links a {
  color: var(--text-dark);
  opacity: 0.75;
}

body.page-light .nav-links a:hover,
body.page-light .nav-links a.active {
  opacity: 1;
}

body.page-light .lang-toggle {
  color: var(--text-dark);
  border-color: var(--line);
}

body.page-light .lang-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--text-dark);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.95rem;
  font-weight: 400;
}

.nav-links a {
  color: var(--text-dark);
  opacity: 0.75;
  transition: opacity 0.2s;
  position: relative;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s;
}

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

.lang-toggle {
  color: var(--text-dark);
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}

.menu-btn {
  display: none;
  color: var(--text-dark);
}

/* Work page header */
.work-header {
  background: var(--white);
  padding: 10rem 4vw 3rem;
}

.work-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 200;
  font-style: italic;
  margin: 0;
}

.work-header h1 em {
  color: var(--muted);
}

.work-sub {
  margin: 1.25rem 0 0;
  color: var(--muted);
  max-width: 560px;
  font-size: 1rem;
}

body.lang-zh .work-header h1 {
  font-style: normal;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 5.5rem 4vw 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  justify-content: center;
  position: relative;
  z-index: 10;
}

.filter-btn {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  transition: all 0.25s;
  color: var(--text-dark);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  color: #15151c;
  border-color: var(--accent);
}

/* Scattered map layout: horizontal + vertical drag canvas */
.scatter-map {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 560px;
  overflow: auto;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-top: 4.5rem;
}

.scatter-map::-webkit-scrollbar {
  display: none;
}

.scatter-map.dragging {
  cursor: grabbing;
}

.scatter-field {
  position: relative;
  width: 200vw;
  height: 165vh;
  min-height: 860px;
}

/* Category view: cards centered in a relaxed grid, no drag */
.scatter-map.mode-grid {
  overflow: hidden;
  cursor: default;
  height: auto;
  min-height: 0;
  padding: 1rem 0 3rem;
}

.scatter-field.mode-grid {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 28px 24px;
  padding: 40px 5vw 80px;
  margin: 0 auto;
}

.scatter-field.mode-grid .project-card.grid-item,
.scatter-field.mode-grid .project-card.text-only.grid-item {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: 22vw;
  max-width: 300px;
}

.scatter-field.mode-grid .project-card.grid-item .media-wrap {
  aspect-ratio: 4/3;
}

@media (max-width: 768px) {
  .scatter-field.mode-grid {
    gap: 18px 16px;
    padding: 24px 4vw 60px;
  }
  .scatter-field.mode-grid .project-card.grid-item,
  .scatter-field.mode-grid .project-card.text-only.grid-item {
    width: 44vw;
  }
}

main#work {
  position: relative;
}

.drag-hint {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.75;
  pointer-events: none;
  white-space: nowrap;
}

.scatter-map.mode-grid .drag-hint {
  display: none;
}

.project-card {
  position: absolute;
  left: var(--l);
  top: var(--t);
  transform: translate(-50%, -50%) rotate(var(--r));
  transform-origin: center center;
  cursor: pointer;
  overflow: visible;
  background: transparent;
  transition: transform 0.35s ease, opacity 0.7s ease;
}

.scatter-field .project-card.reveal {
  opacity: 0;
  transform: translate(-50%, calc(-50% + 18px)) rotate(var(--r));
}

.scatter-field .project-card.reveal.visible {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(var(--r));
}

/* Override reveal for centered grid mode (no rotate, no center translate) */
.scatter-field.mode-grid .project-card.reveal {
  opacity: 0;
  transform: translateY(20px);
}

.scatter-field.mode-grid .project-card.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card .media-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: #0a0a10;
  border: 1px solid var(--line);
  aspect-ratio: 4/3;
}

.project-card img,
.project-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0a10;
  transition: opacity 0.4s ease, transform 0.6s ease;
}

.project-card video {
  opacity: 0;
}

.project-card:hover video {
  opacity: 1;
}

.project-card:hover img {
  transform: scale(1.03);
}

.project-info {
  padding: 0.85rem 0 0.25rem;
}

.project-info h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 300;
  margin: 0 0 0.25rem;
  line-height: 1.25;
}

.project-meta {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-meta .tag {
  color: var(--accent);
  font-weight: 500;
}

/* Card sizes */
.sz-s { width: 15vw; }
.sz-s .media-wrap { aspect-ratio: 4/3; }

.sz-m { width: 20vw; }
.sz-m .media-wrap { aspect-ratio: 4/3; }

.sz-l { width: 25vw; }
.sz-l .media-wrap { aspect-ratio: 16/10; }

.sz-wide { width: 29vw; }
.sz-wide .media-wrap { aspect-ratio: 16/9; }

.sz-tall { width: 17vw; }
.sz-tall .media-wrap { aspect-ratio: 3/4; }

.project-card.text-only {
  width: 19vw;
  min-width: 220px;
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 180px;
  display: flex;
  align-items: flex-end;
  border-radius: 2px;
  padding: 1.25rem;
  backdrop-filter: blur(4px);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.project-card.text-only .project-info {
  padding: 0;
}

.project-card.text-only:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.text-only-hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 13, 0.9);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: #17171f;
  border: 1px solid var(--line);
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 2px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--text-light);
  z-index: 210;
  background: rgba(23, 23, 31, 0.75);
  border: 1px solid var(--line);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(23, 23, 31, 0.95);
}

.modal-media {
  width: 100%;
  background: #000;
}

.modal-media video {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

.modal-body {
  padding: 2.25rem;
}

.modal-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  margin: 0 0 0.75rem;
}

.modal-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  color: rgba(236, 234, 242, 0.85);
}

/* Gallery: single-column long strip, scroll down */
.modal-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.modal-gallery.single {
  grid-template-columns: 1fr;
}

.modal-gallery img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: transparent;
  justify-self: center;
  border-radius: 2px;
}

/* About page hero */
.about-hero {
  min-height: 100vh;
  background: transparent;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 4vw 4rem;
  position: relative;
  overflow: hidden;
}

.about-hero-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.hero-label {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 100;
  font-style: italic;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  min-height: 1.2em;
  color: var(--muted);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 5rem);
  font-weight: 200;
  line-height: 1.08;
  max-width: 900px;
  margin-bottom: 2rem;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.1rem;
  font-weight: 300;
  opacity: 0.8;
  max-width: 560px;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.55;
  animation: bounce 2s infinite;
  color: var(--muted);
}

.scroll-hint span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* Sections */
.section {
  padding: 6rem 4vw;
  max-width: 1200px;
  margin: 0 auto;
}

.section-light {
  background: rgba(255, 255, 255, 0.02);
}

.section-white {
  background: transparent;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 200;
  margin-bottom: 2.5rem;
  line-height: 1.1;
}

.section-title em {
  font-style: italic;
  color: var(--muted);
}

body.lang-zh .section-title em {
  font-style: normal;
}

/* About grid */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 4rem;
  align-items: start;
}

.about-photo {
  position: sticky;
  top: 7rem;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 2px;
}

.about-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 200;
  margin: 0 0 0.5rem;
}

.about-text .role {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.about-text p {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: rgba(236, 234, 242, 0.85);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0;
  width: 1px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-4px);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 300;
  margin: 0 0 0.25rem;
}

.timeline-role {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.timeline-desc {
  font-size: 0.98rem;
  color: rgba(236, 234, 242, 0.8);
  max-width: 680px;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.skills-col h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  color: var(--muted);
}

.skills-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skills-col li {
  font-size: 1.05rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(236, 234, 242, 0.1);
}

/* Contact */
.contact-hero {
  min-height: 70vh;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10rem 4vw 4rem;
}

.contact-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 200;
  margin: 0 0 2.5rem;
  max-width: 900px;
}

.contact-hero h1 em {
  font-style: italic;
  color: var(--muted);
}

.email-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.email-link {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 400;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.25rem;
  transition: color 0.2s, border-color 0.2s;
}

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

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-dark);
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--accent);
  color: #15151c;
  border-color: var(--accent);
}

.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: var(--text-light);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
.footer {
  padding: 2rem 4vw;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  background: transparent;
}

/* Language switching */
[lang="zh"],
[lang="en"] {
  display: none;
}

body.lang-zh [lang="zh"] {
  display: block;
}

body.lang-en [lang="en"] {
  display: block;
}

span[lang="zh"],
span[lang="en"] {
  display: none;
}

body.lang-zh span[lang="zh"],
body.lang-en span[lang="en"] {
  display: inline;
}

/* Chinese text: no bold/italic for <em>, keep accent color */
body.lang-zh em {
  font-style: normal;
  font-weight: 400;
  color: var(--accent);
}

body.lang-zh .hero-title em,
body.lang-zh .section-title em {
  color: var(--accent);
}

body.lang-zh .hero-label {
  font-style: normal;
}

/* Letter intro overlay */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #12121a;
  background-image:
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(124, 108, 220, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 45% at 82% 88%, rgba(72, 96, 178, 0.12), transparent 60%),
    linear-gradient(180deg, #101018 0%, #15151f 55%, #101018 100%);
  overflow: hidden;
  transition: opacity 0.6s ease 0.8s;
}

.intro-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 30px 40px, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 120px 70px, rgba(214, 210, 255, 0.65) 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 190px 140px, rgba(255, 255, 255, 0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 80px 190px, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1.7px 1.7px at 240px 220px, rgba(179, 169, 230, 0.65) 50%, transparent 51%);
  background-size: 250px 250px;
  background-repeat: repeat;
  animation: starTwinkle 6s ease-in-out infinite;
  pointer-events: none;
}

.intro-overlay.gone {
  opacity: 0;
  pointer-events: none;
}

.intro-letters {
  position: absolute;
  inset: 0;
}

.intro-letters .letter {
  position: absolute;
  left: var(--l);
  top: var(--t);
  transform: translate(-50%, -50%) rotate(var(--r));
  font-family: var(--font-display);
  font-size: var(--s);
  font-weight: var(--w);
  line-height: 1;
  color: var(--text-light);
  text-shadow: 0 0 24px rgba(179, 169, 230, 0.25);
  opacity: 0;
  transition:
    opacity 0.7s ease,
    left 1s cubic-bezier(0.22, 1, 0.36, 1),
    top 1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.intro-overlay.ready .letter {
  opacity: 1;
}

.intro-overlay.leaving .letter {
  opacity: 0.85;
}

.intro-overlay.gone .letter {
  opacity: 0;
}

.intro-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.6s ease 1.3s;
  animation: hintPulse 2.4s ease-in-out infinite;
  white-space: nowrap;
}

.intro-overlay.ready .intro-hint {
  opacity: 0.8;
}

.intro-overlay.leaving .intro-hint {
  opacity: 0;
  transition: opacity 0.25s ease;
}

@keyframes hintPulse {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* Falling letters at page bottom */
.letters-end {
  position: relative;
  height: 72vh;
  min-height: 420px;
  margin: 0;
  overflow: hidden;
}

.end-letters .end-letter {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1;
  color: var(--text-light);
  opacity: 0;
  translate: 0 -58vh;
  rotate: calc(var(--r) * 2);
}

.letters-end.drop .end-letter {
  animation: letterDrop 1.05s cubic-bezier(0.3, 1.2, 0.4, 1) both;
  animation-delay: calc(var(--i) * 110ms);
}

@keyframes letterDrop {
  0% { opacity: 0; translate: 0 -58vh; rotate: calc(var(--r) * 2); }
  55% { opacity: 1; }
  78% { translate: 0 2.5vh; }
  100% { opacity: 1; translate: 0 0; rotate: var(--r); }
}

/* Floating camera cursor */
.cursor-cam {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 500;
  width: 30px;
  height: 30px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: transform;
  display: none;
}

.cursor-cam.on {
  opacity: 1;
}

.cursor-cam svg {
  width: 100%;
  height: 100%;
  transition: transform 0.25s ease;
}

.cursor-cam svg * {
  stroke: var(--text-light);
  transition: stroke 0.25s ease;
}

.cursor-cam.active svg {
  transform: scale(1.4);
}

.cursor-cam.active svg * {
  stroke: #8d86ad;
}

@media (pointer: fine) {
  body.cursor-cam-ready,
  body.cursor-cam-ready a,
  body.cursor-cam-ready button,
  body.cursor-cam-ready .project-card,
  body.cursor-cam-ready .intro-overlay {
    cursor: none;
  }

  body.cursor-cam-ready .cursor-cam {
    display: block;
  }
}

/* Timeline education entries */
.timeline-item.timeline-edu::before {
  background: transparent;
  border: 1.5px solid var(--accent);
  width: 8px;
  height: 8px;
}

.timeline-edu .timeline-role {
  font-style: italic;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Responsive */
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dark);
    flex-direction: column;
    padding: 1.5rem 4vw;
    gap: 1.25rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a,
  .nav-links .lang-toggle {
    color: var(--text-light);
  }

  .menu-btn {
    display: flex;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-photo {
    position: static;
    max-width: 187px;
    margin: 0;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .modal-gallery {
    grid-template-columns: 1fr;
  }

  .scatter-field {
    width: 340vw;
    height: 170vh;
    min-height: 820px;
  }

  .sz-s { width: 30vw; }
  .sz-m { width: 36vw; }
  .sz-l { width: 42vw; }
  .sz-wide { width: 48vw; }
  .sz-tall { width: 26vw; }

  .project-card.text-only {
    width: 34vw;
    min-width: 200px;
  }

  .drag-hint {
    display: none;
  }
}

@media (max-width: 520px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 4rem 4vw;
  }

  .scatter-field {
    width: 480vw;
    height: 180vh;
  }

  .sz-s { width: 42vw; }
  .sz-m { width: 50vw; }
  .sz-l { width: 56vw; }
  .sz-wide { width: 62vw; }
  .sz-tall { width: 38vw; }

  .project-card.text-only {
    width: 46vw;
    min-width: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-letters .letter,
  .intro-hint,
  .end-letters .end-letter,
  .cursor-cam {
    transition: none !important;
    animation: none !important;
  }

  .intro-letters .letter {
    opacity: 1;
  }

  .end-letters .end-letter {
    opacity: 1;
    translate: 0 0;
    rotate: var(--r);
  }
}
