/* ===== Variables ===== */
:root {
  --page-pad: clamp(16px, 7vw, 110px);
  /* Height of the homepage full-width banner (21:9). */
  --banner-h: calc((100vw - 2 * var(--page-pad)) * 9 / 21);
  /* Subpage images: one tall unified height, width scales freely (panoramic).
     Generous by default; bumps up further on large/tall (4K) displays. */
  --project-img-h: min(74vh, 860px);
  /* Editable from the admin panel (外观 tab) */
  --bg: #000000;
  --line-spacing: 1.5;
  --font-scale: 1;
}
/* Large / 4K displays: keep images crisp; never scale 1600px frames beyond
   their natural resolution, while still leaving room for the legal line. */
@media (min-width: 2200px), (min-height: 1500px) {
  :root { --project-img-h: min(66vh, 860px); }
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: calc(100% * var(--font-scale, 1)); }
body {
  font-family: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg, #000);
  color: #fff;
  line-height: var(--line-spacing, 1.5);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }

/* ===== Utilities ===== */
.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ===== Entry overlay (WarpText) ===== */
.entry-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.entry-overlay.leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.entry-overlay:focus { outline: none; }
.entry-stage {
  width: 100%;
  max-width: 1400px;
  padding: 0 var(--page-pad);
  font-family: 'Space Grotesk', sans-serif;
}
.entry-stage .warp-text,
.entry-stage #warptext {
  width: 100%;
  height: 44vh;
  min-height: 220px;
}
.entry-overlay .fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: clamp(3rem, 13vw, 13rem);
  font-weight: 700;
  letter-spacing: -0.12em;
  color: #fff;
}
body:not(.no-webgl) .entry-overlay .fallback { display: none; }

/* ===== Ambient background ===== */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: screen;
}

