/* ==========================================================================
   vibecodewith.me — cc 版：實驗筆記本（紙、墨、一點朱紅）
   ========================================================================== */

:root {
  --paper: #eff0eb;
  --paper-2: #e3e5de;
  --ink: #181a17;
  --ink-2: #363933;
  --muted: #565a51;
  --line: #d2d5cb;
  --signal: #c13a1b;
  --signal-ink: #fdf8f1;
  --band: #1b1a17;
  --band-2: #26241f;
  --band-ink: #efe9dd;
  --band-muted: #a8a194;
  --band-line: #3a372f;
  --band-signal: #ff7a52;
  --panel: #f8f8f5;
  --shadow: 0 18px 40px -18px rgb(30 35 25 / 0.35);

  --f-display: "Gloock", "Noto Serif TC", Georgia, serif;
  --f-serif: "Noto Serif TC", "Gloock", Georgia, serif;
  --f-sans: "Noto Sans TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.22, 1.6, 0.36, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1180px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #141311;
  --paper-2: #1c1a17;
  --ink: #ece7dc;
  --ink-2: #d2ccbf;
  --muted: #a39d91;
  --line: #2f2c27;
  --signal: #ff7a52;
  --signal-ink: #1a0d07;
  --band: #1f1d19;
  --band-2: #2a2722;
  --band-ink: #efe9dd;
  --band-muted: #a8a194;
  --band-line: #3b3832;
  --band-signal: #ff7a52;
  --panel: #1b1a17;
  --shadow: 0 18px 40px -18px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--signal);
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out);
  overflow-x: hidden;
}

::selection { background: var(--signal); color: var(--signal-ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 2px solid var(--paper); }

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

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

h1, h2, h3, p, dl, dd, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }

.icon { width: 1.1em; height: 1.1em; flex: none; }

kbd {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 0.1em 0.45em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--muted);
  background: var(--paper);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 46px;
  padding: 0 1.35rem;
  border: 0;
  border-radius: 999px;
  font: 500 0.98rem/1 var(--f-sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.39s var(--spring), background-color 0.25s, box-shadow 0.25s;
}
.btn .icon { transition: transform 0.3s var(--ease-out); }
.btn:hover .icon { transform: translateX(3px); }
/* 按下壓扁、放開回彈（動效參考 UI Moments「夾頁鍵」，見 THIRD_PARTY_NOTICES.md） */
.btn, .tool-btn, .copy-btn, .filter { transition-property: transform, background-color, border-color, box-shadow, color; }
.btn:active, .tool-btn:active, .copy-btn:active, .filter:active {
  transform: translateY(1px) scale(1.04, 0.9);
  transition: transform 100ms ease-out;
}

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

.btn-signal { background: var(--band-signal); color: #1a0d07; }
.btn-signal:hover { background: #ff8d69; }
.btn-signal:hover .icon { transform: rotate(-12deg); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line);
  transition: text-decoration-color 0.2s, color 0.2s;
}
.text-link:hover { color: var(--signal); text-decoration-color: currentColor; }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.masthead.is-scrolled { border-bottom-color: var(--line); }

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 18%, transparent);
}

.nav {
  display: flex;
  gap: 2px;
  margin: 0 auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s, background-color 0.25s var(--ease-out);
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a.is-current, .nav a.is-current:hover { color: var(--paper); background: transparent; }

/* 彈性滑塊（動效參考 UI Moments「對齊撥片」）：在導覽列與篩選鈕之間滑動、拉長再收緊 */
.nav, .filters { position: relative; isolation: isolate; }
.thumb {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  will-change: transform, width;
}
.thumb.is-on { opacity: 1; }
.nav .thumb { background: var(--ink); }
.filters .thumb { border: 1px solid var(--ink); }

.tools { display: flex; gap: 8px; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.tool-btn:hover { background: var(--paper-2); border-color: var(--muted); }
.tool-btn-square { width: 38px; padding: 0; justify-content: center; }
.tool-btn kbd { border: 0; padding: 0; background: none; font-size: 0.75rem; }

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

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 6vw, 72px);
  isolation: isolate;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: end;
}

