/* ==========================================================================
   林家齊 個人網站 · site.css
   淺色（paper）／深色（ink）兩套色票，三個斷點：1080 / 760 / 480
   ========================================================================== */

:root,
[data-theme="paper"] {
  --bg: #F4F5F1;
  --bg-tint: #EAEDE5;
  --surface: #FFFFFF;
  --ink: #16212B;
  --ink-2: #3E4B57;
  --ink-3: #56616D;
  --line: #D6DBD1;
  --line-soft: #E3E7DE;
  --accent: #5C7A2B;          /* 橄欖綠，對應履歷標題色 */
  --accent-ink: #FFFFFF;
  --accent-soft: #E3EBD3;
  --branch: #B97A12;          /* 琥珀，只用在空檔期支線 */
  --branch-soft: #F6ECD8;
  --band: #16212B;            /* 聯絡區塊底色 */
  --band-ink: #EEF1EA;
  --band-ink-2: #A9B4BE;
  --shadow: 0 1px 2px rgba(22, 33, 43, .06), 0 8px 24px -12px rgba(22, 33, 43, .18);
  --grid: rgba(22, 33, 43, .055);
  --photo-bg: #E4E9DF;
  --photo-glow: rgba(255, 255, 255, .75);
  color-scheme: light;
}

[data-theme="ink"] {
  --bg: #12181E;
  --bg-tint: #182028;
  --surface: #1C252E;
  --ink: #E8ECE5;
  --ink-2: #BAC3CB;
  --ink-3: #A3AEB9;
  --line: #2C3843;
  --line-soft: #232D37;
  --accent: #9DBE5E;
  --accent-ink: #12181E;
  --accent-soft: #263220;
  --branch: #E2A642;
  --branch-soft: #2E2616;
  --band: #0D1216;
  --band-ink: #E8ECE5;
  --band-ink-2: #A3AEB9;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
  --grid: rgba(232, 236, 229, .04);
  --photo-bg: #222B33;
  --photo-glow: rgba(232, 236, 229, .10);
  color-scheme: dark;
}

:root {
  --f-serif: "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", "PMingLiU", serif;
  --f-sans: "IBM Plex Sans", "Noto Sans TC", -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
}

/* ---------- 基礎 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* 斷行：只在標點與空白處換行（韓文網站常用的 keep-all），過長時才強制換行 */
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-break: strict;
}
h1, h2, h3, h4, .tier__name, .proof strong { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
.nw { white-space: nowrap; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
time { font-family: var(--f-mono); font-size: .875rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.muted { color: var(--ink-3); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 6px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- 按鈕與小元件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-size: .9375rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--sm { min-height: 36px; padding: 0 16px; font-size: .875rem; }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--accent); color: var(--accent-ink); }
.btn--line { border-color: var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--bg); }
.btn--text { padding-inline: 4px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.btn--text:hover { text-decoration-color: var(--accent); }

.pill {
  display: inline-block; padding: 1px 10px; border-radius: 999px;
  border: 1px solid var(--line); font-size: .875rem; font-weight: 500; color: var(--ink); line-height: 1.75;
}
.pill--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
[data-theme="ink"] .pill--accent { color: var(--accent); }

.tagline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 10px; }

.stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.stack li {
  font-family: var(--f-mono); font-size: .8125rem; line-height: 1;
  padding: 7px 10px; border-radius: 6px; background: var(--bg-tint); color: var(--ink-2);
}

.links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; font-size: .9375rem; font-weight: 500; }
.links a { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1.5px; text-decoration-color: var(--accent); }
.links a:hover { color: var(--accent); }
.links .muted { font-weight: 400; font-size: .875rem; }