/* ===== Expandable brand logo ===== */
.brand-logo {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  height: 56px;
  width: 56px;
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1), border-radius 0.35s ease;
}
.brand-logo__face {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo__face svg { width: 44px; height: 44px; display: block; }
.brand-logo__face .face-bg { fill: #fff; }
.brand-logo__face .eye { fill: #000; }
.brand-logo__face .mouth { stroke: #000; }
.brand-logo__text {
  flex: 0 0 auto;
  padding-right: 22px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #000;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.3s ease 0.05s, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.05s;
  white-space: nowrap;
}

/* Expand on hover */
.brand-logo:hover,
.brand-logo:focus-visible {
  width: 172px;
  border-radius: 28px;
}
.brand-logo:hover .brand-logo__text,
.brand-logo:focus-visible .brand-logo__text {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 640px) {
  .brand-logo { top: 16px; left: 16px; height: 44px; width: 44px; border-radius: 22px; }
  .brand-logo__face { flex: 0 0 44px; width: 44px; height: 44px; }
  .brand-logo__face svg { width: 34px; height: 34px; }
  .brand-logo__text { font-size: 0.95rem; padding-right: 16px; }
  .brand-logo:hover,
  .brand-logo:focus-visible { width: 146px; }
}

/* Face: mouth is morphed via JS spring; transform (bob/scale) set per-frame */
.brand-logo__face {
  will-change: transform;
  transform-origin: center center;
}
.brand-logo__face .eye,
.brand-logo__face .mouth { will-change: transform; }

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 26px var(--page-pad);
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.nav {
  display: flex;
  gap: 28px;
  pointer-events: auto;
}
.nav-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}
.nav-link:hover { color: #fff; }

@media (max-width: 640px) {
  .site-header { padding: 18px var(--page-pad); }
  .nav { gap: 18px; }
  .nav-link { font-size: 0.7rem; }
}

/* ===== Layout ===== */
main { padding: 0 var(--page-pad); }
section { padding: 96px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
section:last-of-type { border-bottom: none; }

@media (max-width: 640px) {
  main { padding: 0 var(--page-pad); }
  section { padding: 72px 0; }
  .about { padding-top: 96px; }
}

/* ===== Entry splash ===== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: introFade 0.9s ease 0.85s forwards;
}
.intro-inner { text-align: center; }
.intro-name {
  display: block;
  font-size: clamp(3rem, 12vw, 9rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  opacity: 0;
  animation: introRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}
.intro-sub {
  display: block;
  margin-top: 1.2rem;
  color: rgba(255,255,255,0.5);
  opacity: 0;
  animation: introFadeIn 0.6s ease 0.4s forwards;
}
@keyframes introFade { to { opacity: 0; visibility: hidden; } }
@keyframes introRise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes introFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Hero ===== */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-top: 100px;
}
.hero-content { max-width: 900px; }
.hero-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin: 0 0 1.5rem;
}
.hero-title { margin: 0; }
.hero-name {
  display: block;
  font-size: clamp(4rem, 15vw, 12rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
}
.hero-statement { margin: 2.4rem 0 0; }
.hero-statement-en {
  max-width: 640px;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: rgba(255,255,255,0.85);
  line-height: 1.65;
  margin: 0;
}
.hero-statement-zh {
  max-width: 640px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.8;
  margin: 1.1rem 0 0;
}

/* Entrance animation — triggered after splash */
.hero-label,
.hero-name,
.hero-statement {
  opacity: 0;
  transform: translateY(26px);
}
body.loaded .hero-label  { animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.95s forwards; }
body.loaded .hero-name   { animation: rise 0.85s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards; }
body.loaded .hero-statement { animation: rise 0.85s cubic-bezier(0.16, 1, 0.3, 1) 1.35s forwards; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.hero-meta {
  position: absolute;
  bottom: 40px;
  left: var(--page-pad);
  right: var(--page-pad);
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,0.45);
}

@media (max-width: 640px) {
  .hero { padding-top: 90px; }
  .hero-meta { bottom: 24px; }
}

/* ===== Reveal & link interactions (Lusion-style) ===== */
/* Scroll-entrance: fade + rise */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Masked line reveal for headings (clip + slide up) */
.reveal-line { display: block; overflow: hidden; }
.reveal-line > span {
  display: block;
  transform: translateY(112%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0ms);
  will-change: transform;
}
.reveal-line.is-visible > span { transform: none; }

/* Line + icon "reveal" link */
.link-reveal { position: relative; display: inline-flex; align-items: center; }
.link-reveal::before {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  height: 1px; width: 0;
  background: currentColor;
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.link-reveal:hover::before,
.link-reveal:focus-visible::before { width: 100%; }

.link-icon {
  width: 16px;
  height: 16px;
  margin-left: 6px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.link-reveal:hover .link-icon,
.link-reveal:focus-visible .link-icon { opacity: 1; transform: translateX(0); }

.nav-icon { transform: translateY(-2px); }
.link-reveal:hover .nav-icon,
.link-reveal:focus-visible .nav-icon { transform: translateY(0); }

.social-icon { transform: translateX(-4px); }
.link-reveal:hover .social-icon,
.link-reveal:focus-visible .social-icon { transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .reveal-line > span { transform: none !important; transition: none !important; }
  .link-reveal::before { transition: none; }
  .link-icon { transition: none; }
  .email-icon svg,
  .contact-email:hover .email-envelope,
  .contact-email:focus-visible .email-envelope,
  .contact-email:hover .email-plane,
  .contact-email:focus-visible .email-plane { animation: none !important; }
  .portrait-img,
  .portrait-video,
  .portrait-ring { animation: none !important; transform: none !important; }
  .portrait-frame:hover .portrait-img,
  .portrait-frame:hover .portrait-video { transform: none !important; }
}

/* ===== Section headers ===== */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 56px;
}
.section-number { color: rgba(255,255,255,0.4); }
.section-title {
  font-size: clamp(4.8rem, 13vw, 11rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.9;
  margin: 0;
}

/* ===== Category blocks (grouped ALL view) ===== */
.cat-block {
  margin-bottom: 56px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.cat-head {
  margin-bottom: 26px;
}
.cat-title {
  font-size: clamp(2.9rem, 6.9vw, 5.3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0;
}
.cat-desc {
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.55);
  max-width: 640px;
  margin: 12px 0 0;
}


/* ===== Filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 44px;
}
.filter {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 9px 18px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.filter:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.filter.is-active { background: #fff; color: #000; border-color: #fff; }

/* ===== Portfolio view toggle (Stack / Grid) — icon by default, label on hover ===== */
.portfolio-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 44px;
}
.portfolio-view-toggle {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
}
.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0 11px;
  height: 24px;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
}
.view-icon {
  width: 16px;
  height: 16px;
  flex: none;
  display: block;
}
.view-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  margin-left: 0;
  transition: max-width 0.28s ease, opacity 0.18s ease, margin-left 0.28s ease;
}
.view-btn:hover .view-label,
.view-btn:focus-visible .view-label {
  max-width: 80px;
  opacity: 1;
  margin-left: 7px;
}
.view-btn:hover { color: #fff; }
.view-btn.is-active { background: #fff; color: #000; }
.view-btn.is-active .view-icon { color: #000; }
/* Touch devices have no hover — keep labels visible */
@media (hover: none) {
  .view-label { max-width: 80px; opacity: 1; margin-left: 7px; }
}

/* ===== Portfolio grid view (flattened frames, grouped by category) ===== */
.portfolio-grid-view {
  display: block;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}
.portfolio-grid-card {
  position: relative;
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.portfolio-grid-media {
  position: relative;
  aspect-ratio: 21 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255,255,255,0.12);
  transition: border-color 0.25s, box-shadow 0.25s, filter 0.25s;
}
.portfolio-grid-media picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.portfolio-grid-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.portfolio-grid-card:hover .portfolio-grid-media {
  border-color: rgba(255,255,255,0.7);
  box-shadow: 0 10px 34px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.18);
  filter: brightness(1.14);
}
.portfolio-grid-card:hover .portfolio-grid-media img { transform: scale(1.04); }
.portfolio-grid-card:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.portfolio-grid-meta {
  padding: 12px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.frame-project {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.frame-caption {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) and (orientation: portrait) {
  .portfolio-grid { gap: 16px; }
  .portfolio-grid-media { aspect-ratio: 21 / 9; }
}
@media (max-width: 640px) {
  .portfolio-toolbar { margin-bottom: 32px; }
  .view-btn { padding: 0 8px; height: 20px; font-size: 0.66rem; }
  .filters { gap: 8px; margin-bottom: 32px; }
  .filter { padding: 7px 13px; height: 28px; font-size: 0.66rem; }
}

/* Phone landscape: denser GRID array (4 across), mirroring the desktop feel */
@media (max-width: 950px) and (orientation: landscape) {
  .portfolio-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
  .portfolio-grid-media { aspect-ratio: 16 / 9; }
  .portfolio-grid-meta { padding-top: 8px; }
  .frame-caption { font-size: 0.78rem; }
  .frame-project { font-size: 0.58rem; }
}

/* ===== Works grid (full-width banner rows) ===== */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
}
.cat-grid { gap: 56px; }
.card {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-media {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #111;
  aspect-ratio: 21 / 9;
}
.card-media picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover .card-media img { transform: scale(1.04); }

/* Caption sits BELOW the image (not overlaying it) */
.card-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.card-meta { display: flex; flex-direction: column; gap: 4px; }
.card-cat {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.card-title {
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* Project title: left arrow reveal, text shifts right on hover */
.title-reveal {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  padding-left: 0;
  transition: padding-left 0.45s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s ease;
}
.title-reveal::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.15em;
  height: 0.48em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 12' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 6h20'/%3E%3Cpath d='M16 1l6 5-6 5'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  transform: translate(-14px, -50%);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.card:hover .title-reveal,
.title-reveal:hover,
.title-reveal:focus-visible {
  padding-left: 1.45em;
}
.card:hover .title-reveal::before,
.title-reveal:hover::before,
.title-reveal:focus-visible::before {
  opacity: 1;
  transform: translate(0, -50%);
}
@media (prefers-reduced-motion: reduce) {
  .title-reveal,
  .title-reveal::before { transition: none; }
}

/* Chinese subtitle under the English title — smaller, secondary */
.card-title-zh {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: clamp(0.95rem, 1.3vw, 1.2rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.55);
  margin: 8px 0 0;
}

@media (max-width: 900px) {
  .card-media { aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .grid { gap: 44px; }
  .cat-grid { gap: 40px; }
  .card-media { aspect-ratio: 4 / 3; }
  .card-info { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card-title { font-size: 1.25rem; }
}

/* ===== About ===== */
.about-header-row {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: clamp(2rem, 5vw, 4rem);
}
.about-left-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 28px);
}
.about-text-col {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.about-text-scroll {
  will-change: transform;
}
.about-text-scroll.is-tall {
  animation: aboutTextScroll var(--scroll-duration, 24s) linear infinite;
}
.about-text-col:hover .about-text-scroll.is-tall,
.about-text-col:focus-within .about-text-scroll.is-tall {
  animation-play-state: paused;
}
.about-text-en {
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  color: rgba(255,255,255,0.88);
  margin: 0 0 1.2em;
  line-height: 1.65;
  font-weight: 400;
}
.about-text-zh {
  font-size: clamp(0.78rem, 1.05vw, 0.9rem);
  color: rgba(255,255,255,0.72);
  margin: 0;
  line-height: 1.85;
  font-weight: 300;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
@keyframes aboutTextScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(var(--scroll-dist, 0)); }
}
@media (prefers-reduced-motion: reduce) {
  .about-text-scroll.is-tall { animation: none; }
}

/* About portrait window with subtle motion */
.about-portrait {
  flex: 0 0 auto;
  width: clamp(360px, 34vw, 520px);
  margin-top: 0;
}
.portrait-frame {
  position: relative;
  margin: 0;
  aspect-ratio: 5 / 6;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  background: #0a0a0a;
  box-shadow: 0 20px 60px -30px rgba(0,0,0,0.8);
}
.portrait-img,
.portrait-video {
  position: absolute;
  inset: -6% 0;            /* slightly taller so the float never reveals edges */
  width: 100%;
  height: 112%;
  object-fit: cover;
  object-position: center top;
  display: block;
  animation: portrait-float 6.5s ease-in-out infinite;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.6s ease;
  will-change: transform;
}
.portrait-video {
  object-position: center;
  background: #0a0a0a;     /* avoids transparent flash before first frame */
}
.portrait-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.10), rgba(255,255,255,0) 55%);
  opacity: 0.7;
  animation: portrait-glow 7s ease-in-out infinite;
}
.portrait-frame:hover .portrait-img,
.portrait-frame:hover .portrait-video {
  transform: scale(1.05);
  filter: brightness(1.06);
}
.portrait-frame:hover .portrait-ring { opacity: 1; }

@keyframes portrait-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes portrait-glow {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.95; }
}

@media (max-width: 900px) {
  .about-portrait { width: clamp(280px, 32vw, 380px); }
}

@media (max-width: 720px) {
  .about-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }
  .about-left-col { gap: 1.25rem; }
  .about-portrait { width: clamp(200px, 56vw, 260px); }
  .portrait-frame { aspect-ratio: 4 / 5; }
}

/* ===== Contact ===== */
.contact-content { max-width: 720px; }
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 40px;
  padding-bottom: 6px;
}
.contact-email:hover { color: #fff; }

.email-text { position: relative; }

.email-icon {
  position: relative;
  display: inline-block;
  width: clamp(28px, 3.5vw, 44px);
  height: clamp(28px, 3.5vw, 44px);
  flex-shrink: 0;
}
.email-icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.25s ease;
}
.email-plane {
  opacity: 0;
  transform: translate(0, 0) rotate(0deg);
}

.contact-email:hover .email-envelope,
.contact-email:focus-visible .email-envelope {
  animation: envelope-shake 0.65s ease forwards;
}
.contact-email:hover .email-plane,
.contact-email:focus-visible .email-plane {
  animation: plane-fly 0.85s ease 0.35s forwards;
}

@keyframes envelope-shake {
  0% { transform: rotate(0deg); opacity: 1; }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(4deg); opacity: 1; }
  100% { transform: rotate(0deg) scale(0.8); opacity: 0; }
}

@keyframes plane-fly {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.7); }
  20% { opacity: 1; transform: translate(4px, -2px) rotate(-8deg) scale(1); }
  100% { opacity: 0; transform: translate(60px, -48px) rotate(-18deg) scale(0.85); }
}

.socials { display: flex; gap: 32px; flex-wrap: wrap; }
.social-link { color: rgba(255,255,255,0.10); text-decoration: none; transition: color 0.2s; }
.social-link:hover { color: rgba(255,255,255,0.4); text-decoration: none; }
.social-link--active { color: rgba(255,255,255,0.4); }

/* ===== Footer ===== */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 44px var(--page-pad);
  color: rgba(255,255,255,0.4);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer__brand { display: flex; gap: 12px; font-size: 0.8rem; letter-spacing: 0.12em; }
.copyright-notice {
  margin: 0;
  max-width: 720px;
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.4);
}
.copyright-notice .en { display: block; margin-top: 8px; }
@media (max-width: 640px) {
  .footer { padding: 32px var(--page-pad); }
  .copyright-notice {
    font-size: 0.55rem;
    line-height: 1.55;
    color: rgba(255,255,255,0.28);
  }
  .copyright-notice .en { margin-top: 6px; }
}

