/* ==========================================================================
   白白 Rbai — Personal Portfolio
   Style: 文青風（Editorial / Minimal）— 暖米紙感、serif 標題、大量留白
   結構索引：
   1. Design Tokens        — 顏色、字體、動效參數（改風格從這裡下手）
   2. Base / Reset
   3. Utilities            — container, section, 標題樣式
   4. Header / Nav
   5. Hero
   6. About
   7. Personality
   8. Skills
   9. Experience
   10. Hobbies（拍立得拼貼）
   11. Contact / Footer
   12. Dark Theme 覆寫
   13. Responsive
   14. Reduced Motion
   ========================================================================== */

/* 1. Design Tokens
   ------------------------------------------------------------------ */
:root {
  /* colors — 暖米紙感＋單一低飽和陶土色 accent */
  --paper: #f6f3ee;
  --surface: #fffdfa;
  --surface-2: #f1ece4;
  --border: rgba(46, 41, 36, 0.1);
  --border-strong: rgba(46, 41, 36, 0.2);
  --ink: #2e2924;
  --muted: #85796b;
  --accent: #b4694e;
  --accent-soft: rgba(180, 105, 78, 0.12);
  --blob-warm: rgba(212, 167, 122, 0.2);
  --blob-sage: rgba(151, 165, 143, 0.18);
  --glass: rgba(246, 243, 238, 0.8);
  --shadow: 0 14px 36px -18px rgba(46, 41, 36, 0.28);

  /* typography */
  --font-serif: "EB Garamond", "Noto Serif TC", serif;
  --font-sans: "Inter", "Noto Sans TC", system-ui, -apple-system, sans-serif;

  /* motion（文青感：慢一點、輕一點；全站節奏由此調整） */
  --dur-fast: 0.35s;
  --dur-base: 0.9s;
  --dur-slow: 1.3s;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* layout */
  --radius: 20px;
  --radius-sm: 12px;
  --container: 1080px;

  color-scheme: light;
}

/* 2. Base / Reset
   ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

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

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 600;
}

ul {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

/* skip link (a11y) */
.skip-link {
  position: fixed;
  top: -100%;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--dur-fast);
}

.skip-link:focus {
  top: 0;
}

/* 3. Utilities
   ------------------------------------------------------------------ */
.container {
  width: min(var(--container), 100% - 48px);
  margin-inline: auto;
}

.section {
  padding: clamp(84px, 13vh, 150px) 0;
  position: relative;
}

/* attachment 固定背景（捲動時產生視差感的紙上照片） */
.section--bg {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.section--bg .container {
  position: relative;
  z-index: 1;
}

.section--bg-warm {
  background-image: url("../assets/img/bg-beach-sunset.jpg");
}

.section--bg-mist {
  background-image: url("../assets/img/bg-sea-mist.jpg");
}

.section-head {
  margin-bottom: clamp(44px, 6vh, 68px);
}

.section-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}

/* 小裝飾線 — 由 JS 做 SVG 線繪 */
.eyebrow-line {
  width: 36px;
  height: 2px;
  overflow: visible;
}

.eyebrow-line line {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.section-head h2 {
  font-size: clamp(32px, 4.5vw, 46px);
  letter-spacing: 0.02em;
  line-height: 1.3;
  margin-top: 12px;
}

.section-head .lead {
  margin-top: 14px;
  max-width: 540px;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast),
    box-shadow var(--dur-fast);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

/* 捲動進度條 */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 120;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* 單色 icon 通用 */
.mono-icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--accent);
}

/* 4. Header / Nav
   ------------------------------------------------------------------ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background var(--dur-fast), border-color var(--dur-fast);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.04em;
}

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

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 999px;
  transition: color var(--dur-fast), background var(--dur-fast);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
  background: rgba(46, 41, 36, 0.05);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle,
.menu-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}

.theme-toggle:hover,
.menu-toggle:hover {
  color: var(--ink);
  border-color: var(--border-strong);
  transform: rotate(15deg);
}

.theme-toggle svg,
.menu-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

.menu-toggle {
  display: none;
}

/* mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 24px 24px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.mobile-menu a {
  padding: 12px 4px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.mobile-menu a:last-child {
  border-bottom: none;
}

.mobile-menu a:hover {
  color: var(--ink);
}

/* 5. Hero
   ------------------------------------------------------------------ */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 130px 0 90px;
}

