:root {
  --bg: #f5f4f0;
  --text: #222;
  --text-sub: #555;
  --text-muted: #999;
  --accent: #bfab90;
  --white: #fdfcf9;
  --border: rgba(0,0,0,0.07);
  --nav-blur: rgba(245,244,240,0.75);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Roboto, Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@keyframes shimmer-sweep {
  0% {
    background-position: 80% center;
    animation-timing-function: cubic-bezier(0.75, 0, 0.15, 1);
  }
  55%          { background-position: 20% center; }
  55.01%, 100% { background-position: 80% center; }
}
img { -webkit-user-drag: none; user-drag: none; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  min-width: 360px;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: #f5f4f0;
  touch-action: manipulation;
}
body {
  font-family: var(--font-body);
  background: var(--bg); color: var(--text);
  overflow-x: hidden; cursor: none;
  overscroll-behavior-x: none;
  min-width: 360px;
  -webkit-touch-callout: none;
  user-select: none; -webkit-user-select: none;
}
/* Remove grey tap flash on all interactive elements */
* { -webkit-tap-highlight-color: transparent; }
/* Re-allow text selection on readable content */
.modal-desc, .about-bio, .about-cat-desc, p, footer span { user-select: text; -webkit-user-select: text; }

/* CURSOR */
#cursor {
  position: fixed; width: 8px; height: 8px; border-radius: 50%;
  background: rgba(0,0,0,.55); pointer-events: none; z-index: 10100;
  transform: translate(-50%,-50%);
  will-change: transform;
  transition: width .35s cubic-bezier(.16,1,.3,1), height .35s cubic-bezier(.16,1,.3,1), background .35s, opacity .2s;
}
#cursor.on-dark { background: #4A90FF; }
#cursor-ring {
  position: fixed; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(34,34,34,.22); pointer-events: none; z-index: 10099;
  transform: translate(-50%,-50%);
  will-change: transform;
  transition: all .2s cubic-bezier(.16,1,.3,1);
}
body.cursor-hover #cursor-ring { opacity: 0; }

/* NAV — frosted glass */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  height: 4.4rem; padding: 0 3rem; z-index: 200;
  background: var(--nav-blur);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid transparent;
  transition: border-color .4s;
}
nav.scrolled { border-bottom-color: var(--border); }
.nav-logo { font-size: .78rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-sub); line-height: 1; text-decoration: none; }
.nav-logo:hover { color: var(--text-sub); }

/* Right group: lang | sep | links | hamburger */
.nav-right { display: flex; align-items: center; gap: 0; }
/* Separator is a pseudo-element on the button — not a flex item, avoids box-height alignment issues */
.lang-toggle::after {
  content: '';
  display: inline-block;
  width: 1px; height: 14px;
  background: rgba(0,0,0,.18);
  margin-left: 2rem;
}
nav.on-dark:not(.scrolled) .lang-toggle::after { background: rgba(240,237,232,.22); }


.nav-links { display: flex; align-items: center; justify-content: flex-end; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav-links li { display: flex; align-items: center; }
.nav-sep { color: var(--text-sub); opacity: 0.5; }
.nav-links a {
  font-size: .72rem; font-weight: 400; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; color: var(--text-sub); position: relative; transition: color .3s;
  line-height: 1;
}
html[lang="zh-CN"] .nav-links { gap: 2.2rem; }
html[lang="zh-CN"] .nav-links a { letter-spacing: .04em; }
.nav-current-blog {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(240,237,232,0.92);
  line-height: 1;
}
html[lang="zh-CN"] .nav-current-blog { letter-spacing: .04em; }
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--text);
  transition: width .4s cubic-bezier(.16,1,.3,1);
}
.nav-links a:hover::after { width: 100%; }