/* ---------- 頂部導覽 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand__name { font-family: var(--f-serif); font-weight: 900; font-size: 1.25rem; letter-spacing: .06em; }
.brand__role { font-size: .9375rem; font-weight: 500; color: var(--ink-2); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  position: relative; padding: 8px 12px; font-size: .9375rem; color: var(--ink-2); text-decoration: none; border-radius: 6px;
}
.nav a:hover { color: var(--ink); background: var(--bg-tint); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent);
}
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.theme-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.theme-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-moon { display: none; }
[data-theme="ink"] .theme-btn .i-sun { display: none; }
[data-theme="ink"] .theme-btn .i-moon { display: block; }

/* ---------- 開場 ---------- */
.hero {
  position: relative; isolation: isolate;
  padding: clamp(48px, 8vw, 104px) 0 8px;
}
/* 製圖紙方格，呼應建築製圖背景；只淡出底紋，不影響內容 */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(32px, 6vw, 80px); align-items: start; }

.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: .875rem; font-weight: 500; color: var(--ink-2);
}
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.hero__name {
  margin-top: 28px;
  font-family: var(--f-serif); font-weight: 900;
  font-size: clamp(3.5rem, 10vw, 7rem); line-height: 1; letter-spacing: .08em;
}
.hero__role {
  margin-top: 14px;
  font-family: var(--f-serif); font-weight: 600;
  font-size: clamp(1.25rem, 2.4vw, 1.625rem); color: var(--ink-2); letter-spacing: .04em;
}
.hero__lead { margin-top: 24px; max-width: 36em; font-size: 1.0625rem; line-height: 1.9; color: var(--ink-2); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 32px; }

