/* ============================================================
   CEO AI Lab — nk.studio 風格（Hero POC v0）
   ------------------------------------------------------------
   設計決策：
   - 保留 Lab 的 Void #05070a 底色，但品牌主色從 --neon #00e5c7
     換成 nk.studio 的綠色霓虹 #00e5c7（搭配 --neon-bright #d9fff7）
   - 字型：Latin 走 DM Sans（nk.studio 同款），CJK 走 Noto Sans TC
   - 視覺手法：固定 3D WebGL 場景底圖 + 大字排版 + 圓角膠囊 CTA + glow
   - 不破壞其他區塊，只覆寫 Hero 區
   ============================================================ */

/* ---------- 設計 token 覆寫（nk.studio 風格）---------- */
:root {
  --neon:        #00e5c7;
  --neon-bright: #d9fff7;
  --neon-deep:   #023b34;
  --neon-glow:   rgba(0, 229, 199, 0.46);
  --neon-dim:    rgba(0, 229, 199, 0.14);

  --lab-void:    #090d12;
  --lab-carbon:  #171b18;
  --lab-slate:   #202522;
  --lab-steel:   #303632;
  --lab-white:   #e8f1f0;
  --lab-mute:    #9b9f98;
  --lab-faint:   rgba(232, 241, 240, 0.58);

  --font-display: 'Space Grotesk', 'PingFang TC', 'Microsoft JhengHei', -apple-system, 'Segoe UI', sans-serif;
  --font-sans:    'DM Sans', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* 從 nk.studio 學到的過場曲線 */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-emph:   cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:    200ms;
  --dur-base:    420ms;
  --dur-slow:    800ms;

  /* nk.studio 用的側邊 nav 高度 */
  --nk-nav-h: 64px;
}

/* ============================================================
   全站 3D Matrix 背景層
   ------------------------------------------------------------
   canvas 固定在視窗底層，內容全部墊在它上面（z-index: 1）。
   .nk-bg-scan 補上 WebGL 不做的後製：CRT 掃描線 + 暗角。
   ============================================================ */
.nk-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--lab-void);
  overflow: hidden;
}

#nk-webgl {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
}
.nk-bg.is-live #nk-webgl { opacity: 1; }

/* 掃描線用 3px 週期：2px 的話在 2x 螢幕上會跟像素格打架長出摩爾紋 */
.nk-bg-scan {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 0 2px,
      rgba(0, 0, 0, 0.16) 2px 3px
    ),
    radial-gradient(
      ellipse 125% 85% at 50% 42%,
      transparent 28%,
      rgba(5, 7, 10, 0.45) 72%,
      rgba(5, 7, 10, 0.88) 100%
    );
}

/* 內容層一律墊高，避免被背景吃掉 */
main,
.site-footer,
.formula-bar {
  position: relative;
  z-index: 1;
}

/* 首頁：hero 完全透空看見數字雨，往下逐漸罩上底色讓長文可讀 */
main.is-immersive {
  background: linear-gradient(
    180deg,
    transparent 0,
    transparent 88vh,
    rgba(5, 7, 10, 0.72) 118vh,
    rgba(5, 7, 10, 0.92) 160vh,
    rgba(5, 7, 10, 0.92) 100%
  );
}

/* 內頁：整片壓一層底，背景只當底紋 */
main:not(.is-immersive) {
  background: rgba(5, 7, 10, 0.86);
}

/* ============================================================
   側邊導覽列（取代原本的水平 header）
   ============================================================ */
.site-header.nk-side-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  height: var(--nk-nav-h);
  background: transparent;
  border: 0;
  backdrop-filter: none;
  transition:
    background var(--dur-base) var(--ease-out),
    backdrop-filter var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
  pointer-events: none;  /* 子元素自己設 pointer-events: auto */
}

/* 向下捲時收起（規格書 §v1.1 的三態狀態機，由 app.js 的 initHeader 控制） */
.site-header.nk-side-nav[data-state="hidden"] {
  transform: translateY(-110%);
}

.site-header.nk-side-nav.is-pinned,
.site-header.nk-side-nav[data-state="pinned"] {
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(232, 241, 240, 0.08);
}

.nk-sidenav-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 4rem);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  pointer-events: auto;
}

/* logo */
.nk-sidenav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--lab-white);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
  transition: color var(--dur-fast) var(--ease-out);
}
.nk-sidenav-logo:hover { color: var(--neon-bright); }
.nk-sidenav-logo .logo-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 14px var(--neon-glow);
  transform: translateY(-1px);
}
.nk-sidenav-logo-text { font-weight: 500; }

/* 中央條目 */
.nk-sidenav-list {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 1.6vw, 1.2rem);
  justify-self: end;
  margin-right: clamp(0.5rem, 1.5vw, 1.2rem);
}
.nk-sidenav-list a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.6rem;
  color: var(--lab-faint);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.nk-sidenav-list a:hover,
.nk-sidenav-list a.is-active {
  color: var(--lab-white);
}
.nk-sidenav-list a.is-active .nk-slash {
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon-glow);
}

/* 綠色斜線 marker（nk.studio 招牌） */
.nk-slash {
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--neon);
  box-shadow: 0 0 8px var(--neon-glow);
  transform: skewX(-18deg);
  border-radius: 1px;
  transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.nk-sidenav-list a:hover .nk-slash {
  background: var(--neon-bright);
  box-shadow: 0 0 12px var(--neon-bright);
}

/* 右側 actions */
.nk-sidenav-actions {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.6rem, 1.4vw, 1.2rem);
}

.nk-lang-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  color: var(--lab-faint);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(232, 241, 240, 0.18);
  border-radius: 999px;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.nk-lang-toggle:hover {
  color: var(--neon);
  border-color: var(--neon);
}