/* ===== Logo wall (infinite marquee) ===== */
.logo-wall {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: #000;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
.logo-wall__track {
  display: flex;
  align-items: center;
  width: max-content;
  height: 50px;
  animation: logoScroll 40s linear infinite;
}
.logo-wall:hover .logo-wall__track { animation-play-state: paused; }
.logo-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 50px;
  padding: 0 38px;
  white-space: nowrap;
  color: rgba(255,255,255,0.85);
  font-family: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
}
.logo-item img {
  height: 26px;
  width: auto;
  object-fit: contain;
  /* Drop in already-white logos. For colored sources, add: filter: brightness(0) invert(1); */
}
@keyframes logoScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (max-width: 640px) {
  .logo-wall__track { height: 44px; animation-duration: 30s; }
  .logo-item { height: 44px; padding: 0 24px; font-size: 0.85rem; }
  .logo-item img { height: 22px; }
}

/* ===== Modal ===== */
/* ===== Project detail — horizontal subpage (Lusion-style) ===== */
.project-view {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.project-view.open { opacity: 1; pointer-events: auto; }

.project-copyright {
  position: absolute;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  width: 92%;
  max-width: 820px;
  text-align: center;
  font-size: 0.6rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.22);
  pointer-events: none;
  z-index: 158;
}

