:root {
  --bg: #111110;
  --panel: rgba(21, 21, 20, 0.92);
  --panel-2: #1c1c1a;
  --ink: #ebe7dd;
  --ink-2: rgba(235, 231, 221, 0.82);
  --mute: #958f85;
  --line: rgba(232, 228, 218, 0.18);
  --faint: rgba(232, 228, 218, 0.09);
  --amber: #f0b040;
  --amber-soft: rgba(240, 176, 64, 0.14);
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, "Noto Sans TC", monospace;
  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --halo: 0 0 12px var(--bg), 0 0 4px var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); overflow-x: clip; scrollbar-color: #3a3936 var(--bg); scrollbar-width: thin; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.8 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--amber); outline-offset: 4px; }
::selection { background: var(--amber); color: var(--bg); }
.mono { font-family: var(--mono); font-weight: 400; letter-spacing: 0.04em; }
.dot { width: 7px; height: 7px; background: var(--amber); display: inline-block; flex: none; }

/* ---------- 背景（在機器後面） ---------- */
#field { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100vh; height: 100lvh; display: block; }

/* ---------- 機器 ---------- */
#machine {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100vh; height: 100lvh;
  display: block; opacity: 0; transition: opacity 0.9s ease;
}
.machine-ready #machine { opacity: 1; }
main { position: relative; z-index: 1; overflow-x: clip; }
.dial-hover main { cursor: pointer; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px; border-radius: 6px;
  font: 500 15px/1.2 var(--sans); letter-spacing: 0.04em; white-space: nowrap;
  color: #15130f; background: var(--amber); border: 1px solid var(--amber);
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s;
}
.btn:hover { background: #ffc661; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-ghost { color: var(--ink); background: var(--panel); border-color: var(--line); }
.btn-ghost:hover { background: var(--panel-2); border-color: rgba(232, 228, 218, 0.4); }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }

/* ---------- 導覽 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 58px; padding: 0 var(--pad);
  font: 400 14px/1 var(--sans);
  background: rgba(17, 17, 16, 0.9);
  border-bottom: 1px solid var(--line);
}
.nav-name { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; }
.nav-name .dot { animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); }
.nav-links a:not(.btn) { position: relative; padding: 8px 0; color: var(--mute); letter-spacing: 0.1em; white-space: nowrap; transition: color 0.2s; }
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--amber);
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.nav-links a:not(.btn):hover, .nav-links a.on:not(.btn) { color: var(--ink); }
.nav-links a.on:not(.btn)::after { transform: scaleX(1); }

/* ---------- 欄寬：內容只佔左側，右側留給轉盤 ---------- */
.col { width: min(100%, 640px, 45vw); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  padding: 0 var(--pad);
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden; overflow: clip;
}
.hero-main { position: relative; padding-top: 58px; width: min(100%, 56vw); transform-origin: 0% 60%; }
.chip-link {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 13px; margin-bottom: clamp(18px, 3vh, 30px);
  font-size: 12px; line-height: 1.2; text-transform: uppercase; white-space: nowrap; color: var(--ink-2);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}
.chip-link:hover { border-color: var(--amber); color: var(--ink); }
.chip-link .sep { color: var(--mute); }
.chip-link .chev { color: var(--amber); }
.hero-title { font: 700 clamp(54px, 8.6vw, 128px)/1.1 var(--sans); letter-spacing: -0.01em; }
.line { display: block; overflow: hidden; padding: 0.04em 0 0.1em; margin: -0.04em 0 -0.1em; }
.line-in { display: inline-block; white-space: nowrap; }
.hero-en { margin-top: clamp(16px, 2.4vh, 26px); font-size: clamp(12px, 1.05vw, 15px); line-height: 1.4; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); }
.hero-meta { margin-top: 8px; font-size: 14.5px; color: var(--mute); letter-spacing: 0.06em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(24px, 4vh, 40px); }