.nk-cta-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem 0.5rem 1.3rem;
  background: var(--neon);
  color: #041819;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 999px;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  box-shadow: 0 0 0 0 transparent;
}
.nk-cta-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px var(--neon-glow), 0 0 0 1px var(--neon-bright) inset;
}
.nk-cta-pill .nk-cta-arrow {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #041819;
  color: var(--neon);
  transition: transform var(--dur-fast) var(--ease-out);
}
.nk-cta-pill:hover .nk-cta-arrow {
  transform: translateX(2px);
}

/* 行動版：把條目收進漢堡 */
@media (max-width: 880px) {
  .nk-sidenav-list { display: none; }
  .nk-sidenav-inner { grid-template-columns: 1fr auto; }
  .nk-burger { display: inline-flex; }
  .nk-cta-pill { display: none; }
}
@media (max-width: 520px) {
  .nk-cta-pill { padding: 0.4rem 0.9rem; font-size: 0.72rem; }
  .nk-cta-pill .nk-cta-arrow { display: none; }
}

/* 漢堡按鈕（行動版顯示，桌機隱藏）*/
.nk-burger {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(232, 241, 240, 0.18);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}
@media (min-width: 881px) {
  .nk-burger { display: none; }
}
.nk-burger:hover { border-color: var(--neon); }
.nk-burger-line {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--lab-white);
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.nk-burger[aria-expanded="true"] .nk-burger-line:nth-child(1) {
  transform: translateY(2.75px) rotate(45deg);
}
.nk-burger[aria-expanded="true"] .nk-burger-line:nth-child(2) {
  transform: translateY(-2.75px) rotate(-45deg);
}

/* 行動版全螢幕選單 overlay */
.nk-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 7, 10, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}
.nk-menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-base) var(--ease-out), visibility 0s linear 0s;
}
.nk-menu-overlay-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  max-width: 480px;
}
.nk-menu-overlay-list a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0.8rem;
  color: var(--lab-faint);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(232, 241, 240, 0.08);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.nk-menu-overlay-list a:active,
.nk-menu-overlay-list a:hover {
  color: var(--neon);
  transform: translateX(4px);
}
.nk-menu-overlay-list a.is-cta {
  margin-top: 1.5rem;
  border: 1px solid var(--neon);
  border-radius: 999px;
  color: var(--neon);
  justify-content: center;
  padding: 1.1rem 1.5rem;
}

/* ============================================================
   Hero 區（取代原本的 .hero）
   ============================================================ */
.nk-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: transparent;   /* 背景由 .nk-bg 的 WebGL 場景負責 */
  display: flex;
  align-items: center;
  isolation: isolate;
}

/* 只壓文字所在的左半與上下邊，讓右半的數字雨與地板保持乾淨 */
.nk-hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(100deg,
      rgba(5, 7, 10, 0.92) 0%,
      rgba(5, 7, 10, 0.86) 30%,
      rgba(5, 7, 10, 0.62) 52%,
      rgba(5, 7, 10, 0.24) 74%,
      transparent 92%),
    linear-gradient(180deg,
      rgba(5, 7, 10, 0.62) 0%,
      transparent 22%,
      transparent 74%,
      rgba(5, 7, 10, 0.55) 100%);
}

@media (max-width: 880px) {
  /* 直式螢幕文字會壓到中央，改成整片均勻壓暗 */
  .nk-hero-veil {
    background:
      linear-gradient(180deg,
        rgba(5, 7, 10, 0.72) 0%,
        rgba(5, 7, 10, 0.60) 45%,
        rgba(5, 7, 10, 0.30) 72%,
        rgba(5, 7, 10, 0.62) 100%);
  }
}

.nk-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: calc(var(--nk-nav-h) + 2rem) clamp(1.25rem, 4vw, 4rem) clamp(3rem, 6vw, 5rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(1.2rem, 2.4vw, 2rem);
}

.nk-hero-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  transform: translateY(20px);
  animation: nk-rise 700ms var(--ease-out) 200ms forwards;
}
.nk-hero-eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--neon);
  box-shadow: 0 0 6px var(--neon-glow);
}

.nk-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 1.4rem + 6.2vw, 7.2rem);
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--lab-white);
  max-width: 18ch;
}
.nk-hero-line {
  display: block;
  opacity: 0;
  transform: translateY(36px);
  animation: nk-rise 800ms var(--ease-out) forwards;
}
.nk-hero-line:nth-child(1) { animation-delay: 360ms; }
.nk-hero-line:nth-child(2) { animation-delay: 460ms; }

/* 品牌主標題（CEO AI Lab）與一行定位文案 */
.nk-hero-brand { font-weight: 600; letter-spacing: -0.015em; }
.nk-hero-lede {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1rem, 0.92rem + 0.4vw, 1.18rem);
  line-height: 1.8;
  color: var(--editorial-soft);
  opacity: 0;
  animation: nk-fade 700ms var(--ease-out) 660ms forwards;
}

.nk-hero-subtitle {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 0.7rem + 0.5vw, 1.05rem);
  letter-spacing: 0.1em;
  color: var(--lab-faint);
  text-transform: uppercase;
  opacity: 0;
  animation: nk-fade 700ms var(--ease-out) 780ms forwards;
}

.nk-hero-cta {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  margin-top: clamp(0.5rem, 1.5vw, 1.2rem);
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  background: rgba(5, 7, 10, 0.72);
  color: var(--lab-white);
  text-decoration: none;
  border: 1px solid rgba(0, 229, 199, 0.7);
  border-radius: 0;
  overflow: visible;
  box-shadow: inset 3px 0 0 var(--neon);
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  opacity: 0;
  animation: nk-fade 700ms var(--ease-out) 920ms forwards;
}
.nk-hero-cta:hover {
  background: rgba(0, 229, 199, 0.13);
  border-color: var(--neon-bright);
  transform: translateY(-2px);
}
.nk-hero-cta::after {
  content: "→";
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  margin-left: 0.35rem;
  border: 1px solid rgba(232, 241, 240, 0.24);
  color: var(--neon-bright);
  font-family: var(--font-mono);
  font-size: 1rem;
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.nk-hero-cta:hover::after { transform: translateX(3px); background: rgba(0, 229, 199, 0.14); }
.nk-hero-cta-text {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
}
.nk-hero-cta-sub {
  position: static;
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--editorial-soft);
  opacity: 1;
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
}
.nk-hero-cta:hover .nk-hero-cta-text,
.nk-hero-cta:hover .nk-hero-cta-sub { opacity: 1; }

