:root {
  /* Figma Glass: shallow color, -45°, 80%; Refraction 80, Depth 59.21,
     Dispersion 100, Frost 22, Splay 30. */
  --glass-refraction: 80;
  --glass-depth: 59.21;
  --glass-dispersion: 100;
  --glass-frost: 22;
  --glass-splay: 30;
}

.hero-portfolio-glass {
  position: absolute;
  z-index: 1;
  left: 5.7%;
  top: 13.2%;
  width: 88.6%;
  height: 49.1%;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
  /* iOS lock-screen time: thick translucent body with neutral refraction. */
  background:
    radial-gradient(ellipse 42% 32% at 22% 5%, rgba(255,255,255,.5), transparent 70%),
    radial-gradient(ellipse 44% 42% at 82% 82%, rgba(236,248,255,.32), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.12) 48%, rgba(210,232,245,.18) 100%);
  background-size: 132% 132%;
  background-position: 14% 50%;
  backdrop-filter: blur(9px) saturate(86%) brightness(1.14) contrast(1.04);
  -webkit-backdrop-filter: blur(9px) saturate(86%) brightness(1.14) contrast(1.04);
  mask: url("assets/hero-portfolio-word-figma.svg") center / 100% 100% no-repeat;
  -webkit-mask: url("assets/hero-portfolio-word-figma.svg") center / 100% 100% no-repeat;
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.9),
    inset 0 -3px 4px rgba(106,146,176,.16);
  /* Keep the frost inside the glyph; external shadow softens the SVG edge. */
  filter: none;
  opacity: .76;
  animation: liquid-glass-shift 8s ease-in-out infinite alternate;
  transition: transform .36s cubic-bezier(.2,.8,.2,1);
}

.hero-pointer-light {
  position: absolute;
  z-index: 1;
  left: var(--pointer-x, 50%);
  top: var(--pointer-y, 50%);
  width: min(38vw, 580px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.28) 0%, rgba(184,230,255,.16) 25%, transparent 68%);
  filter: blur(16px);
  mix-blend-mode: screen;
  transition: opacity .35s ease, left .14s linear, top .14s linear;
}

.hero.pointer-active .hero-pointer-light { opacity: 1; }
.hero.pointer-active .hero-portfolio-glass { transform: translate(var(--glass-x, 0px), var(--glass-y, 0px)); }
.hero.pointer-active .hero-portfolio-lockscreen-outline { transform: translate(var(--glass-x, 0px), var(--glass-y, 0px)); }
.hero.pointer-active .hero-portfolio-inner-highlight { transform: translate(var(--glass-x, 0px), var(--glass-y, 0px)); }
.hero.pointer-active .hero-person { transform: perspective(1200px) translateX(calc(-50% + var(--person-x, 0px))) translateY(var(--person-y, 0px)) rotateY(var(--person-turn, 0deg)) rotateZ(var(--person-tilt, 0deg)); }

.hero-cursor {
  position: absolute;
  z-index: 8;
  left: var(--pointer-x, 50%);
  top: var(--pointer-y, 50%);
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255,255,255,.12), 0 4px 14px rgba(0,25,72,.22);
  transform: translate(-50%, -50%) scale(.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .18s ease, left .1s linear, top .1s linear;
}

.hero.pointer-active .hero-cursor { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.hero-portfolio-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 26%, rgba(247,252,255,.1) 35%, rgba(255,255,255,.62) 44%, rgba(238,249,255,.16) 52%, transparent 62%);
  background-size: 210% 100%;
  mix-blend-mode: screen;
  animation: liquid-glass-sheen 5.5s ease-in-out infinite;
}

.hero-portfolio-lockscreen-outline {
  position: absolute;
  z-index: 1;
  left: 5.7%;
  top: 13.2%;
  width: 88.6%;
  height: 49.1%;
  object-fit: fill;
  pointer-events: none;
  mix-blend-mode: normal;
  opacity: .9;
  filter: none;
  transition: transform .36s cubic-bezier(.2,.8,.2,1);
}

.hero-portfolio-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 34% 55% at 86% 52%, rgba(255,255,255,.6) 0%, rgba(236,250,255,.28) 34%, transparent 72%),
    linear-gradient(315deg, rgba(255,255,255,.26), transparent 28%);
  mix-blend-mode: screen;
  opacity: 1;
}

.hero-portfolio-inner-highlight {
  position: absolute;
  z-index: 1;
  left: 5.7%;
  top: 13.2%;
  width: 88.6%;
  height: 49.1%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.64) 0%, rgba(255,255,255,.18) 13%, transparent 38%, transparent 72%, rgba(220,239,250,.15) 100%);
  mix-blend-mode: screen;
  mask: url("assets/hero-portfolio-word-figma.svg") center / 100% 100% no-repeat;
  -webkit-mask: url("assets/hero-portfolio-word-figma.svg") center / 100% 100% no-repeat;
  filter: none;
  opacity: .62;
}

@keyframes liquid-glass-shift { to { background-position: 100% 50%; } }
@keyframes liquid-glass-sheen { from { background-position: 150% 0; } to { background-position: -50% 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero-portfolio-glass, .hero-portfolio-glass::before { animation: none; }
  .hero-pointer-light, .hero-cursor { display: none; }
}

.nav .download {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.48);
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.96), inset 0 -1px 4px rgba(255,255,255,.2), 0 8px 20px rgba(0,29,74,.12);
  backdrop-filter: blur(16px) saturate(68%) brightness(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(68%) brightness(1.1);
  text-shadow: 0 1px 3px rgba(0,0,0,.12);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

.nav .download::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 26%, rgba(255,255,255,.58) 43%, transparent 57%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}

.nav .download:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.28);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.92), inset 0 -2px 6px rgba(255,255,255,.26), 0 12px 24px rgba(0,29,74,.2);
}

.nav .download:hover::after { transform: translateX(120%); }

.hero-person { z-index: 2; transform-origin: 53% 74%; transition: transform .38s cubic-bezier(.2,.8,.2,1); }
.hero-scrub-video,
.hero-motion-video {
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.hero-banner-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-position: center center;
}

.hero.has-video-scrubber {
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.hero.is-video-dragging { cursor: grabbing; }

.hero h1 { z-index: 3; transform: translate(-50%, -28px); }
html[lang="zh-CN"] .hero h1 { font-size: 52px; }
.hero .scroll-cue { z-index: 3; }

/* Designer positioning: Figma-sourced stacked books replace the eyebrow copy. */
.intro-books {
  position: relative;
  z-index: 2;
  width: clamp(190px, 18.75vw, 360px);
  aspect-ratio: 360 / 211;
  margin: 0 0 16px;
  isolation: isolate;
}

.intro-books img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 800px) {
  .intro-books {
    width: clamp(170px, 52vw, 230px);
    margin-bottom: 16px;
  }
}

@media (max-width: 800px) {
  .hero-portfolio-word { left: 4%; top: 20%; width: 92%; height: 31%; opacity: .2; }
  .hero-portfolio-refract { left: 4%; top: 20%; width: 92%; height: 31%; }
  .hero-portfolio-glass { left: 4%; top: 20%; width: 92%; height: 31%; }
  .hero-portfolio-lockscreen-outline { left: 4%; top: 20%; width: 92%; height: 31%; }
  .hero-portfolio-inner-highlight { left: 4%; top: 20%; width: 92%; height: 31%; }
  .hero-pointer-light, .hero-cursor { display: none; }
}
