/* ===== 設計變數 ===== */
:root {
  --bg: #f5f6f0;
  --bg-2: #ffffff;
  --line: #dde1d6;
  --text: #141714;
  --muted: #5c645d;
  --volt: #d4ff3a;      /* 主色：螢光黃綠（色塊用） */
  --volt-ink: #4a7a0c;  /* 主色深版：淺底上的文字、線條用 */
  --track: #ee4b24;     /* 輔色：跑道橘紅 */
  --display: "Big Shoulders Display", "Noto Sans TC", sans-serif;
  --body: "Noto Sans TC", sans-serif;
  --mono: "JetBrains Mono", monospace;
  --gutter: clamp(16px, 5vw, 72px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
::selection { background: var(--volt); color: var(--text); }

/* 顆粒質感 */
.grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .035;
  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'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== 導覽列 ===== */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  transition: background .3s, backdrop-filter .3s, padding .3s;
}
.nav.scrolled {
  background: rgba(245, 246, 240, .85);
  backdrop-filter: blur(12px);
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  background: var(--volt); color: var(--text);
  font-weight: 900; font-size: 24px;
  transform: skewX(-10deg);
}
.logo-text { font-weight: 900; font-size: 18px; line-height: 1.1; letter-spacing: .08em; }
.logo-text small { display: block; font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--muted); letter-spacing: .2em; }
.logo-text small span { color: var(--volt-ink); font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: 32px; font-size: 15px; }
.nav-links a { position: relative; color: var(--muted); transition: color .2s; }
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
  background: var(--volt-ink); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta { padding: 8px 18px; background: var(--volt); color: var(--text) !important; font-weight: 500; }
.nav-cta:hover { background: var(--text); color: var(--volt) !important; }

.nav-toggle { display: none; background: none; border: 0; width: 36px; height: 36px; padding: 0; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; margin: 8px 4px; background: var(--text); transition: transform .3s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-5px) rotate(-45deg); }

/* ===== 按鈕 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; font-weight: 500; font-size: 15px; letter-spacing: .05em;
  border: 1px solid transparent; cursor: pointer; font-family: var(--body);
  transition: transform .2s var(--ease), background .2s, color .2s;
}
.btn span { transition: transform .2s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn-primary { background: var(--volt); color: var(--text); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px var(--volt); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 40px;
  padding: 120px var(--gutter) 110px;
  overflow: hidden;
  background:
    radial-gradient(60% 60% at 85% 30%, rgba(212, 255, 58, .45), transparent 70%),
    radial-gradient(40% 50% at 0% 100%, rgba(238, 75, 36, .12), transparent 70%);
}
/* 跑道線 */
.lanes {
  position: absolute; inset: -20% -10%; display: flex; justify-content: space-between;
  transform: rotate(-18deg); opacity: .5; pointer-events: none;
}
.lanes span { width: 1px; background: linear-gradient(transparent, var(--line) 30%, var(--line) 70%, transparent); }
.lanes span:nth-child(4) { background: linear-gradient(transparent, rgba(74,122,12,.35) 40%, transparent); }