/* HERO */
#hero {
  width: 100%; min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 0 3rem 0 8vw; position: relative; overflow: hidden;
  background: #0a0705;
}
#hero-starfield {
  position: absolute; top: 0; left: 0;
  width: 100% !important; height: 100% !important;
  pointer-events: none;
}
#home_particle {
  position: absolute; top: 0; left: 0;
  width: 100% !important; height: 100% !important;
  pointer-events: none; opacity: .72;
  mix-blend-mode: screen;
}
.hero-eyebrow {
  font-size: .7rem; font-weight: 400; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(240,237,232,.42); margin-bottom: 1.8rem;
  opacity: 0; transform: translateY(16px);
  animation: fadeUp .7s .2s cubic-bezier(.16,1,.3,1) forwards;
}
.hero-title {
  font-family: var(--font-body);
  font-size: clamp(3.2rem, 8vw, 9.5rem);
  font-weight: 400; line-height: .9; letter-spacing: -.02em; color: #f0ede8;
}
.hero-title .line {
  display: block; overflow: hidden;
  padding-bottom: 0.2em; margin-bottom: -0.2em;
}
.hero-title .line:nth-child(1) { transform: translateY(-0.14em); }
.hero-title .line:nth-child(3) { transform: translateY(0.14em); }
.hero-title .word {
  display: inline-block; opacity: 0; transform: translateY(105%);
  color: rgba(240,237,232,0.38);
  transition: color 0.4s cubic-bezier(.16,1,.3,1);
  cursor: none;
}
@media (hover: hover) {
  .hero-title .word:hover { color: #d4a843; }
}
.hero-title .word.active { color: #d4a843; }
.hero-title .italic { font-style: normal; }

/* NAV dark-hero mode */
nav.on-dark { background: transparent; }
nav.on-dark.scrolled { background: var(--nav-blur); }
nav.on-dark:not(.scrolled) .nav-logo { color: rgba(240,237,232,.55); }
nav.on-dark:not(.scrolled) .nav-links a { color: rgba(240,237,232,.55); }
nav.on-dark:not(.scrolled) .nav-links a:hover { color: rgba(240,237,232,.92); }
nav.on-dark:not(.scrolled) .nav-links a::after { background: rgba(240,237,232,.7); }
/* Hamburger lines visible on dark hero background */
nav.on-dark:not(.scrolled) .nav-hamburger span { background: rgba(240,237,232,0.55); }

/* HAMBURGER BUTTON */
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer; padding: 0;
  width: 24px; height: 16px; position: relative; flex-shrink: 0;
  color: currentColor;
}
.nav-hamburger span {
  display: block; width: 100%; height: 1.5px;
  background: currentColor;
  position: absolute; left: 0;
  transition: all 0.35s cubic-bezier(.16,1,.3,1);
}
.nav-hamburger span:nth-child(1) { top: 0; }
.nav-hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-hamburger span:nth-child(3) { bottom: 0; }
.nav-hamburger.open span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: translateY(-50%) scaleX(0); }
.nav-hamburger.open span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* LANG TOGGLE — fixed height ensures EN (Latin) and 中文 (CJK fallback font) render same box height */
.lang-toggle {
  background: none; border: none;
  padding: 0; margin-right: 2rem;
  font-size: .72rem; font-weight: 400; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-sub); cursor: pointer;
  transition: color .3s; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  height: 1.1em; line-height: 1;
}
.lang-toggle:hover { color: var(--text); }
nav.on-dark:not(.scrolled) .lang-toggle { color: rgba(240,237,232,0.55); }
nav.on-dark:not(.scrolled) .lang-toggle:hover { color: rgba(240,237,232,0.95); }