/* 有機曲線色塊（SVG blob，idle 緩慢漂浮） */
.blob {
  position: absolute;
  pointer-events: none;
  filter: blur(2px);
}

.blob--warm {
  width: clamp(320px, 42vw, 560px);
  top: 6%;
  right: -10%;
  color: var(--blob-warm);
}

.blob--sage {
  width: clamp(260px, 34vw, 440px);
  bottom: 2%;
  left: -8%;
  color: var(--blob-sage);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin-inline: auto;
}

/* 標題周圍的 SVG 星芒（緩慢閃爍） */
.sparkle {
  position: absolute;
  width: 18px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
  pointer-events: none;
  animation: twinkle 3.6s ease-in-out infinite;
}

.sparkle--1 {
  top: -6%;
  left: 13%;
}

.sparkle--2 {
  top: 16%;
  right: 9%;
  width: 14px;
  animation-delay: 1.2s;
}

.sparkle--3 {
  bottom: 26%;
  left: 6%;
  width: 12px;
  animation-delay: 2.3s;
}

@keyframes twinkle {

  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.75) rotate(0deg);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.05) rotate(18deg);
  }
}

.hero h1 {
  margin-top: 30px;
  font-size: clamp(42px, 7.5vw, 76px);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.hero h1 .name-wrap {
  position: relative;
  display: inline-block;
}

.hero h1 .en-name {
  color: var(--accent);
  font-style: italic;
}

/* 名字底下的 SVG 手繪弧線（線繪動畫） */
.name-underline {
  position: absolute;
  left: 0;
  bottom: -12px;
  width: 100%;
  height: 18px;
  overflow: visible;
}

.name-underline path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.8;
}

/* 輪播職稱 */
.hero .roles {
  margin-top: 32px;
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  min-height: 1.7em;
}

.roles .role-word {
  color: var(--ink);
  font-family: var(--font-serif);
  display: inline-block;
  min-width: 13ch;
  text-align: left;
}

.roles .cursor {
  width: 1.5px;
  height: 1.1em;
  background: var(--accent);
  display: inline-block;
  transform: translateY(3px);
  animation: blink 1.2s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero .intro {
  margin: 24px auto 0;
  max-width: 520px;
  font-size: 16.5px;
  color: var(--muted);
}

.hero-cta {
  margin-top: 44px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast),
    background var(--dur-fast),
    border-color var(--dur-fast),
    color var(--dur-fast);
}

.btn svg {
  width: 16px;
  height: 16px;
}

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

.btn--primary:hover {
  transform: translateY(-2px);
  background: var(--accent);
  box-shadow: 0 12px 28px -14px rgba(180, 105, 78, 0.6);
}

.btn--ghost {
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

/* 捲動提示（SVG 滑鼠 idle 動畫） */
.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.scroll-hint svg {
  width: 20px;
  height: 32px;
}

.scroll-hint .wheel {
  animation: wheel 2.2s var(--ease-out) infinite;
}

@keyframes wheel {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  70% {
    transform: translateY(8px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 0;
  }
}

/* 6. About
   ------------------------------------------------------------------ */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(44px, 7vw, 90px);
  align-items: center;
}

.about-copy p {
  color: var(--muted);
  margin-bottom: 18px;
}

.about-copy strong {
  color: var(--ink);
  font-weight: 600;
}

.quick-facts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.fact-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}

.fact-chip .mono-icon {
  width: 16px;
  height: 16px;
}

.fact-chip:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* 部分重疊排版：個人照（1:1 大、後）＋插畫頭貼（1:1 小、前）— 圓角方形 */
.about-visual {
  position: relative;
  justify-self: center;
  width: min(360px, 100%);
}

.about-visual .photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--border-strong);
}

.about-visual .illust {
  position: absolute;
  left: -14%;
  bottom: -11%;
  width: 45%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22px;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow);
  background: var(--surface);
}

