:root {
  --night: #0b1230;
  --night-2: #070b22;
  --blue: #1e90ff;
  --ice: #e6ecf7;
  --muted: #8f9bbd;
  --line: rgba(230, 236, 247, .12);
  --display: 'Anton', 'Noto Sans TC', sans-serif;
  --body: 'Noto Sans TC', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night-2); color-scheme: dark; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--night-2);
  color: var(--ice);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
em { font-style: normal; }

/* 底片顆粒 */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -2%); } 80% { transform: translate(3%, 3%); }
}

/* ===== NAV ===== */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  pointer-events: none;
  transition: transform .5s var(--ease), opacity .5s;
}
.nav > * { pointer-events: auto; }
.nav.is-hidden:not(:focus-within) { transform: translateY(-120%); opacity: 0; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 20px; letter-spacing: .08em; }
.nav-brand img { border-radius: 8px; }
.nav-menu {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px 10px 18px; border-radius: 999px; cursor: pointer;
  background: rgba(11, 18, 48, .55); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-weight: 700; font-size: 14px; letter-spacing: .04em;
  transition: background .3s, border-color .3s;
}
.nav-menu:hover { background: rgba(30, 144, 255, .25); border-color: rgba(30, 144, 255, .6); }
.nav-count {
  display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px;
  border-radius: 999px; background: var(--blue); color: #fff; font-family: var(--mono); font-size: 12px;
}

/* ===== HERO ===== */
.hero { position: relative; height: 420vh; }
.hero-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--night-2); }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 50% 55%; will-change: transform; }
.hero-mask { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-cover { fill: var(--night-2); }
.hero-word { font-family: 'Anton', sans-serif; letter-spacing: .02em; }
.hero-outline {
  fill: none; stroke: rgba(230, 236, 247, .85); stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2400; stroke-dashoffset: 2400;
  filter: drop-shadow(0 0 12px rgba(30, 144, 255, .7));
}
.hero-tagline {
  position: absolute; left: 50%; bottom: 14vh; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; opacity: 0; width: max-content; max-width: calc(100% - 32px);
}
.hero-logo { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 0 40px rgba(30, 144, 255, .45); }
.hero-tagline p { margin: 0; font-size: clamp(13px, 1.4vw, 16px); letter-spacing: .3em; color: var(--muted); font-weight: 500; }
.hero-tagline .dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); vertical-align: middle; margin: 0 .6em; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 4vh; width: 22px; height: 36px; margin-left: -11px;
  border: 1.5px solid rgba(230, 236, 247, .4); border-radius: 12px; opacity: 0;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px;
  border-radius: 2px; background: var(--ice); animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80%, 100% { transform: translateY(14px); opacity: 0; } }

.hero-statement {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 0 var(--gutter);
  text-align: center; opacity: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(7, 11, 34, .62), transparent);
  background-size: min(1100px, 120vw) min(520px, 60vh); background-position: center; background-repeat: no-repeat;
}
.hero-statement h1 {
  margin: 0; font-weight: 900; line-height: 1.15; letter-spacing: .02em;
  font-size: clamp(34px, 7vw, 104px);
  text-shadow: 0 6px 40px rgba(7, 11, 34, .55);
}
.hero-statement em {
  color: #ff5c97;
  text-shadow: 0 0 28px rgba(255, 77, 141, .55), 0 6px 40px rgba(7, 11, 34, .55);
}

/* ===== CHAPTERS ===== */
.chapter { position: relative; --a1: #fff; --a2: #fff; }
.chapter-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.chapter-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 70% at 85% 30%, color-mix(in srgb, var(--a1) 22%, transparent), transparent 70%),
    radial-gradient(50% 60% at 10% 90%, color-mix(in srgb, var(--a2) 18%, transparent), transparent 70%),
    var(--night-2);
}
.chapter-bg::after {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.track { position: relative; display: flex; align-items: center; gap: 4vw; padding: 0 var(--gutter); will-change: transform; }

.chapter-title { flex: 0 0 auto; width: min(52vw, 760px); padding-right: 2vw; }
.chapter-no {
  font-family: var(--display); font-size: clamp(120px, 22vw, 340px); line-height: .8;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--a1) 70%, transparent);
  display: block;
}
.chapter-title h2 {
  margin: .1em 0 .15em; font-size: clamp(44px, 7.2vw, 120px); font-weight: 900; line-height: 1; letter-spacing: .02em;
  color: var(--ice);
  text-shadow: 0 0 40px color-mix(in srgb, var(--a1) 45%, transparent);
}
.chapter-en { font-family: var(--mono); font-size: 14px; letter-spacing: .5em; color: var(--muted); }
.chapter-title .reveal { display: block; overflow: hidden; }
.chapter-title .reveal > * { transform: translateY(105%); transition: transform 1.1s var(--ease); }
.chapter.in .chapter-title .reveal > * { transform: none; }
.chapter.in .chapter-title .reveal:nth-child(2) > * { transition-delay: .08s; }
.chapter.in .chapter-title .reveal:nth-child(3) > * { transition-delay: .16s; }

