/* 視覺參考 shaundataanalytics.github.io：zinc 底色、cyan 強調色、Geist 字型、毛玻璃浮動導覽、卡片式 Timeline */
:root {
  --bg: #fafafa; --fg: #18181b; --muted: #52525c; --soft: #71717b;
  --card: rgba(255,255,255,.82); --card-solid: #fff; --border: #e4e4e7;
  --chip-bg: #fafafa; --chip-fg: #3f3f46; --pill: #f4f4f5; --pill-hover: #e4e4e7;
  --accent: #0891b2; --accent-fg: #0e7490; --accent-soft: rgba(6,182,212,.1); --accent-line: rgba(6,182,212,.3);
  --btn: #0891b2; --btn-hover: #06b6d4; --shadow: 0 10px 30px -12px rgba(24,24,27,.18);
}
:root[data-theme="dark"] {
  --bg: #09090b; --fg: #fafafa; --muted: #d4d4d8; --soft: #a1a1aa;
  --card: rgba(24,24,27,.8); --card-solid: #18181b; --border: #27272a;
  --chip-bg: #09090b; --chip-fg: #a1a1aa; --pill: rgba(39,39,42,.8); --pill-hover: #3f3f46;
  --accent: #22d3ee; --accent-fg: #22d3ee; --accent-soft: rgba(34,211,238,.1); --accent-line: rgba(34,211,238,.2);
  --btn: #06b6d4; --btn-hover: #22d3ee; --shadow: 0 10px 30px -12px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --fg: #fafafa; --muted: #d4d4d8; --soft: #a1a1aa;
    --card: rgba(24,24,27,.8); --card-solid: #18181b; --border: #27272a;
    --chip-bg: #09090b; --chip-fg: #a1a1aa; --pill: rgba(39,39,42,.8); --pill-hover: #3f3f46;
    --accent: #22d3ee; --accent-fg: #22d3ee; --accent-soft: rgba(34,211,238,.1); --accent-line: rgba(34,211,238,.2);
    --btn: #06b6d4; --btn-hover: #22d3ee; --shadow: 0 10px 30px -12px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  font-family: "Geist", system-ui, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  background: var(--bg); color: var(--fg); line-height: 1.7; font-size: 18px; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.mono { font-family: "Geist Mono", ui-monospace, Consolas, monospace; }
.wrap { max-width: 1152px; margin: 0 auto; padding: 0 24px; }

/* header */
header.top { position: sticky; top: 16px; z-index: 50; max-width: 1152px; margin: 0 auto; padding: 0 16px; }
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); background: var(--card); backdrop-filter: blur(12px);
  border-radius: 16px; padding: 12px 20px; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; }
.brand:hover { color: var(--accent-fg); }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--btn); color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 800; }
nav.links { display: flex; gap: 24px; }
nav.links a { font-size: 18px; font-weight: 500; color: var(--soft); transition: color .15s; }
nav.links a:hover, nav.links a.on { color: var(--fg); }
.tools { display: flex; align-items: center; gap: 8px; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 10px; font-size: 16px; font-weight: 600; color: var(--soft); }
.seg button.on { background: var(--btn); color: #fff; }
.icon-btn { border: 0; background: transparent; border-radius: 10px; padding: 8px; display: grid; place-items: center; color: var(--soft); }
.icon-btn:hover { background: var(--pill); color: var(--fg); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn { display: none; }

/* hero */
.hero { min-height: min(72vh, 620px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 0 40px; }
.badge-live { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-fg); border-radius: 99px; padding: 6px 16px; font-size: 14px; font-weight: 700; margin-bottom: 24px; }
.ping { position: relative; width: 8px; height: 8px; }
.ping::before, .ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); }
.ping::before { animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite; opacity: .6; }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
.hero h1 { font-size: clamp(46px, 8vw, 83px); font-weight: 900; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 16px; }
.hero p.tag { max-width: 640px; font-size: clamp(20px, 2.4vw, 24px); color: var(--muted); margin-bottom: 32px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 12px 24px; font-size: 18px; font-weight: 700; transition: .15s; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--btn); color: #fff; box-shadow: 0 10px 20px -8px rgba(6,182,212,.5); }
.btn.primary:hover { background: var(--btn-hover); }
.btn.ghost { border: 1px solid var(--border); background: var(--card); }
.btn.ghost:hover { border-color: var(--soft); }
.socials { display: flex; gap: 14px; }
.socials a { border: 1px solid var(--border); background: var(--card); border-radius: 12px; padding: 12px; color: var(--soft); display: grid; place-items: center; transition: .15s; }
.socials a:hover { color: var(--fg); border-color: var(--soft); }
.socials svg { width: 20px; height: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; margin-top: 8px; }
.tile { border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 18px 20px; text-align: left; }
.tile b { display: block; font-size: 36px; font-weight: 800; color: var(--accent-fg); line-height: 1.2; }
.tile span { font-size: 17px; color: var(--soft); }
.asof { font-size: 14px; opacity: .75; white-space: nowrap; }