/* MOBILE NAV OVERLAY */
.nav-mobile {
  position: fixed; inset: 0;
  background: rgba(10,7,5,0.97);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.8rem; z-index: 199;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s cubic-bezier(.16,1,.3,1);
}
.nav-mobile.open { opacity: 1; pointer-events: all; }
.nav-mobile a {
  font-family: var(--font-body);
  font-size: clamp(2rem, 8vw, 3rem); font-weight: 400; letter-spacing: -.01em;
  text-decoration: none; color: rgba(240,237,232,0.55);
  transition: color 0.3s;
}
.nav-mobile a:hover, .nav-mobile a:active { color: #d4a843; }




/* ABOUT */
#about { scroll-margin-top: 80px; padding: 9rem 3rem 8rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.about-avatar-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 4px 28px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.about-avatar-wrap::after {
  content: 'Avatar';
  position: absolute;
  color: rgba(0,0,0,.20);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  pointer-events: none;
  opacity: 0;
}
.about-avatar-wrap.failed::after { opacity: 1; }
.about-avatar {
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.about-avatar-wrap.failed .about-avatar { visibility: hidden; }
.about-name {
  font-family: var(--font-body);
  font-size: 1.5rem; font-weight: 500; letter-spacing: .02em;
  color: var(--text); margin-top: 1rem; margin-bottom: 1rem;
}
.about-meta {
  display: flex; gap: 2.8rem; flex-wrap: wrap; justify-content: center;
  margin-bottom: 2rem;
  min-height: 0; align-items: center;
}
.about-meta-item {
  display: flex; align-items: center; gap: .5rem;
}
.about-meta-item svg { flex-shrink: 0; color: rgba(0,0,0,.45); position: relative; top: -.5px; }
.about-meta-val { font-size: .85rem; font-weight: 400; color: var(--text-sub); }
.about-bio {
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  font-weight: 400; line-height: 1.78; letter-spacing: -.005em; color: var(--text-sub);
  max-width: 60ch;
  margin-bottom: 2rem;
  text-align: center;
  hyphens: none;
  overflow-wrap: break-word;
}
.about-bio em { font-style: normal; color: var(--text-sub); }

/* 4-category row */
.about-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  max-width: 1200px; width: 100%;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: visible;
}
/* clip border-radius visually via the first/last child corners */
.about-cat-item:first-child { border-radius: 14px 0 0 14px; }
.about-cat-item:last-child  { border-radius: 0 14px 14px 0; }
.about-cat-item {
  /* subgrid: text row + projs row share same heights across all 4 columns */
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
  align-items: start;
  padding: 1.8rem 2.0rem;
  border-right: 1px solid var(--border);
  text-align: left;
  min-width: 0;
  overflow: hidden;
}
.about-cat-item:last-child { border-right: none; }
.about-cat-text {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: .6rem;
}
.about-cat-num {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .2rem .56rem; border-radius: 5px;
  font-size: .68rem; font-weight: 700; letter-spacing: .18em;
  line-height: 1; color: #fff;
}
.about-cat-item:nth-child(1) .about-cat-num { background: #3b82f6; }
.about-cat-item:nth-child(2) .about-cat-num { background: #8b5cf6; }
.about-cat-item:nth-child(3) .about-cat-num { background: #22c55e; }
.about-cat-item:nth-child(4) .about-cat-num { background: #f97316; }
.about-cat-title {
  font-size: 1.18rem; font-weight: 600; letter-spacing: -.02em;
  color: var(--text); line-height: 1.2;
}
.about-cat-desc {
  font-size: .78rem; font-weight: 400; line-height: 1.6;
  color: #777;
  text-align: justify;
  hyphens: none;
  -webkit-hyphens: none;
}
/* Project icons inside each category */
.about-cat-groups {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-top: .8rem;
  align-self: start;
}
.about-cat-subgroup {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.acp-sublabel {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #888;
  opacity: 1;
  line-height: 1;
}
.about-cat-projs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 52px));
  gap: .4rem;
  padding-top: .8rem;
  align-self: start;
  width: 100%;
}
.about-cat-subgroup .about-cat-projs {
  padding-top: .3rem;
}
.acp-item {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: auto; aspect-ratio: 1;
  background: var(--bg);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s;
}
.acp-item:hover { border-color: rgba(0,0,0,.22); position: relative; z-index: 30; }
.acp-item[data-project-id] { cursor: pointer; }
.acp-item--wide { grid-column: span 2; aspect-ratio: auto; min-height: 52px; }
/* Placeholder slots (no <img>): text becomes readable */
.acp-item:not(:has(.acp-img)) .acp-abbr { color: rgba(0,0,0,.45); }
.acp-item:not(:has(.acp-img)) { background: linear-gradient(135deg, #f5f5f5, #ebebeb); border-style: dashed; }
/* Image layer — paste your icon here; abbr hides automatically */
.acp-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 10px;
  display: none;
}
.acp-img.loaded { display: block; }
.acp-img.loaded ~ .acp-abbr { display: none; }
.acp-img--icon { filter: grayscale(0); transition: filter .3s; }
/* white overlay removed — icons show full color by default */
.acp-item:has(.acp-img--icon) { position: relative; }
.acp-abbr {
  font-size: .72rem; font-weight: 700; letter-spacing: -.01em;
  color: rgba(0,0,0,.18); line-height: 1;
  pointer-events: none;
}
/* Tooltip */
.acp-item[data-tip] { overflow: visible; }
.acp-item[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  background: rgba(20,18,15,.82);
  color: rgba(255,255,255,.9);
  font-size: .58rem;
  font-weight: 400;
  letter-spacing: .02em;
  padding: .22rem .48rem;
  border-radius: 4px;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity .18s, transform .18s;
}
.acp-item[data-tip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.about-highlights {
  display: flex; align-items: stretch; gap: 0;
  justify-content: center; flex-wrap: wrap;
  margin: 2rem 0 2.4rem;
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.about-hl-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .32rem; padding: 1.4rem 3rem;
  border-right: 1px solid var(--border);
}
.about-hl-item:last-child { border-right: none; }
.about-hl-num {
  font-family: var(--font-body);
  font-size: 1.9rem; font-weight: 300; letter-spacing: -.04em; color: var(--text); line-height: 1;
}
.about-hl-label {
  font-size: .58rem; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted);
}
.about-skills {
  max-width: 52ch;
  display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: center;
}
.skill-tag {
  font-size: .82rem; font-weight: 400; letter-spacing: .02em;
  color: rgba(0,0,0,.38);
  white-space: nowrap;
}
.skill-tag--primary {
  color: rgba(0,0,0,.78); font-weight: 500;
}
.skill-tag--primary::before { color: rgba(0,0,0,.5); }
.skill-tag::before { content: '#'; margin-right: .18em; }

/* WORK */
/* ── CAROUSEL LAYOUT ── */
#work { scroll-margin-top: 80px; padding: 4rem 0 9rem; }
#work-caption {
  text-align: center;
  font-size: .78rem; font-weight: 400; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted);
  margin-top: 3rem;
}
.section-header {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-bottom: 3rem; padding: 0 3rem;
}
.section-title {
  font-family: var(--font-body);
  font-size: clamp(2.8rem, 5.5vw, 5.5rem);
  font-weight: 400; letter-spacing: -.025em; line-height: 1; color: var(--text);
}
.section-eyebrow {
  font-size: .68rem; font-weight: 400; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 1rem;
}

.carousel-block { }

/* —— SWIPER CAROUSEL —— */
.swiper { overflow: hidden; background: var(--bg); }
.swiper-big  { margin-top: 0; }
.swiper-small { margin-top: 8px; }
/* 极慢启动 → 陡然加速 → 对称减速（cubic-bezier 两端控制点靠近两侧使两端更缓）*/
.swiper-big .swiper-wrapper,
.swiper-small .swiper-wrapper {
  transition-timing-function: cubic-bezier(0.87, 0, 0.13, 1) !important;
}
#carousel-zone { cursor: grab; touch-action: pan-y; overscroll-behavior-x: contain; }
#carousel-zone.is-dragging { cursor: grabbing; user-select: none; touch-action: none; }

/* Big carousel — 1200×500 */
.swiper-big .swiper-slide { width: 1200px; cursor: none; }
.swiper-big .proj-img { width: 1200px; height: 500px; }

/* Small carousel — 450×250 */
.swiper-small .swiper-slide { width: 450px; cursor: none; }
.swiper-small .proj-img { width: 450px; height: 250px; }

/* Shared proj-img */
.proj-img {
  overflow: hidden; border-radius: 0;
  background: #d0cdc8; position: relative;
}
.proj-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0) 41%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 59%);
  background-size: 400% 100%;
  background-repeat: no-repeat;
  animation: shimmer-sweep 4s infinite;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.proj-img:has(.img-ready)::before {
  opacity: 0;
  animation: none;
}
.proj-img:has(.proj-video)::before {
  display: none;
}
.proj-img img, .proj-img .proj-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.proj-img img {
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.03);
  transition: opacity .45s ease, filter .6s ease, transform .6s ease;
}
.proj-img img.img-ready {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}
.proj-img .proj-video {
  transition: transform 0.6s ease;
}
.swiper-slide:hover .proj-img img,
.swiper-slide:hover .proj-img .proj-video { transform: scale(1.04); }
.swiper-slide:hover .proj-img img.img-ready { transform: scale(1.04); }
/* 图片加载失败占位 */
.img-error-placeholder {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: .5rem;
  background: #e8e5e0;
  color: rgba(0,0,0,.28);
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  pointer-events: none;
}
.img-error-placeholder svg { opacity: .45; }
.img-error-placeholder.visible { display: flex; }