.hero-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(3.4rem, 10vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.hero-line { display: block; }
.hero-line-em { color: var(--signal); padding-left: 0.6em; }

.hero-lede {
  max-width: 30em;
  font-size: 1.08rem;
  color: var(--ink-2);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 28px;
}

/* Hero entrance — the page's one authored moment on load */
@media (prefers-reduced-motion: no-preference) {
  .hero-line {
    animation: inkIn 1.1s var(--ease-out) both;
  }
  .hero-line-em { animation-delay: 0.12s; }
  .hero-side { animation: fadeUp 0.9s 0.3s var(--ease-out) both; }
  @keyframes inkIn {
    from { opacity: 0; filter: blur(10px); transform: translateY(0.12em); }
    to { opacity: 1; filter: blur(0); transform: none; }
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
  }
}

/* Now strip */
.now-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-top: clamp(48px, 7vw, 88px);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}
.now-cell { padding: 16px 28px 18px 0; }
.now-cell + .now-cell { padding-left: 28px; border-left: 1px solid var(--line); }
.now-cell dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.now-cell dd { margin-top: 4px; font-size: 0.98rem; }
.now-cell dd a { text-decoration: none; }
.now-cell dd a:hover { color: var(--signal); }

.clock {
  font-family: var(--f-mono);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9e5b;
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }

.section-title {
  font-family: var(--f-serif);
  font-weight: 900;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* Section head: the divider every block opens with */
.sec-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--ink);
}
.sec-note { margin-top: 6px; font-size: 0.95rem; color: var(--muted); }
.sec-head > .sec-note { margin-top: 0; }

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(22px, 3vw, 36px);
}
.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.panel-label { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.chip {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
}
.about-text { margin-top: 14px; max-width: 36em; color: var(--ink-2); }
.about-lead {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--ink);
}
.skills { margin-top: 20px; font-size: 0.92rem; color: var(--muted); }
.skills span { margin: 0 0.4em; color: var(--line); }

.toolkit-list li:first-child { padding-top: 0; }
.toolkit-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.toolkit-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.toolkit-list .icon { width: 20px; height: 20px; color: var(--signal); }
.toolkit-list li span { margin-left: auto; font-weight: 400; font-size: 0.9rem; color: var(--muted); }

/* ---------- Vibe machine ---------- */
.section-tight { padding-top: 0; }
.vibe {
  background: var(--band);
  color: var(--band-ink);
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid var(--band-line);
  border-radius: 28px;
}
.vibe-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: start;
}
.vibe-heading {
  font-family: var(--f-serif);
  font-weight: 900;
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.15;
  text-wrap: balance;
}
.vibe-intro { margin-top: 18px; color: var(--band-muted); max-width: 26em; }
.vibe-actions { display: flex; align-items: center; gap: 18px; margin-top: 32px; }
.vibe-count {
  font-family: var(--f-mono);
  font-size: 0.85rem;
  color: var(--band-muted);
  font-variant-numeric: tabular-nums;
}

.vibe-sheet {
  position: relative;
  background: var(--band-2);
  border: 1px solid var(--band-line);
  border-radius: 20px;
  padding: clamp(24px, 3.4vw, 40px);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.6);
}
.vibe-meta {
  font-size: 0.85rem;
  color: var(--band-signal);
  font-weight: 500;
}
.vibe-title {
  margin-top: 10px;
  font-family: var(--f-serif);
  font-weight: 900;
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  line-height: 1.3;
  text-wrap: balance;
}
.vibe-desc { margin-top: 12px; color: var(--band-muted); max-width: 34em; }

.prompt {
  margin-top: 28px;
  border-top: 1px dashed var(--band-line);
  padding-top: 18px;
}
.prompt figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--band-muted);
}
.prompt pre {
  margin: 12px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--f-mono);
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--band-ink);
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--band-line);
  border-radius: 999px;
  background: transparent;
  color: var(--band-ink);
  font: 500 0.82rem var(--f-sans);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.copy-btn:hover { background: var(--band-line); }
.vibe :focus-visible { outline-color: var(--band-signal); }

/* Swap: the old idea dissolves, the new one resolves from blur */
.vibe-sheet > * { transition: opacity 0.22s ease, filter 0.22s ease, transform 0.22s ease; }
.vibe-sheet.is-swapping > * { opacity: 0; filter: blur(6px); transform: translateY(6px); }
.vibe-sheet.is-swapping > *:nth-child(2) { transition-delay: 0.03s; }
@media (prefers-reduced-motion: reduce) {
  .vibe-sheet > * { transition: opacity 0.15s linear; }
  .vibe-sheet.is-swapping > * { filter: none; transform: none; }
}