.hero-inner { position: relative; z-index: 1; }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--volt-ink); letter-spacing: .3em; margin: 0 0 24px; }
.eyebrow::before { content: ""; display: inline-block; width: 32px; height: 1px; background: var(--volt-ink); vertical-align: middle; margin-right: 12px; }
.hero-title {
  margin: 0; font-weight: 900; font-size: clamp(44px, 7.5vw, 112px); line-height: 1.08; letter-spacing: -.01em;
}
.hero-title .line { display: block; }
.hero-title em {
  font-style: normal; color: var(--text); background: var(--volt);
  padding: 0 .12em; display: inline-block; transform: skewX(-10deg);
}
.hero-sub { max-width: 34em; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); margin: 32px 0 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* 即時數據卡 */
.live-card {
  position: relative; z-index: 1; justify-self: end; width: 100%; max-width: 380px;
  background: rgba(255, 255, 255, .88); border: 1px solid var(--line);
  padding: 24px; backdrop-filter: blur(8px);
  box-shadow: 0 40px 80px -30px rgba(30, 40, 20, .25);
}
.live-card::before { content: ""; position: absolute; left: -1px; top: -1px; width: 40px; height: 3px; background: var(--volt); }
.live-head { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .15em; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--track); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.pulse { width: 100%; height: 70px; margin: 20px 0; }
.pulse path {
  fill: none; stroke: var(--volt-ink); stroke-width: 2; stroke-linejoin: round;
  stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2.4s linear infinite;
}
@keyframes draw { to { stroke-dashoffset: -600; } }
.live-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.live-stats dt { font-size: 12px; color: var(--muted); }
.live-stats dd { margin: 0; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.live-stats b { display: block; font-family: var(--display); font-size: 34px; line-height: 1.1; color: var(--text); }

/* 跑馬燈 */
.ticker { position: absolute; left: 0; right: 0; bottom: 0; border-block: 1px solid var(--line); overflow: hidden; background: var(--bg); }
.ticker-track { display: flex; gap: 32px; width: max-content; padding: 14px 0; animation: marquee 30s linear infinite; }
.ticker-track span { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.ticker-track span:nth-child(even) { color: var(--volt-ink); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== 共用區塊 ===== */
.section { position: relative; padding: clamp(80px, 12vw, 160px) var(--gutter); border-top: 1px solid var(--line); }
.section-label { font-family: var(--mono); font-size: 12px; letter-spacing: .25em; color: var(--muted); margin-bottom: 48px; }
.section-title { font-size: clamp(36px, 5vw, 64px); font-weight: 900; margin: 0 0 56px; line-height: 1.2; }
.hl { color: var(--volt-ink); }

/* 關於 */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: end; }
.about h2 { font-size: clamp(32px, 4.4vw, 60px); font-weight: 900; line-height: 1.3; margin: 0; }
.about-copy p { color: var(--muted); margin: 0 0 1em; font-size: 16px; }

/* 服務 */
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card {
  position: relative; background: var(--bg); padding: 36px 28px 40px; overflow: hidden;
  transition: background .35s var(--ease);
}
.card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--volt); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.card:hover { background: var(--bg-2); }
.card:hover::after { transform: scaleX(1); }
.card-no { font-family: var(--display); font-weight: 900; font-size: 64px; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--muted); transition: -webkit-text-stroke-color .3s; }
.card:hover .card-no { -webkit-text-stroke-color: var(--volt-ink); }
.card h3 { font-size: 22px; margin: 28px 0 12px; }
.card p { color: var(--muted); font-size: 15px; margin: 0 0 20px; }
.card ul { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: 12px; }
.card li::before { content: "▸ "; color: var(--volt-ink); }

/* 產品 */
.product-list { display: grid; gap: 48px; }
.product {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: center;
  padding: clamp(28px, 4vw, 56px); border: 1px solid var(--line); background: var(--bg-2);
  position: relative;
}
.product::before { content: ""; position: absolute; left: -1px; top: -1px; width: 64px; height: 3px; background: var(--volt); }
.product-alt { grid-template-columns: 1.1fr 1fr; }
.product-alt .product-visual { order: 2; }
.product-alt::before { background: var(--track); }

.product-visual {
  aspect-ratio: 4 / 3; display: grid; place-items: center;
  background:
    repeating-linear-gradient(-18deg, transparent 0 38px, rgba(0,0,0,.04) 38px 39px),
    var(--bg);
  border: 1px solid var(--line);
}
.mock { width: min(78%, 300px); font-size: 14px; }
.mock-stock { background: var(--bg-2); border: 1px solid var(--line); padding: 20px; box-shadow: 0 30px 60px -30px rgba(30, 40, 20, .35); transform: rotate(-3deg); }
.mock-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.mock-head b { color: var(--volt-ink); font-weight: 600; }
.mock-num { font-family: var(--display); font-weight: 900; font-size: 72px; line-height: 1; margin: 8px 0 12px; }
.mock-num small { font-family: var(--body); font-size: 16px; color: var(--muted); margin-left: 6px; }
.mock-bar { height: 6px; background: var(--line); }
.mock-bar i { display: block; height: 100%; background: var(--volt); }
.mock-rows { list-style: none; padding: 0; margin: 16px 0 0; font-size: 13px; }
.mock-rows li { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); color: var(--muted); }
.mock-rows .warn { color: var(--track); }