/* 開場：常用技術規格表 */
.spec { margin-top: 40px; max-width: 620px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.spec__row { display: grid; grid-template-columns: 5.5em 1fr; align-items: center; gap: 14px; padding: 12px 0; }
.spec__row + .spec__row { border-top: 1px solid var(--line); }
.spec__row dt { font-size: .9375rem; font-weight: 500; color: var(--ink-2); }
.spec__chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.spec__chips li {
  font-family: var(--f-mono); font-size: .875rem; line-height: 1; padding: 8px 11px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.spec__chips li.is-main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }

/* 求職條件：建築圖說標題欄 */
.tblock {
  background: var(--surface); border: 1px solid var(--ink); border-radius: 4px;
  box-shadow: 6px 6px 0 var(--line);
}
.tblock__photo {
  position: relative; aspect-ratio: 1 / 1.08; overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background:
    radial-gradient(60% 55% at 50% 42%, var(--photo-glow), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 14px 14px,
    var(--photo-bg);
}
.tblock__photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 30%;
}
.tblock__grid { margin: 0; }
.tblock__row { display: grid; grid-template-columns: 5.6em 1fr; border-top: 1px solid var(--line); }
.tblock__row:first-child { border-top: 0; }
.tblock__row dt, .tblock__row dd { padding: 10px 14px; }
.tblock__row dt { font-size: .9375rem; font-weight: 500; color: var(--ink-2); border-right: 1px solid var(--line); line-height: 1.7; }
.tblock__row dd { font-size: .9375rem; font-weight: 500; line-height: 1.6; }
.tblock__row--split { grid-template-columns: 1fr 1fr; border-top-color: var(--ink); }
.tblock__row--split > div { display: flex; align-items: baseline; }
.tblock__row--split dt { border-right: 0; padding-right: 0; white-space: nowrap; }
.tblock__row--split > div + div { border-left: 1px solid var(--line); }
.tblock__row--split dt, .tblock__row--split dd { padding-block: 9px; font-size: .9375rem; }
.tblock__row--split dd { font-family: var(--f-serif); font-weight: 700; }
.tblock__row--split time { color: var(--ink); font-size: .9375rem; font-weight: 600; }

/* 2014–2026 時間總覽 */
.overview { margin-top: clamp(48px, 7vw, 80px); padding-top: 22px; border-top: 1px solid var(--ink); }
.overview__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.overview__title { font-family: var(--f-serif); font-weight: 700; font-size: 1.125rem; letter-spacing: .03em; }
.overview__more { font-size: .875rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.overview__more:hover { color: var(--accent); }

.ov { position: relative; height: 92px; margin-top: 34px; }
.ov__svg { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 64px; overflow: visible; }
.ov__svg * { fill: none; vector-effect: non-scaling-stroke; }
.ov__base { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.ov__main { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.ov__branch { stroke: var(--branch); stroke-width: 2.5; stroke-linecap: round; }
.ov__dot {
  position: absolute; top: 46px; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--bg);
}
.ov__dot--branch { top: 14px !important; background: var(--bg); border: 2px solid var(--branch); }
.ov__dot--head { width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; background: var(--bg); border: 3.5px solid var(--accent); }
.ov__label {
  position: absolute; top: 58px; transform: translateX(-50%); white-space: nowrap;
  font-size: .875rem; font-weight: 500; color: var(--ink-2);
}
.ov__label--up { top: -18px; color: var(--branch); font-weight: 500; }
.ov__label--accent { color: var(--accent); font-weight: 600; }
.ov__label--head {
  top: 12px; right: 0; left: auto; transform: none;
  font-family: var(--f-mono); font-size: .8125rem; font-weight: 600; color: var(--accent);
}
.ov__years { position: relative; height: 30px; border-top: 1px solid var(--line-soft); margin-top: 4px; }
.ov__years span { position: absolute; top: 6px; transform: translateX(-50%); font-family: var(--f-mono); font-size: .875rem; font-weight: 500; color: var(--ink-2); }
.ov__years span:first-child { transform: none; }

.proof { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 28px; }
.proof a {
  display: block; height: 100%; padding: 16px 18px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color .2s;
}
.proof a:hover { border-color: var(--accent); }
.proof strong { display: block; font-family: var(--f-serif); font-weight: 700; font-size: clamp(1.375rem, 2.2vw, 1.75rem); line-height: 1.25; }
.proof span { display: block; margin-top: 4px; font-size: .875rem; line-height: 1.6; color: var(--ink-2); }

/* ---------- 區塊 ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section--tint { background: var(--bg-tint); }
.section__head { max-width: 46em; margin-bottom: clamp(36px, 5vw, 56px); }
.section__head h2 {
  font-family: var(--f-serif); font-weight: 700;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem); line-height: 1.3; letter-spacing: .03em;
}
.section__head p { margin-top: 12px; color: var(--ink-2); }
.subhead { font-family: var(--f-serif); font-weight: 700; font-size: 1.25rem; letter-spacing: .03em; margin-bottom: 18px; }

/* ---------- 作品：主打 ---------- */
.feature {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(28px, 4.5vw, 64px); align-items: center;
  padding-bottom: clamp(48px, 6vw, 72px); margin-bottom: clamp(48px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
}
.feature--flip .media { order: 2; }

/* 作品截圖／影片 */
.media {
  position: relative; display: block; overflow: hidden; background: #0E1318;
  border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.media img, .media video { display: block; width: 100%; height: auto; aspect-ratio: 1877 / 903; object-fit: cover; object-position: center top; }
.media video { background: #0E1318; }
.media__toggle {
  position: absolute; left: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 14px 0 7px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(14, 19, 24, .78); color: #fff; font: 500 .8125rem/1 var(--f-sans);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: .9; transition: background-color .2s, opacity .2s;
}
.media__toggle time { color: rgba(255, 255, 255, .85); font-size: .8125rem; }
.media__icon { position: relative; width: 24px; height: 24px; border-radius: 50%; background: #9DBE5E; }
/* 播放中顯示暫停圖示，暫停時顯示播放三角形 */
.media__icon::before, .media__icon::after {
  content: ""; position: absolute; top: 7px; width: 3px; height: 10px; border-radius: 1px; background: #12181E;
}
.media__icon::before { left: 8px; }
.media__icon::after { left: 13px; }
.media__toggle[data-paused] .media__icon::before { display: none; }
.media__toggle[data-paused] .media__icon::after {
  left: 9px; top: 7px; width: 0; height: 0; border-radius: 0; background: none;
  border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent #12181E;
}
.media:hover .media__toggle, .media__toggle:focus-visible { background: rgba(14, 19, 24, .95); opacity: 1; }
.media__toggle:focus-visible { outline: 2px solid #9DBE5E; outline-offset: 2px; }


.feature__body h3 { font-family: var(--f-serif); font-weight: 700; font-size: clamp(1.375rem, 2.4vw, 1.75rem); line-height: 1.35; letter-spacing: .02em; }
.feature__desc { margin-top: 12px; color: var(--ink-2); }
.ticks { margin-top: 18px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 22px; font-size: .9375rem; line-height: 1.7; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 9px; height: 5px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}

/* ---------- 作品：其他 ---------- */
.minis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.mini {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.mini > .media { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.mini--wide { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
.mini--wide .mini__body { flex: 1.6; }
.mini__aside { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 20px 22px; border-left: 1px solid var(--line-soft); }
.mini__aside .stack { margin-top: 0; }
.mini__body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.mini h4 { font-family: var(--f-serif); font-weight: 700; font-size: 1.1875rem; line-height: 1.4; letter-spacing: .02em; }
.mini__body > p:not(.tagline):not(.links) { margin-top: 8px; font-size: .9375rem; color: var(--ink-2); }
.mini .links { margin-top: auto; padding-top: 16px; }
.mini__aside .links { margin-top: 0; padding-top: 0; }

/* ---------- 經歷：commit graph ---------- */
.legend { display: flex; gap: 22px; margin-top: 18px !important; font-size: .9375rem; color: var(--ink-2); }
.legend__item { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 22px; height: 3px; border-radius: 2px; }
.legend__main { background: var(--accent); }
.legend__branch { background: var(--branch); }

.career { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.career__aside { position: sticky; top: 96px; }
.summary { padding: 22px 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.summary__title { font-family: var(--f-serif); font-weight: 700; font-size: 1.125rem; letter-spacing: .03em; }
.summary__list { margin-top: 10px; }
.summary__list div { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.summary__list dt { font-size: .875rem; font-weight: 500; color: var(--ink-2); }
.summary__list strong { display: block; font-family: var(--f-serif); font-weight: 700; font-size: 1.5rem; line-height: 1.3; }
.summary__list span { display: block; font-size: .875rem; color: var(--ink-2); line-height: 1.6; }
.summary__cta { width: 100%; margin-top: 12px; }
.graph { --x-main: 14px; --x-branch: 44px; --dot: 14px; }
.node { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); }
.node__rail { position: relative; }

/* 主線 */
.node__rail::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--x-main) - 1px); width: 2px; background: var(--accent);
}
.node--head .node__rail::before { top: 22px; }
.node--root .node__rail::before { bottom: auto; height: 22px; }

/* 節點圓點 */
.node__rail::after {
  content: ""; position: absolute; top: 15px; left: calc(var(--x-main) - var(--dot) / 2);
  width: var(--dot); height: var(--dot); border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--bg-tint);
}
.node--head .node__rail::after {
  width: 20px; height: 20px; top: 12px; left: calc(var(--x-main) - 10px);
  background: var(--bg-tint); border: 4px solid var(--accent);
}
.node--branch .node__rail::after {
  top: 34px; left: calc(var(--x-branch) - var(--dot) / 2);
  background: var(--bg-tint); border: 2.5px solid var(--branch);
}

/* 支線：分岔與合併 */
.node--branch::before,
.node--branch::after {
  content: ""; position: absolute; left: var(--x-main);
  width: calc(var(--x-branch) - var(--x-main) + 1px); height: 20px;
  border-right: 2px solid var(--branch); pointer-events: none;
}
.node--branch::before { top: 0; border-top: 2px solid var(--branch); border-top-right-radius: 18px; }
.node--branch::after { bottom: 0; border-bottom: 2px solid var(--branch); border-bottom-right-radius: 18px; }
.node--branch .node__card::before {
  content: ""; position: absolute; left: calc(var(--x-branch) - 1px); top: 20px; bottom: 20px; width: 2px; background: var(--branch);
}

.node__card { padding: 10px 0 40px; }
.node--branch .node__card {
  margin: 22px 0 40px 22px; padding: 18px 22px 20px;
  background: var(--branch-soft); border-radius: var(--radius);
}
.node--head .node__card {
  padding: 22px 24px 24px; margin-bottom: 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.node--root .node__card { padding-bottom: 0; }

.node__time { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.node__time time { font-size: .875rem; color: var(--ink-2); font-weight: 500; }
.node__ref {
  font-family: var(--f-mono); font-size: .8125rem; font-weight: 600; line-height: 1;
  padding: 5px 8px; border-radius: 5px; background: var(--accent); color: var(--accent-ink);
}
.node__dur { font-size: .875rem; color: var(--ink-2); }
.node__gap {
  font-size: .875rem; font-weight: 600; line-height: 1.6; padding: 0 10px; border-radius: 999px;
  color: var(--branch); border: 1px solid currentColor;
}
.node h3 { margin-top: 6px; font-family: var(--f-serif); font-weight: 700; font-size: 1.25rem; line-height: 1.45; letter-spacing: .02em; }
.node--root h3 { font-size: 1.0625rem; color: var(--ink-2); }
.node__org { margin-top: 2px; font-size: .9375rem; font-weight: 500; color: var(--ink-2); }
.node__card > p:not(.node__time):not(.node__org) { margin-top: 10px; font-size: .9375rem; color: var(--ink-2); max-width: 40em; }

.steps { margin-top: 18px; border-top: 1px solid var(--line-soft); }
.steps li { display: grid; grid-template-columns: 10.5em 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: .9375rem; }
.steps time { padding-top: 2px; }

/* 經歷進場：整條線依序出現，是全站唯一的捲動動畫 */
.graph.is-armed .node { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.graph.is-armed .node.is-in { opacity: 1; transform: none; }
.graph.is-armed .node__rail::before { transform-origin: top; transform: scaleY(0); transition: transform .6s ease .1s; }
.graph.is-armed .node.is-in .node__rail::before { transform: scaleY(1); }

/* ---------- 技能 ---------- */
.tiers { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; }
.tier { padding: 22px 24px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.tier p:last-child { margin-top: 8px; font-size: .9375rem; color: var(--ink-2); }
.tier__label { font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.tier__name { margin-top: 2px; font-family: var(--f-serif); font-weight: 700; font-size: 1.625rem; line-height: 1.3; }
.tier--main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tier--main .tier__label, .tier--main p:last-child { color: color-mix(in srgb, var(--accent-ink) 82%, transparent); }

.skill-table { margin-top: 40px; border-top: 1px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
.skill-table div { display: grid; grid-template-columns: 8.5em 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.skill-table dt { font-weight: 600; font-size: .9375rem; }
.skill-table dd { color: var(--ink-2); font-size: .9375rem; }

/* ---------- 工作習慣 ---------- */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 40px); }
.value { padding-top: 18px; border-top: 2px solid var(--accent); }
.value h3 { font-family: var(--f-serif); font-weight: 700; font-size: 1.1875rem; line-height: 1.5; letter-spacing: .02em; }
.value p { margin-top: 10px; font-size: .9375rem; color: var(--ink-2); }

/* ---------- 學歷證照 ---------- */
.cred { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 64px); }
.cred-list { border-top: 1px solid var(--ink); }
.cred-list li { display: grid; grid-template-columns: 9.5em 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cred-list--compact li { grid-template-columns: 1fr; padding: 11px 0; }
.cred-list time { padding-top: 3px; }
.cred-list strong { display: block; font-weight: 600; font-size: .9375rem; line-height: 1.6; }
.cred-list span { display: block; font-size: .9375rem; color: var(--ink-2); }

/* ---------- 聯絡 ---------- */
.contact { background: var(--band); color: var(--band-ink); padding: clamp(64px, 9vw, 104px) 0; }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 80px); align-items: end; }
.contact h2 { font-family: var(--f-serif); font-weight: 700; font-size: clamp(1.75rem, 3.8vw, 2.625rem); line-height: 1.35; letter-spacing: .03em; }
.contact__grid > div > p { margin-top: 14px; max-width: 32em; color: var(--band-ink-2); }
.contact__mail {
  display: inline-block; margin-top: 28px;
  font-family: var(--f-mono); font-size: clamp(1.125rem, 2.6vw, 1.625rem); font-weight: 500;
  text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 2px; text-decoration-color: #9DBE5E;
  word-break: break-all;
}
.contact__mail:hover { color: #9DBE5E; }
.contact__list div { display: grid; grid-template-columns: 5.5em 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(238, 241, 234, .14); }
.contact__list div:first-child { border-top: 1px solid rgba(238, 241, 234, .14); }
.contact__list dt { color: var(--band-ink-2); font-size: .9375rem; padding-top: 2px; }
.contact__list dd { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.contact__list a { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(238, 241, 234, .35); }
.contact__list a:hover { text-decoration-color: #9DBE5E; }
.contact :focus-visible { outline-color: #9DBE5E; }

.footer { background: var(--band); color: var(--band-ink-2); border-top: 1px solid rgba(238, 241, 234, .1); font-size: .875rem; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 22px; }

/* ==========================================================================
   兩側裝飾（寬螢幕才出現，只占左右留白）
   參考：日本網站的縱書側欄、美國 2026 趨勢的底紋顆粒與緩慢漸層
   ========================================================================== */
:root { --side: max(0px, calc((100vw - var(--wrap)) / 2)); }

/* 邊緣柔光：遮罩讓光暈只停留在兩側留白 */
.ambient {
  position: fixed; inset: 0; z-index: 44; pointer-events: none; display: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(var(--side) - 10px), transparent calc(var(--side) + 30px), transparent calc(100% - var(--side) - 30px), #000 calc(100% - var(--side) + 10px), #000 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(var(--side) - 10px), transparent calc(var(--side) + 30px), transparent calc(100% - var(--side) - 30px), #000 calc(100% - var(--side) + 10px), #000 100%);
}
.ambient span {
  position: absolute; width: 46vh; height: 46vh; border-radius: 50%; filter: blur(60px);
  opacity: var(--glow-opacity, .5); animation: drift 26s ease-in-out infinite alternate;
}
.ambient span:first-child { left: -14vh; top: 12vh; background: radial-gradient(circle, var(--accent) 0, transparent 68%); }
.ambient span:last-child { right: -14vh; top: 52vh; background: radial-gradient(circle, var(--branch) 0, transparent 68%); animation-delay: -13s; }
[data-theme="paper"] .ambient { --glow-opacity: .32; }
[data-theme="ink"] .ambient { --glow-opacity: .22; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, 18vh, 0) scale(1.15); }
}

/* 底紋顆粒：極低透明度，模擬印刷紙張質感 */
.grain {
  position: fixed; inset: -50%; z-index: 45; pointer-events: none;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .05;
}
[data-theme="ink"] .grain { opacity: .09; filter: invert(1); }

/* 左側縱書欄 */
.rail { position: fixed; top: 50%; z-index: 46; display: none; transform: translateY(-50%); }
.rail--left {
  left: max(14px, calc(var(--side) / 2 - 12px));
  flex-direction: column; align-items: center; gap: 16px; color: var(--ink-3);
}
.rail--left > span:not(.rail__rule) { writing-mode: vertical-rl; white-space: nowrap; overflow-wrap: normal; flex-shrink: 0; }
.rail__name { font-family: var(--f-serif); font-weight: 700; font-size: 1.1875rem; letter-spacing: .35em; color: var(--ink); }
.rail__section { font-family: var(--f-serif); font-size: 1.0625rem; letter-spacing: .3em; color: var(--accent); font-weight: 600; transition: opacity .3s; }
.rail__section.is-swapping { opacity: 0; }
.rail__year { font-family: var(--f-mono); font-size: .8125rem; letter-spacing: .2em; color: var(--ink-2); }
.rail__rule { width: 1px; height: 64px; background: var(--ink-3); opacity: .5; }

/* 右側 commit 進度欄：可點擊跳到各區塊 */
.rail--right { right: max(14px, calc(var(--side) / 2 - 12px)); height: 340px; width: 24px; }
.rail__track { position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.rail__fill { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: var(--accent); transform-origin: top; transform: scaleY(var(--progress, 0)); }
.rail__dots { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.rail__dots a {
  position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; text-decoration: none;
}
.rail__dots a::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--ink-3); transition: background-color .25s, border-color .25s, transform .25s;
}
.rail__dots a.is-done::before { background: var(--accent); border-color: var(--accent); }
.rail__dots a.is-current::before { background: var(--bg); border-color: var(--accent); border-width: 3px; transform: scale(1.3); }
.rail__dots span {
  position: absolute; right: 30px; top: 50%; transform: translate(6px, -50%); white-space: nowrap;
  padding: 4px 12px; border-radius: 999px; font-size: .875rem; color: var(--bg); background: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.rail__dots a:hover span, .rail__dots a:focus-visible span { opacity: 1; transform: translate(0, -50%); }

@media (min-width: 1360px) {
  .ambient { display: block; }
  .rail--left { display: flex; }
  .rail--right { display: block; }
}


/* ---------- 斷點 1：1080 ---------- */
@media (max-width: 1080px) {
  .nav { display: none; }
  .topbar__actions { margin-left: auto; }
  .hero__grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .tblock__row { grid-template-columns: 4.8em 1fr; }
  .feature { grid-template-columns: 1fr; }
  .career { grid-template-columns: 1fr; }
  .career__aside { position: static; max-width: 560px; }
  .skill-table { grid-template-columns: 1fr; }
  .feature--flip .media { order: 0; }
  .feature > .media { max-width: 760px; }
}

/* ---------- 斷點 2：760 ---------- */
@media (max-width: 760px) {
  /* 手機行寬短，keep-all 會讓行尾參差太大，改回一般斷行，只保護 .nw 片語 */
  body { font-size: 15.5px; word-break: normal; overflow-wrap: break-word; }
  .hero__grid { grid-template-columns: 1fr; }
  .tblock { max-width: 460px; }
  .spec { margin-top: 32px; }
  .spec__row { grid-template-columns: 1fr; gap: 8px; }
  .tblock__photo { aspect-ratio: 1 / .85; }
  .tblock__photo img { object-position: 50% 12%; }
  .tblock__row { grid-template-columns: 5em 1fr; }
  .tblock__row dt, .tblock__row dd { padding: 7px 10px; }
  .proof { grid-template-columns: repeat(2, 1fr); }
  .mini--wide { flex-direction: column; }
  .mini__aside { border-left: 0; border-top: 1px solid var(--line-soft); padding-top: 16px; }
  .ov__label { font-size: .8125rem; }
  .ov__years span:nth-child(even) { display: none; }
  .ov__label--head { font-size: .75rem; }
  .minis, .tiers, .values, .cred, .contact__grid { grid-template-columns: 1fr; }
  .values { gap: 28px; }
  .graph { --x-branch: 38px; }
  .node--branch .node__card { margin-left: 8px; }
  .node { grid-template-columns: 52px minmax(0, 1fr); }
  .steps li { grid-template-columns: 1fr; gap: 0; }
  .skill-table div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- 斷點 3：480 ---------- */
@media (max-width: 480px) {
  .brand__role { display: none; }
  .hero__cta .btn--solid, .hero__cta .btn--line { flex: 1 1 auto; }
  .tblock { box-shadow: 4px 4px 0 var(--line); }
  .tblock__row:not(.tblock__row--split) { grid-template-columns: 1fr; }
  .tblock__row:not(.tblock__row--split) dt { border-right: 0; padding-bottom: 0; }
  .tblock__row:not(.tblock__row--split) dd { padding-top: 0; }
  .tblock__row--split { grid-template-columns: 1fr; }
  .tblock__row--split > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .ov__label:not(.ov__label--up):not(.ov__label--accent):not(.ov__label--head) { display: none; }
  .proof a { padding: 14px; }
  .node--head .node__card, .node--branch .node__card { padding-inline: 16px; }
  .cred-list li { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .theme-btn, .hero__cta { display: none; }
  .hero::before { display: none; }
}