.project-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 52px;
  height: 52px;
  font-size: 1.8rem;
  color: #fff;
  z-index: 160;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.project-close:hover { background: rgba(255,255,255,0.12); }

.project-rail {
  display: flex;
  height: 100%;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.project-rail::-webkit-scrollbar { display: none; }

.project-panel {
  flex: 0 0 auto;
  min-width: auto;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: flex-start; /* text & image share the same top baseline */
  gap: clamp(32px, 4vw, 60px);
  padding: 4vh 1vw 0 13vw;
  box-sizing: border-box;
}

.project-text {
  flex: 0 0 auto;
  width: clamp(250px, 25vw, 380px);
  min-width: 250px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Staggered group-by-group entrance for the left-side text (Lusion-style) */
.project-text > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-view.open .project-text > * { opacity: 1; transform: translateY(0); }
.project-view.open .project-text > *:nth-child(1) { transition-delay: 0.12s; }
.project-view.open .project-text > *:nth-child(2) { transition-delay: 0.24s; }
.project-view.open .project-text > *:nth-child(3) { transition-delay: 0.36s; }
.project-view.open .project-text > *:nth-child(4) { transition-delay: 0.48s; }
.project-view.open .project-text > *:nth-child(5) { transition-delay: 0.60s; }
.project-view.open .project-text > *:nth-child(6) { transition-delay: 0.72s; }
.project-view.open .project-text > *:nth-child(7) { transition-delay: 0.84s; }
.project-cat {
  font-family: 'IBM Plex Mono', monospace;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin: 0 0 6px;
}
.project-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255,255,255,0.08);
  margin: 0 0 4px;
}
.project-title {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}
.project-title-zh {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.02em;
  margin: 0;
}
/* Per-image editable English label — prominent heading on every panel */
.project-img-title {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: rgba(255,255,255,0.92);
}
/* Project-level overview description, shown only on the first panel */
.project-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.65);
  margin: 0;
}
.project-tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.5;
}
.project-intro {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.65);
  margin: 0;
}
/* Hide empty placeholder elements so they don't consume space or animate */
.project-tagline:empty,
.project-intro:empty,
img.project-logo[src=""] { display: none; }

