/* YUEIN FOREST AUDIO — 首页 · 声之森 */

body.home { overflow-x: hidden; }

.site {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden; isolation: isolate;
  background:
    radial-gradient(90% 70% at 72% 38%, rgb(var(--tint) / .055), transparent 60%),
    radial-gradient(60% 50% at 8% 0%, rgb(255 255 255 / .03), transparent 70%),
    var(--bg);
}
.site[data-mode="audio"]    { --tint: 232 182 94; }
.site[data-mode="cases"]    { --tint: 186 180 255; }
.site[data-mode="software"] { --tint: 128 206 255; }
.site[data-mode="about"]    { --tint: 150 226 200; }

.field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* 场景 */
.scenes { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.scene { position: absolute; margin: 0; opacity: 0; visibility: hidden; transition: opacity .9s var(--ease), visibility 0s .9s; }
.scene.is-on { opacity: 1; visibility: visible; transition: opacity .9s var(--ease); }
@media (hover: hover) and (pointer: fine) { .scene { will-change: opacity; } }
.scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.1s var(--ease); }
.scene img.is-loaded { opacity: 1; }
.scene--product { top: 0; right: 0; bottom: 0; width: 64%;
  -webkit-mask-image: radial-gradient(64% 58% at 58% 44%, #000 38%, transparent 100%);
          mask-image: radial-gradient(64% 58% at 58% 44%, #000 38%, transparent 100%); }
.scene--product img { object-position: 50% 42%; }
.scene[data-scene="audio"] img { opacity: 0; transform: scale(1.03); transition: opacity 1s var(--ease), transform 2.4s var(--ease); }
.scene[data-scene="audio"] img.is-loaded.is-current { opacity: 1; transform: none; }
.scene--wide { inset: 0; }
.scene--wide.is-on { opacity: .78; }
.scene[data-scene="about"] img { object-position: 70% 60%; }
.scene[data-scene="cases"] img { object-position: 62% 40%; }

.shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgb(7 7 8 / .94) 0%, rgb(7 7 8 / .72) 30%, rgb(7 7 8 / .12) 62%, rgb(7 7 8 / .35) 100%),
    linear-gradient(180deg, rgb(7 7 8 / .55) 0%, transparent 18%, transparent 58%, rgb(7 7 8 / .86) 82%, var(--bg) 100%);
}

/* 顶栏 */
.top {
  position: relative; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: max(24px, env(safe-area-inset-top)) var(--gx) 0;
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.sound-toggle {
  display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 16px 0 14px;
  border: 1px solid rgb(var(--fg) / .16); border-radius: 999px;
  font: 500 10px var(--sans); letter-spacing: .26em;
  transition: border-color .4s, background-color .4s;
}
.sound-toggle:hover { border-color: rgb(var(--fg) / .4); }
.sound-state::before { content: "OFF"; color: rgb(var(--fg) / .42); }
.is-sound .sound-state::before { content: "ON"; color: rgb(var(--gold)); }
.is-sound .sound-toggle { border-color: rgb(var(--gold) / .55); background: rgb(var(--gold) / .07); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { display: block; width: 2px; height: 12px; background: currentColor; border-radius: 1px; opacity: .8; transform: scaleY(.25); transform-origin: bottom; }
.is-sound .eq i { background: rgb(var(--gold)); animation: eq 1s var(--ease-io) infinite alternate; }
.is-sound .eq i:nth-child(2) { animation-duration: .74s; animation-delay: -.2s; }
.is-sound .eq i:nth-child(3) { animation-duration: 1.18s; animation-delay: -.5s; }
.is-sound .eq i:nth-child(4) { animation-duration: .86s; animation-delay: -.1s; }
.is-sound .eq i:nth-child(5) { animation-duration: 1.32s; animation-delay: -.7s; }
@keyframes eq { from { transform: scaleY(.18); } to { transform: scaleY(1); } }
.motion-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid rgb(var(--fg) / .16); border-radius: 50%;
  color: rgb(var(--fg) / .7); transition: border-color .4s, color .4s;
}
.motion-toggle:hover { border-color: rgb(var(--fg) / .4); color: rgb(var(--fg)); }
.motion-toggle svg { width: 14px; height: 14px; }
.motion-toggle .i-play { display: none; }
.is-paused .motion-toggle .i-play { display: block; fill: currentColor; stroke: none; }
.is-paused .motion-toggle .i-pause { display: none; }

/* 主视觉 */
.hero { position: relative; z-index: 4; display: flex; align-items: center; padding: 0 var(--gx); min-height: 400px; pointer-events: none; }
.hero a, .hero button { pointer-events: auto; }
.brand { position: relative; z-index: 2; max-width: 52%; padding: 4vh 0 7vh; }
.kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: clamp(20px, 3.2vh, 36px); }
.rec { position: relative; width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--red)); animation: rec 2.8s ease-in-out infinite; }
.rec::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgb(var(--red) / .6); animation: recring 2.8s ease-out infinite; }
@keyframes rec { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes recring { 0% { transform: scale(.4); opacity: .8; } 70%, 100% { transform: scale(1.6); opacity: 0; } }
.kicker-zh { font-size: 13px; letter-spacing: .32em; color: rgb(var(--fg) / .8); }
.kicker-en { font: 500 10px var(--sans); letter-spacing: .3em; color: rgb(var(--fg) / .4); padding-left: 14px; border-left: 1px solid rgb(var(--fg) / .2); }

.title { margin: 0; font-weight: 300; }
.title-main { display: flex; font: 300 clamp(54px, min(8.8vw, 14.6vh), 148px)/1 var(--serif); letter-spacing: .04em; margin-left: -.06em; color: rgb(var(--fg)); }
.ch { display: inline-block; overflow: hidden; padding: .06em 0 .1em; margin: -.06em 0 -.1em; }
.ch > span { display: inline-block; }
.title-sub { display: flex; align-items: center; gap: 18px; margin-top: clamp(14px, 2.2vh, 22px); }
.title-sub .zh { font: 300 clamp(16px, 1.4vw, 20px)/1 var(--serif); letter-spacing: .62em; margin-right: -.62em; color: rgb(var(--fg) / .92); }
.title-sub .rule { width: clamp(36px, 5vw, 72px); height: 1px; background: linear-gradient(90deg, rgb(var(--gold)), rgb(var(--gold) / .1)); margin-left: 12px; }
.title-sub .en { font: 500 11px/1 var(--sans); letter-spacing: .44em; color: rgb(var(--fg) / .62); }
.motto { margin-top: clamp(24px, 4.6vh, 52px); }
.motto-main { font: 300 clamp(17px, 1.4vw, 21px)/1.6 var(--serif); letter-spacing: .22em; color: rgb(var(--fg) / .9); }
.motto-sub { margin-top: 6px; font-size: 12.5px; letter-spacing: .26em; color: rgb(var(--fg) / .48); }

/* 舞台 · 驱动单元 */
:root { --driver: min(57vh, 38vw, 620px); }
.stage { position: absolute; z-index: 1; right: calc(var(--gx) + 4vw); bottom: 30px; width: var(--driver); aspect-ratio: 1; }
.stage-in { position: absolute; inset: 0; }
.aura {
  position: absolute; inset: -34%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgb(var(--tint) / .2), rgb(var(--tint) / .06) 45%, transparent 72%);
  opacity: .5; will-change: opacity;
}
.orbit { position: absolute; inset: -9%; pointer-events: none; transition: opacity .8s var(--ease), transform 1.4s var(--ease); }
.orbit-spin { position: absolute; inset: 0; will-change: transform; }
.orbit-spin svg { width: 100%; height: 100%; overflow: visible; display: block; }
.orbit-spin--text { animation: spin 120s linear infinite; }
.orbit-spin--dial { animation: spin 160s linear infinite reverse; }
.orbit .dial { fill: none; stroke: rgb(var(--fg) / .2); stroke-width: 1; stroke-dasharray: 1 12.3; }
.orbit text { font: 500 10.5px var(--sans); letter-spacing: .3em; fill: rgb(var(--fg) / .42); }
@keyframes spin { to { transform: rotate(360deg); } }
.driver-shadow { position: absolute; left: 6%; right: 6%; bottom: -5%; height: 22%; border-radius: 50%; background: radial-gradient(closest-side, rgb(0 0 0 / .7), transparent); pointer-events: none; }
.driver { position: absolute; inset: 0; transition: opacity .8s var(--ease), transform 1.2s var(--ease); }
.drv { position: absolute; inset: 0; display: block; border-radius: 50%; cursor: pointer; will-change: transform; pointer-events: auto; }
.drv:focus-visible { outline-offset: -6px; border-radius: 50%; }
.drv-base { width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.drv-layer { position: absolute; inset: 0; background: url("../img/driver.webp") center / 100% 100% no-repeat; will-change: transform; pointer-events: none; }
/* 分层：折环外缘羽化并锚定在盆架上，只有内侧随纸盆运动；纸盆与防尘罩整体前后推动 */
.drv-surround { -webkit-mask-image: radial-gradient(36.6% 37.9% at 52.3% 49.5%, #000 72%, transparent 100%); mask-image: radial-gradient(36.6% 37.9% at 52.3% 49.5%, #000 72%, transparent 100%); transform-origin: 52.3% 49.5%; }
.drv-cone { -webkit-mask-image: radial-gradient(30.2% 31.4% at 52.1% 49.5%, #000 92%, transparent 100%); mask-image: radial-gradient(30.2% 31.4% at 52.1% 49.5%, #000 92%, transparent 100%); transform-origin: 52.1% 49.5%; }
.drv-cap { -webkit-mask-image: radial-gradient(13.4% 13.6% at 50.1% 49.4%, #000 94%, transparent 100%); mask-image: radial-gradient(13.4% 13.6% at 50.1% 49.4%, #000 94%, transparent 100%); transform-origin: 50.1% 49.4%; }
.drv-light, .drv-dark { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
.drv-light { background: radial-gradient(28% 28% at 47% 42%, rgb(200 225 255 / .32), transparent 70%); mix-blend-mode: screen; }
.drv-dark { background: radial-gradient(30.2% 31.4% at 52.1% 49.5%, transparent 55%, rgb(0 0 0 / .75) 100%); }
.drv-hint {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%);
  font: 500 9px var(--sans); letter-spacing: .34em; color: rgb(var(--fg) / .0); white-space: nowrap; pointer-events: none;
  transition: color .5s var(--ease);
}
.drv:hover + .drv-hint, .drv:focus-visible + .drv-hint { color: rgb(var(--fg) / .55); }
.site:not([data-mode="idle"]) .driver { opacity: 0; transform: scale(.9); }
.site:not([data-mode="idle"]) .drv { pointer-events: none; }
.site:not([data-mode="idle"]) .orbit { opacity: 0; transform: scale(1.08) rotate(-8deg); }
.site:not([data-mode="idle"]) .driver-shadow { opacity: 0; }

/* 图注 · 引线标注 */
.caption {
  position: absolute; z-index: 3;
  right: calc(var(--gx) + 4vw + var(--driver) + 26px);
  bottom: calc(30px + var(--driver) * .3);
  display: grid; justify-items: end; row-gap: 8px; text-align: right;
  width: max-content; max-width: 30vw;
  text-shadow: 0 0 14px rgb(7 7 8 / .95), 0 0 30px rgb(7 7 8 / .8);
  pointer-events: none;
}
.cap-fig { display: inline-flex; align-items: center; gap: 12px; font: 500 10px var(--sans); letter-spacing: .3em; color: rgb(var(--tint)); }
.cap-fig::after { content: ""; width: 54px; height: 1px; margin-right: -26px; background: linear-gradient(90deg, rgb(var(--tint) / .7), rgb(var(--tint) / 0)); }
.cap-body { display: grid; gap: 5px; justify-items: end; padding-right: 28px; }
.cap-zh { font: 300 17px/1.4 var(--serif); letter-spacing: .2em; margin-right: -.2em; color: rgb(var(--fg) / .92); }
.cap-en { font: 500 9.5px/1.4 var(--sans); letter-spacing: .28em; color: rgb(var(--fg) / .45); }
.cap-count { padding-right: 28px; font: 500 10px var(--sans); letter-spacing: .18em; color: rgb(var(--fg) / .45); font-variant-numeric: tabular-nums; }
.cap-count:empty { display: none; }
.caption.is-swap .cap-body, .caption.is-swap .cap-fig, .caption.is-swap .cap-count { animation: capin .7s var(--ease) both; }
@keyframes capin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 地平线 · 频率刻度 */
.horizon { position: absolute; left: 0; right: 0; bottom: 0; height: 0; z-index: 2; }
.ticks { position: absolute; left: 0; right: 0; top: 0; height: 22px; }
.ticks span { position: absolute; top: 7px; left: calc(var(--f) * 100%); transform: translateX(-50%); font: 500 9px/1 var(--sans); letter-spacing: .08em; color: rgb(var(--fg) / .3); font-variant-numeric: tabular-nums; }
.ticks span::before { content: ""; position: absolute; left: 50%; top: -7px; width: 1px; height: 4px; background: rgb(var(--fg) / .28); }
.ticks .unit::before { display: none; }

/* 四个入口 */
.portals { position: relative; z-index: 5; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px var(--gx) 0; border-top: 1px solid rgb(var(--fg) / .14); }
.portal { position: relative; display: grid; align-content: start; gap: 6px; min-height: 128px; padding: 20px 26px 22px 0; isolation: isolate; }
.portal + .portal { padding-left: 26px; border-left: 1px solid rgb(var(--fg) / .1); }
.portal::before { content: ""; position: absolute; inset: -1px 0 0; z-index: -1; background: linear-gradient(180deg, rgb(var(--tint) / .09), transparent 75%); opacity: 0; transition: opacity .6s var(--ease); }
.p-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.p-no { font: 500 10.5px var(--sans); letter-spacing: .16em; color: rgb(var(--fg) / .45); font-variant-numeric: tabular-nums; transition: color .4s; }
.p-bar { position: relative; flex: 1; height: 1px; background: rgb(var(--fg) / .08); overflow: hidden; }
.p-bar::after { content: ""; position: absolute; inset: 0; background: rgb(var(--tint)); transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease); }
.p-arrow { width: 15px; height: 15px; color: rgb(var(--fg) / .55); transition: transform .5s var(--ease), color .4s; }
.p-zh { font: 300 clamp(22px, 2vw, 30px)/1.15 var(--serif); letter-spacing: .14em; transition: transform .6s var(--ease); }
.p-en { font: 500 10px/1.4 var(--sans); letter-spacing: .3em; color: rgb(var(--fg) / .45); }
.p-desc { margin-top: 6px; font-size: 12px; letter-spacing: .12em; color: rgb(var(--fg) / .5); transition: color .5s var(--ease); }
.portal:hover::before, .portal.is-active::before { opacity: 1; }
.portal:hover .p-bar::after, .portal.is-active .p-bar::after { transform: none; }
.portal:hover .p-no, .portal.is-active .p-no { color: rgb(var(--tint)); }
.portal:hover .p-arrow, .portal.is-active .p-arrow { transform: translate(3px, -3px); color: rgb(var(--fg)); }
.portal:hover .p-zh, .portal.is-active .p-zh { transform: translateX(4px); }
.portal:hover .p-desc, .portal.is-active .p-desc { color: rgb(var(--fg) / .82); }
.portal:active .p-zh { transform: translateX(4px) scale(.985); }

.foot { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px var(--gx) max(20px, env(safe-area-inset-bottom)); font: 400 10.5px/1.5 var(--sans); letter-spacing: .14em; color: rgb(var(--fg) / .38); }
.foot-sep { display: inline-block; width: 1px; height: 9px; margin: 0 12px; vertical-align: -1px; background: rgb(var(--fg) / .22); }
.foot-mid { font-weight: 500; letter-spacing: .5em; color: rgb(var(--fg) / .24); }
.foot-icp { transition: color .3s; }
.foot-icp:hover { color: rgb(var(--fg) / .8); }

.veil { position: fixed; inset: 0; z-index: 70; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .45s var(--ease-io); }
.is-leaving .veil { opacity: 1; }

/* 开场 */
.js .reveal { opacity: 0; transform: translate3d(0, 14px, 0); }
.js .title .ch > span { transform: translate3d(0, 112%, 0); }
.js .stage-in { opacity: 0; transform: scale(.92); }
.is-ready .reveal { opacity: 1; transform: none; transition: opacity 1.1s var(--ease) var(--d, 0s), transform 1.3s var(--ease) var(--d, 0s); }
.is-ready .title .ch > span { transform: none; transition: transform 1.5s var(--ease) calc(.5s + var(--i) * .085s); }
.is-ready .stage-in { opacity: 1; transform: none; transition: opacity 1.6s var(--ease) .3s, transform 2.2s var(--ease) .3s; }
.no-intro .reveal, .no-intro .title .ch > span, .no-intro .stage-in { transition: none !important; }

.is-paused .grain, .is-paused .orbit-spin, .is-paused .rec, .is-paused .rec::after { animation-play-state: paused; }

/* 响应式 */
@media (max-width: 1180px) {
  :root { --driver: min(50vh, 42vw, 540px); }
  .brand { max-width: 56%; }
  .kicker-en { display: none; }
  .caption { bottom: 40px; }
  .portal { padding-right: 18px; min-height: 112px; }
  .portal + .portal { padding-left: 18px; }
  .p-desc { display: none; }
}
@media (max-width: 960px) { .foot-mid { display: none; } }
@media (max-height: 760px) and (min-width: 761px) {
  .motto-sub { display: none; }
  .portal { min-height: 104px; padding-top: 16px; padding-bottom: 14px; }
  .p-desc { display: none; }
  .p-top { margin-bottom: 8px; }
}

@media (max-width: 760px), (max-width: 1100px) and (max-aspect-ratio: 5/6) {
  :root { --gx: 18px; --driver: min(68vw, 30svh, 330px); }
  .top { padding-top: max(16px, env(safe-area-inset-top)); }
  .top .lockup-name { display: none; }
  .top .lockup-logo { height: 46px; }
  .top-actions { gap: 6px; }
  .sound-label { display: none; }
  .sound-toggle { height: 34px; padding: 0 12px; gap: 8px; }
  .motion-toggle { width: 34px; height: 34px; }
  .hero { flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: 0; padding-top: clamp(14px, 2.6svh, 32px); }
  .brand { max-width: none; padding: 0; text-align: center; }
  .kicker { justify-content: center; margin-bottom: 14px; }
  .kicker-zh { font-size: 11.5px; letter-spacing: .26em; }
  .title-main { justify-content: center; margin-left: .04em; font-size: clamp(48px, 16vw, 84px); }
  .title-sub { justify-content: center; gap: 12px; margin-top: 12px; }
  .title-sub .zh { font-size: 15px; letter-spacing: .5em; margin-right: -.5em; }
  .title-sub .rule { width: 24px; margin-left: 8px; }
  .title-sub .en { font-size: 9.5px; letter-spacing: .32em; }
  .motto { margin-top: 14px; }
  .motto-main { font-size: 14px; letter-spacing: .2em; }
  .motto-sub { display: none; }
  .stage { position: relative; right: auto; bottom: auto; margin: clamp(20px, 3.4svh, 36px) auto clamp(8px, 1.6svh, 16px); flex: none; }
  .caption { display: none; }
  .horizon { position: relative; height: 22px; flex: none; margin: 0 calc(-1 * var(--gx)); }
  .ticks span { font-size: 8px; }
  .ticks span:nth-child(3), .ticks span:nth-child(6) { display: none; }
  .scene--product { width: 100%; top: 18%; bottom: 22%;
    -webkit-mask-image: radial-gradient(50% 50% at 50% 50%, #000 40%, transparent 100%);
            mask-image: radial-gradient(50% 50% at 50% 50%, #000 40%, transparent 100%); }
  .shade { background: linear-gradient(180deg, rgb(7 7 8 / .7) 0%, rgb(7 7 8 / .2) 40%, rgb(7 7 8 / .3) 62%, rgb(7 7 8 / .92) 82%, var(--bg) 100%); }
  .portals { grid-template-columns: 1fr 1fr; margin-top: 8px; }
  .portal { min-height: 0; padding: 14px 12px 16px 0; gap: 3px; }
  .portal + .portal { padding-left: 0; border-left: 0; }
  .portal:nth-child(even) { padding-left: 16px; border-left: 1px solid rgb(var(--fg) / .1); }
  .portal:nth-child(n+3) { border-top: 1px solid rgb(var(--fg) / .1); }
  .p-top { margin-bottom: 6px; gap: 10px; }
  .p-zh { font-size: 21px; letter-spacing: .12em; }
  .p-en { font-size: 8.5px; letter-spacing: .24em; }
  .p-desc { display: none; }
  .foot { flex-direction: column; align-items: center; gap: 2px; padding-top: 14px; font-size: 9.5px; text-align: center; }
}
@media (min-width: 761px) and (max-width: 1100px) and (max-aspect-ratio: 5/6) {
  :root { --gx: 40px; --driver: min(56vw, 31svh, 540px); }
  .top .lockup-name { display: grid; }
  .top .lockup-logo { height: 54px; }
  .sound-label { display: inline; }
  .sound-toggle { height: 38px; }
  .motion-toggle { width: 38px; height: 38px; }
  .hero { padding-top: clamp(24px, 3.4svh, 64px); }
  .kicker { margin-bottom: 22px; }
  .kicker-zh { font-size: 13px; }
  .title-main { font-size: clamp(88px, 14.5vw, 150px); }
  .title-sub .zh { font-size: 20px; }
  .title-sub .en { font-size: 11px; }
  .motto { margin-top: 24px; }
  .motto-main { font-size: 18px; }
  .p-zh { font-size: 28px; }
  .p-en { font-size: 10px; }
  .portal { padding: 20px 20px 22px 0; }
  .portal:nth-child(even) { padding-left: 24px; }
  .foot { font-size: 10.5px; }
}