/* ===== CARD ===== */
.card {
  --c1: var(--a1); --c2: var(--a2);
  position: relative; flex: 0 0 auto; display: block;
  width: min(74vw, 1080px); height: min(74vh, 720px);
  border-radius: 28px; overflow: hidden; text-decoration: none; isolation: isolate;
  background: var(--night);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .08);
  will-change: transform;
}
.card-art {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(70% 90% at 75% 20%, color-mix(in srgb, var(--c1) 85%, transparent), transparent 65%),
    radial-gradient(60% 80% at 100% 100%, color-mix(in srgb, var(--c2) 80%, transparent), transparent 70%),
    linear-gradient(160deg, #141d4a, var(--night-2));
  transition: transform 1.2s var(--ease);
}
.card:hover .card-art { transform: scale(1.04); }
.card-ghost {
  position: absolute; top: 6%; left: 0; white-space: nowrap;
  font-family: var(--display); font-size: clamp(90px, 15vw, 230px); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .28);
  will-change: transform;
}
.card-icon {
  position: absolute; right: 8%; top: 50%; width: clamp(160px, 26vw, 380px); aspect-ratio: 1;
  margin-top: calc(clamp(160px, 26vw, 380px) / -2);
  display: grid; place-items: center; will-change: transform;
}
.card-icon svg {
  width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: .9; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--c1) 90%, transparent)) drop-shadow(0 20px 40px rgba(0, 0, 0, .4));
  animation: float 6s ease-in-out infinite;
}
.card-icon::before {
  content: ''; position: absolute; inset: 8%; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 0 0 28px rgba(255, 255, 255, .03), 0 0 0 64px rgba(255, 255, 255, .02);
}
@keyframes float { 50% { transform: translateY(-14px) rotate(-3deg); } }