/* ---------- Lab ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.filter {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 0.92rem var(--f-sans);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.filter span { font-family: var(--f-mono); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.filter:hover { color: var(--ink); background: var(--paper-2); }
.filter.is-active, .filter.is-active:hover { color: var(--ink); background: transparent; }

.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.project { display: flex; }
.project-link {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  padding: clamp(22px, 2.6vw, 30px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  text-decoration: none;
  transition: transform 0.35s var(--ease-out), border-color 0.25s, box-shadow 0.35s var(--ease-out);
}
.project-link:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: var(--shadow); }
.project-head { padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.project-cta { margin-top: auto; justify-content: space-between; }

.project-name {
  font-family: var(--f-serif);
  font-weight: 900;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.project-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 0.75rem;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9e5b;
}
.status-wip::before { background: transparent; border: 1.5px solid var(--signal); }

.project-desc { color: var(--ink-2); max-width: 40em; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.82rem; color: var(--muted); }
.project-tags span::before { content: "#"; color: var(--line); margin-right: 2px; }

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink);
}
.project-cta .icon {
  width: 34px;
  height: 34px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: transform 0.35s var(--ease-out), background-color 0.25s, color 0.25s, border-color 0.25s;
}
.project-link:hover .project-cta .icon {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--signal-ink);
  transform: translateX(4px);
}

.projects-empty { grid-column: 1 / -1; padding: 40px 0; color: var(--muted); }

.contact-panel { padding: clamp(28px, 5vw, 64px); }

/* ---------- Contact ---------- */
.contact { padding-top: 0; }
.contact-title {
  font-family: var(--f-serif);
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.18;
  text-wrap: balance;
}
.contact-sub { margin-top: 18px; max-width: 34em; color: var(--ink-2); }

.email-btn {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  width: 100%;
  margin-top: clamp(36px, 5vw, 56px);
  padding: 22px 0;
  border: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.email-text {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 5.4vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  transition: color 0.25s;
}
.email-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}
.email-btn:hover .email-text { color: var(--signal); }

.contact-links { margin-top: 24px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 0.85rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Spotlight ---------- */
.spotlight {
  width: min(620px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 80px -24px rgb(20 15 5 / 0.45);
  overflow: hidden;
}
.spotlight[open] { display: flex; flex-direction: column; }
.spotlight::backdrop {
  background: rgb(20 18 14 / 0.35);
  backdrop-filter: blur(3px);
}
@media (prefers-reduced-motion: no-preference) {
  .spotlight[open] { animation: popIn 0.32s var(--ease-out); }
  @keyframes popIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); filter: blur(4px); }
    to { opacity: 1; transform: none; filter: none; }
  }
}
.spotlight-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.spotlight-row > .icon { color: var(--muted); }
.spotlight-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 400 1.08rem var(--f-sans);
}
.spotlight-input::placeholder { color: var(--muted); }
.spotlight-esc {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: 500 0.72rem var(--f-mono);
  padding: 4px 8px;
  cursor: pointer;
}
.spotlight-list { overflow-y: auto; padding: 8px; }
.spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 400 0.95rem var(--f-sans);
  text-align: left;
  cursor: pointer;
}
.spotlight-item-meta { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.spotlight-item.is-selected { background: var(--ink); color: var(--paper); }
.spotlight-item.is-selected .spotlight-item-meta { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.spotlight-empty { padding: 24px 12px; color: var(--muted); text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.92rem;
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: no-preference) {
  .toast:not([hidden]) { animation: toastIn 0.35s var(--ease-out); }
  @keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .about-grid { grid-template-columns: 1fr; }
  .vibe-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .masthead-inner { flex-wrap: wrap; height: auto; padding-block: 10px; row-gap: 10px; }
  .tools { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; justify-content: space-between; }
  .nav a { padding: 6px 14px; }
  html { scroll-padding-top: 120px; }
}

@media (max-width: 640px) {
  .kbd-hint { display: none; }
  .tool-btn:not(.tool-btn-square) { width: 38px; padding: 0; justify-content: center; }
  .now-strip { grid-template-columns: 1fr 1fr; }
  .now-cell { padding: 14px 16px 14px 0; }
  .now-cell + .now-cell { padding-left: 16px; }
  .now-cell-wide { grid-column: 1 / -1; grid-row: 2; border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid var(--line); }
  .hero-line-em { padding-left: 0.3em; }
  .projects { grid-template-columns: 1fr; }
  .footer-hint { display: none; }
}

@media (hover: none) {
  .footer-hint, .kbd-hint { display: none; }
  .project-link:hover { transform: none; box-shadow: none; }
}
/* 主題鈕：圖示轉入 */
.tool-btn-square .icon { transition: transform 0.5s var(--spring), opacity 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .btn:active, .tool-btn:active, .copy-btn:active, .filter:active { transform: none; }
  .thumb { transition: none; }
}