.mock-chat { display: grid; gap: 12px; transform: rotate(2deg); }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--bg-2); border: 1px solid var(--line); line-height: 1.6; }
.bubble.me { justify-self: end; border-radius: 16px 16px 4px 16px; background: #06c755; border-color: #06c755; color: #fff; }
.bubble.bot { border-color: var(--track); }

.product-tag { font-family: var(--mono); font-size: 12px; letter-spacing: .15em; color: var(--volt-ink); }
.product-alt .product-tag { color: var(--track); }
.product h3 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 900; margin: 10px 0 8px; line-height: 1.25; }
.product-lead { color: var(--text); font-size: 17px; margin: 0 0 20px; }
.product-features { list-style: none; padding: 0; margin: 0 0 32px; color: var(--muted); font-size: 15px; }
.product-features li { padding: 8px 0 8px 24px; position: relative; border-bottom: 1px dashed var(--line); }
.product-features li::before { content: "▸"; position: absolute; left: 0; color: var(--volt-ink); }
.product-alt .product-features li::before { color: var(--track); }

/* 應用場景 */
.case-list { border-top: 1px solid var(--line); }
.case {
  display: grid; grid-template-columns: 140px 1fr 1.2fr 40px; align-items: center; gap: 24px;
  padding: 32px 0; border-bottom: 1px solid var(--line);
  transition: padding .35s var(--ease), background .35s;
}
.case:hover { padding-inline: 20px; background: var(--bg-2); }
.case-tag { font-family: var(--mono); font-size: 12px; color: var(--volt-ink); letter-spacing: .1em; }
.case-name { font-size: clamp(22px, 2.6vw, 34px); font-weight: 900; }
.case-desc { color: var(--muted); font-size: 15px; }
.case-arrow { font-size: 24px; transition: transform .3s var(--ease), color .3s; }
.case:hover .case-arrow { transform: rotate(45deg); color: var(--volt-ink); }

/* 流程 */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; position: relative; }
.steps::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; border-top: 2px dashed var(--line); }
.steps li { position: relative; padding-top: 44px; }
.steps li::before { content: ""; position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--volt-ink); }
.steps li:last-child::before { background: var(--volt); }
.steps b { font-family: var(--mono); font-size: 12px; color: var(--track); letter-spacing: .15em; }
.steps h3 { font-size: 22px; margin: 6px 0 8px; }
.steps p { color: var(--muted); margin: 0; font-size: 15px; }

/* 聯絡 */
.contact { background: linear-gradient(180deg, var(--bg), var(--bg-2)); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.contact-title { font-size: clamp(44px, 6.5vw, 96px); font-weight: 900; line-height: 1.1; margin: 0 0 48px; }
.contact-title em { font-style: normal; color: var(--volt-ink); }
.contact-info { list-style: none; padding: 0; margin: 0; }
.contact-info li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.contact-info span { display: inline-block; width: 96px; font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .15em; }
.contact-info a { transition: color .2s; }
.contact-info a:hover { color: var(--volt-ink); }
.contact-body { align-self: end; }
.contact-lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; }
.contact-body .btn { margin-bottom: 40px; }
.contact-body .contact-info { border-top: 1px solid var(--line); }

/* 頁尾 */
.footer { padding: 0 var(--gutter) 32px; border-top: 1px solid var(--line); overflow: hidden; }
.footer-big {
  font-family: var(--display); font-weight: 900; font-size: clamp(48px, 12vw, 200px); line-height: 1;
  white-space: nowrap; color: transparent; -webkit-text-stroke: 1px var(--line); padding: 48px 0 32px;
}
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }
.footer-row a:hover { color: var(--volt-ink); }

/* ===== 進場動畫 ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .pulse path { stroke-dashoffset: 0; }
}

/* ===== RWD ===== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; padding-top: 140px; }
  .live-card { justify-self: start; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .product, .product-alt { grid-template-columns: 1fr; }
  .product-alt .product-visual { order: 0; }
  .case { grid-template-columns: 110px 1fr 40px; }
  .case-desc { grid-column: 2 / 3; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; position: relative; z-index: 2; }
  .nav-links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 28px;
    background: var(--bg); font-size: 22px;
    opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  .nav-links.open { opacity: 1; pointer-events: auto; }
  .service-grid { grid-template-columns: 1fr; }
  .case { grid-template-columns: 1fr 32px; gap: 8px 16px; }
  .case-tag, .case-desc { grid-column: 1 / 2; }
  .case-arrow { grid-row: 1 / 4; grid-column: 2; }
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .steps::before { top: 0; bottom: 0; left: 9px; right: auto; border-top: 0; border-left: 2px dashed var(--line); }
  .steps li { padding: 0 0 0 44px; }
}