/* ——— Lightbox ——— */
#lightbox {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  gap: 20px;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background .3s;
}
#lightbox.open {
  background: rgba(0,0,0,.82);
  pointer-events: all;
  cursor: zoom-out;
}
/* Frame always matches landscape max-width so buttons stay anchored */
#lightbox-frame {
  width: min(82vw, 1280px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: none;
  position: relative;
  overflow: hidden;
}
#lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  opacity: 0;
  transform: translateX(0) scale(.96);
  transition: opacity .35s ease, transform .45s cubic-bezier(.16,1,.3,1);
  cursor: default;
  pointer-events: none;
}
#lightbox.open #lightbox-img {
  /* opacity / transform controlled by JS openLightbox to prevent scan-line flash */
  pointer-events: all;
}
.lightbox-nav {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.28);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.55);
  flex-shrink: 0;
  visibility: hidden;
  pointer-events: none;
  transition: background .25s, border-color .25s, color .25s;
  user-select: none;
}
#lightbox.open .lightbox-nav {
  visibility: visible;
  pointer-events: all;
}
.lightbox-nav:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.6);
  color: rgba(255,255,255,.9);
}
#lightbox.single-image .lightbox-nav {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* card-info overlay */
/* Type badge — top-right, big slides only */
.card-type {
  position: absolute; top: 1.4rem; right: 1.8rem;
  font-size: .84rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.88); text-shadow: 0 1px 3px rgba(0,0,0,.22);
  pointer-events: none; z-index: 2;
  max-width: 22em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0; transition: opacity 0.86s cubic-bezier(0.87, 0, 0.13, 1);
}
.swiper-slide-active .card-type { opacity: 1; }

/* Bottom-left info row: [title pill]  [role labels] */
.card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 0 2.8rem 2.6rem;
  display: flex; align-items: center; gap: 1.2rem;
  pointer-events: none; z-index: 2;
  opacity: 0.22;
  transition: opacity 0.86s cubic-bezier(0.87, 0, 0.13, 1);
}
.swiper-slide-active .card-info { opacity: 1; }
.swiper-small .swiper-slide-prev .card-info,
.swiper-small .swiper-slide-next .card-info { opacity: 0.65; }
.card-info-title {
  font-size: .88rem; font-weight: 500;
  color: #333; letter-spacing: -.01em; line-height: 1.2;
  background: rgba(255,255,255,0.93);
  border-radius: 999px;
  padding: 13px 21px;
  min-width: 6em; max-width: 20em;
  min-height: 1.8em;
  display: inline-block; vertical-align: middle; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Roles — appear to the right of title pill */
.card-roles {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 0;
  max-width: 28em; overflow: hidden;
  flex-shrink: 1; min-width: 0;
}
.card-role {
  font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.78); text-shadow: 0 1px 4px rgba(0,0,0,.4);
  white-space: nowrap;
}
.card-role + .card-role::before { content: '·'; margin: 0 .45em; color: rgba(255,255,255,.4); }
/* Small slides: no type badge, no roles */
.swiper-small .card-type { display: none; }
.swiper-small .card-roles { display: none; }
.swiper-small .card-info { padding: 0 1.4rem 1.3rem; gap: 0; }
.swiper-small .card-info-title { font-size: .7rem; padding: 8px 16px; border-radius: 999px; }
/* Dynamic gradient overlay — big slides only */
.swiper-big .proj-img::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(
    to top,
    var(--gc-from, rgba(0,0,0,.52)) 0%,
    var(--gc-mid,  rgba(0,0,0,.14)) 22%,
    transparent 38%
  );
}

@media (max-width: 1240px) {
  .swiper-big .swiper-slide { width: 90vw; }
  .swiper-big .proj-img     { width: 90vw; height: calc(90vw * 500 / 1200); }
  .swiper-small .swiper-slide { width: 55vw; }
  .swiper-small .proj-img   { width: 55vw; height: calc(55vw * 250 / 450); }
}

@media (max-width: 1050px) {
  /* Nav */
  nav { padding: 1.4rem 2rem; }
  .nav-links { gap: 1.6rem; }
  /* About */
  #about { padding: 6rem 2rem 5rem; }
  .about-cats {
    display: flex; flex-wrap: wrap; /* switch away from subgrid */
    max-width: 100%;
  }
  .about-cat-item {
    flex: 1 1 calc(50% - 1px); min-width: 0;
    display: flex; flex-direction: column; /* override grid */
    grid-row: auto;
  }
  /* Stretch icon containers so auto-fill has full column width to work with */
  .about-cat-groups { align-self: stretch; width: 100%; }
  .about-cat-subgroup { width: 100%; }
  .about-cat-item:nth-child(2) { border-right: none; }
  .about-cat-item:nth-child(1),
  .about-cat-item:nth-child(2) { border-bottom: 1px solid var(--border); }
  .about-cat-text { min-height: 7.5rem; }
  /* Work */
  .section-header { padding: 0 2rem; }
  /* Swiper */
  .swiper-big .swiper-slide { width: 80vw; }
  .swiper-big .proj-img { width: 80vw; height: calc(80vw * 500 / 1200); }
  .swiper-small .swiper-slide { width: 52vw; }
  .swiper-small .proj-img { width: 52vw; height: calc(52vw * 250 / 450); }
}