.project-media {
  flex: 1 1 auto;
  /* The image uses a unified, slightly shorter height so the legal line at
     the bottom stays visible; width stays free so wide / panoramic art can
     extend past the viewport and be explored by horizontal scrolling. */
  height: var(--project-img-h);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: auto;
  overflow: visible;
  position: relative; /* anchor for the fullscreen button */
}
.project-media picture {
  display: block;
  height: 100%;
}
.project-media img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: top center;
  border-radius: 4px;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.9s ease 0.22s, transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.22s;
}
.project-view.open .project-media img {
  opacity: 1;
  transform: scale(1);
  cursor: pointer; /* clicking the image also opens fullscreen */
}

/* Fullscreen-view button — sits on wide / panoramic images only */
.fullscreen-btn {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 5;
}
.project-media:hover .fullscreen-btn { opacity: 1; transform: translateY(0); }
.fullscreen-btn:hover { background: rgba(255,255,255,0.16); }
.fullscreen-btn svg { width: 28px; height: 28px; }
.fullscreen-btn:focus-visible { opacity: 1; outline: 2px solid #fff; }

/* Fullscreen image viewer — fits the whole image to the screen, no scroll/pan.
   This is the sharpest way to view a very wide panorama on a 4K display. */
.fullscreen-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
}
.fullscreen-viewer.open { display: flex; opacity: 1; }
.fullscreen-viewer img {
  max-width: 96vw;
  max-height: 96vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}
