/* Hallmark · checked: 2026-11-30 · genre: editorial (inferred)
 * floor: 0 FAIL · fixed: 7 (19, 50, 54, 63, 67, 38iii, 26b) · structural: 4 printed as notes (44c, 58, 59, 78)
 * built: the project · redesign: polish · v2.0.0 */
/* huberton.dev：明亮學習平台風格。設計規格見 design-system/MASTER.md。顏色只在這個區塊定義。 */
:root {
  color-scheme: light;
  --bg: #fcfefd;
  --soft: #f3f4f6;
  --tint: #f0fdfa;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --brand: #0f766e;
  --brand-hover: #115e59;
  --brand-soft: #ccfbf1;
  --brand-ink: #115e59;
  --on-brand: #fcfefd;
  --line: #e5e7eb;
  --line-strong: #cbd5e1;
  --focus: #2563eb;
  --shadow-sm: rgb(17 24 39 / 0.06);
  --shadow-lg: rgb(17 24 39 / 0.16);
  --brand-glow: rgb(15 118 110 / 0.45);

  --sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --r-sm: 10px; --r-md: 16px; --r-lg: 20px; --r-pill: 999px;
  --wrap: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.75 var(--sans);
  /* 中文字型還沒載入、先用系統字型時，依漢字字身高度對齊大小，換字型時比較不會跳動 */
  font-size-adjust: ic-height from-font;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }

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

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s4); top: -100px; z-index: 10;
  padding: var(--s3) var(--s4); background: var(--ink); color: var(--bg);
  border-radius: var(--r-sm); text-decoration: none;
}
.skip:focus { top: var(--s4); }

.wrap { width: min(100% - 2 * var(--s5), var(--wrap)); margin-inline: auto; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico--fill { fill: currentColor; stroke: none; }

/* 標誌 */
.mark {
  display: inline-grid; place-items: center; flex: none;
  background: var(--brand); color: var(--on-brand);
  font-weight: 900; line-height: 1;
}
.mark--sm { width: 36px; height: 36px; font-size: 1.1875rem; border-radius: var(--r-sm); }
.mark--lg { width: 64px; height: 64px; font-size: 1.875rem; border-radius: var(--r-md); }

/* 頂欄 */
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top__in { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; min-height: 48px; }
.brand__name { font-weight: 700; font-size: 1.125rem; letter-spacing: .04em; }
.nav { display: flex; gap: var(--s1); }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--s3);
  border-radius: var(--r-pill);
  text-decoration: none; color: var(--ink-2); font-size: 0.9375rem; font-weight: 500;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav a:hover { color: var(--brand-ink); background: var(--tint); }
@media (max-width: 560px) {
  .brand__name { display: none; }
  .nav a { padding-inline: var(--s2); }
}

/* Hero */
.hero { padding-block: var(--s8) var(--s7); text-align: center; }
@media (min-width: 760px) { .hero { padding-block: var(--s9) var(--s8); } }
.hero__title {
  font-weight: 700; font-size: clamp(2.125rem, 6.4vw, 4.25rem); line-height: 1.25; letter-spacing: .02em;
  text-wrap: balance;
}
.hero__lead { margin: var(--s5) auto 0; max-width: 34em; text-wrap: pretty; color: var(--ink-2); font-size: clamp(1.0625rem, 1.9vw, 1.1875rem); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); margin-top: var(--s6); }

/* 按鈕 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 52px; padding: var(--s3) var(--s5);
  border: 0; border-radius: var(--r-pill);
  font: 700 1rem/1.2 var(--sans); letter-spacing: .04em; text-decoration: none;
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease), translate .1s var(--ease);
}
.btn:active { translate: 0 1px; }
.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 20px -8px var(--brand-glow); }
.btn--primary:hover { background: var(--brand-hover); box-shadow: 0 10px 24px -8px var(--brand-glow); }
.btn--soft { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn--soft:hover { background: var(--soft); }
.btn--soft:active { background: var(--line); }
.btn .ico { transition: translate .2s var(--ease); }
.btn:hover .ico:not(.ico--fill) { translate: 3px 0; }

/* 區塊 */
.section { padding-block: var(--s8) 0; }
.section__head { text-align: center; }
.section__title { font-weight: 700; font-size: clamp(1.625rem, 3.6vw, 2.125rem); line-height: 1.35; letter-spacing: .04em; }
.section__note { margin-top: var(--s2); text-wrap: pretty; color: var(--ink-2); font-size: 1rem; }