/* DIRECTIONAL REVEAL */
[data-reveal] {
  opacity: 0;
  transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1);
}
[data-reveal="up"]    { transform: translateY(50px); }
[data-reveal="down"]  { transform: translateY(-30px); }
[data-reveal="left"]  { transform: translateX(-60px); }
[data-reveal="right"] { transform: translateX(60px); }
[data-reveal="scale"] { transform: translateY(30px) scale(.96); }
[data-reveal].in-view { opacity: 1; transform: none; }
[data-delay="1"]{transition-delay:.08s} [data-delay="2"]{transition-delay:.18s}
[data-delay="3"]{transition-delay:.3s}  [data-delay="4"]{transition-delay:.44s}
[data-delay="5"]{transition-delay:.58s}

/* MODAL */
#modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0);
  z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none; transition: background .5s;
  /* side padding = same visual gap as top gap (5vw) */
  padding: 0 5vw;
}
#modal-overlay.open { background: rgba(0,0,0,.42); pointer-events: all; }
/* outer clip — enforces border-radius + hides elastic-bounce exposure */
#modal-wrap {
  width: 100%;
  /* max-height leaves a 3vw gap at top */
  max-height: calc(100vh - 3vw); border-radius: 28px 28px 0 0;
  background: var(--white); overflow: hidden;
  transform: translateY(100%); transition: transform .65s cubic-bezier(.16,1,.3,1);
  position: relative;
}
#modal-overlay.open #modal-wrap { transform: translateY(0); }
/* inner scroll container */
#modal {
  width: 100%; max-height: calc(100vh - 3vw);
  overflow-y: scroll; overflow-x: hidden;
  position: relative;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
#modal::-webkit-scrollbar { display: none; }
/* custom thin scrollbar — lives in #modal-wrap, clipped by its border-radius */
#modal-sb-track {
  position: absolute; right: 8px; top: 36px; bottom: 8px;
  width: 3px; border-radius: 2px;
  background: rgba(0,0,0,.06);
  opacity: 0; transition: opacity .3s .6s, top .45s cubic-bezier(.16,1,.3,1);
  pointer-events: none; z-index: 20;
}
#modal-wrap.sb-visible #modal-sb-track { opacity: 1; transition-delay: 0s; }
#modal-wrap.sb-visible.sb-idle #modal-sb-track { opacity: 0; transition-delay: 0s; transition-duration: .8s; }
#modal-sb-thumb {
  position: absolute; left: 0; right: 0;
  border-radius: 2px; background: rgba(0,0,0,.22);
  min-height: 32px;
}

/* sticky header inside modal */
#modal-sticky {
  position: sticky; top: 0; z-index: 10;
  background: var(--white);
  padding: 2rem 2rem 0;
  display: grid;
  grid-template-rows: auto auto;
  transition: padding .45s cubic-bezier(.16,1,.3,1);
}
#modal-sticky-row {
  display: flex; justify-content: space-between; align-items: center;
  height: 0; overflow: hidden;
  transition: height .45s cubic-bezier(.16,1,.3,1);
}
#modal.scrolled #modal-sticky { padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); }
#modal.scrolled #modal-sticky-row { height: 46px; }

.modal-close {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  cursor: none; display: flex; align-items: center; justify-content: center;
  transition: background .3s, border-color .3s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--text); border-color: var(--text); }
.modal-close svg line { transition: stroke .3s; }
.modal-close:hover svg line { stroke: var(--white); }
/* close btn floats top-right initially */
#modal-close-float {
  position: absolute; top: 2rem; right: 2rem;
  transition: opacity .3s;
}
#modal.scrolled #modal-close-float { opacity: 0; pointer-events: none; }
/* sticky title (small) */
#modal-sticky-title {
  font-size: 1rem; font-weight: 500; letter-spacing: -.01em; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#modal-body { padding: 2rem 3.5rem 3.5rem; }
