/* ===========================================================
   base.css — 設計 token、reset、字型
   載入順序：base → layout → components → pages
   =========================================================== */

:root {
  color-scheme: light;

  /* —— 版面 —— */
  --radius: 10px;
  --radius-pill: 999px;
  --container: 1280px;
  --gutter: clamp(20px, 5vw, 96px);

  /* —— 色票 —— */
  --paper:           #FFFFFF;
  --paper-cream:     #FAF5EA;
  --paper-warm:     #FFF4D6;

  --ink:             #211715;
  --muted:           #6F6256;

  --kagyu-yellow:    #F5C518;
  --kagyu-yellow-soft:#FBE49B;
  --kagyu-red:       #B21F35;
  --kagyu-red-deep:  #6B1217;
  --gold-soft:       #D4A24A;
  --turquoise:       #1F7378;

  --line:            rgba(178, 31, 53, 0.16);
  --line-strong:     rgba(178, 31, 53, 0.32);

  --shadow-card:     0 14px 40px rgba(107, 44, 16, 0.10);
  --shadow-hover:    0 22px 60px rgba(107, 44, 16, 0.16);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* —— 字型 —— */
  --font-serif: "Noto Serif TC", "Noto Sans TC", "Microsoft JhengHei", serif;
  --font-sans:  "Noto Sans TC", "Inter", "Microsoft JhengHei", sans-serif;
  --font-en:    "Inter", "Noto Sans TC", sans-serif;

  font-family: var(--font-serif);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(245, 197, 24, 0.16), transparent 38rem),
    linear-gradient(180deg, #ffffff 0%, var(--paper-cream) 55%, #fff8e8 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 180ms var(--ease);
}

a:hover { color: var(--kagyu-red); }

button, input, textarea, select { font: inherit; color: inherit; }

button, a, input, textarea { outline-offset: 4px; }

:focus-visible {
  outline: 3px solid rgba(31, 115, 120, 0.45);
  outline-offset: 3px;
}

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

h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 5.6rem);
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--ink);
}

h2 {
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.9rem);
  line-height: 1.18;
  color: var(--ink);
}

h3 {
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--ink);
}

p { margin: 0 0 1rem; color: var(--ink); }

p:last-child { margin-bottom: 0; }

strong { font-weight: 700; }

em { font-style: italic; }

ul, ol { margin: 0; padding-left: 1.25rem; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

code, pre {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", monospace;
}

::selection {
  background: var(--kagyu-yellow-soft);
  color: var(--kagyu-red-deep);
}

/* —— 共用文字小標 —— */
.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  color: var(--kagyu-red);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* —— 視覺輔助 —— */
.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: -200px;
  left: 16px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--kagyu-red);
  color: #fff;
  border-radius: var(--radius);
}

.skip-link:focus { top: 16px; color: #fff; }

.text-link {
  color: var(--kagyu-red);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.text-link:hover { color: var(--kagyu-red-deep); }

/* —— 動作輔助 —— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}