.nk-hero-cta-glow {
  display: none;
}

@keyframes nk-rise {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes nk-fade {
  to { opacity: 1; }
}

/* 行動版：字級縮小 */
@media (max-width: 720px) {
  .nk-hero-title { max-width: 14ch; }
  .nk-hero-cta { padding: 0.75rem 1.4rem 0.75rem 1.6rem; }
  .nk-hero-cta-text, .nk-hero-cta-sub { font-size: 0.82rem; }
}

/* ============================================================
   滾動指示器
   ============================================================ */
.nk-scroll-indicator {
  --scroll-end-opacity: 1;
  position: fixed;
  right: clamp(1rem, 2.4vw, 2rem);
  bottom: clamp(1rem, 2.4vw, 2rem);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.8rem 0.4rem 0.4rem;
  background: rgba(5, 7, 10, 0.55);
  border: 1px solid rgba(232, 241, 240, 0.1);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.nk-scroll-indicator.is-visible {
  opacity: var(--scroll-end-opacity);
  transform: translateY(0);
}
.nk-scroll-indicator.is-visible.is-near-end {
  transform: translateY(4px);
}
.nk-scroll-circle {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: block;
}
.nk-scroll-circle #nk-scroll-progress {
  transition: stroke-dasharray 80ms linear;
}
.nk-scroll-label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lab-faint);
  white-space: nowrap;
}
.nk-scroll-pct {
  color: var(--neon);
  font-weight: 600;
  min-width: 2.5em;
  text-align: right;
}
.nk-scroll-hint {
  display: inline-flex;
  gap: 0.35rem;
  color: var(--lab-faint);
}
.nk-scroll-hint span:nth-child(2)::before {
  content: " ";
}

@media (max-width: 720px) {
  .nk-scroll-indicator { right: 0.8rem; bottom: 0.8rem; padding: 0.3rem 0.7rem 0.3rem 0.3rem; }
  .nk-scroll-circle { width: 26px; height: 26px; flex-basis: 26px; }
  .nk-scroll-label { font-size: 0.62rem; }
}

/* ============================================================
   隱藏原本的 .hero 相關舊元素（v1.1 殘留）
   nk-hero 已取代，所以舊的 .hero 區塊不會被渲染
   但其他頁面仍可能在 document 中出現舊 class，需保留可見性
   ============================================================ */

/* 在 nk.studio 模式下，原本的 .hero 區塊（如果未來有殘留）應該隱藏 */
.nk-hero ~ .hero { display: none; }

/* ============================================================
   Editorial Computational Art pass
   ------------------------------------------------------------
   v2 UI/UX direction: make the lab read less like a dashboard
   and more like a curated digital-art institute.
   ============================================================ */
:root {
  --editorial-ink: #e8f1f0;
  --editorial-soft: rgba(232, 241, 240, 0.68);
  --editorial-dim: rgba(232, 241, 240, 0.42);
  --editorial-line: rgba(232, 241, 240, 0.14);
  --editorial-panel: rgba(12, 14, 18, 0.66);
  --editorial-panel-strong: rgba(9, 13, 18, 0.86);
}

html {
  text-rendering: geometricPrecision;
}

body {
  font-family: var(--font-sans);
}

main.is-immersive {
  background: transparent;
}

.nk-hero {
  min-height: 100vh;
  min-height: 100dvh;
  align-items: flex-end;
}

.nk-hero-content {
  padding-bottom: 7rem;
  gap: 1.6rem;
}

.nk-hero-eyebrow,
.nk-hero-subtitle,
.nk-hero-cta-text,
.nk-hero-cta-sub {
  letter-spacing: 0.12em;
}

.nk-hero-title {
  font-size: 6.7rem;
  line-height: 0.98;
  letter-spacing: 0;
  max-width: 16ch;
}

.nk-hero-line.is-accent {
  font-weight: 500;
  color: var(--editorial-ink);
  text-shadow: none;
}

.nk-hero-line.is-accent::after {
  content: "";
  display: block;
  width: min(7.5rem, 42%);
  height: 2px;
  margin-top: 0.18em;
  background: var(--neon);
  box-shadow: 0 0 18px var(--neon-glow);
}

.nk-hero-subtitle {
  color: var(--editorial-soft);
  max-width: 34rem;
}

.nk-hero-cta {
  border-radius: 4px;
  padding: 1rem 1.45rem;
  min-width: 14rem;
}

.section {
  padding-block: 6rem;
}

.section-head {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(10rem, 0.4fr);
  align-items: start;
  gap: 1rem 1.75rem;
  margin-bottom: 2.75rem;
  padding-bottom: 0;
  border-bottom: 0;
}

.section-head::after {
  content: "";
  grid-column: 2 / -1;
  height: 1px;
  background: linear-gradient(90deg, var(--editorial-line), transparent);
  transform: translateY(0.9rem);
}

.section-head .sec-no {
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--neon);
  opacity: 0.95;
  padding-top: 0.35rem;
  white-space: nowrap;
}

.section-head h2 {
  font-size: clamp(2.5rem, 4.4vw, 3.35rem);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: 0;
  max-width: 16ch;
}

.section-head .sec-sub {
  font-size: 0.78rem;
  line-height: 1.65;
  letter-spacing: 0.08em;
  color: var(--editorial-soft);
  padding-top: 0.35rem;
}

.section-head .sec-line {
  display: none;
}

#positioning .section-head {
  display: none;
}

#works,
#capability {
  background: transparent;
  border-block-color: rgba(232, 241, 240, 0.06);
}

#talent {
  background: transparent;
}