.modal-tag { font-size: .65rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .3rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.modal-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2rem; margin-bottom: 1rem;
}
.modal-title {
  font-family: var(--font-body);
  font-size: clamp(2.2rem,4.5vw,4rem); font-weight: 400; letter-spacing: -.025em; line-height: 1.12;
  color: var(--text); margin-bottom: 0; flex: 1;
  overflow: visible;
}
.modal-visit {
  display: inline-flex; align-items: center; gap: .4rem;
  flex-shrink: 0;
  margin-top: calc(clamp(2.2rem,4.5vw,4rem) * 1.12 / 2 - 0.7rem);
  padding: .45rem 1.1rem; border-radius: 2rem;
  border: 1px solid var(--border); background: transparent;
  font-size: .7rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-sub); text-decoration: none;
  transition: color .3s, border-color .3s, background .3s;
  cursor: none;
}
.modal-visit:hover { background: var(--text); border-color: var(--text); color: var(--white); }
.modal-visit svg { transition: stroke .3s; }
.modal-visit:hover svg line, .modal-visit:hover svg polyline { stroke: var(--white); }
/* desc: collapse to 3 lines, expand on click */
.modal-desc-wrap { position: relative; margin-bottom: 1.6rem; max-width: 100%; }
/* Gradient fade before the chevron — creates the "----  V" inline illusion */
.modal-desc-wrap::after {
  content: '';
  position: absolute; bottom: 0; right: 0;
  width: 4.5rem; height: 1.9em;
  background: linear-gradient(to right, transparent, var(--white) 55%);
  pointer-events: none;
  z-index: 1;
}
.modal-desc-wrap.expanded::after { display: none; }
.modal-desc {
  font-size: .92rem; font-weight: 400; line-height: 1.8; color: var(--text-sub);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden;
  padding-right: 0; /* no padding needed — gradient + button handle the fade */
}
.modal-desc.expanded {
  display: block; overflow: visible; padding-right: 0;
}
/* Chevron — sits on top of the gradient, visually at end of last line */
.modal-desc-toggle {
  display: none;
  position: absolute; bottom: 4px; right: 2px;
  background: none; border: none; padding: .15rem;
  color: var(--text-muted); cursor: pointer;
  opacity: 0.65;
  z-index: 2;
  transition: opacity .2s;
}
.modal-desc-toggle:hover { opacity: 1; }
.modal-desc-toggle.visible { display: block; }
.modal-desc-toggle svg { display: block; transition: transform .3s cubic-bezier(.16,1,.3,1); }
.modal-desc-toggle.open svg { transform: rotate(180deg); }
/* Image grid:
   - img 1: left 2/3 wide
   - img 2: right 1/3, same row/height as img 1
   - img 3,4,5 and beyond: 3-column equal grid rows
*/
.modal-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .9rem;
}
.modal-image-item { overflow: hidden; border-radius: 0; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); background: #e8e6e2; }
.modal-image-item::after {
  content: ''; pointer-events: none;
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.10);
  z-index: 1;
}
/* loading spinner — real DOM element (::before unreliable above <video> on iOS Safari) */
@keyframes media-spin {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}
.media-spinner {
  display: none;
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 22px; height: 22px;
  border: 2.5px solid rgba(0,0,0,.13);
  border-top-color: rgba(0,0,0,.5);
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
}
.modal-image-item.is-loading .media-spinner {
  display: block;
  animation: media-spin .75s linear infinite;
}
/* img1: span first 2 cols; img2: col 3 — shares the same 3-col grid as extra rows */
.modal-images > .modal-image-item:first-child  { grid-column: 1 / 3; grid-row: 1; aspect-ratio: 16/9; }
.modal-images > .modal-image-item:nth-child(2) { grid-column: 3;     grid-row: 1; }
/* if only 1 image rendered, span full width */
.modal-images > .modal-image-item:only-child   { grid-column: 1 / -1; }
/* img3+: subgrid so column tracks are identical to parent — perfect alignment */
.modal-images-extra {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  gap: .9rem;
  margin-top: 0;
}
.modal-images-extra .modal-image-item { aspect-ratio: 16/9; }
.modal-image-item img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; filter: blur(10px); transform: scale(1.04); transition: opacity .45s ease, filter .6s ease, transform .55s cubic-bezier(.16,1,.3,1); }
.modal-image-item img.img-ready { opacity: 1; filter: blur(0); transform: scale(1); }
.modal-image-item:hover img.img-ready { transform: scale(1.04); }
.modal-img-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 400; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.4);
}
/* Mobile video thumbnail with play button */
.modal-video-thumb {
  position: relative; width: 100%; height: 100%;
  cursor: pointer; display: block;
}
.modal-video-thumb img { border-radius: inherit; }
.modal-video-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.modal-video-play-btn svg { filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }

#carousel-dots {
  display: flex; align-items: center; justify-content: center;
  gap: 9px; padding: 2rem 0 0;
}
.c-dot {
  height: 7px; width: 7px; border-radius: 99px;
  background: rgba(0,0,0,.18);
  transition: width .42s cubic-bezier(.16,1,.3,1), background .42s;
  flex-shrink: 0; cursor: pointer;
}
.c-dot.active { width: 24px; background: rgba(0,0,0,.6); }