.card-info {
  position: absolute; left: 0; bottom: 0; width: 100%;
  padding: clamp(24px, 3.4vw, 52px);
  background: linear-gradient(to top, rgba(7, 11, 34, .92), rgba(7, 11, 34, .6) 60%, transparent);
}
.card-meta { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; color: rgba(230, 236, 247, .7); }
.card-meta .bar { width: 36px; height: 2px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.card-name { margin: 14px 0 10px; font-size: clamp(32px, 4.4vw, 68px); font-weight: 900; line-height: 1.05; letter-spacing: .02em; max-width: 14ch; }
.card-desc { margin: 0; max-width: 34em; font-size: clamp(14px, 1.15vw, 17px); line-height: 1.7; color: rgba(230, 236, 247, .82); }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); }
.tag--slow { border-color: color-mix(in srgb, #ffd36e 60%, transparent); color: #ffe3a3; }
.card-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 15px;
  background: #fff; color: var(--night-2);
  transition: gap .4s var(--ease), background .3s, color .3s;
}
.card-cta .arr { transition: transform .4s var(--ease); }
.card:hover .card-cta, .card:focus-visible .card-cta { background: linear-gradient(90deg, var(--c1), var(--c2)); color: #fff; gap: 14px; }
.card:hover .card-cta .arr { transform: translate(2px, -2px); }
.card:focus-visible { outline-offset: 6px; border-radius: 28px; }

.track-end { flex: 0 0 8vw; height: 1px; }

/* ===== OUTRO ===== */
.outro { position: relative; padding: 18vh 0 14vh; overflow: hidden; background: radial-gradient(70% 60% at 50% 100%, rgba(30, 144, 255, .18), transparent 70%), var(--night-2); }
.marquee { overflow: hidden; white-space: nowrap; padding: 6px 0; }
.marquee-track { display: inline-flex; gap: .6em; will-change: transform; font-family: var(--display); font-size: clamp(56px, 10vw, 150px); line-height: 1.05; }
.marquee-track span { color: transparent; -webkit-text-stroke: 1.2px rgba(230, 236, 247, .3); }
.marquee-track span:nth-child(3n+1) { color: var(--ice); -webkit-text-stroke: 0; }
.marquee--alt .marquee-track span:nth-child(3n+1) { color: transparent; -webkit-text-stroke: 1.2px rgba(30, 144, 255, .7); }
.marquee-track i { font-style: normal; color: var(--blue); }
.outro-body { display: flex; flex-direction: column; align-items: center; gap: 32px; margin-top: 12vh; padding: 0 var(--gutter); text-align: center; }
.outro-body h2 { margin: 0; font-size: clamp(36px, 6vw, 88px); font-weight: 900; }
.outro-body h2 em { color: var(--blue); }
.btn-top {
  padding: 14px 26px; border-radius: 999px; text-decoration: none; font-weight: 700;
  border: 1px solid var(--line); transition: background .3s, border-color .3s;
}
.btn-top:hover { background: rgba(30, 144, 255, .2); border-color: var(--blue); }
.footer { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px var(--gutter) 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.footer img { border-radius: 6px; }

/* ===== MENU ===== */
.menu {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0;
  border: 0; background: rgba(7, 11, 34, .94); color: var(--ice);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  overflow-y: auto; overscroll-behavior: contain;
}
.menu::backdrop { background: transparent; }
.menu[open] { animation: menuIn .5s var(--ease); }
@keyframes menuIn { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0); } }
.menu-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px var(--gutter); background: linear-gradient(var(--night-2) 60%, transparent); }
.menu-title { font-family: var(--mono); font-size: 13px; letter-spacing: .3em; color: var(--muted); }
.menu-close { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 16px; transition: background .3s, transform .4s var(--ease); }
.menu-close:hover { background: rgba(255, 255, 255, .08); transform: rotate(90deg); }
.menu-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px clamp(24px, 4vw, 64px); padding: 8px var(--gutter) 64px; }
.menu-group h3 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; }
.menu-group h3 span { font-family: var(--display); font-size: 28px; color: var(--a1); }
.menu-link {
  --a1: var(--blue);
  position: relative; display: flex; align-items: center; gap: 16px; padding: 16px 4px; text-decoration: none;
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.menu-link::before {
  content: ''; position: absolute; inset: 0; z-index: -1; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, color-mix(in srgb, var(--a1) 30%, transparent), transparent);
  transition: transform .5s var(--ease);
}
.menu-link:hover::before, .menu-link:focus-visible::before { transform: scaleX(1); }
.menu-link svg { flex: 0 0 auto; width: 26px; height: 26px; fill: none; stroke: var(--a1); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.menu-link b { font-size: clamp(18px, 2vw, 22px); font-weight: 700; }
.menu-link small { font-family: var(--mono); font-size: 11px; letter-spacing: .15em; color: var(--muted); }
.menu-link .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menu-link .go { margin-left: auto; transition: transform .4s var(--ease); }
.menu-link:hover .go { transform: translate(3px, -3px); }

.noscript-list { padding: 120px var(--gutter); line-height: 2.2; font-size: 20px; }

/* ===== 手機／平板：直向卡片 ===== */
@media (max-width: 899px) {
  .chapter-pin { position: relative; height: auto; overflow: visible; display: block; padding: 18vh 0 10vh; }
  .chapter-bg { position: absolute; }
  .track { flex-direction: column; align-items: stretch; gap: 28px; transform: none !important; }
  .chapter-title { width: 100%; padding: 0 0 4vh; }
  .chapter-no { font-size: clamp(110px, 34vw, 200px); }
  .card { width: 100%; height: auto; min-height: 0; aspect-ratio: auto; display: flex; flex-direction: column; transform: none !important; }
  .card-visual { position: relative; height: 52vw; min-height: 220px; max-height: 360px; }
  .card-ghost { top: 10%; font-size: 26vw; }
  .card-icon { right: 50%; margin-right: calc(clamp(140px, 42vw, 240px) / -2); width: clamp(140px, 42vw, 240px); margin-top: calc(clamp(140px, 42vw, 240px) / -2); }
  .card-info { position: relative; background: linear-gradient(to top, var(--night-2), rgba(7, 11, 34, .85)); }
  .card-name { max-width: none; }
  .card-cta { width: 100%; justify-content: center; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .card { opacity: 0; translate: 0 60px; transition: opacity .9s var(--ease), translate 1s var(--ease); }
  .card.in { opacity: 1; translate: 0 0; }
  .track-end { display: none; }
}
@media (min-width: 900px) {
  .card-visual { position: absolute; inset: 0; }
}

/* ===== 減少動態效果 ===== */
.rm .hero { height: 100vh; height: 100svh; }
.rm .hero-cover { opacity: .55; }
.rm .hero-outline { stroke-dashoffset: 0; }
.rm .grain, .rm .card-icon svg, .rm .scroll-cue span { animation: none; }
.rm .chapter-title .reveal > * { transform: none; transition: none; }
.rm .card { opacity: 1; translate: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