#formula {
  background: transparent;
}

#works::before,
#capability::before {
  opacity: 0.22;
}

#positioning {
  padding-top: clamp(4rem, 8vh, 7rem);
}

#positioning::before,
#works::after,
#talent::before,
#capability::after,
#formula::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 74% 36% at 50% 8%, rgba(5, 7, 10, 0.18), transparent 62%),
    linear-gradient(180deg, rgba(5, 7, 10, 0.10), rgba(5, 7, 10, 0.03) 36%, rgba(5, 7, 10, 0.10));
}

.positioning-grid {
  grid-template-columns: minmax(19rem, 0.78fr) minmax(0, 1fr);
  gap: 5rem;
  align-items: center;
}

.game-wrap {
  border-radius: 4px;
  background: rgba(5, 6, 8, 0.26);
  border-color: rgba(232, 241, 240, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 2.25rem 5rem rgba(0, 0, 0, 0.24);
}

.positioning-copy {
  max-width: 43rem;
  padding-left: 2.5rem;
  border-left: 1px solid var(--editorial-line);
}

.positioning-copy .eyebrow {
  margin-bottom: 1.4rem;
  color: var(--neon);
}

.positioning-copy > h2 {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: 0;
}

.positioning-copy p {
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--editorial-soft);
}

.positioning-copy .four-labs {
  background: none;
  color: var(--editorial-ink);
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.45;
}

.lab-underline {
  border-bottom-width: 1px !important;
}

.works-columns {
  gap: 1.15rem;
}

.works-col {
  gap: 1.15rem;
}

.work-card {
  border: 0;
  border-radius: 4px;
  background: #05070a;
  box-shadow: 0 0 0 1px rgba(232, 241, 240, 0.08);
}

.work-card:hover,
.work-card:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    0 1.5rem 4rem rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(232, 241, 240, 0.2);
}

.work-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 46%, rgba(0, 0, 0, 0.42));
  opacity: 0.35;
  transition: opacity var(--dur-base) var(--ease-out);
}

.work-card:hover::after,
.work-card:focus-visible::after {
  opacity: 0.68;
}

.work-kind,
.work-play {
  border-radius: 3px;
  background: rgba(5, 7, 10, 0.74);
}

.work-meta {
  padding-inline: 1.15rem;
}

.work-meta h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
}

.series-nav {
  border-bottom: 1px solid var(--editorial-line);
  padding-bottom: 0.85rem;
}

.series-btn {
  border-radius: 3px;
  background: transparent;
}

/* Works：讓影像本身成為介面，不需要游標才播放或點擊展開。 */
#works {
  padding-block: clamp(3.5rem, 7vw, 7rem);
}

#works .work-card {
  cursor: default;
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-out);
}

#works .work-card:hover,
#works .work-card:focus-visible {
  transform: none;
  box-shadow: 0 0 0 1px rgba(232, 241, 240, 0.1);
}

#works .work-card::after {
  display: none;
}

#works .work-preview {
  display: block;
  opacity: 1;
  transition: none;
}

#works .work-still,
#works .work-preview {
  filter: contrast(1.04) saturate(0.94) brightness(0.96);
}

@media (hover: none) {
  #works .work-preview { display: block; }
}

.series-btn.is-active {
  background: var(--editorial-ink);
  color: #05070a;
}

.curation-card {
  border-radius: 4px;
  border-color: var(--editorial-line);
  background: rgba(5, 7, 10, 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: none;
}

.curation-card-title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0;
}

.pool-grid {
  border-top-color: var(--editorial-line);
}

.pool {
  grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
  gap: 5rem;
  border-bottom-color: var(--editorial-line);
}

.pool:nth-child(even) {
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem);
}

.pool-visual {
  border-radius: 4px;
  border-color: color-mix(in srgb, var(--pool-ch, #fff) 35%, var(--editorial-line));
  background: rgba(5, 6, 8, 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.pool-info .pool-name {
  font-size: 3.75rem;
  font-weight: 500;
  color: var(--editorial-ink);
  border-bottom-color: color-mix(in srgb, var(--pool-ch) 55%, transparent);
}

.role-grid {
  gap: 1px;
  background: color-mix(in srgb, var(--pool-ch) 26%, var(--editorial-line));
  border: 1px solid color-mix(in srgb, var(--pool-ch) 26%, var(--editorial-line));
}

.role-card {
  border: 0;
  border-radius: 0;
  background: rgba(5, 7, 10, 0.68);
  min-height: 5.9rem;
  padding: 1rem;
}

.role-card:hover {
  transform: none;
}

.role-card.is-active {
  background: color-mix(in srgb, var(--pool-ch) 18%, rgba(5, 7, 10, 0.92));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pool-ch) 56%, transparent);
}

.role-card .role-glyph {
  border-radius: 2px;
}

.periodic-hint {
  max-width: 45rem;
  line-height: 1.75;
}

.periodic-scroll {
  padding: 0.6rem 0 1.25rem;
  border-block: 1px solid var(--editorial-line);
}

.periodic-grid {
  grid-template-columns: 28px repeat(18, minmax(58px, 1fr));
  grid-template-rows: 28px repeat(4, minmax(74px, auto));
  gap: 4px;
}

.periodic-period-no {
  background: rgba(5, 7, 10, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ============================================================
   週期表中央說明區（點選元素後的回饋面板）
   ------------------------------------------------------------
   這塊佔的是週期表本身的負空間（第 1-2 週期、第 4-13 族的空隙），
   所以刻意「不畫框」——一個灰色 1px 方框會讓它看起來像浮在表格上
   的外來卡片，而不是表格的一部分。改用選中元素的分頻色當左側軸線
   與背景暈染，讓它讀起來是「這一格展開了」。

   點擊時整塊 innerHTML 重畫 → 底下的 animation 會重新觸發，
   那就是點擊回饋。（只綁 click 不綁 hover，所以不會閃。）
   ============================================================ */
.periodic-callout {
  --cal-ch: var(--neon);
  --cal-dim: rgba(0, 229, 199, 0.14);

  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.periodic-callout .periodic-callout-inner {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 2.2vw, 2rem);
  align-items: center;
  padding: clamp(0.9rem, 1.8vw, 1.5rem) clamp(1rem, 2.4vw, 1.9rem);

  /* 分頻色從左側滲進來，右側收乾淨——不封邊，才不會變成一個框 */
  background:
    linear-gradient(97deg,
      color-mix(in srgb, var(--cal-ch) 13%, transparent) 0%,
      color-mix(in srgb, var(--cal-ch) 5%, transparent) 34%,
      rgba(5, 7, 10, 0.30) 68%,
      transparent 100%);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

/* 左側一道分頻色軸線，取代原本的四邊灰框 */
.periodic-callout .periodic-callout-inner::before {
  content: '';
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--cal-ch) 22%, var(--cal-ch) 78%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--cal-ch) 55%, transparent);
}

/* 背景大字：讓選到哪一個元素在餘光就看得出來 */
.p-ghost {
  position: absolute;
  right: clamp(0.5rem, 2vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 9vw, 8.5rem);
  line-height: 0.78;
  letter-spacing: -0.04em;
  color: color-mix(in srgb, var(--cal-ch) 12%, transparent);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.periodic-detail > *:not(.p-ghost) { position: relative; z-index: 1; }

/* ---------- 左邊：放大的元素卡 ---------- */
.periodic-callout .p-callout-sample {
  width: clamp(76px, 7vw, 96px);
  height: auto;
  aspect-ratio: 72 / 86;
  border: 1px solid color-mix(in srgb, var(--cal-ch) 62%, transparent);
  border-radius: 3px;
  padding: 7px 8px;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--cal-ch) 22%, transparent), transparent 62%),
    rgba(10, 12, 16, 0.86);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cal-ch) 16%, transparent),
    0 0 26px color-mix(in srgb, var(--cal-ch) 30%, transparent);
}