.fs-close {
  position: fixed;
  top: 26px;
  right: 30px;
  width: 80px;
  height: 80px;
  font-size: 3rem;
  line-height: 1;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  cursor: pointer;
  z-index: 201;
  transition: background .2s ease, transform .2s ease;
}
.fs-close:hover { background: rgba(255,255,255,0.16); transform: scale(1.05); }

/* Loading / error states inside the fullscreen viewer */
.fs-loading, .fs-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: rgba(255,255,255,0.72);
  text-align: center;
  pointer-events: none;
  transition: opacity .3s ease;
}
.fs-loading-ring {
  width: 52px;
  height: 52px;
  animation: ringSpin 1s linear infinite;
}
.fs-loading-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.fs-error { display: none; }
.fs-error p { margin: 0; font-size: 0.9rem; line-height: 1.6; }
.fs-error .fs-error-en { font-size: 0.75rem; color: rgba(255,255,255,0.45); }
.fullscreen-viewer[data-fs-state="loading"] .fs-loading { opacity: 1; }
.fullscreen-viewer[data-fs-state="loaded"] .fs-loading,
.fullscreen-viewer[data-fs-state="error"] .fs-loading { opacity: 0; pointer-events: none; }
.fullscreen-viewer[data-fs-state="error"] .fs-error { display: flex; }

