/* =========================================================================
   ASUKA — Base / Reset / Typography
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--anchornav-h, 0px) + 16px);   /* v1.29.3 加上頁內導覽列的高度（ui.js 量測），錨點不會被黏在上方的導覽列蓋住 */
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-on-light);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

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

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

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

/* ---------- 標題 ----------
   標題一律使用 --font-display（Archivo），內文維持 --font-sans（Inter）。
   中文會自動落到 Noto Sans TC，兩種語言的骨架才不會差太多。 */
h1, h2, h3, h4,
.t-display, .t-h1, .t-h2, .t-h3, .t-h4 { font-family: var(--font-display); }

.t-display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  font-weight: var(--fw-black);
  letter-spacing: var(--tracking-tight);
}
.t-h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); }
.t-h2 { font-size: var(--fs-h2); line-height: var(--lh-snug); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); }
.t-h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); font-weight: var(--fw-semi); }
.t-h4 { font-size: var(--fs-h4); line-height: var(--lh-snug); font-weight: var(--fw-semi); }

.t-lead { font-size: clamp(1.05rem, .98rem + .5vw, 1.28rem); line-height: 1.6; }

/* 中文（CJK）需要較鬆的行高與字距，否則大標會擠在一起 */
html[lang^="zh"] .t-display { line-height: 1.24; letter-spacing: .01em; }
html[lang^="zh"] .t-h1,
html[lang^="zh"] .t-h2 { line-height: 1.32; letter-spacing: .01em; }
html[lang^="zh"] .t-h3,
html[lang^="zh"] .t-h4 { line-height: 1.45; }
html[lang^="zh"] body,
html[lang^="zh"] .t-lead { line-height: 1.85; }
/* 2026-10-15：英文導言避免最後一行只剩一個字（例：「…when the site needs / it.」）。
   pretty 只調整段落最後幾行；不給中文用（同 balance，可能從詞中間切開）。 */
html[lang^="en"] .t-lead { text-wrap: pretty; }
html[lang^="zh"] .eyebrow { letter-spacing: .1em; }
.t-sm   { font-size: var(--fs-sm); }
.t-xs   { font-size: var(--fs-xs); }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-eyebrow-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--brand);
}
.eyebrow--muted { color: var(--text-on-light-3); }

.muted      { color: var(--text-on-light-2); }
.muted-dark { color: var(--text-on-dark-2); }

/* ---------- 容器 / 區塊 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * .6); }
.section--dark  { background: var(--ink-900); color: var(--text-on-dark); }
.section--ink   { background: var(--ink-800); color: var(--text-on-dark); }
.section--soft  { background: var(--surface-1); }

.section--dark .eyebrow,
.section--ink  .eyebrow { color: var(--brand-soft); }
.section--dark .muted,
.section--ink  .muted { color: var(--text-on-dark-2); }

.section-head { max-width: 780px; margin-bottom: var(--sp-7); }
.section-head > * + * { margin-top: var(--sp-3); }

.section-head--split {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
}
.section-head--split .section-head__text { max-width: 720px; }
.section-head--split .section-head__text > * + * { margin-top: var(--sp-3); }

/* ---------- 網格 ---------- */
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ---------- 進場動畫 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }
/* v1.29.3：錨點目標（#連結指到的那一項）不做位移動畫，否則捲過去後元素再往上滑，會停到 header 底下 */
[data-reveal]:target { transform: none; transition: opacity .7s var(--ease); }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