/* 照片後方的柔和色塊 */
.about-visual::before {
  content: "";
  position: absolute;
  inset: -7% -9% auto auto;
  width: 62%;
  height: 62%;
  border-radius: 42% 58% 55% 45% / 50% 44% 56% 50%;
  background: var(--blob-warm);
  z-index: -1;
}

/* 7. Personality
   ------------------------------------------------------------------ */
.trait-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.trait {
  padding: 28px 26px;
}

.trait .mono-icon {
  width: 24px;
  height: 24px;
}

.trait h3 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.trait p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

/* 8. Skills
   ------------------------------------------------------------------ */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.skill-card {
  padding: 28px 26px;
}

.skill-card .skill-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.skill-card .skill-icon svg {
  width: 21px;
  height: 21px;
}

.skill-card h3 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.skill-tags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tags li {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--muted);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}

.skill-tags li:hover {
  color: var(--ink);
  border-color: var(--accent);
}

/* 9. Experience
   ------------------------------------------------------------------ */
/* 數字動畫 */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: clamp(52px, 7vh, 76px);
}

.stat {
  padding: 30px 22px;
  text-align: center;
}

.stat .num {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 48px);
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat .label {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* 時間軸 */
.timeline {
  position: relative;
  padding-left: 32px;
  display: grid;
  gap: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: 0.4;
}

.tl-item {
  position: relative;
  padding: 26px 28px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 34px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 2.5px solid var(--accent);
}

.tl-item .tl-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.tl-item h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
}

.tl-item .period {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.tl-item .org {
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.tl-item ul {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.tl-item ul li {
  display: flex;
  gap: 10px;
  font-size: 14.5px;
  color: var(--muted);
}

.tl-item ul li .check {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 7px;
  color: var(--accent);
}

/* 代表專案 */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: clamp(52px, 7vh, 76px);
}

.project {
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
}

.project .tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 13px;
  border-radius: 999px;
}

.project h3 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
}

.project p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  flex: 1;
}

.project .impact {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--ink);
  display: grid;
  gap: 6px;
}

.project .impact span {
  display: flex;
  gap: 8px;
}

.project .impact .check {
  flex: none;
  width: 13px;
  height: 13px;
  margin-top: 6px;
  color: var(--accent);
}

/* 10. Hobbies — 拍立得拼貼（生活感）
   ------------------------------------------------------------------ */
.polaroid-grid {
  columns: 3;
  column-gap: 20px;
}

.polaroid {
  break-inside: avoid;
  margin: 20px;
  padding: 12px 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 10px 26px -16px rgba(46, 41, 36, 0.3);
  position: relative;
  transition: transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast);
}

/* 紙膠帶裝飾 */
.polaroid::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 74px;
  height: 20px;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--accent-soft);
  border-left: 1px dashed rgba(180, 105, 78, 0.3);
  border-right: 1px dashed rgba(180, 105, 78, 0.3);
  opacity: 0.9;
}

/* 手作感的凌亂拼貼：角度、位移、大小各自不同，放大的卡片會微微疊上鄰居（hover 時扶正） */
.polaroid:nth-child(6n + 1) {
  transform: rotate(-2.6deg) translate(2px, 4px) scale(1.08);
}

.polaroid:nth-child(6n + 2) {
  transform: rotate(1.9deg) translate(-3px, -5px) scale(0.97);
}

.polaroid:nth-child(6n + 3) {
  transform: rotate(-1.2deg) translate(4px, 7px) scale(1.12);
}

.polaroid:nth-child(6n + 4) {
  transform: rotate(2.8deg) translate(-5px, 2px) scale(1.04);
}

.polaroid:nth-child(6n + 5) {
  transform: rotate(-3.1deg) translate(3px, -4px) scale(1.1);
}

.polaroid:nth-child(6n) {
  transform: rotate(1.4deg) translate(-2px, 6px) scale(0.96);
}

/* 放大的卡片疊在上層，層次更自然 */
.polaroid:nth-child(6n + 3),
.polaroid:nth-child(6n + 5) {
  z-index: 1;
}

/* 紙膠帶位置也跟著亂貼 */
.polaroid:nth-child(3n + 1)::before {
  left: 32%;
  transform: translateX(-50%) rotate(-6deg);
}