/* 作品卡 */
.works { display: grid; gap: var(--s5); margin-top: var(--s6); }
@media (min-width: 760px) { .works { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.work { display: flex; }
.work__link {
  display: flex; flex-direction: column; width: 100%;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: 0 1px 2px var(--shadow-sm), 0 12px 32px -16px var(--shadow-lg);
  transition: translate .25s var(--ease), box-shadow .25s var(--ease);
}
a.work__link:hover { translate: 0 -4px; box-shadow: 0 1px 2px var(--shadow-sm), 0 20px 40px -16px var(--shadow-lg); }
a.work__link:active { translate: 0 -2px; }
a.work__link:focus-visible { outline-offset: 4px; border-radius: var(--r-lg); }
.work__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--tint); }
.work__media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.work__media--contain img { object-fit: contain; padding: var(--s4); }
.work__body { display: flex; flex-direction: column; gap: var(--s2); flex: 1; padding: var(--s5); }
.work__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.work__url { color: var(--ink-3); font-size: 0.875rem; }
.work__title { font-weight: 700; font-size: clamp(1.3125rem, 2.6vw, 1.5rem); line-height: 1.4; }
.work__desc { color: var(--ink-2); text-wrap: pretty; font-size: 1rem; }
.work__cta {
  display: inline-flex; align-items: center; gap: var(--s2); margin-top: auto; padding-top: var(--s3);
  color: var(--brand); font-weight: 700;
}
.work__cta .ico { transition: translate .2s var(--ease); }
a.work__link:hover .work__cta .ico { translate: 3px 0; }

.tag {
  display: inline-flex; align-items: center;
  padding: 0 var(--s2); border-radius: var(--r-pill);
  background: var(--brand-soft); color: var(--brand-ink);
  font-size: 0.8125rem; font-weight: 500;
}

/* 關於 */
.about {
  display: grid; gap: var(--s5); align-items: center;
  padding: var(--s6); border-radius: var(--r-lg); background: var(--tint);
}
@media (min-width: 760px) { .about { grid-template-columns: 1fr 1.6fr; padding: var(--s7); } }
.about .section__title { text-align: left; }
.about__text { display: grid; text-wrap: pretty; gap: var(--s4); color: var(--ink-2); font-size: 1.0625rem; }
.points { display: grid; gap: var(--s3); margin-top: var(--s4); }
.points li { display: flex; gap: var(--s3); align-items: flex-start; color: var(--ink); font-weight: 500; }
.points .ico { margin-top: 4px; color: var(--brand); }

/* 粉專 */
.follow {
  display: grid; gap: var(--s5); align-items: center; justify-items: center; text-align: center;
  padding: var(--s6); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg);
  box-shadow: 0 1px 2px var(--shadow-sm), 0 12px 32px -16px var(--shadow-lg);
}
@media (min-width: 760px) { .follow { grid-template-columns: auto 1fr auto; justify-items: start; text-align: left; padding: var(--s7); } }
.follow__title { font-weight: 700; font-size: clamp(1.375rem, 3vw, 1.625rem); line-height: 1.4; }
.follow__text p { margin-top: var(--s1); text-wrap: pretty; color: var(--ink-2); }

/* 頁尾 */
.foot { margin-top: var(--s9); padding-block: var(--s6); border-top: 1px solid var(--line); background: var(--soft); color: var(--ink-2); font-size: 0.875rem; }
.foot__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s5); }
.foot a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }
.foot a:hover { color: var(--brand-ink); }

/* 首頁與先秦諸子吃早餐之間換頁時淡入淡出（同網域、兩邊都要開；不支援的瀏覽器照常換頁） */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* 404 */
.lost { min-height: 70dvh; display: grid; place-items: center; }

/* 動態偏好：平滑捲動只在使用者沒有要求減少動態時開啟 */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* 要求減少動態時只關掉位移；顏色與背景的變化保留，按鈕回饋才看得到 */
@media (prefers-reduced-motion: reduce) {
  a.work__link:hover, a.work__link:active, .btn:active,
  .btn:hover .ico:not(.ico--fill), a.work__link:hover .work__cta .ico { translate: none; }
}