/* Hint that clicking the enlarged image closes the viewer */
.fullscreen-viewer img { cursor: zoom-out; }

/* Mobile panoramic scroll mode: very wide scroll-like art is shown at full
   viewport height and explored by swiping/dragging horizontally. */
.fullscreen-viewer.fs-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: flex-start;
  align-items: center;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fullscreen-viewer.fs-scroll::-webkit-scrollbar { display: none; }
.fullscreen-viewer.fs-scroll img {
  height: 96vh;
  max-height: none;
  width: auto;
  max-width: none;
  cursor: grab;
  border-radius: 0;
}
.fullscreen-viewer.fs-scroll:active,
.fullscreen-viewer.fs-scroll:active img { cursor: grabbing; }

@media (pointer: coarse) {
  /* Always show the fullscreen button on touch devices where hover is unavailable. */
  .fullscreen-btn { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .fullscreen-viewer, .fullscreen-btn { transition: none; }
  .fullscreen-viewer.fs-scroll { scroll-behavior: auto; }
}

/* Unified text column width across all desktop panels so every frame/image relationship is identical. */

.project-progress {
  position: fixed;
  left: 8vw;
  right: 8vw;
  bottom: 32px;
  height: 2px;
  background: rgba(255,255,255,0.12);
  z-index: 160;
}
.project-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.08s linear;
}