.periodic-callout .p-sample-symbol {
  color: var(--cal-ch);
  font-size: clamp(1.7rem, 2.6vw, 2.1rem);
  text-shadow: 0 0 20px color-mix(in srgb, var(--cal-ch) 55%, transparent);
  -webkit-text-fill-color: currentColor;   /* 蓋掉 style.css 的 prism 漸層裁切 */
  background: none;
}

.periodic-callout .p-sample-name,
.periodic-callout .p-sample-zh { color: var(--editorial-soft, var(--lab-mute)); }

/* ---------- 右邊：文字 ---------- */
.periodic-callout .p-callout-legend {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.p-selected-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cal-ch);
  margin: 0;
}
.p-group-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cal-ch);
  box-shadow: 0 0 10px var(--cal-ch);
  flex: none;
}
.p-group-count {
  color: var(--lab-faint);
  letter-spacing: 0.14em;
  font-size: 0.62rem;
}
.p-group-count::before { content: '·'; margin-right: 0.4em; }

.periodic-callout .p-selected-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--lab-white);
  margin: 0;
}

.periodic-callout .p-selected-sub {
  font-size: 0.95rem;
  color: var(--editorial-soft, var(--lab-mute));
  margin: 0;
}

/* 狀態列：這一格現在在不在配方裡 */
.p-selected-state {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
  margin: 0.45rem 0 0;
  padding: 0.32rem 0.7rem 0.32rem 0.45rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--cal-ch) 34%, transparent);
  background: color-mix(in srgb, var(--cal-ch) 10%, transparent);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cal-ch);
}
.p-state-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--cal-ch);
  color: #050607;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}
.periodic-detail.is-picked .p-selected-state {
  background: color-mix(in srgb, var(--cal-ch) 18%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--cal-ch) 26%, transparent);
}