/* ---------- 輸送帶 ---------- */
.band {
  position: relative; padding: 20px 0; display: grid; gap: 12px; overflow: hidden;
  background: rgba(17, 17, 16, 0.94);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.mq { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.mq-track { display: flex; gap: 10px; width: max-content; padding-right: 10px; will-change: transform; }
.tagchip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 13px; border-radius: 5px;
  font: 400 12.5px/1.2 var(--mono); letter-spacing: 0.04em; white-space: nowrap; color: var(--ink-2);
  background: var(--panel-2); border: 1px solid var(--faint);
}
.tagchip i { width: 5px; height: 5px; background: var(--mute); }
.tagchip.hot { border-color: rgba(240, 176, 64, 0.45); color: var(--ink); }
.tagchip.hot i { background: var(--amber); }

/* ---------- 章節共用 ---------- */
.sec {
  position: relative;
  min-height: 100vh;
  padding: clamp(110px, 17vh, 170px) var(--pad) clamp(130px, 19vh, 200px);
  display: flex; align-items: center;
  text-shadow: var(--halo);
}
.sec-head { margin-bottom: clamp(24px, 4vh, 42px); }
.eyebrow { display: flex; align-items: center; gap: 12px; font-size: 12px; line-height: 1.2; text-transform: uppercase; letter-spacing: 0.14em; color: var(--amber); margin-bottom: 16px; }
.eyebrow i { width: 34px; height: 1px; background: var(--amber); opacity: 0.6; }
.sec-title { font: 700 clamp(40px, 4.6vw, 68px)/1.15 var(--sans); letter-spacing: 0.01em; }
.lead { font: 400 clamp(16.5px, 1.3vw, 19px)/1.95 var(--sans); color: var(--ink-2); text-wrap: pretty; }

/* ---------- 01 近況 ---------- */
.now-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: clamp(30px, 5vh, 48px); }
.now-col { padding: 16px 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; text-shadow: none; }
.now-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--faint); font-weight: 700; font-size: 14.5px; }
.now-label .mono { font-size: 10px; color: var(--amber); letter-spacing: 0.12em; text-transform: uppercase; }
.now-col li { position: relative; padding-left: 14px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.now-col li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 5px; height: 5px; background: var(--mute); }
.now-col li + li { margin-top: 8px; }

/* ---------- 02 影片 ---------- */
.reel-list { display: grid; gap: 20px; }
.reel-card { margin: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; text-shadow: none; transition: border-color 0.25s; }
.reel-card:hover { border-color: rgba(240, 176, 64, 0.55); }
.reel-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.reel-frame video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; background: #000; }
.reel-cap { padding: 13px 16px 15px; }
.reel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.reel-idx { font-size: 11.5px; color: var(--amber); }
.reel-title { flex: 1; font: 700 18px/1.4 var(--sans); letter-spacing: 0.02em; }
.reel-meta { font-size: 11px; color: var(--mute); white-space: nowrap; }
.reel-note { margin-top: 5px; font-size: 13.5px; line-height: 1.7; color: var(--mute); }

/* ---------- 03 工作 ---------- */
.work-row { position: relative; }
.work-link { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 14px; align-items: start; padding: 22px 12px 24px 0; border-radius: 6px; }
.w-rule { position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line); transform-origin: left; }
.work-row:last-child .work-link::after, .log-item:last-child::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
.w-idx { font: 400 12px/1 var(--mono); color: var(--mute); padding-top: 0.75em; }
.w-title { font: 700 clamp(20px, 1.9vw, 26px)/1.4 var(--sans); letter-spacing: 0.02em; transition: color 0.2s; }
.w-sum { margin-top: 6px; font-size: 14px; line-height: 1.75; color: var(--mute); }
.w-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 11px; color: var(--ink-2); }
.w-tags span { padding: 3px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); text-shadow: none; }
.w-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 0.45em; font-size: 11.5px; color: var(--mute); white-space: nowrap; }
.w-status { display: inline-flex; align-items: center; gap: 8px; padding: 4px 9px; border-radius: 4px; font-size: 12px; color: var(--ink); background: var(--panel); border: 1px solid rgba(240, 176, 64, 0.45); text-shadow: none; }
.w-status .dot { width: 6px; height: 6px; border-radius: 50%; }
.w-thumb { display: none; }
@media (hover: hover) and (pointer: fine) {
  .work-link { transition: background 0.25s, padding-left 0.35s var(--ease); }
  .work-row:hover .work-link { background: var(--amber-soft); padding-left: 12px; }
  .work-row:hover .w-title, .work-row:hover .w-idx { color: var(--amber); }
}

