/* 做伙顧樹 × 樹靈記 介紹網站 */
:root {
  --ground: #0c1510;
  --panel: #101d15;
  --panel-2: #162a1c;
  --line: #1f3327;
  --line-2: #2f5c3b;
  --lime: #b8e45a;
  --lime-2: #d6f58c;
  --ink: #e8efe6;
  --ink-2: #c9d6c9;
  --muted: #9db39f;
  --muted-2: #6f8f78;
  --cream: #f4f1e8;
  --cream-2: #fbfaf5;
  --cream-line: #e3dfd0;
  --forest: #2f5c3b;
  --cream-ink: #1e2b22;
  --cream-ink-2: #33453a;
  --cream-muted: #5f7264;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --radius: 24px;
  --wrap: 1280px;
  --gutter: 48px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--lime); }
a:hover { color: var(--lime-2); }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 900; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; color: var(--lime); text-transform: uppercase; }
.eyebrow.dark { color: var(--forest); }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.section-head h2 { font-size: clamp(30px, 3.2vw, 40px); }
.section-head p { font-size: 17px; line-height: 1.7; color: #b7c7b9; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font-weight: 700; font-size: 17px; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-lime { background: var(--lime); color: var(--ground); }
.btn-lime:hover { background: var(--lime-2); color: var(--ground); }
.btn-ghost { border: 1px solid #3a5a44; color: var(--ink); font-weight: 500; }
.btn-ghost:hover { border-color: var(--lime); color: var(--ink); }
.btn-forest { background: var(--forest); color: var(--cream); }
.btn-forest:hover { background: #244a2f; color: var(--cream); }
.btn-sm { min-height: 44px; padding: 0 20px; font-size: 15px; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(12, 21, 16, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 16px 32px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 18px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand .x { color: var(--muted-2); font-weight: 400; }
.nav-links { display: flex; gap: 24px; margin-left: auto; font-size: 15px; }
.nav-links a { color: var(--ink-2); text-decoration: none; }
.nav-links a:hover { color: var(--lime); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; }

/* HERO */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: 96px; padding-bottom: 72px; }
.hero-copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero-tag { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; color: var(--lime); letter-spacing: .04em; }
.hero-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(184, 228, 90, .18); }
.hero h1 { font-size: clamp(38px, 4.6vw, 64px); }
.hero .lede { font-size: 20px; line-height: 1.7; color: #b7c7b9; max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 16px; font-size: 14px; color: #8fa893; }
.hero-art { flex: 0 1 560px; min-width: 0; display: flex; justify-content: center; align-items: flex-end; position: relative; min-height: 620px; }
.phone { border-radius: 32px; border: 6px solid #1a2a1f; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); }
.phone-a { width: 260px; transform: rotate(-6deg) translateY(30px); animation: floatA 7s ease-in-out infinite; }
.phone-b { width: 290px; margin-left: -60px; position: relative; z-index: 1; animation: floatB 8s ease-in-out infinite; }
@keyframes floatA { 0%, 100% { transform: rotate(-6deg) translateY(30px); } 50% { transform: rotate(-6deg) translateY(18px); } }
@keyframes floatB { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* WHY */
.why { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.why .wrap { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 40px; }
.why-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 48px; }
.why-head h2 { flex: 1 1 420px; font-size: clamp(30px, 3.2vw, 40px); }
.why-head p { flex: 1 1 420px; font-size: 17px; line-height: 1.7; color: #b7c7b9; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.stat { padding: 28px; border-radius: 20px; background: var(--ground); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.stat .num { font-family: var(--mono); font-size: 44px; font-weight: 600; line-height: 1; color: var(--ink); }
.stat .num.hot { color: var(--lime); }
.stat .label { font-size: 15px; color: var(--ink-2); }
.stat .src { font-size: 12px; color: var(--muted-2); }

/* TWO DOORS */
.doors { padding-top: 80px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 32px; }
.door-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.door { border-radius: var(--radius); padding: 36px; display: flex; flex-direction: column; gap: 18px; }
.door.app { background: var(--panel); border: 1px solid var(--line); }
.door.web { background: var(--cream); color: var(--cream-ink); }
.door-head { display: flex; align-items: center; gap: 14px; }
.door-head img, .door-head .glyph { width: 52px; height: 52px; border-radius: 14px; flex: 0 0 auto; }
.door-head .glyph { background: var(--forest); display: flex; align-items: center; justify-content: center; }
.door-head .t { display: flex; flex-direction: column; }
.door-head .t b { font-size: 24px; font-weight: 900; }
.door-head .t span { font-size: 13px; color: #8fa893; }
.door.web .door-head .t span { color: var(--cream-muted); }
.door ul { margin: 0; padding-left: 20px; font-size: 16px; line-height: 1.9; color: var(--ink-2); }
.door.web ul { color: var(--cream-ink-2); }
.door .foot { margin-top: auto; font-size: 14px; color: var(--lime); }
.door.web .foot { color: var(--forest); font-weight: 700; }

/* PLAY */
.play { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 40px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.step { display: flex; flex-direction: column; gap: 16px; }
.step .media { border-radius: 24px; border: 4px solid #1a2a1f; overflow: hidden; background: #000; aspect-ratio: 480 / 1044; }
.step .media video, .step .media img { width: 100%; height: 100%; object-fit: cover; }
.step .text { display: flex; gap: 12px; align-items: flex-start; }
.step .n { font-family: var(--mono); font-size: 14px; color: var(--lime); padding-top: 3px; }
.step h3 { font-size: 20px; font-weight: 700; }
.step p { font-size: 14px; line-height: 1.7; color: var(--muted); margin-top: 6px; }

/* FEATURES */
.features { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.features .wrap { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 40px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.feat { border-radius: var(--radius); background: var(--ground); border: 1px solid var(--line); padding: 24px; display: flex; gap: 20px; align-items: flex-start; transition: border-color .15s ease, transform .15s ease; }
.feat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.feat img { width: 132px; border-radius: 14px; flex: 0 0 auto; }
.feat .t { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.feat h3 { font-size: 20px; font-weight: 700; }
.feat p { font-size: 14px; line-height: 1.7; color: var(--muted); }

/* DATA FLOW (interactive) */
.data { padding-top: 80px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 40px; }
.flow { display: grid; grid-template-columns: 300px minmax(0, 1fr) 380px; gap: 24px; }
.flow-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.flow-col .k { font-family: var(--mono); font-size: 12px; color: var(--muted-2); letter-spacing: .06em; }
.action {
  display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
  min-height: 72px; padding: 14px 16px; border-radius: 14px; font-family: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); transition: background .15s ease, border-color .15s ease;
}
.action b { font-size: 17px; font-weight: 700; }
.action span { font-size: 13px; line-height: 1.5; opacity: .8; }
.action:hover { border-color: var(--line-2); }
.action[aria-pressed="true"] { background: var(--lime); color: var(--ground); border-color: var(--lime); }
.tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.tbl {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; min-height: 74px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted-2); transition: all .2s ease;
}
.tbl code { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.tbl small { font-size: 12px; line-height: 1.5; opacity: .85; }
.tbl .note { display: none; font-size: 12px; color: var(--lime); margin-top: 2px; }
.tbl.on { background: var(--panel-2); border-color: var(--lime); color: var(--ink); }
.tbl.on .note { display: block; }
.flow-note { font-size: 12px; color: var(--muted-2); margin-top: auto; }
.result { border-radius: 16px; background: var(--cream); color: var(--cream-ink); padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.result h3 { font-size: 18px; font-weight: 900; }
.result p { font-size: 14px; line-height: 1.7; color: var(--cream-ink-2); }
.result pre { margin: 0; margin-top: auto; padding: 12px 14px; border-radius: 12px; background: var(--cream-2); border: 1px solid var(--cream-line); font-family: var(--mono); font-size: 12px; color: var(--forest); white-space: pre-wrap; line-height: 1.6; }
.sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.source { border-radius: 16px; background: var(--panel); border: 1px solid var(--line); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.source b { font-weight: 700; }
.source span { font-size: 13px; color: var(--muted); }

/* KOOTREE */
.koo { background: var(--cream); color: var(--cream-ink); }
.koo .wrap { padding-top: 80px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 40px; }
.koo-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 48px; }
.koo-head .section-head { flex: 1 1 480px; }
.koo-head .section-head p { color: var(--cream-ink-2); }
.koo-shot { width: 100%; border-radius: 20px; border: 1px solid #d9d4c4; box-shadow: 0 24px 60px rgba(30, 43, 34, .18); }
.koo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.koo-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 16px; background: var(--cream-2); border: 1px solid var(--cream-line); }
.koo-card b { font-weight: 700; font-size: 17px; }
.koo-card span { font-size: 14px; line-height: 1.7; color: var(--cream-muted); }

/* FOOTER */
.footer { padding-top: 56px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 28px; }
.footer .srcs { display: flex; flex-wrap: wrap; gap: 12px 32px; font-size: 13px; color: #8fa893; line-height: 1.7; }
.footer .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted-2); }
.footer .bar nav { display: flex; gap: 24px; margin-left: auto; }
.footer .bar a { color: var(--muted); text-decoration: none; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .phone-a, .phone-b { animation: none; }
  html { scroll-behavior: auto; }
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .stats, .koo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: 1fr; }
  .flow-col.actions { flex-direction: row; flex-wrap: wrap; }
  .flow-col.actions .k { flex-basis: 100%; }
  .flow-col.actions .action { flex: 1 1 220px; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .nav .wrap { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links { display: none; flex-basis: 100%; flex-direction: column; gap: 12px; padding: 8px 0 4px; }
  .nav-links.open { display: flex; }
  .nav .btn { display: none; }
  .hero { padding-top: 56px; padding-bottom: 40px; gap: 32px; }
  .hero-art { min-height: 0; flex-basis: 100%; }
  .phone-a { width: 44%; }
  .phone-b { width: 50%; margin-left: -8%; }
  .stats, .feat-grid, .door-grid, .koo-grid, .sources { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .step h3 { font-size: 17px; }
  .step p { font-size: 13px; }
  .hero h1 br { display: none; }
  .tables { grid-template-columns: 1fr; }
  .door { padding: 24px; }
  .feat img { width: 104px; }
  .stat .num { font-size: 36px; }
  .footer .bar nav { margin-left: 0; }
}