@media (max-width: 900px) {
  .project-copyright {
    font-size: 0.45rem;
    line-height: 1.35;
    color: rgba(255,255,255,0.18);
    bottom: 44px;
  }
  .project-media picture { height: auto; }
  /* Phone / tablet portrait: the subpage becomes a vertical scroll of frames
     instead of a horizontal rail (which would clip taller panels on small screens). */
  .project-rail {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
  }
  .project-panel {
    flex: 0 0 auto;
    min-width: 100%;
    width: 100%;
    height: auto;
    min-height: 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
    padding: 20px 5vw 0;
    margin-bottom: 16px;
    scroll-snap-align: start;
  }
  .project-panel:first-child { padding-top: 56px; }
  .project-text { flex: 0 0 auto; width: 100%; max-width: 100%; gap: 10px; }
  .project-cat { font-size: 0.65rem; margin: 0 0 2px; }
  .project-logo { width: 48px; height: 48px; }
  .project-title { font-size: clamp(1.5rem, 7vw, 2.4rem); letter-spacing: -0.02em; }
  .project-title-zh { font-size: 0.85rem; }
  .project-desc,
  .project-intro { font-size: 0.85rem; line-height: 1.55; }
  .project-img-title { font-size: clamp(1.1rem, 5vw, 1.5rem); }
  .project-media {
    height: auto;
    width: 100%;
    flex: 0 0 auto;
    min-height: 0;
    justify-content: center;
  }
  .project-media img {
    height: auto;
    width: 100%;
    max-width: 100%;
    max-height: 62vh;
    object-fit: contain;
  }
  /* Wide / scroll-like art on phones: keep the frame tall enough to be readable
     and let the user swipe horizontally to explore the long panorama. */
  .project-media.media-scroll {
    height: 52vh;
    min-height: 320px;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .project-media.media-scroll::-webkit-scrollbar { display: none; }
  .project-media.media-scroll picture {
    height: 100%;
    width: auto;
    flex: 0 0 auto;
  }
  .project-media.media-scroll img {
    height: 100%;
    width: auto;
    max-width: none;
    max-height: none;
    object-fit: contain;
    border-radius: 0;
  }
  .fullscreen-btn { width: 56px; height: 56px; right: 14px; bottom: 14px; }
}
@media (max-width: 640px) {
  .project-close { top: 12px; right: 12px; width: 44px; height: 44px; font-size: 1.5rem; }
  .project-title { font-size: clamp(1.35rem, 6.5vw, 1.9rem); }
  .project-title-zh { font-size: 0.8rem; }
  .project-desc,
  .project-intro { font-size: 0.8rem; line-height: 1.5; }
  .project-img-title { font-size: 1rem; }
  .project-copyright { font-size: 0.42rem; }
}

@media (prefers-reduced-motion: reduce) {
  .project-text > *,
  .project-media img { transition: none; opacity: 1; transform: none; }
}

/* Continuous scrolling on all devices — wide art extends past the viewport. */
.project-rail { scroll-snap-type: none; }

/* ===== Subpage thumbnail contact-sheet toggle (left of the close X) ===== */
.project-grid-toggle {
  position: fixed;
  top: 20px;
  right: 88px;            /* 24px offset + 52px close button + 12px gap */
  width: 52px;
  height: 52px;
  z-index: 160;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.project-grid-toggle:hover { background: rgba(255,255,255,0.12); }
.project-grid-toggle svg { width: 22px; height: 22px; }
.project-grid-toggle.active { background: #fff; color: #000; border-color: #fff; }

.project-grid {
  position: fixed;
  inset: 0;
  z-index: 155;           /* above the rail (150), below the top buttons (160) */
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  padding: 96px 6vw 64px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.project-grid.open { opacity: 1; pointer-events: auto; }

.project-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
  max-width: 1500px;
  margin: 0 auto;
}

.project-thumb {
  position: relative;
  aspect-ratio: 21 / 9;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: #111;
  padding: 0;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), border-color 0.25s, box-shadow 0.25s;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.project-thumb:hover {
  transform: scale(1.05);
  border-color: rgba(255,255,255,0.7);
  box-shadow: 0 10px 34px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.18);
  filter: brightness(1.14);
  z-index: 2;
}
.project-thumb:hover img { transform: scale(1.04); }
.project-thumb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.project-thumb.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.9); }
.project-thumb .thumb-index {
  position: absolute; top: 10px; left: 10px;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.05em;
  color: #fff; background: rgba(0,0,0,0.55); padding: 3px 8px; border-radius: 4px;
}
.project-thumb .thumb-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 12px 10px;
  font-size: 0.85rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(transparent, rgba(0,0,0,0.82));
  pointer-events: none;
}
@media (max-width: 640px) {
  .project-grid-toggle { top: 12px; right: 64px; width: 44px; height: 44px; }
  .project-grid { padding: 80px 5vw 56px; }
  .project-grid-inner { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .project-thumb { transition: border-color 0.2s, box-shadow 0.2s, filter 0.2s; }
  .project-thumb:hover { transform: none; }
  .project-thumb img { transition: none; }
  .project-thumb:hover img { transform: none; }
}

/* ===== Image loading placeholder (brand "face" spinner) ===== */
.pic { position: relative; display: block; }
.pic-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.pic-loading .pic-ring {
  width: clamp(34px, 12%, 60px);
  height: clamp(34px, 12%, 60px);
  transform-origin: center;
  animation: ringSpin 1s linear infinite;
}
@keyframes ringSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.pic[data-img-state="loaded"] .pic-loading { display: none; }

/* ===== Landscape suggestion (non-blocking, phone portrait only) ===== */
.orient-hint {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(0);
  z-index: 140;
  display: none;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
@media (max-width: 900px) and (orientation: portrait) {
  .orient-hint { display: block; }
  .orient-hint.dismissed { display: none; }
}
.orient-hint-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  background: rgba(18,18,18,0.86);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
.orient-hint-icon {
  width: 30px;
  height: 30px;
  flex: none;
  fill: none;
  stroke: rgba(255,255,255,0.9);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: orientTilt 2.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.orient-hint-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}
.orient-hint-close {
  flex: none;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.orient-hint-close:hover { color: #fff; background: rgba(255,255,255,0.12); }
.orient-hint-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes orientTilt {
  0%, 35% { transform: rotate(0deg); }
  55%, 100% { transform: rotate(-90deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pic-loading .pic-ring,
  .fs-loading-ring { animation: none; }
  .pic-loading .pic-ring { opacity: 0.6; }
  .orient-hint-icon { animation: none; }
}