/* sections */
section { padding: 72px 0 24px; }
.sec-head { text-align: center; margin-bottom: 40px; }
.sec-head .pill { display: inline-block; background: var(--accent-soft); color: var(--accent-fg); border-radius: 99px; padding: 4px 14px; font-size: 14px; font-weight: 700; }
.sec-head h2 { font-size: clamp(30px, 4vw, 41px); font-weight: 800; margin-top: 12px; }
.sec-head p { margin: 8px auto 0; max-width: 520px; font-size: 18px; color: var(--soft); }
.stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.stack-card { border: 1px solid var(--border); background: var(--card); border-radius: 14px; padding: 18px; transition: .15s; }
.stack-card:hover { border-color: var(--accent-line); }
.stack-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }

.chip { display: inline-block; border: 1px solid var(--border); background: var(--chip-bg); color: var(--chip-fg); border-radius: 6px; padding: 1px 8px; font-size: 14px; font-weight: 500; margin: 2px 4px 2px 0; font-family: "Geist Mono", ui-monospace, Consolas, monospace; }

/* timeline */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.filters button { border: 0; border-radius: 99px; padding: 6px 16px; font-size: 16px; font-weight: 700; background: var(--pill); color: var(--soft); transition: .15s; }
.filters button:hover { background: var(--pill-hover); }
.filters button.on { background: var(--btn); color: #fff; box-shadow: 0 6px 14px -6px rgba(6,182,212,.6); }
.tl { position: relative; max-width: 880px; margin: 0 auto; border-left: 2px solid var(--accent-line); padding-left: 32px; display: grid; gap: 28px; }
.tl-item { position: relative; }
.tl-item::before { content: ""; position: absolute; left: -41px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--btn); border: 3px solid var(--bg); }
.card { border: 1px solid var(--border); background: var(--card); backdrop-filter: blur(8px); border-radius: 18px; padding: 22px; transition: .2s; }
.card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.tl-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.date { font-size: 16px; font-weight: 600; color: var(--accent-fg); }
.tag-pill { background: var(--pill); color: var(--soft); border-radius: 6px; padding: 2px 10px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tl-org { font-size: 17px; color: var(--soft); font-weight: 600; }
.card h3 { font-size: 22px; font-weight: 700; }
.card ul { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.card li { position: relative; padding-left: 16px; font-size: 18px; color: var(--muted); line-height: 1.7; }
.card li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.card .tags { margin-top: 14px; }
/* 有圖片的經歷卡：字在左、圖在右（規則見 personal-site-decisions） */
.card.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: start; }
.card.split .shots { margin-top: 0; }
.card.split .shot img { height: 160px; }
@media (max-width: 860px) { .card.split { grid-template-columns: 1fr; } .card.split .shots { margin-top: 18px; } }

/* projects：參考動態版的作品區（面板、聚光卡片、等寬標籤、無底色大數字），每個專案一張寬卡，文字在左、截圖在右 */
.hdr { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; opacity: .85; margin-bottom: 8px; }
.hdr b { color: var(--accent-fg); letter-spacing: .14em; font-size: 18px; font-weight: 500; }
.hdr i { font-style: normal; color: var(--soft); }
.hdr span { color: var(--soft); font-size: 16px; letter-spacing: .08em; text-transform: uppercase; }
.proj-title { font-size: clamp(34px, 4.4vw, 50px); font-weight: 800; line-height: 1.2; margin-bottom: 8px; }
.grad { background: linear-gradient(90deg, #3b82f6, #06b6d4, #14b8a6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.proj-sub { font-size: 17px; color: var(--soft); margin-bottom: 22px; max-width: 640px; }
.panel { background: var(--card-solid); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; }
.glow { position: relative; overflow: hidden; --mx: 50%; --my: 50%; transition: transform .3s, border-color .3s, box-shadow .2s; }
.glow::before { content: ""; position: absolute; inset: -1px; opacity: 0; pointer-events: none; transition: opacity .3s; background: radial-gradient(350px circle at var(--mx) var(--my), var(--accent-soft), transparent 70%); }
.glow:hover { transform: translateY(-2px); }
.glow:hover::before { opacity: 1; }
.glow > * { position: relative; }
.proj .cat { font-size: 15px; letter-spacing: .16em; color: var(--accent-fg); }
.proj h3 { font-size: 29px; margin: 4px 0 2px; }
.proj .sub { font-size: 17px; color: var(--soft); }
.wide { display: grid; grid-template-columns: 1.05fr .95fr; gap: 26px; padding: 26px; }
.wide + .wide { margin-top: 12px; }
.wide .shots { margin-top: 0; align-content: start; }
.proj-link { display: inline-block; margin-top: 14px; font-size: 16px; color: var(--accent-fg); }
.proj-link:hover { text-decoration: underline; }
.shot { position: relative; }
.shot[hidden] { display: none; }
.shot-more { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.68); color: #fff; font-size: 16px; font-weight: 700; padding: 2px 12px; border-radius: 99px; pointer-events: none; }
.shots { display: grid; gap: 16px; margin-top: 18px; }
.shot { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.shot a { display: block; cursor: zoom-in; }
.shot img { display: block; width: 100%; height: 220px; object-fit: cover; object-position: top; }
/* 燈箱：在站內看完整圖，長圖可上下捲動 */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.88); display: flex; flex-direction: column; }
.lb-body { flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 60px 72px 16px; }
.lb-body img { max-width: min(100%, 1400px); height: auto; background: #fff; border-radius: 6px; }
.lb-cap { color: #e4e4e7; text-align: center; font-size: 15px; padding: 10px 16px 14px; }
.lb-x, .lb-nav { position: absolute; border: 0; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 22px; line-height: 1; }
.lb-x:hover, .lb-nav:hover { background: rgba(255,255,255,.32); }
.lb-x { top: 12px; right: 16px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
@media (max-width: 860px) { .wide { grid-template-columns: 1fr; padding: 18px; } }
@media (max-width: 820px) { .lb-body { padding: 60px 12px 8px; } .lb-nav { top: auto; bottom: 56px; transform: none; } }
.shot figcaption { padding: 8px 12px; font-size: 14px; color: var(--soft); background: var(--card-solid); border-top: 1px solid var(--border); }
.metrics { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 16px 0 6px; }
.metric { flex: 0 1 auto; max-width: 13rem; font-size: 15px; line-height: 1.4; color: var(--soft); }
.metric b { display: block; font-size: 28px; color: var(--accent-fg); line-height: 1.3; }
.flow-label, .hl-label { font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); margin: 16px 0 8px; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flow span.step { border: 1px solid var(--border); background: var(--chip-bg); border-radius: 8px; padding: 4px 10px; font-size: 16px; font-weight: 500; }
.flow span.arrow { color: var(--accent); font-size: 14px; }
.proj .card-actions { margin-top: auto; padding-top: 16px; display: flex; gap: 10px; }
.proj .btn { padding: 8px 16px; font-size: 17px; }
.more-h { font-size: 16px; letter-spacing: .14em; color: var(--soft); margin: 26px 6px 12px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.more-grid .card h3 { font-size: 19px; }
.more-grid .shot img { height: 150px; }
.more-grid .card p { font-size: 18px; color: var(--muted); margin-top: 6px; }

.cert-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.cert-list span { border: 1px solid var(--border); background: var(--card); border-radius: 99px; padding: 6px 16px; font-size: 17px; color: var(--muted); }
.ai-note { text-align: center; font-size: 17px; color: var(--soft); margin-top: 16px; }

/* contact + footer */
.contact { text-align: center; }
.contact .row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 24px; }
main.wrap { padding-bottom: 72px; }

/* reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ping::before { animation: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 820px) {
  nav.links { display: none; position: absolute; top: calc(100% + 8px); left: 16px; right: 16px; flex-direction: column; gap: 4px; border: 1px solid var(--border); background: var(--card-solid); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
  nav.links.open { display: flex; }
  nav.links a { padding: 10px 12px; border-radius: 10px; }
  nav.links a:hover { background: var(--pill); }
  .menu-btn { display: grid; }
  .brand span.nm { display: none; }
  .tl { padding-left: 24px; }
  .tl-item::before { left: -33px; }
}