.polaroid:nth-child(3n + 2)::before {
  left: 50%;
  transform: translateX(-50%) rotate(3deg);
}

.polaroid:nth-child(3n)::before {
  left: 68%;
  transform: translateX(-50%) rotate(5deg);
}

.polaroid:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.06);
  box-shadow: var(--shadow);
  z-index: 2;
}

/* 圖片保持原始比例，不裁切 */
.polaroid img {
  width: 100%;
  height: auto;
  border-radius: 3px;
}

.polaroid figcaption {
  margin-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  font-family: var(--font-serif);
  font-size: 14.5px;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.polaroid figcaption .mono-icon {
  width: 17px;
  height: 17px;
}

.polaroid figcaption .note {
  color: var(--muted);
  font-size: 13px;
  margin-left: auto;
  white-space: nowrap;
}

/* 大尺寸時一行 3 欄 */
@media (min-width: 1100px) {
  .polaroid-grid {
    columns: 3;
  }
}

/* 有隱藏彩蛋的照片：週期性微微跳動提示（hover 時停住） */
@keyframes nudge {

  0%,
  84%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  88% {
    transform: translateY(-6px) rotate(-1.2deg);
  }

  92% {
    transform: translateY(1px) rotate(0.9deg);
  }

  96% {
    transform: translateY(-3px) rotate(0deg);
  }
}

.polaroid--peek>img {
  animation: nudge 5.4s ease-in-out infinite;
  animation-delay: var(--peek-delay, 0s);
  /* 各卡片錯開跳動時機 */
}

.polaroid--peek:hover>img,
.polaroid--peek:focus-within>img {
  animation-play-state: paused;
}

/* 兔子 hover 對話泡泡 */
.bubble-wrap {
  position: relative;
  display: block;
}

.speech-bubble {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translate(-50%, 6px);
  opacity: 0;
  padding: 7px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: 0.05em;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
  z-index: 2;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
}

.polaroid:hover .speech-bubble,
.polaroid:focus-within .speech-bubble {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 11. Contact / Footer
   ------------------------------------------------------------------ */
.contact {
  text-align: center;
}

.contact .section-head {
  margin-bottom: 0;
}

.contact .lead {
  margin-inline: auto;
}

/* 標題下的手繪波浪線 */
.squiggle {
  display: block;
  width: 130px;
  height: 14px;
  margin: 14px auto 0;
  color: var(--accent);
  overflow: visible;
}

.squiggle path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.contact-links {
  margin-top: 40px;
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 15px;
  letter-spacing: 0.04em;
  transition: border-color var(--dur-fast), color var(--dur-fast),
    transform var(--dur-fast) var(--ease-out);
}

.contact-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.contact-links .mono-icon {
  width: 16px;
  height: 16px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 48px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
}

.made-with {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.made-with span {
  padding: 3px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
}

/* 12. Dark Theme 覆寫（暖色調深夜模式）
   ------------------------------------------------------------------ */
:root[data-theme="dark"] {
  --paper: #211d18;
  --surface: #2a2520;
  --surface-2: #322c26;
  --border: rgba(241, 235, 227, 0.1);
  --border-strong: rgba(241, 235, 227, 0.2);
  --ink: #f1ebe3;
  --muted: #a79c8e;
  --accent: #d89070;
  --accent-soft: rgba(216, 144, 112, 0.14);
  --blob-warm: rgba(212, 167, 122, 0.1);
  --blob-sage: rgba(151, 165, 143, 0.1);
  --glass: rgba(33, 29, 24, 0.8);
  --shadow: 0 14px 36px -16px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .polaroid {
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.5);
}

/* 13. Responsive
   ------------------------------------------------------------------ */
@media (max-width: 960px) {

  .trait-grid,
  .skill-grid,
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .polaroid-grid {
    columns: 2;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  .mobile-menu.is-open {
    display: flex;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-visual {
    order: -1;
    width: min(300px, 82%);
  }

  .hobby-grid,
  .trait-grid,
  .skill-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .roles .role-word {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .polaroid-grid {
    columns: 1;
  }
}

/* 14. Reduced Motion（WCAG 2.3.3）
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}