/* 紙色底、墨色字、一個朱紅強調色。深色模式是同一套 token 換值。 */
:root {
  --paper: #f3efe6;
  --paper-2: #e9e3d6;
  --card: #fffdf8;
  --ink: #16140f;
  --muted: #6d675b;
  --line: #d9d2c2;
  --accent: #d9431f;
  --accent-ink: #fffdf8;
  --band-dark: #16140f;
  --band-dark-card: #221f18;
  --band-dark-ink: #f3efe6;
  --band-dark-muted: #a39c8c;
  --band-dark-line: #37332a;
  --radius: 26px;
  /* 卡片靠陰影浮起來，不靠框線 */
  --shadow: 0 1px 0 rgb(22 20 15 / 0.03), 0 14px 34px -20px rgb(22 20 15 / 0.28);
  --wrap: 1120px;
  /* 英數用 Outfit（圓、粗），中文用思源黑體（有 900 的字重）；載不到就退回系統字 */
  --sans: 'Outfit', 'Noto Sans TC', system-ui, -apple-system, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #12110e;
    --paper-2: #1a1814;
    --card: #1f1d18;
    --ink: #f1ecdf;
    --muted: #a39c8c;
    --line: #35312a;
    --accent: #ff6a43;
    --accent-ink: #16140f;
    --band-dark: #0b0a08;
    --band-dark-card: #1a1814;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --paper: #12110e;
  --paper-2: #1a1814;
  --card: #1f1d18;
  --ink: #f1ecdf;
  --muted: #a39c8c;
  --line: #35312a;
  --accent: #ff6a43;
  --accent-ink: #16140f;
  --band-dark: #0b0a08;
  --band-dark-card: #1a1814;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.muted {
  color: var(--muted);
}

.accent {
  color: var(--accent);
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: 8px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── 頂列 ─────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 20px;
}