.preview {
  position: fixed; top: 0; left: 0; z-index: 20;
  width: clamp(260px, 24vw, 340px); aspect-ratio: 72 / 46;
  pointer-events: none; overflow: hidden; border-radius: 8px;
  border: 1px solid rgba(240, 176, 64, 0.55); background: var(--bg);
  opacity: 0; transform-origin: 0 50%; clip-path: inset(0 100% 0 0 round 8px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transition: clip-path 0.45s var(--ease), opacity 0.2s;
}
.preview.on { opacity: 1; clip-path: inset(0 0 0 0 round 8px); }
.preview canvas, .preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.preview img { display: none; }
.preview.has-img img { display: block; }
.preview.has-img canvas { display: none; }

/* ---------- 03 探索 ---------- */
.lab-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.lab-card {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 196px; padding: 16px 18px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  text-shadow: none; transition: border-color 0.25s, transform 0.3s var(--ease);
}
.lab-card:hover { border-color: rgba(240, 176, 64, 0.55); transform: translateY(-2px); }
.lab-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11px; color: var(--mute); }
.lab-status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.lab-status .dot { width: 6px; height: 6px; border-radius: 50%; }
.lab-title { font: 700 19px/1.4 var(--sans); letter-spacing: 0.02em; margin-top: 4px; }
.lab-note { flex: 1; font-size: 13.5px; line-height: 1.75; color: var(--mute); }
.lab-bar { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.bar { position: relative; flex: 1; height: 9px; background: repeating-linear-gradient(90deg, rgba(232, 228, 218, 0.14) 0 4px, transparent 4px 6px); }
.bar i { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, var(--amber) 0 4px, transparent 4px 6px); clip-path: inset(0 calc(100% - var(--p, 0) * 100%) 0 0); }
.pct { font: 500 12px/1 var(--mono); min-width: 3em; text-align: right; color: var(--ink); }

/* ---------- 04 消息 ---------- */
.log-item { position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 18px; padding: 20px 0 22px; }
.log-when { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding-top: 4px; }
.log-when time { font-size: 12px; color: var(--mute); }
.tag { font: 400 11.5px/1.2 var(--sans); padding: 4px 8px; border-radius: 4px; color: var(--amber); border: 1px solid rgba(240, 176, 64, 0.45); background: var(--panel); text-shadow: none; }
.log-body h3 { font: 700 17px/1.5 var(--sans); letter-spacing: 0.02em; }
.log-body h3 a { border-bottom: 1px solid rgba(240, 176, 64, 0.5); transition: color 0.2s; }
.log-body h3 a:hover { color: var(--amber); }
.log-body p { margin-top: 6px; font-size: 14px; line-height: 1.75; color: var(--mute); }

/* ---------- 05 聯絡 ---------- */
.contact-line { font-size: clamp(38px, 4.4vw, 64px); }
.contact-links { display: grid; gap: 10px; margin-top: clamp(26px, 4vh, 40px); text-shadow: none; }
.contact-links a {
  display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line);
  transition: border-color 0.25s, background 0.25s, transform 0.3s var(--ease);
}
.contact-links a:hover { border-color: var(--amber); background: var(--panel-2); transform: translateX(4px); }
.c-label { font: 400 11px/1.2 var(--mono); color: var(--amber); letter-spacing: 0.12em; text-transform: uppercase; }
.c-val { font-size: 15.5px; overflow-wrap: anywhere; }
.c-arr { color: var(--mute); transition: transform 0.3s var(--ease), color 0.2s; }
.contact-links a:hover .c-arr { color: var(--amber); transform: translate(3px, -3px); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: clamp(40px, 7vh, 72px); padding-top: 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--mute); }
.foot a:hover { color: var(--amber); }

/* ---------- 窄螢幕：轉盤退到背景，內容佔滿 ---------- */
@media (max-width: 859px) {
  .col, .hero-main { width: 100%; }
  .hero { justify-content: flex-end; }
  .hero-main { padding-bottom: 72px; }
}
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .nav { height: 54px; }
  .nav-name span[data-bind] { display: none; }
  .nav-links { gap: 14px; font-size: 13.5px; }
  .nav-links a:not(.btn) { letter-spacing: 0.04em; }
  .btn-sm { padding: 6px 11px; font-size: 13px; }
  .chip-link { font-size: 10.5px; gap: 8px; padding: 6px 11px; }
  .sec { padding-top: 96px; padding-bottom: 110px; min-height: 100svh; }
  .now-cols { grid-template-columns: 1fr; }
  .work-link { grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; padding-right: 0; }
  .w-meta { grid-column: 2; flex-direction: row; align-items: center; gap: 12px; padding-top: 14px; }
  .w-thumb { display: block; grid-column: 1 / -1; width: 100%; margin-top: 16px; aspect-ratio: 16 / 7; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
  .lab-grid { grid-template-columns: 1fr; }
  .lab-card { min-height: 0; }
  .log-item { grid-template-columns: 1fr; row-gap: 10px; }
  .log-when { flex-direction: row; align-items: center; gap: 12px; padding-top: 0; }
  .contact-links a { grid-template-columns: 84px minmax(0, 1fr) auto; }
  .preview { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #machine { transition: none; }
  .nav-name .dot { animation: none; }
}
