/* --- 自架字型 -------------------------------------------------------------
   由 scripts/build-fonts.py 產生，只含站上實際用到的字。
   原本用 Google Fonts CDN，那支 CSS 是 365 KB 且 render-blocking；改自架後
   少掉兩次跨網域連線，體積也小一個數量級。改動這段請重跑該腳本，不要手改。
   ------------------------------------------------------------------------- */

@font-face {
  font-family: "Noto Sans TC Subset";
  src: url("../fonts/notosanstc.woff2?v=c4ecdbcb") format("woff2-variations");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Jost Subset";
  src: url("../fonts/jost.woff2?v=166d1a75") format("woff2-variations");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 岩石墨色 palette */
  --bg:        #FAF8F5;   /* 暖米白底 */
  --bg-alt:    #F1EDE7;   /* 交替區塊 */
  --ink:       #1C1A17;   /* 主文字・墨石 */
  /* 岩灰。刻意調深到 #6F6961：在 --bg 上 5.1:1、--bg-alt 上 4.7:1，
     小字才過 WCAG AA 4.5:1（原本的 #8A8378 只有 3.2–3.5:1）。 */
  --ink-soft:  #6F6961;
  --accent:    #A65E3C;   /* 強調・黏土赤 */
  --accent-dk: #8A4B2E;
  --line:      #E3DDD3;
  --overlay-dk:rgba(28, 26, 23, .62);

  /* 字體 */
  --font-zh: "Noto Sans TC Subset", "PingFang TC", "Microsoft JhengHei", "Hiragino Sans", sans-serif;
  --font-en: "Jost Subset", "Helvetica Neue", Arial, sans-serif;

  /* 尺度 */
  --wrap: 1200px;
  --gut: 24px;
  --header-h: 88px;

  /* 動態 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .45s;
}

/* --- reset ------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* header 是 fixed，錨點跳轉時要留出它的高度，否則標題會被蓋住 */
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-zh);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: .04em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked { overflow: hidden; }

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

img, svg, video { display: block; max-width: 100%; height: auto; }

/* 本站有幾個元件把 display 寫死（例如 .lightbox__nav 是 grid），會蓋掉 UA 樣式表的
   [hidden]{display:none}。用 !important 讓 hidden 屬性在任何情況下都有效。 */
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--accent); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button { background: none; border: 0; cursor: pointer; }

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

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

/* --- 字體樣式 ----------------------------------------------------------- */

.en {
  font-family: var(--font-en);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: .22em;
}

/* 區段標題：置中，中文末二字上色 + 短底線（承襲參考站語彙） */
.sect-head {
  text-align: center;
  margin-bottom: 56px;
}
.sect-head__en {
  display: block;
  font-family: var(--font-en);
  font-weight: 300;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .34em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.sect-head__zh {
  display: inline-block;
  position: relative;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .12em;
  padding-bottom: 18px;
}
.sect-head__zh em { font-style: normal; color: var(--accent); }
.sect-head__zh::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 44px;
  height: 2px;
  background: var(--accent);
  transform: translateX(-50%);
}
.sect-head__lead {
  max-width: 660px;
  margin: 22px auto 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 2.1;
}

/* --- 按鈕 --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 38px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  letter-spacing: .16em;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--ink); color: var(--bg); }

.btn--accent { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-dk); border-color: var(--accent-dk); color: #fff; }

.btn--light { border-color: rgba(255, 255, 255, .8); color: #fff; }
.btn--light:hover { background: #fff; color: var(--ink); border-color: #fff; }


/* --- 共用小工具 --------------------------------------------------------- */

/* 區段結尾置中的按鈕列（一顆或多顆都適用） */
.center-action {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}
.center-action--gap { margin-top: 48px; }

/* 電話號碼不要在中間斷行。用 CSS 而不是 &#8209; 非斷行連字號：
   後者有些字型缺字，也會讓使用者複製或搜尋號碼時對不上。 */
a[href^="tel:"] { white-space: nowrap; }

.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: absolute;
  top: -100px;
  left: 16px;
  z-index: 999;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--bg);
}
.skip-link:focus { top: 16px; color: var(--bg); }

/* 進場動畫（js/site.js 以 IntersectionObserver 加上 .is-in） */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* --- RWD 字級 ----------------------------------------------------------- */

@media (max-width: 768px) {
  :root { --header-h: 68px; --gut: 20px; }
  body { font-size: 15px; line-height: 1.85; }
  .sect-head { margin-bottom: 40px; }
  .sect-head__zh { font-size: 24px; }
}