.brand {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.topbar .brand,
.nav,
.theme-toggle {
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  border-radius: 999px;
}

.topbar .brand {
  padding: 6px 16px;
}

/* 文字標誌：黑底上的彩色點陣字，跟頭貼同一個配色邏輯 */
.wordmark {
  display: block;
  height: 20px;
  width: auto;
}

.topbar .brand.has-wordmark {
  background: var(--band-dark);
  border-color: var(--band-dark);
  padding: 11px 18px;
}

.footer-brand .wordmark {
  height: 30px;
}

.powered {
  color: var(--band-dark-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.powered:hover {
  color: var(--accent);
}

.nav {
  margin: 0 auto;
  display: flex;
  gap: 2px;
  padding: 4px;
  font-size: 14px;
}

.nav a {
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.nav a:hover {
  background: var(--paper-2);
}

.nav a[aria-current='page'] {
  background: var(--ink);
  color: var(--paper);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: inherit;
  cursor: pointer;
  flex: none;
}

/* ── 段落 ─────────────────────────────────────────── */
.band {
  position: relative;
  padding: 56px 0 72px;
}

/* 每一段都是同一個紙色底，不換色、不鋪背景圖。
   （試過段落背景圖和明暗交替：比素底醜，而且整頁底色一直跳。圖只放在卡片裡。） */

.wrap {
  position: relative;
  z-index: 1;
}

/* ── 圖片插槽（src/img/ 有圖才會生效）──────────────── */

.cat {
  position: absolute;
  pointer-events: none;
  display: none;
}

@media (min-width: 760px) {
  .cat {
    display: block;
  }

  .hero:has(.cat-hero),
  .contact:has(.cat-contact) {
    position: relative;
  }

  /* 只讓下半部的內文讓位給吉祥物，標題維持整行寬 */
  .hero:has(.cat-hero) .lede,
  .contact:has(.cat-contact) .lede {
    max-width: min(34em, calc(100% - 200px));
  }

  .cat-hero {
    right: 18px;
    bottom: 12px;
    width: 180px;
    height: 180px;
    object-fit: contain;
  }

  .cat-contact {
    right: 28px;
    bottom: 18px;
    width: 160px;
    height: 160px;
    object-fit: contain;
  }
}

/* 首頁主視覺（src/img/hero.*）：大卡橫跨整排，圖當底，文字放在左上的留白處。
   圖是亮底，所以這張卡不跟著深色模式變色 */
.hero.has-art {
  --card: #fdfdfb;
  --ink: #16140f;
  --muted: #5f5a50;
  --line: #d9d2c2;
  color: var(--ink);
  background-color: var(--card);
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: auto 250px;
  padding-bottom: 250px;
}

.hero.has-art .now {
  background: color-mix(in srgb, var(--card) 85%, transparent);
}

@media (min-width: 760px) {
  .hero.has-art {
    background-size: cover;
    padding-bottom: clamp(24px, 4vw, 40px);
    min-height: 500px;
    /* 內容靠上，把左下角留給圖裡的筆觸，按鈕才不會壓在上面 */
    justify-content: flex-start;
    padding-top: clamp(32px, 4vw, 52px);
  }

  .hero.has-art h1,
  .hero.has-art .lede {
    max-width: 56%;
  }
}

@media (min-width: 980px) {
  .hero-grid:has(.hero.has-art) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .hero-grid:has(.hero.has-art) .hero {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .hero-grid:has(.hero.has-art) .stat.ink {
    grid-column: auto;
  }
}

/* 聯絡卡的底圖（src/img/contact.*）：暗底，角色在右半邊，文字放左上的留白。
   暗的只有這張卡片本身（底色取樣約 #161318），外面的段落維持紙色 */
.contact.has-art {
  --ink: #f4efe9;
  --muted: #b9b2b6;
  color: var(--ink);
  background-color: #161318;
  border-color: #332d33;
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: auto 250px;
  padding-bottom: 262px;
  overflow: hidden;
}

@media (min-width: 760px) {
  .contact.has-art {
    background-size: cover;
    min-height: 540px;
    justify-content: flex-start;
    padding: 40px 48px;
  }

  .contact.has-art h2,
  .contact.has-art .lede {
    max-width: 46%;
  }
}

/* 大卡裡的軟體截圖：做成一個小視窗嵌在卡片裡，不撐滿。
   寬度上限 360px，比原圖的像素寬小，所以在高解析螢幕上也不會糊 */
/* 主打卡有截圖時：文字在左、畫面在右，畫面貼著卡片底邊像從下面探出來。
   畫面寬度不超過原圖的像素寬，所以不會糊 */
.lead.has-shot {
  padding-bottom: 0;
  gap: 18px;
}

.lead-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shot {
  display: block;
  width: min(340px, 100%);
  height: auto;
  margin: auto auto 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -6px 30px -12px rgb(22 20 15 / 0.3);
}

/* 文字在上、佔滿整張卡的寬度；畫面在下方置中，寬度固定不放大 */
.lead.has-shot .shot {
  width: min(400px, 100%);
  margin-top: auto;
}

/* 真的 logo：不要底色，圓角小一點，維持原圖比例 */
.logo-mark {
  background: none;
  object-fit: contain;
  border-radius: 9px;
}

.with-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.with-logo .logo-mark {
  width: 44px;
  height: 44px;
}

.card.small.has-thumb {
  padding-top: 0;
  overflow: hidden;
}

.thumb {
  display: block;
  width: calc(100% + 44px);
  max-width: none;
  margin: 0 -22px 14px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.wrap.narrow {
  max-width: 820px;
}

.band-intro {
  padding-top: 28px;
}

/* 段落之間只靠留白分開；上一段的下留白加下一段的上留白太多，收一點 */
.band + .band {
  padding-top: 8px;
}

/* 段落的小標：一塊墨色的標籤，編號是強調色 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 700 13px/1 var(--sans);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  background: var(--band-dark);
  color: var(--band-dark-ink);
  padding: 5px 13px 5px 5px;
  border-radius: 10px;
}

.eyebrow span {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 5px 8px;
  border-radius: 6px;
  font: 800 12px/1 var(--mono);
  letter-spacing: 0.04em;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 900;
}

/* 段落的大標放在一塊白色圓角卡裡 */
.section-head h2 {
  background: var(--card);
  border-radius: 22px;
  padding: 14px 24px 16px;
  box-shadow: var(--shadow);
}

/* 重點字下面一條強調色的線 */
.hl {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

h3 {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0;
}

/* ── 卡片 ─────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

a.card {
  transition: transform 0.15s, box-shadow 0.15s;
}

a.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 0 rgb(22 20 15 / 0.03), 0 22px 40px -22px rgb(22 20 15 / 0.4);
}

.card p {
  color: var(--muted);
  font-size: 14.5px;
}

.card.ink {
  background: var(--band-dark);
  color: var(--band-dark-ink);
  border-color: var(--band-dark);
  --muted: var(--band-dark-muted);
  --line: var(--band-dark-line);
  --paper-2: var(--band-dark-line);
}

.label {
  font: 600 12.5px/1.4 var(--sans);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.big {
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.big small {
  font-size: 0.34em;
  font-weight: 700;
  letter-spacing: 0;
  margin-left: 4px;
}

.mono-mark {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--tile, var(--ink));
  color: #16140f;
  font: 800 17px/1 var(--mono);
}

/* 吉祥物：去背的貼紙，站在墨色卡片的右下角，下半身被卡片邊緣裁掉 */
.with-avatar {
  position: relative;
  overflow: hidden;
  padding-right: 168px;
  min-height: 190px;
}

.avatar {
  position: absolute;
  right: 6px;
  bottom: -26px;
  width: auto;
  height: 200px;
}

/* 數字卡右下角的貼紙（src/img/cat-kit.*、cat-stars.*） */
.with-sticker {
  position: relative;
  overflow: hidden;
  padding-right: 128px;
  min-height: 176px;
}

.sticker {
  position: absolute;
  right: 4px;
  bottom: -14px;
  width: auto;
  height: 158px;
  pointer-events: none;
}

/* 寬螢幕：貼紙放大、往下破出卡片，落在卡片下方的留白。
   手機上卡片是直排，破出去會壓到下一張，所以維持收在卡片裡 */
@media (min-width: 620px) {
  .with-sticker {
    overflow: visible;
    padding-right: 150px;
  }

  .sticker {
    height: 228px;
    right: -6px;
    bottom: -84px;
    z-index: 2;
    filter: drop-shadow(0 14px 16px rgb(22 20 15 / 0.18));
  }
}

/* 越往右破格越多：黑卡那隻住在卡片裡，Kit 探出一點，星星那隻整個衝出來 */
@media (min-width: 620px) {
  .sticker-kit {
    height: 196px;
    bottom: -40px;
  }

  .sticker-stars {
    height: 250px;
    right: -14px;
    bottom: -104px;
  }
}

/* 中間寬度三張並排會擠到貼紙，改成大卡一整排、兩張小卡各半 */
@media (min-width: 620px) and (max-width: 1139px) {
  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .hero-grid .stat.ink {
    grid-column: 1 / -1 !important;
  }
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}

.list-head h3 a:hover {
  color: var(--accent);
}

/* ── 專案卡片的底圖（src/img/cards/<專案名>.*）─────────
   暗底、角色在右半邊。電腦上整張當底，文字放左邊；手機上圖放在文字下面 */
.dark-card.has-art {
  background-color: #0e0a0c;
  border-color: #0e0a0c;
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: auto 210px;
  padding-bottom: 222px;
}

@media (min-width: 620px) {
  .dark-card.has-art {
    background-size: cover;
    background-position: right 35%;
    min-height: 330px;
    padding-bottom: 22px;
  }

  .dark-card.has-art p:not(.label) {
    max-width: 52%;
  }

  /* 星數和標籤跟在說明下面，不要沉到卡片底部壓在圖上 */
  .dark-card.has-art .meta {
    margin-top: 4px;
  }
}

/* ── 教學、關於我 ─────────────────────────────────── */
.guides-page .card,
.guide-page .card,
.about-page .card,
.about-banner,
.about-stats {
  margin-top: 18px;
}

.guide-list {
  display: flex;
  flex-direction: column;
}

.guide-card time {
  font: 500 12.5px/1.4 var(--mono);
}

.prose .page-title {
  font-size: clamp(26px, 4.2vw, 36px);
  margin-bottom: 4px;
}

.guide-date {
  font: 500 13px/1.4 var(--mono);
  margin-top: 0;
}

.guide-page .more-link {
  margin-top: 20px;
}

.guide-page .more-link svg {
  transform: rotate(180deg);
}

.about-banner {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.about-stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.about-stats .card {
  margin-top: 0;
}

.about-stats .big {
  font-size: clamp(30px, 6vw, 46px);
}

@media (max-width: 520px) {
  .about-stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── 作品介紹頁 ───────────────────────────────────── */
/* 每一塊之間的距離由這裡統一給，卡片本身不帶外距（不然放進格狀排列會錯位） */
.project-page .wrap > * + * {
  margin-top: 16px;
}

.project-page .wrap > .pill-title,
.project-page .wrap > .group-head {
  margin-top: 44px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.crumbs.pill {
  width: fit-content;
  background: var(--card);
  border-radius: 999px;
  padding: 7px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 0;
}

.crumbs a:hover {
  color: var(--accent);
}

.crumbs span:last-child {
  color: var(--ink);
  font-weight: 700;
}

/* 主視覺：左邊資訊卡，右邊畫面 */
.project-hero {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

.project-head {
  gap: 12px;
  padding: clamp(24px, 4vw, 36px);
}

.project-icon .mono-mark {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  font-size: 30px;
  display: grid;
}

.project-head .page-title {
  font-size: clamp(32px, 5vw, 46px);
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.tagline {
  color: var(--accent);
  font-size: clamp(17px, 2.2vw, 20px);
  font-weight: 800;
  line-height: 1.4;
}

.card p.tagline {
  color: var(--accent);
  font-size: clamp(17px, 2.2vw, 20px);
}

.project-head .lede {
  font-size: 15.5px;
}

.card p.note {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
}

.project-head .meta {
  margin-top: 4px;
  padding-top: 0;
}

.project-head .actions {
  margin-top: auto;
  padding-top: 14px;
}

.screen-card {
  padding: 22px;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
}

.screen-card img {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 18px 40px -20px rgb(22 20 15 / 0.45);
}

@media (min-width: 860px) {
  .project-hero.has-screen {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* 段落標題：一塊白色膠囊 */
.pill-title {
  width: fit-content;
  background: var(--card);
  border-radius: 18px;
  padding: 9px 20px 11px;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 900;
  box-shadow: var(--shadow);
}

.plain-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 900;
  margin-top: 2px;
}

/* 怎麼用：三張步驟卡，加一張墨色的重點卡 */
.step-grid,
.group-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.step-card {
  position: relative;
  padding-top: 54px;
  gap: 6px;
}

.step-no {
  position: absolute;
  top: 20px;
  left: 24px;
  font: 800 13px/1 var(--mono);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  padding: 6px 9px;
  border-radius: 8px;
}

.highlight-card {
  justify-content: center;
  gap: 12px;
}

.highlight-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 500;
}

.highlight-card li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.highlight-card li::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
  transform: translateY(-1px);
}

/* 功能分組：第一張是帶底色的引言卡 */
.card.tint {
  background: color-mix(in srgb, var(--accent) 9%, var(--card));
  justify-content: flex-end;
}

.card.tint p {
  color: var(--ink);
  font-weight: 500;
}

/* 看看畫面：橫向排開，放不下就左右滑 */
.gallery {
  flex-direction: row;
  gap: 16px;
  overflow-x: auto;
  padding: 22px;
  background: var(--paper-2);
}

.gallery img {
  flex: none;
  width: min(440px, 78vw);
  height: auto;
  border-radius: 14px;
  box-shadow: 0 14px 34px -18px rgb(22 20 15 / 0.4);
}

/* 所有功能：一張大卡裡面排小格 */
.feature-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.feature {
  background: var(--paper);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature h3 {
  font-size: 15.5px;
}

.feature p {
  font-size: 13.5px;
}

/* 常見問題：可以展開收合 */
.faq details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font: 500 20px/1 var(--mono);
  color: var(--muted);
  flex: none;
}

.faq details[open] summary::after {
  content: '−';
}

.faq details p {
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.bottom-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 860px) {
  .bottom-grid:not(.single) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.project-page .log .row {
  align-items: baseline;
}

.project-page .log .row > span {
  flex-direction: row;
}

.link-row {
  justify-content: space-between;
}

.btn.small {
  padding: 5px 13px;
  font-size: 13px;
}

/* 結尾：圖示、一句話、按鈕 */
.closing-card {
  gap: 16px;
  padding: clamp(22px, 3.4vw, 30px);
}

.closing-card .app-head {
  align-items: flex-start;
}

.closing-card .card-title {
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.35;
}

/* 其他作品：一排名字 */
.others {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 26px;
  padding: 16px 24px;
  font-weight: 700;
  font-size: 15px;
}

.others a:not(.btn):hover {
  color: var(--accent);
}

.others .btn {
  margin-left: auto;
}

.readme-note {
  font-size: 13.5px;
}

.readme-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.readme-note a:hover {
  color: var(--accent);
}

/* 文章放在整頁寬度裡會太寬，限制一下行長 */
.project-page .prose {
  max-width: 820px;
}

/* 文章內文（content/*.md 轉出來的） */
.prose {
  display: block;
  padding: clamp(22px, 4vw, 34px);
  font-size: 16.5px;
  line-height: 1.85;
}

.prose > * + * {
  margin-top: 1em;
}

.prose p {
  color: var(--ink);
  font-size: inherit;
}

.prose h2,
.prose h3,
.prose h4,
.prose h5 {
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-top: 1.7em;
}

.prose h2 {
  font-size: 24px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.prose h3 {
  font-size: 19px;
}

.prose h4,
.prose h5 {
  font-size: 16.5px;
}

.prose > :first-child {
  margin-top: 0;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line);
}

.prose blockquote p {
  color: var(--muted);
}

.prose code {
  font: 0.88em var(--mono);
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 5px;
}

.prose pre {
  background: var(--band-dark);
  color: var(--band-dark-ink);
  padding: 16px 18px;
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.6;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 14px;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}

/* ── 開發日誌頁 ───────────────────────────────────── */
.devlog-page .card {
  margin-top: 22px;
}

.heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.day {
  margin-top: 30px;
}

.day-title {
  font-size: 18px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  letter-spacing: 0;
}

.day-title .muted {
  font: 600 12.5px/1 var(--mono);
}

.devlog-page .day .card {
  margin-top: 10px;
  padding: 4px 22px;
}

.devlog-page .log .row:first-child {
  border-top: 0;
}

/* 標籤：淡色實心的膠囊，不用線框 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
  background: color-mix(in srgb, var(--paper-2) 80%, var(--card));
  white-space: nowrap;
}

.card.ink .chip {
  background: color-mix(in srgb, var(--band-dark-ink) 12%, transparent);
  color: var(--band-dark-ink);
}

.chip b {
  font: 700 11.5px/1 var(--mono);
  color: var(--ink);
}

.chips,
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.meta {
  margin-top: auto;
  padding-top: 8px;
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font: 800 15px/1 var(--sans);
  margin-right: 4px;
}

/* 段落右上角的「全部 N 件」：白底膠囊，浮在背景上 */
.section-head .btn {
  background: var(--card);
  border-color: transparent;
  box-shadow: var(--shadow);
}

.section-head .btn:hover {
  background: var(--ink);
  color: var(--card);
}

/* 主打卡的抬頭：圖示在左，名稱和小標在右 */
.app-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.app-head .mono-mark {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  font-size: 22px;
}

.app-head h3 {
  font-size: clamp(22px, 2.6vw, 27px);
  font-weight: 800;
  line-height: 1.2;
}

.app-head .label {
  font: 500 13px/1.4 var(--sans);
  letter-spacing: 0;
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
  background: transparent;
  color: var(--ink);
}

.btn:hover {
  background: var(--ink);
  color: var(--card);
}

.btn.primary {
  background: var(--ink);
  color: var(--card);
}

.btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* ── 01 起點 ──────────────────────────────────────── */
.hero-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

.hero {
  padding: clamp(24px, 4vw, 40px);
  gap: 16px;
}

.hero h1 {
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.25;
  text-wrap: balance;
  letter-spacing: -0.02em;
  font-weight: 900;
}

.lede {
  color: var(--muted);
  max-width: 34em;
  font-size: 16px;
}

.now {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 13px/1 var(--mono);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
}

.now i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9e5b;
}

.stat {
  justify-content: space-between;
  gap: 14px;
}

@media (min-width: 620px) {
  .hero-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    grid-column: 1 / -1;
  }
}

@media (min-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .hero {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .hero-grid .stat.ink {
    grid-column: 2 / span 2;
  }
}

/* ── 02 作品 ──────────────────────────────────────── */
.bento {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

.lead {
  position: relative;
  overflow: hidden;
  padding-bottom: 96px;
}

.lead h3 {
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.03em;
}

.lead .meta {
  margin-top: 6px;
}

.waveform {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  height: 62px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.waveform i {
  flex: 1;
  height: var(--h);
  min-height: 6px;
  border-radius: 3px;
  background: var(--ink);
  opacity: 0.9;
}

.waveform i:nth-child(3n) {
  background: var(--accent);
}

.dark-card h3 {
  font-size: 24px;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.list-head .muted {
  font-size: 13px;
}

.rows {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.row > span:not(.mono-mark):not(.num) {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  font-size: 14px;
  line-height: 1.45;
}

.row .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

a.row:hover strong {
  color: var(--accent);
}

.row time {
  font: 600 12.5px/1 var(--mono);
  color: var(--muted);
  flex: none;
}

/* 還沒公開的專案：整排寬，圖示用淡色方塊；寬螢幕排成兩欄 */
.row-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

.private-card .list-head .muted {
  font-weight: 700;
  color: var(--ink);
}

@media (min-width: 620px) {
  .private-card {
    grid-column: 1 / -1 !important;
  }

  .private-card .rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 36px;
  }
}

.kit-card .big {
  margin: 4px 0;
}

.chip.more {
  border-style: dashed;
}

@media (min-width: 620px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead,
  .list-card,
  .kit-card {
    grid-column: 1 / -1;
  }
}

@media (min-width: 980px) {
  .bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .lead {
    grid-column: 1 / span 2;
    grid-row: span 2;
  }

  .dark-card {
    grid-column: 3 / span 2;
  }

  .list-card,
  .kit-card {
    grid-column: span 2;
  }

  .kit-card .chips {
    margin-top: auto;
    padding-top: 10px;
  }
}

/* ── 03 最近 ──────────────────────────────────────── */
.recent-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 14px);
  grid-auto-columns: 14px;
  gap: 4px;
  margin: 6px 0 10px;
}

.heatmap i {
  border-radius: 3px;
  background: var(--line);
}

.heatmap .lv1 {
  background: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.heatmap .lv2 {
  background: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.heatmap .lv3 {
  background: color-mix(in srgb, var(--accent) 80%, var(--line));
}

.heatmap .lv4 {
  background: var(--accent);
}

.count-row {
  justify-content: space-between;
}

.num {
  font: 700 15px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.stat-stack {
  justify-content: space-between;
  gap: 22px;
}

.stat-stack > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-stack .big {
  font-size: clamp(34px, 4vw, 46px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stat-stack .big svg {
  width: 26px;
  height: 26px;
}

.stat-stack .muted {
  font-size: 13.5px;
}

@media (min-width: 980px) {
  .recent-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}

/* ── 04 工具 ──────────────────────────────────────── */
.tools-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

.big-chips {
  margin-top: 10px;
  gap: 8px;
}

.big-chips .chip {
  font-size: 14px;
  padding: 6px 14px;
  color: var(--ink);
}

.principles {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.principles li {
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  color: var(--muted);
}

.principles strong {
  color: var(--ink);
  margin-right: 4px;
}

@media (min-width: 860px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── 05 聯絡 ──────────────────────────────────────── */
.contact {
  padding: clamp(26px, 5vw, 48px);
  gap: 14px;
}

/* 聯絡卡有暗色底圖時，裡面的按鈕改成淺色框、主要按鈕用強調色 */
.contact.has-art .btn {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}

.contact.has-art .btn.primary,
.contact.has-art .btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ── 側邊段落索引 ─────────────────────────────────── */
.stage-index {
  display: none;
}

@media (min-width: 1240px) {
  /* 一條直立的膠囊，每一格之間用短線連起來，像一條路徑 */
  .stage-index {
    position: fixed;
    /* 貼在內容欄的左邊，不是貼在視窗邊緣：內容欄左緣是 50% - 540px，索引寬 54px，中間留 16px */
    left: max(12px, calc(50% - 540px - 54px - 16px));
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px 9px;
    background: var(--card);
    border-radius: 999px;
    box-shadow: var(--shadow);
  }

  .stage-index a {
    position: relative;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--paper);
    font: 800 14px/1 var(--sans);
    color: var(--muted);
    transition: background-color 0.15s, color 0.15s;
  }

  .stage-index a + a::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -14px;
    width: 2px;
    height: 14px;
    margin-left: -1px;
    background: var(--line);
  }

  .stage-index a:hover {
    color: var(--ink);
  }

  .stage-index a[aria-current='true'] {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 6px 14px -6px var(--accent);
  }

  .stage-index em {
    position: absolute;
    left: 48px;
    font: 600 12.5px/1 var(--sans);
    font-style: normal;
    white-space: nowrap;
    background: var(--ink);
    color: var(--paper);
    padding: 6px 9px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
  }

  .stage-index a:hover em,
  .stage-index a:focus-visible em {
    opacity: 1;
  }
}

/* ── 作品牆 ───────────────────────────────────────── */
.page-title {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 900;
  margin-bottom: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 18px;
}

.filter {
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  padding: 6px 14px;
  color: var(--ink);
}

.filter[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card);
}

.filter[aria-pressed='true'] b {
  color: var(--card);
}

.wall {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.wall-item[hidden] {
  display: none;
}

.wall-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card.small h3 {
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.card.small p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 頁尾 ─────────────────────────────────────────── */
.footer {
  background: var(--band-dark);
  margin-top: 24px;
  color: var(--band-dark-ink);
  --muted: var(--band-dark-muted);
  padding: 8px 0 40px;
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 28px;
  padding-bottom: 20px;
  border-top: 1px solid var(--band-dark-line);
}

.footer-inner p {
  max-width: 30em;
  margin-top: 6px;
}

.footer nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.footer nav a:hover {
  color: var(--accent);
}

.footer-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--band-dark-muted);
  font: 500 12px/1.6 var(--mono);
}

@media (max-width: 520px) {
  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .topbar .brand {
    padding: 6px 12px;
    font-size: 17px;
  }

  .nav a {
    padding: 5px 9px;
  }

  /* 手機上選單項目變多，放不下時可以左右滑，不把整頁撐寬 */
  .nav {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: 13.5px;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .wordmark {
    height: 16px;
  }

  .topbar .brand.has-wordmark {
    padding: 10px 12px;
  }

  .nav a[rel] {
    display: none;
  }

  .band {
    padding: 40px 0 52px;
  }

  .heatmap {
    grid-template-rows: repeat(7, 12px);
    grid-auto-columns: 12px;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  a.card {
    transition: none;
  }
}