/* ---------- 進場：點擊後的回饋 ---------- */
@keyframes p-cal-wash {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes p-cal-pop {
  0%   { opacity: 0; transform: scale(0.82) translateY(6px); }
  60%  { opacity: 1; transform: scale(1.04) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes p-cal-ghost {
  from { opacity: 0; transform: translateY(-50%) translateX(26px); }
  to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}
@keyframes p-cal-rise {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

.periodic-detail { animation: p-cal-wash 380ms var(--ease-out) both; }
.periodic-detail .p-callout-sample { animation: p-cal-pop 460ms var(--ease-out) both; }
.periodic-detail .p-ghost { animation: p-cal-ghost 620ms var(--ease-out) both; }
.periodic-detail .p-selected-group { animation: p-cal-rise 360ms var(--ease-out) 60ms both; }
.periodic-detail .p-selected-title { animation: p-cal-rise 380ms var(--ease-out) 110ms both; }
.periodic-detail .p-selected-sub   { animation: p-cal-rise 380ms var(--ease-out) 160ms both; }
.periodic-detail .p-selected-state { animation: p-cal-rise 400ms var(--ease-out) 220ms both; }

@media (prefers-reduced-motion: reduce) {
  .periodic-detail,
  .periodic-detail * { animation: none !important; }
}

/* ---------- 預設（尚未選任何元素） ---------- */
.periodic-callout .p-callout-empty {
  display: flex;
  align-items: center;
  min-height: 100%;
  color: var(--lab-faint);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
}

/* 手機：面板被 app.js 的 placeCallout() 搬到表格下方（見該函式註解），
   這時它是一塊獨立的全寬區塊，需要自己的上下留白與左側軸線。 */
.periodic-callout.is-detached {
  margin-top: var(--space-3);
}
.periodic-callout.is-detached .periodic-callout-inner {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 108px;
}

/* 窄螢幕：背景大字縮小讓位，避免壓到文字 */
@media (max-width: 900px) {
  .p-ghost { font-size: clamp(3.5rem, 15vw, 5.5rem); }
}

@media (max-width: 560px) {
  .periodic-callout .periodic-callout-inner {
    gap: 0.85rem;
    padding: 1rem 1.1rem;
  }
  .periodic-callout .p-callout-sample { width: 66px; }
  .p-ghost { right: 0.25rem; opacity: 0.55; }
  .periodic-callout .p-selected-title { font-size: 1.25rem; }
}

.element-cell {
  border-radius: 3px;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--el-ch) 16%, transparent), transparent 58%),
    rgba(10, 12, 16, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  min-height: 4.55rem;
}

.element-cell .el-symbol {
  font-weight: 600;
  font-size: 1.55rem;
}

.custom-formula-card,
.formula-card {
  border-radius: 4px;
  background: rgba(5, 7, 10, 0.34);
  border-color: var(--editorial-line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: none;
}

.custom-formula-card.has-selection {
  border-color: rgba(0, 229, 199, 0.48);
  box-shadow: 0 0 0 1px rgba(0, 229, 199, 0.16);
}

.custom-formula-empty {
  border-radius: 4px;
  background: transparent;
}

.custom-formula-title,
.formula-output .f-out-name {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0;
}

.custom-formula-diagram,
.formula-figure {
  border-radius: 3px;
  background: rgba(5, 6, 8, 0.68);
}

/* 自訂配方改為「配方工作台」：資訊與分子結構同樣重要，避免儀表板式的微小標籤。 */
.custom-formula-card.has-selection {
  padding: 1.65rem;
  box-shadow: inset 3px 0 0 rgba(0, 229, 199, 0.72);
}
.custom-formula-content {
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 1.75rem;
  align-items: stretch;
}
.custom-formula-meta {
  justify-content: center;
  gap: 1rem;
}
.custom-formula-eyebrow {
  color: var(--neon-bright);
  font-size: 0.72rem;
}
.custom-formula-title {
  font-size: clamp(1.65rem, 2.4vw, 2.2rem);
  line-height: 1.08;
}
.formula-compact-line {
  margin: 0;
  color: var(--editorial-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.formula-result-title {
  grid-template-columns: minmax(0, 1fr) 5.4rem;
  gap: 1.25rem;
}
.formula-result-title p {
  margin-top: 0.7rem;
  font-size: 1.04rem;
  line-height: 1.72;
}
.formula-score {
  aspect-ratio: 1 / 1.12;
  border-radius: 0;
  background: rgba(232, 241, 240, 0.045);
  border: 1px solid var(--editorial-line);
}
.formula-score::after { inset: 5px; border-radius: 0; background: rgba(5, 7, 10, 0.78); }
.formula-score strong { font-size: 1.45rem; }
.formula-score span { color: var(--neon-bright); }
.formula-metrics > div { padding: 0.85rem 0.7rem; }
.formula-metrics strong { font-size: 1rem; }
.custom-formula-diagram {
  min-height: 0;
  padding: 0;
  border-color: var(--editorial-line);
  box-shadow: none;
}
.custom-formula-diagram::before { display: none; }
.custom-molecule-svg { display: block; min-height: 15rem; }
.custom-molecule-svg .node-symbol { font-size: 21px; }
.custom-molecule-svg .node-label { font-size: 10px; fill: var(--text-primary); }
.custom-molecule-svg .product-name { font-size: 8px; fill: var(--text-primary); letter-spacing: 0.11em; }
.custom-molecule-svg .formula-axis-label { font-size: 8px; fill: var(--neon-bright); }
.custom-molecule-svg .custom-orbit-bond { opacity: 0.4; stroke-dasharray: 3 7; }
.formula-playbook {
  padding: 1.35rem 1.45rem;
  background: rgba(255, 255, 255, 0.012);
}
.formula-playbook > span { font-size: 0.72rem; color: var(--neon-bright); }
.formula-playbook li { grid-template-columns: 3.25rem minmax(0, 1fr); padding: 0.85rem 0; }
.formula-playbook li > b { font-size: 0.9rem; }
.formula-playbook li strong { font-size: 1rem; }
.formula-playbook li p { font-size: 0.91rem; line-height: 1.55; }

@media (max-width: 900px) {
  .custom-formula-card.has-selection { padding: 1.5rem; }
  .custom-formula-content { grid-template-columns: 1fr; gap: 1.75rem; }
  .custom-formula-meta { justify-content: flex-start; }
}

.formula-card::before {
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--neon), transparent);
}

.formula-intro {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--editorial-soft);
}

.formula-equation span {
  border-radius: 2px;
}

.section-cta-banner {
  border-radius: 0;
  border-inline: 0;
  padding: 2.25rem 0;
  background: transparent;
  box-shadow: none;
  border-color: var(--editorial-line);
}

.section-cta-banner::before {
  display: none;
}

.cta-banner-content h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: 0;
}

.btn-primary {
  border-radius: 4px;
}

/* CTA 採用編輯式控制列，不使用高飽和漸層與大面積發光。 */
.section-cta-banner .btn-primary,
.footer-cta .btn-primary,
.custom-formula-actions .btn-primary {
  position: relative;
  min-width: 14.5rem;
  justify-content: flex-start;
  padding: 0.85rem 1.15rem 0.85rem 1.35rem;
  border: 1px solid rgba(0, 229, 199, 0.58);
  border-radius: 0;
  background: rgba(0, 229, 199, 0.08);
  color: var(--editorial-ink);
  box-shadow: inset 3px 0 0 var(--neon);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.section-cta-banner .btn-primary::before,
.footer-cta .btn-primary::before,
.custom-formula-actions .btn-primary::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 0.32rem;
  height: 0.32rem;
  border-top: 1px solid var(--neon-bright);
  border-right: 1px solid var(--neon-bright);
  opacity: 0.9;
}
.section-cta-banner .btn-primary:hover,
.footer-cta .btn-primary:hover,
.custom-formula-actions .btn-primary:hover {
  background: rgba(0, 229, 199, 0.16);
  border-color: var(--neon-bright);
  box-shadow: inset 3px 0 0 var(--neon-bright), 5px 5px 0 rgba(0, 229, 199, 0.14);
  filter: none;
  transform: translate(-2px, -2px);
}
.section-cta-banner .btn-primary:focus-visible,
.footer-cta .btn-primary:focus-visible,
.custom-formula-actions .btn-primary:focus-visible,
.nk-hero-cta:focus-visible {
  outline: 2px solid var(--neon-bright);
  outline-offset: 3px;
}

.nk-hero .nk-hero-cta {
  min-width: 0;
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  border-radius: 0;
}

/* 黏底公式列：與其餘 CTA 使用相同的低飽和控制列語言。 */
.formula-bar #fb-cta {
  position: relative;
  min-width: 11rem;
  justify-content: flex-start;
  padding: 0.72rem 1rem 0.72rem 1.2rem;
  border: 1px solid rgba(0, 229, 199, 0.58);
  border-radius: 0;
  background: rgba(0, 229, 199, 0.08);
  color: var(--editorial-ink);
  box-shadow: inset 3px 0 0 var(--neon);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.formula-bar #fb-cta::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 0.3rem;
  height: 0.3rem;
  border-top: 1px solid var(--neon-bright);
  border-right: 1px solid var(--neon-bright);
}
.formula-bar #fb-cta:hover {
  background: rgba(0, 229, 199, 0.16);
  border-color: var(--neon-bright);
  box-shadow: inset 3px 0 0 var(--neon-bright), 4px 4px 0 rgba(0, 229, 199, 0.14);
  filter: none;
  transform: translate(-2px, -2px);
}
.formula-bar #fb-cta:focus-visible {
  outline: 2px solid var(--neon-bright);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .nk-hero-title {
    font-size: 5.2rem;
  }

  .section-head {
    /* Keep the section number, title and English descriptor in one row.
       The previous two-column breakpoint pushed .sec-sub onto its own row,
       creating an oversized empty gap beneath every section title. */
    grid-template-columns: 4.75rem minmax(0, 1fr) minmax(9rem, 0.38fr);
    gap: 0.9rem 1.25rem;
  }

  .section-head .sec-sub {
    grid-column: auto;
    align-self: center;
    max-width: none;
    padding-top: 0;
  }

  .section-head::after {
    grid-column: 2;
  }

  .positioning-grid,
  .pool,
  .pool:nth-child(even) {
    gap: 3rem;
  }
}

