:root {
  color-scheme: light;
  --bg: #fffaf5;
  --surface: #ffffff;
  --surface-soft: #fff4eb;
  --surface-tint: #fbe5d6;
  --text: #292524;
  --text-soft: #78716c;
  --text-faint: #a8a29e;
  --line: #f1ded2;
  --line-strong: #e8cbbb;
  --accent: #e8875b;
  --accent-strong: #d96c3e;
  --accent-soft: #f7d4c0;
  --ink-inverse: #fffaf5;
  --shadow: 0 24px 60px rgba(115, 70, 38, 0.1);
  --shadow-soft: 0 12px 30px rgba(115, 70, 38, 0.07);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --container: 1180px;
  --font-display: "Avenir Next", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  --font-body: "Inter", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111111;
  --surface: #1a1a1a;
  --surface-soft: #201714;
  --surface-tint: #3a241c;
  --text: #f5f5f4;
  --text-soft: #a8a29e;
  --text-faint: #78716c;
  --line: #2e2e2e;
  --line-strong: #4a332a;
  --accent: #f59e72;
  --accent-strong: #ffb08d;
  --accent-soft: #5a3022;
  --ink-inverse: #16110f;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 14px 36px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; transition: background-color 220ms ease, color 220ms ease; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
.container { width: min(calc(100% - 64px), var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--text); color: var(--bg); transform: translateY(-150%); transition: transform 160ms ease; }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); }
.header-inner { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: max-content; }
.brand-mark { position: relative; display: inline-flex; width: 27px; height: 27px; align-items: end; gap: 3px; padding: 4px; border: 1px solid var(--accent); border-radius: 8px; transform: rotate(-8deg); }
.brand-mark span { display: block; width: 4px; border-radius: 3px; background: var(--accent); transform: rotate(8deg); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 15px; opacity: .78; }
.brand-mark span:nth-child(3) { height: 11px; }
.brand-copy { display: grid; gap: 0; line-height: 1.1; }
.brand-copy strong { font-size: .92rem; font-weight: 750; letter-spacing: .01em; }
.brand-copy small { color: var(--text-faint); font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; }
.desktop-nav { display: flex; align-items: center; gap: 34px; margin-left: auto; margin-right: 26px; }
.nav-link { position: relative; color: var(--text-soft); font-size: .8rem; font-weight: 650; letter-spacing: .02em; transition: color 180ms ease; }
.nav-link::after { position: absolute; right: 0; bottom: -8px; left: 0; height: 2px; border-radius: 2px; background: var(--accent); content: ""; transform: scaleX(0); transform-origin: right; transition: transform 180ms ease; }
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); transform-origin: left; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.github-link { display: inline-flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: .78rem; font-weight: 650; transition: color 180ms ease; }
.github-link:hover { color: var(--accent-strong); }
.github-link svg { width: 17px; fill: currentColor; }
.theme-toggle, .mobile-menu-toggle { display: inline-grid; place-items: center; border: 0; background: transparent; cursor: pointer; }
.theme-toggle { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; transition: border-color 180ms ease, background 180ms ease; }
.theme-toggle:hover { border-color: var(--accent); background: var(--surface-tint); }
.theme-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.theme-icon-moon { display: none; fill: currentColor; stroke: none; }
html[data-theme="dark"] .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: block; }
.mobile-menu-toggle { display: none; width: 34px; height: 34px; gap: 4px; padding: 7px; }
.mobile-menu-toggle span { display: block; width: 100%; height: 1px; background: var(--text); transition: transform 180ms ease, opacity 180ms ease; }
.mobile-nav { display: none; }
.hero-section { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-section::before { position: absolute; inset: 0; background-image: linear-gradient(color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px); background-size: 70px 70px; content: ""; mask-image: linear-gradient(to right, black, transparent 78%); opacity: .45; pointer-events: none; }
.hero-grid { position: relative; display: grid; min-height: 620px; align-items: center; grid-template-columns: minmax(0, .94fr) minmax(420px, .86fr); gap: 40px; padding-top: 64px; padding-bottom: 72px; }
.hero-copy { position: relative; z-index: 2; padding: 35px 0 25px; }
.eyebrow, .section-kicker { margin: 0 0 18px; color: var(--accent-strong); font-size: .68rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; }
.eyebrow-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.18; }
h1 { max-width: 660px; margin-bottom: 24px; font-size: clamp(3.25rem, 6.2vw, 5.8rem); font-weight: 750; letter-spacing: -.075em; }
h1 em, h2 em { color: var(--accent-strong); font-style: normal; }
.hero-description { max-width: 540px; margin-bottom: 31px; color: var(--text-soft); font-size: 1rem; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 13px; padding: 0 19px; border: 1px solid transparent; border-radius: 10px; font-size: .8rem; font-weight: 750; letter-spacing: .01em; transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent); color: var(--ink-inverse); box-shadow: 0 9px 20px color-mix(in srgb, var(--accent) 24%, transparent); }
.button-primary:hover { background: var(--accent-strong); }
.button-ghost { border-color: var(--line-strong); color: var(--text); }
.button-ghost:hover { border-color: var(--accent); background: var(--surface-tint); }
.button-dark { background: var(--text); color: var(--bg); }
.button-dark:hover { background: var(--accent); color: var(--ink-inverse); }
.hero-meta { display: flex; align-items: center; gap: 11px; margin-top: 42px; color: var(--text-faint); font-size: .68rem; letter-spacing: .05em; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #8fb86d; box-shadow: 0 0 0 4px color-mix(in srgb, #8fb86d 15%, transparent); }
.meta-divider { width: 25px; height: 1px; background: var(--line-strong); }
.hero-visual { position: relative; min-height: 485px; }
.visual-orbit { position: absolute; border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent); border-radius: 50%; transform: rotate(-22deg); }
.orbit-one { top: 39px; right: 6%; width: 77%; height: 80%; }
.orbit-two { top: 17%; right: -3%; width: 83%; height: 68%; transform: rotate(33deg); opacity: .45; }
.visual-card { border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 89%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.card-main { position: absolute; top: 16%; right: 7%; width: min(85%, 410px); min-height: 305px; padding: 24px; border-radius: 20px; transform: rotate(4deg); }
.card-topline, .card-bottomline { display: flex; align-items: center; justify-content: space-between; color: var(--text-faint); font-size: .58rem; letter-spacing: .16em; }
.card-topline span:last-child { color: var(--accent); font-size: .75rem; }
.signal-lines { display: flex; height: 135px; align-items: center; justify-content: center; gap: 11px; margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: repeating-linear-gradient(90deg, transparent 0 29px, color-mix(in srgb, var(--accent) 14%, transparent) 29px 30px); }
.signal-lines span { display: block; width: 2px; border-radius: 2px; background: var(--accent); transform: rotate(7deg); }
.signal-lines span:nth-child(1) { height: 32px; opacity: .38; }
.signal-lines span:nth-child(2) { height: 70px; opacity: .62; }
.signal-lines span:nth-child(3) { height: 108px; }
.signal-lines span:nth-child(4) { height: 56px; opacity: .73; }
.signal-lines span:nth-child(5) { height: 28px; opacity: .42; }
.visual-coordinate { display: flex; align-items: end; justify-content: space-between; gap: 22px; padding: 21px 0 19px; }
.visual-coordinate strong { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.7rem; letter-spacing: -.06em; }
.visual-coordinate small { max-width: 142px; color: var(--text-faint); font-size: .58rem; line-height: 1.55; text-align: right; }
.card-bottomline { padding-top: 16px; border-top: 1px solid var(--line); }
.card-float { position: absolute; display: grid; border-radius: 14px; }
.card-float-top { top: 6%; right: 0; width: 109px; padding: 14px; transform: rotate(-7deg); }
.card-float-bottom { bottom: 11%; left: 4%; grid-template-columns: 24px 1fr; align-items: center; gap: 8px; width: 155px; padding: 14px; color: var(--text-soft); font-size: .67rem; line-height: 1.45; transform: rotate(-6deg); }
.float-label { color: var(--accent); font-size: .56rem; font-weight: 750; letter-spacing: .18em; }
.card-float-top strong { font-family: var(--font-display); font-size: 2.4rem; letter-spacing: -.08em; line-height: 1.05; }
.card-float-top small { color: var(--text-faint); font-size: .62rem; }
.tiny-spark { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-size: .75rem; }
.visual-cross { position: absolute; color: var(--accent); font-family: ui-monospace, monospace; font-size: 1.1rem; }
.cross-one { top: 2%; left: 13%; }
.cross-two { right: 9%; bottom: 3%; opacity: .7; }
.section-block { padding: 112px 0; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 38px; }
.section-heading .section-kicker { margin-bottom: 11px; }
h2 { margin-bottom: 0; font-size: clamp(2rem, 3.3vw, 3.2rem); font-weight: 730; letter-spacing: -.065em; }
.text-link { display: inline-flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: .77rem; font-weight: 700; white-space: nowrap; transition: color 180ms ease, gap 180ms ease; }
.text-link:hover { color: var(--accent-strong); gap: 15px; }
.project-grid { display: grid; grid-template-columns: 1.16fr 1fr 1fr; gap: 14px; }
.project-card { position: relative; display: flex; min-height: 343px; flex-direction: column; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background 220ms ease; }
.project-card:hover { border-color: color-mix(in srgb, var(--accent) 65%, var(--line)); box-shadow: var(--shadow-soft); transform: translateY(-5px); }
.project-card-featured { border-color: var(--accent-soft); background: linear-gradient(145deg, var(--surface-tint), var(--surface)); }
.project-card-head, .project-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.project-number, .project-status { color: var(--accent-strong); font-family: ui-monospace, monospace; font-size: .61rem; font-weight: 750; letter-spacing: .15em; }
.project-status { padding: 4px 8px; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 20px; font-size: .53rem; }
.status-muted { color: var(--text-faint); border-color: var(--line); }
.project-icon { display: flex; height: 94px; align-items: center; margin: 27px 0 19px; }
.icon-notes { gap: 8px; align-items: end; }
.icon-notes span { width: 17px; border-radius: 6px 6px 2px 2px; background: var(--accent); }
.icon-notes span:nth-child(1) { height: 32px; opacity: .44; }
.icon-notes span:nth-child(2) { height: 70px; }
.icon-notes span:nth-child(3) { height: 52px; opacity: .68; }
.icon-grid { width: 96px; flex-wrap: wrap; gap: 8px; }
.icon-grid span { width: 38px; height: 38px; border: 1px solid var(--accent); border-radius: 9px; background: var(--surface-soft); }
.icon-grid span:nth-child(2), .icon-grid span:nth-child(3) { background: var(--accent); opacity: .7; }
.icon-orbit { position: relative; width: 100px; }
.icon-orbit::before, .icon-orbit::after, .icon-orbit span { position: absolute; display: block; border: 1px solid var(--accent); border-radius: 50%; content: ""; }
.icon-orbit::before { width: 62px; height: 62px; transform: rotate(36deg) skewX(18deg); }
.icon-orbit::after { width: 38px; height: 38px; transform: rotate(-36deg) skewX(18deg); opacity: .68; }
.icon-orbit span { top: 26px; left: 32px; width: 8px; height: 8px; border: 0; background: var(--accent); }
.project-card h3 { margin: 0 0 9px; font-size: 1.3rem; letter-spacing: -.04em; }
.project-card p { max-width: 310px; margin-bottom: auto; color: var(--text-soft); font-size: .81rem; line-height: 1.8; }
.project-card-foot { padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent); color: var(--text-faint); font-size: .61rem; letter-spacing: .08em; text-transform: uppercase; }
.arrow { color: var(--accent); font-size: 1.1rem; transition: transform 180ms ease; }
.project-card:hover .arrow { transform: translate(3px, -3px); }
.notes-section { background: var(--surface-soft); }
.notes-list { border-top: 1px solid var(--line-strong); }
.note-row { display: grid; grid-template-columns: 125px minmax(0, 1fr) 155px 26px; align-items: center; gap: 22px; min-height: 78px; border-bottom: 1px solid var(--line-strong); transition: padding 180ms ease, background 180ms ease; }
.note-row:hover { padding-inline: 15px; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.note-date, .note-tag { color: var(--text-faint); font-family: ui-monospace, monospace; font-size: .63rem; letter-spacing: .06em; }
.note-title { font-size: .92rem; font-weight: 650; }
.note-tag { color: var(--accent-strong); font-size: .55rem; font-weight: 750; letter-spacing: .13em; }
.note-arrow { color: var(--accent); font-size: 1.05rem; text-align: right; }
.topics-layout { display: grid; grid-template-columns: .78fr 1.22fr; gap: 90px; align-items: start; }
.topics-intro h2 { margin-bottom: 22px; }
.topics-intro > p:last-child { max-width: 310px; color: var(--text-soft); font-size: .84rem; line-height: 1.9; }
.topic-list { border-top: 1px solid var(--line-strong); }
.topic-item { display: grid; grid-template-columns: 48px 1fr 25px; align-items: center; gap: 17px; min-height: 81px; border-bottom: 1px solid var(--line-strong); transition: padding 180ms ease, background 180ms ease; }
.topic-item:hover { padding-inline: 15px; background: var(--surface-soft); }
.topic-index { color: var(--accent); font-family: ui-monospace, monospace; font-size: .65rem; }
.topic-item strong { display: block; font-size: 1rem; }
.topic-item small { display: block; color: var(--text-faint); font-size: .64rem; letter-spacing: .04em; }
.topic-arrow { color: var(--accent); font-size: 1.1rem; text-align: right; }
.about-strip { padding: 112px 0; background: var(--accent); color: var(--ink-inverse); }
.about-strip .section-kicker { color: color-mix(in srgb, var(--ink-inverse) 75%, transparent); }
.about-layout { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 80px; }
.about-strip h2 { max-width: 450px; }
.about-strip h2 em { color: var(--ink-inverse); font-style: normal; opacity: .75; }
.about-copy { max-width: 420px; }
.about-copy p { margin-bottom: 28px; color: color-mix(in srgb, var(--ink-inverse) 75%, transparent); font-size: .95rem; line-height: 1.9; }
.about-copy .button-dark { background: var(--ink-inverse); color: var(--accent-strong); }
.about-copy .button-dark:hover { background: var(--text); color: var(--ink-inverse); }
.site-footer { padding: 34px 0 20px; background: var(--text); color: var(--bg); }
.footer-top, .footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-brand .brand-copy small { color: color-mix(in srgb, var(--bg) 52%, transparent); }
.footer-brand .brand-mark { border-color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; color: color-mix(in srgb, var(--bg) 70%, transparent); font-size: .72rem; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { margin-top: 55px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--bg) 16%, transparent); color: color-mix(in srgb, var(--bg) 46%, transparent); font-size: .62rem; letter-spacing: .05em; }
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; min-height: auto; padding-top: 52px; }
  .hero-copy { padding-bottom: 0; }
  .hero-visual { width: min(100%, 600px); min-height: 440px; margin: 0 auto; }
  .project-grid { grid-template-columns: 1fr 1fr; }
  .project-card:first-child { grid-column: 1 / -1; min-height: 300px; }
  .topics-layout { gap: 48px; }
}
@media (max-width: 700px) {
  .container { width: min(calc(100% - 36px), var(--container)); }
  .header-inner { min-height: 67px; }
  .desktop-nav, .github-link { display: none; }
  .mobile-menu-toggle { display: grid; }
  .mobile-nav { display: grid; max-height: 0; overflow: hidden; padding: 0 18px; border-top: 0 solid var(--line); background: var(--bg); transition: max-height 220ms ease, padding 220ms ease, border-top-width 220ms ease; }
  .mobile-nav.is-open { max-height: 250px; padding: 12px 18px 18px; border-top-width: 1px; }
  .mobile-nav .nav-link { padding: 9px 0; }
  .mobile-nav .nav-link::after { bottom: 4px; right: auto; width: 24px; }
  .mobile-menu-toggle.is-open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .mobile-menu-toggle.is-open span:nth-child(2) { opacity: 0; }
  .mobile-menu-toggle.is-open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
  .hero-grid { padding-top: 42px; padding-bottom: 35px; }
  h1 { font-size: clamp(2.9rem, 14vw, 4.4rem); }
  .hero-description { font-size: .92rem; }
  .hero-meta { margin-top: 30px; }
  .hero-visual { min-height: 340px; transform: scale(.9); transform-origin: top center; margin-bottom: -24px; }
  .card-main { top: 13%; right: 4%; width: 83%; min-height: 250px; padding: 18px; }
  .signal-lines { height: 105px; }
  .visual-coordinate strong { font-size: 1.25rem; }
  .visual-coordinate small { font-size: .5rem; }
  .card-float-top { right: -1%; }
  .card-float-bottom { left: 1%; bottom: 5%; }
  .section-block, .about-strip { padding: 74px 0; }
  .section-heading { align-items: start; flex-direction: column; gap: 16px; margin-bottom: 28px; }
  .section-heading h2 { font-size: 2.25rem; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card:first-child { grid-column: auto; min-height: 343px; }
  .note-row { grid-template-columns: 1fr 25px; gap: 4px 15px; padding: 16px 0; }
  .note-date { grid-column: 1; grid-row: 1; }
  .note-tag { grid-column: 1; grid-row: 2; }
  .note-title { grid-column: 1; grid-row: 3; padding-top: 4px; font-size: .89rem; }
  .note-arrow { grid-column: 2; grid-row: 1 / span 3; }
  .topics-layout, .about-layout { grid-template-columns: 1fr; gap: 39px; }
  .about-strip h2 { font-size: 2.35rem; }
  .footer-top, .footer-bottom { align-items: start; flex-direction: column; }
  .footer-bottom { margin-top: 36px; gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