/* BLOG SECTION */
#blog {
  scroll-margin-top: 80px;
  padding: 8rem 3rem;
  display: flex; flex-direction: column; align-items: center;
}
.blog-posts {
  width: 100%; max-width: 720px;
  margin-bottom: 3rem;
}
/* Blog cards — mirrors the blog/index.html list design */
.blog-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  cursor: none;
  opacity: .82;
  transition: opacity .2s;
}
.blog-card:first-child { border-top: 1px solid var(--border); }
.blog-card:hover { opacity: 1; }
.blog-card-body { min-width: 0; }
.blog-card-tags {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-bottom: .75rem;
}
.blog-card-tag {
  font-size: .65rem; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
.blog-card-tag::before { content: '#'; }
.blog-card-title {
  font-size: 1.1rem; font-weight: 500; letter-spacing: -.01em;
  color: #333; line-height: 1.45; margin-bottom: .6rem;
  transition: color .2s;
}
.blog-card:hover .blog-card-title { color: var(--text); }
.blog-card-excerpt {
  font-size: .875rem; color: var(--text-sub); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card-meta { text-align: right; flex-shrink: 0; padding-top: .25rem; }
.blog-card-date {
  font-size: .7rem; color: var(--text-muted);
  letter-spacing: .04em; white-space: nowrap;
}
.blog-view-all {
  display: inline-block;
  font-size: .68rem; letter-spacing: .17em; text-transform: uppercase;
  color: var(--text-sub); text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
  transition: color .25s, border-color .25s;
}
.blog-view-all:hover { color: var(--text); border-color: var(--text); }

/* CONTACT */
#contact {
  scroll-margin-top: 80px;
  padding: 8rem 3rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.contact-label { font-size: .68rem; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2rem; }
.contact-cta {
  font-family: var(--font-body);
  font-size: clamp(3.5rem,7.5vw,7.5rem); font-weight: 400; letter-spacing: -.035em; line-height: .9;
  background: none; border: none; padding: 0;
  color: var(--text); display: inline-block; position: relative; cursor: none;
}
.contact-cta::after {
  content: ''; position: absolute; bottom: 4px; left: 0; right: 0;
  height: 1.5px; background: var(--text);
  transform: scaleX(1); transform-origin: right;
  transition: transform .55s cubic-bezier(.16,1,.3,1);
}
.contact-cta:hover::after { transform: scaleX(0); transform-origin: left; }
/* SOCIAL POPUP */
#social-popup {
  display: flex; justify-content: center; flex-wrap: nowrap; gap: 0;
  max-width: none;
  margin-top: 3rem;
  opacity: 0; transform: translateY(18px);
  pointer-events: none;
  transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1);
}
#social-popup.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.social-link {
  display: flex; flex-direction: column; align-items: center; gap: .7rem;
  width: 80px;
  text-decoration: none; color: var(--text-sub); transition: color .3s;
}
.social-link:hover { color: var(--text); }
.social-icon {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  transition: border-color .35s, transform .35s cubic-bezier(.16,1,.3,1);
}
.social-icon::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--brand, #000);
  transform: translate(-50%, -50%) scale(0);
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.social-link:hover .social-icon { border-color: var(--brand, rgba(0,0,0,.12)); }
.social-link:hover .social-icon::before { transform: translate(-50%, -50%) scale(1); }
.social-icon img {
  width: 18px; height: 18px; position: relative; z-index: 1;
  filter: grayscale(1) opacity(.45);
  transition: filter .35s;
}
.social-link:hover .social-icon img { filter: brightness(0) invert(1); }
.social-icon svg { color: rgba(34,34,34,.35); transition: color .35s; position: relative; z-index: 1; }
.social-link:hover .social-icon svg { color: #fff !important; }
.social-label { font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; }

/* FOOTER */
footer { padding: 1.8rem 3rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
footer span { font-size: .65rem; font-weight: 400; letter-spacing: .1em; color: var(--text-muted); }

@keyframes fadeUp { to { opacity:1; transform:translateY(0); } }

/* SCROLL HINT — double chevron, mobile only */
.hero-scroll-hint {
  display: none; /* shown via @media below */
  position: absolute; bottom: 2.4rem; left: 1.5rem;
  flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; z-index: 2;
  color: rgba(240,237,232,0.45);
  animation: scrollHintBounce 2.2s ease-in-out infinite;
}
.hero-scroll-hint span {
  display: block; width: 13px; height: 13px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.hero-scroll-hint span:nth-child(2) { margin-top: -7px; opacity: .4; }
@keyframes scrollHintBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}

@media (max-width: 768px) {
  nav { padding: 1.4rem 1.5rem; }
  .lang-toggle { margin-right: 0.8rem; }
  .lang-toggle::after { margin-left: 0.8rem; }
  .nav-links { display: none; }
  /* Hero: left-align to 1.5rem — matches about/section-header */
  #hero { padding: 0 1.5rem 0; }
  /* About */
  #about { grid-template-columns: 1fr; padding: 4rem 1.5rem 3.5rem; gap: 0; }
  .about-meta { min-height: 0; }
  .about-avatar-wrap { width: 180px; height: 180px; margin-bottom: .4rem; }
  .about-name { font-size: 1.3rem; margin-top: 1.6rem; margin-bottom: .8rem; }
  .about-meta { gap: .5rem 1.2rem; margin-bottom: 2rem; }
  .about-meta-val { font-size: .82rem; }
  .about-bio { font-size: 1.05rem; line-height: 1.75; max-width: 100%; margin-bottom: 1.2rem; }
  .about-cats { display: flex; flex-direction: column; max-width: 100%; border: none; }
  /* Remove all dividing lines between category items on mobile */
  .about-cat-item,
  .about-cat-item:nth-child(1),
  .about-cat-item:nth-child(2) { border: none; }
  .about-cat-item {
    flex: 0 0 100%; width: 100%; min-width: 0;
    display: flex; flex-direction: column;
    grid-row: auto;
    border: none;
    padding: 2rem 1.2rem;
  }
  .about-cat-item:first-child { border-radius: 0; }
  .about-cat-item:last-child  { border-radius: 0; border: none; }
  .about-cat-item:nth-child(2) { border: none; }
  /* Stretch groups & projs to full item width so auto-fill can count columns properly */
  .about-cat-groups { align-self: stretch; width: 100%; }
  .about-cat-subgroup { width: 100%; }
  .about-cat-projs { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); width: 100%; align-self: stretch; }
  /* Square cells — height follows column width via aspect-ratio; wide item spans 2 cols → ~2:1 naturally */
  .about-cat-projs .acp-item { height: auto; aspect-ratio: 1; }
  .about-cat-projs .acp-item--wide { aspect-ratio: auto; }
  .about-cat-text { min-height: 0; }
  /* About icons: show full color on mobile, no white overlay */
  .acp-img--icon { filter: grayscale(0); }
  .acp-item:has(.acp-img--icon)::after { display: none; }
  /* About card text: bump up for mobile readability */
  .about-cat-desc { font-size: .88rem; }
  .acp-sublabel { font-size: .72rem; }
  .about-cat-num { font-size: .75rem; }
  .about-highlights { margin: 1.4rem 0 1.8rem; border-radius: 10px; }
  .about-hl-item { padding: 1.1rem 2rem; }
  .about-hl-num { font-size: 1.5rem; }
  .about-skills { max-width: 100%; gap: .4rem 1.2rem; }
  /* Work: remove side padding — section-header has its own 1.5rem */
  .section-header { padding: 0 1.5rem; }
  #work { padding: 3rem 0 6rem; }
  /* Portrait carousel — Apple-style peeking, sides ~half visible */
  .swiper-big .swiper-slide  { width: 58vw; cursor: auto; }
  .swiper-big .proj-img      { width: 58vw; height: calc(58vw * 3 / 2); border-radius: 0; }
  .swiper-small .swiper-slide { width: 40vw; cursor: auto; }
  .swiper-small .proj-img    { width: 40vw; height: calc(40vw * 4 / 3); border-radius: 0; }
  /* Portrait card-info: centred */
  .card-info {
    flex-direction: column; align-items: center; justify-content: flex-start;
    text-align: center; padding: 0 0.8rem 1.1rem; gap: 0.4rem;
    z-index: 2;
  }
  .card-roles { padding-bottom: 0; justify-content: center; width: auto; max-width: calc(100% - 1.6rem); align-self: center; }
  .card-info-title { font-size: .78rem; padding: 9px 14px; max-width: calc(100% - 2rem); flex-shrink: 1; }
  .card-role { font-size: .5rem; }
  .card-type { top: .8rem; right: 1rem; font-size: .6rem; }
  .swiper-small .card-info { padding: 0 0.6rem 0.85rem; gap: 0.25rem; }
  .swiper-small .card-info-title { font-size: .68rem; padding: 7px 11px; max-width: calc(100% - 1.2rem); flex-shrink: 1; }
  /* Gradient — big slides only, uses same CSS var approach */
  .swiper-big .proj-img::after { border-radius: inherit; }
  /* Hero title: loosen line-height on mobile — more breathing room */
  .hero-title { line-height: 1.08; }
  /* Show scroll hint */
  .hero-scroll-hint { display: flex; }
  /* Modal: slightly narrowed so edges breathe */
  #modal-overlay { padding: 0 8px; }
  #modal-wrap  { max-height: 82vh; }
  #modal       { max-height: 82vh; }
  /* Push content down past the 28px border-radius zone */
  #modal-sticky { padding: 2rem 1rem 0; }
  #modal-body   { padding: 1.6rem 1rem 3.5rem; }
  /* Close btn must sit below the 28px corner radius to avoid clipping */
  #modal-close-float { top: 2.4rem; right: 1rem; }
  /* Push title+desc down, keep tag in place */
  .modal-header-row { margin-top: 1rem; }
  /* Portrait image grid: single column, all images at 16/9 ratio */
  .modal-images { grid-template-columns: 1fr; }
  /* reset both grid-column AND grid-row so items stack naturally */
  .modal-images > .modal-image-item:first-child  { grid-column: 1; grid-row: auto; aspect-ratio: 16/9; }
  .modal-images > .modal-image-item:nth-child(2) { grid-column: 1; grid-row: auto; aspect-ratio: 16/9; }
  .modal-images-extra { grid-template-columns: 1fr; }
  .modal-images-extra .modal-image-item { aspect-ratio: 16/9; }
  /* Disable blur on mobile — GPU compositing layer per image causes OOM crash */
  .modal-image-item img { filter: none; transform: none; }
  .modal-image-item img.img-ready { opacity: 1; filter: none; transform: none; }
  .proj-img img { filter: none; transform: none; }
  .proj-img img.img-ready { opacity: 1; filter: none; transform: none; }
  /* Contact / footer */
  #contact { padding: 5rem 1.5rem; }
  /* Blog section */
  #blog { padding: 5rem 1.5rem 6rem; }
  .blog-posts { max-width: 100%; }
  .blog-card { grid-template-columns: 1fr; gap: .4rem 0; padding: 1.6rem 0; }
  .blog-card-meta { text-align: left; }
  .blog-card-title { font-size: .95rem; }
  #social-popup { flex-wrap: wrap; justify-content: center; max-width: 400px; row-gap: 1.8rem; }
  .social-link { width: 20%; }
  footer { flex-direction: column; gap: .5rem; text-align: center; padding: 1.5rem; }
  /* Nav */
  .nav-links { display: none; }
  .nav-sep { display: none; }
  .nav-hamburger { display: flex; align-items: center; }
  /* Disable custom cursor on touch devices */
  body { cursor: auto; }
  #cursor, #cursor-ring { display: none; }
}

/* LANDSCAPE PHONE — hide nav bar, compact modal sticky header */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
  /* Nav takes too much vertical space in landscape — hide it */
  nav { display: none; }
  /* Modal: use more available height */
  #modal-wrap { max-height: 92vh; border-radius: 18px 18px 0 0; }
  #modal       { max-height: 92vh; }
  /* Compact sticky header + close button */
  #modal-sticky { padding: 1rem 1rem 0; }
  #modal-close-float { top: 1rem; right: 1rem; }
  .modal-close { width: 34px; height: 34px; }
  /* Slightly tighter body padding */
  #modal-body { padding: 1.2rem 1rem 3rem; }
}