@media (max-width: 900px) {
  .nk-hero {
    min-height: 96vh;
    min-height: 96dvh;
  }

  .nk-hero-content {
    padding-bottom: 4.5rem;
  }

  .nk-hero-title {
    font-size: 4.1rem;
    max-width: 12.5ch;
  }

  .section {
    padding-block: 5.5rem;
  }

  .positioning-grid,
  .pool,
  .pool:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .pool:nth-child(even) .pool-visual,
  .pool:nth-child(even) .pool-info {
    order: initial;
  }

  .positioning-copy {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .nk-hero-title {
    font-size: 3rem;
    line-height: 1.02;
    max-width: 100%;
  }

  .nk-hero-line {
    max-width: 100%;
  }

  .nk-hero-eyebrow,
  .nk-hero-subtitle {
    font-size: 0.72rem;
  }

  .nk-hero-cta {
    min-width: 0;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 3rem;
  }

  .section-head h2 {
    font-size: 2.45rem;
    max-width: none;
  }

  .section-head .sec-sub,
  .section-head::after {
    grid-column: 1;
  }

  .positioning-copy > h2,
  .pool-info .pool-name {
    font-size: 2.55rem;
  }

  .positioning-copy .four-labs {
    font-size: 1.32rem;
  }

  .role-grid {
    grid-template-columns: 1fr;
  }

  .role-card {
    min-height: 4.9rem;
  }

  .periodic-scroll {
    margin-inline: calc(-1 * var(--container-pad));
    width: calc(100% + 2 * var(--container-pad));
    padding-inline: var(--container-pad);
  }

  .periodic-grid {
    min-width: 980px;
  }

  .section-cta-banner {
    padding: 1.75rem 0;
  }
}

@media (max-width: 480px) {
  .nk-hero-title {
    font-size: 2.55rem;
  }

  .section-head h2,
  .positioning-copy > h2,
  .pool-info .pool-name {
    font-size: 2.15rem;
  }

  .works-columns {
    gap: 0.85rem;
  }
}

/* ============================================================
   xmcp-inspired interaction layer
   Thin rules, centred first-viewport storytelling and precise feedback,
   expressed with CEO AI Lab's serif voice, Matrix field and neon spectrum.
   ============================================================ */
:root {
  --interface-rule: rgba(232, 241, 240, 0.13);
  --interface-rule-hot: rgba(0, 229, 199, 0.52);
  --interface-panel: rgba(5, 7, 10, 0.72);
}

.site-header.nk-side-nav {
  height: 56px;
  border-bottom: 1px solid var(--interface-rule);
}
.nk-sidenav-inner {
  max-width: none;
  padding-inline: clamp(1rem, 2vw, 2rem);
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1.25rem;
}
.nk-sidenav-logo { grid-column: 2; grid-row: 1; }
.nk-sidenav-list { grid-column: 1; grid-row: 1; justify-self: start; margin: 0; }
.nk-sidenav-actions { grid-column: 3; grid-row: 1; justify-self: end; }
.nk-sidenav-list a { padding-inline: 0.35rem; }
.nk-sidenav-list .nk-slash { width: 2px; height: 10px; opacity: 0.6; }
.nk-sidenav-list a:not(.is-active) .nk-slash { background: rgba(232, 241, 240, 0.28); box-shadow: none; }
.nk-lang-toggle,
.nk-cta-pill { border-radius: 0; min-height: 34px; }
.nk-cta-pill {
  background: transparent;
  color: var(--lab-white);
  border: 1px solid var(--interface-rule);
  box-shadow: inset 2px 0 0 var(--neon);
}
.nk-cta-pill:hover { background: rgba(0, 229, 199, 0.1); }

.nk-hero { min-height: min(900px, 100dvh); align-items: flex-start; }
.nk-hero-veil {
  background:
    radial-gradient(circle at 50% 45%, transparent 0 20%, rgba(5, 7, 10, 0.18) 48%, rgba(5, 7, 10, 0.74) 100%),
    linear-gradient(180deg, rgba(5, 7, 10, 0.28), transparent 24%, transparent 74%, rgba(5, 7, 10, 0.84));
}
.nk-hero-content {
  min-height: min(900px, 100dvh);
  padding-top: clamp(7rem, 17vh, 10rem);
  padding-bottom: clamp(4rem, 8vh, 6rem);
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: clamp(1rem, 2vw, 1.5rem);
}
.nk-hero-eyebrow {
  border: 1px solid var(--interface-rule);
  padding: 0.42rem 0.64rem;
  color: var(--lab-faint);
  background: rgba(5, 7, 10, 0.5);
  backdrop-filter: blur(8px);
}
.nk-hero-eyebrow::before { width: 6px; height: 6px; border-radius: 50%; }
.nk-hero-title {
  max-width: 15ch;
  font-size: clamp(3rem, 1.8rem + 3.5vw, 5.4rem);
  line-height: 0.98;
  text-wrap: balance;
}
.nk-hero-lede { max-width: 46ch; }
.nk-hero-subtitle {
  max-width: 52ch;
  padding: 0.45rem 0.8rem;
  border-inline: 1px solid var(--interface-rule);
  background: rgba(5, 7, 10, 0.36);
}
.nk-hero-cta { margin-top: 0.35rem; backdrop-filter: blur(10px); }
.nk-hero::after {
  content: "SYSTEM / 01";
  position: absolute;
  left: clamp(1rem, 2vw, 2rem);
  bottom: 1.15rem;
  z-index: 3;
  color: var(--text-tertiary);
  font: 0.65rem/1 var(--font-mono);
  letter-spacing: 0.14em;
}

.section {
  position: relative;
  border-top: 1px solid var(--interface-rule);
  background:
    linear-gradient(90deg, transparent, rgba(0, 229, 199, 0.018) 50%, transparent),
    rgba(5, 7, 10, 0.78);
  transition: background-color 700ms var(--ease-out);
}
.section::before,
.section::after {
  content: "";
  position: absolute;
  top: 0;
  width: 1px;
  height: 2rem;
  background: var(--neon);
  opacity: 0.2;
  transition: height 700ms var(--ease-out), opacity 700ms var(--ease-out);
}
.section::before { left: max(var(--container-pad), calc((100vw - var(--container-max)) / 2 + var(--container-pad))); }
.section::after { right: max(var(--container-pad), calc((100vw - var(--container-max)) / 2 + var(--container-pad))); }
.section[data-inview="true"]::before,
.section[data-inview="true"]::after { height: 5rem; opacity: 0.72; }

.section-head .sec-no {
  display: inline-grid;
  place-items: center;
  min-width: 3rem;
  min-height: 2rem;
  border: 1px solid var(--interface-rule);
  background: var(--interface-panel);
}
.section-head h2 { text-wrap: balance; }
.section-head::after {
  transition: transform 800ms var(--ease-out), background 500ms var(--ease-out);
  transform-origin: left;
}
.section[data-inview="true"] .section-head::after { background: var(--interface-rule-hot); }

.work-card,
.pool,
.curation-card,
.game-wrap,
.formula-card,
.custom-formula-card,
.section-cta-banner,
.periodic-grid {
  --spot-x: 50%;
  --spot-y: 50%;
  border-color: var(--interface-rule);
  background-image: radial-gradient(420px circle at var(--spot-x) var(--spot-y), rgba(0, 229, 199, 0.075), transparent 42%);
  transition: border-color 240ms ease, transform 420ms var(--ease-out), box-shadow 420ms var(--ease-out);
}
.work-card:hover,
.pool:hover,
.curation-card:hover,
.game-wrap:hover,
.formula-card:hover,
.custom-formula-card:hover {
  border-color: var(--interface-rule-hot);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(0, 229, 199, 0.035);
}
.pool:hover,
.formula-card:hover { transform: translateY(-2px); }
.role-card,
.periodic-item,
.series-tab { transition-duration: 180ms; }

.reveal {
  filter: blur(6px);
  transition: opacity 780ms var(--ease-out), transform 780ms var(--ease-out), filter 780ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in { filter: blur(0); }

@media (max-width: 1100px) {
  .nk-sidenav-inner { grid-template-columns: auto 1fr auto; }
  .nk-sidenav-logo { grid-column: 1; }
  .nk-sidenav-list { grid-column: 2; justify-self: end; }
  .nk-sidenav-actions { grid-column: 3; }
}
@media (max-width: 880px) {
  .site-header.nk-side-nav { height: 60px; }
  .nk-sidenav-inner { grid-template-columns: 1fr auto; }
  .nk-sidenav-logo { grid-column: 1; }
  .nk-sidenav-actions { grid-column: 2; }
  .nk-hero-content { min-height: 92dvh; padding-top: 8rem; justify-content: flex-start; }
  .nk-hero-title { max-width: 12ch; }
}
@media (max-width: 720px) {
  .nk-hero { min-height: 92dvh; }
  .nk-hero-content { min-height: 92dvh; text-align: left; align-items: flex-start; padding-top: 7.5rem; }
  .nk-hero-eyebrow { font-size: 0.64rem; }
  .nk-hero-title { font-size: clamp(2.8rem, 13vw, 4.25rem); max-width: 10.5ch; }
  .nk-hero-subtitle { border-left: 1px solid var(--neon); border-right: 0; padding-left: 0.7rem; }
  .nk-hero::after { display: none; }
  .section::before { left: 0; }
  .section::after { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { filter: none; transition-delay: 0ms; }
  .section::before, .section::after { transition: none; }
}
