/* ==========================================================================
   base.css — 設計變數、重置、基礎排版
   Taiwan SAR Consortium
   ========================================================================== */

:root {
  /* 底色：純黑 → 深灰 → 灰藍 */
  --bg:            #0a0b0d;
  --bg-2:          #101317;
  --bg-3:          #161b21;
  --surface:       #1a212a;
  --surface-2:     #202a35;
  --slate:         #2b3a49;

  /* 線條 */
  --line:          rgba(140, 170, 200, 0.14);
  --line-strong:   rgba(140, 170, 200, 0.26);

  /* 文字 */
  --txt:           #dfe6ee;
  --txt-dim:       #9fadbd;
  --txt-mute:      #6d7d8f;

  /* 主色：天藍 / 淺藍 */
  --accent:        #4a9eff;
  --accent-2:      #64b5f6;
  --accent-deep:   #2b7fe0;
  --accent-soft:   rgba(74, 158, 255, 0.12);
  --accent-glow:   rgba(74, 158, 255, 0.35);

  /* 標籤色（六類最新消息） */
  --tag-org:       #4a9eff;
  --tag-imagery:   #22c6a9;
  --tag-member:    #b18cff;
  --tag-workshop:  #f0a850;
  --tag-training:  #5cd07a;
  --tag-intl:      #ff7f92;

  /* 字體 */
  --font-latin: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-cjk:   "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-sans:  var(--font-latin), var(--font-cjk);
  --font-mono:  "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* 尺度 */
  --nav-h: 68px;
  --wrap: 1180px;
  --wrap-narrow: 780px;
  --radius: 4px;
  --radius-lg: 8px;

  /* 節奏 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------- 重置 --------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景微光：固定在視窗，不隨捲動 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 78% -8%, rgba(74, 158, 255, 0.10), transparent 62%),
    radial-gradient(760px 520px at 8% 102%, rgba(43, 58, 73, 0.55), transparent 60%);
}

img { max-width: 100%; display: block; }

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: #9acbff; }

button { font: inherit; }

ul, ol { padding-left: 1.3em; }

/* --------------------------------------------------- 字級與標題 --------- */

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 0 0 0.6em;
  color: #eef3f9;
}

h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.35rem); }
h4 { font-size: 1.05rem; }

/* 段落寬度不使用 ch：ch 是以拉丁字母「0」的寬度計算，
   中文字寬約為兩倍，72ch 只裝得下約 36 個中文字，
   會在寬版面中央就折行。改用實際像素值控制每行長度。 */
p { margin: 0 0 1.1em; }

/* 文字區塊的可讀行長（約 45–50 個中文字） */
.page-body,
.lead,
.panel p,
.goal ul { max-width: 62rem; }

.lead {
  font-size: 1.075rem;
  color: var(--txt-dim);
  line-height: 1.9;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--txt-mute);
}

/* ---------------------------------------------------- 版面容器 --------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.wrap-narrow { max-width: var(--wrap-narrow); }

.section {
  padding-block: clamp(64px, 8vw, 104px);
  position: relative;
}

.section--tight { padding-block: clamp(44px, 5vw, 64px); }

.section--alt { background: var(--bg-2); }

.section--line { border-top: 1px solid var(--line); }

/* ------------------------------------------- 軌道式章節標題 ----------- */
/* 視覺母題：衛星沿軌飛行的軌跡線 + 節點                                  */

/* ------------------------------------------- 章節標題的角標 ----------- */
/* 借用技術圖面上的裁切角標：左上角一組短折線，不帶點與連接線            */

.sec-head {
  position: relative;
  padding-top: 15px;
  margin-bottom: 40px;
}

.sec-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 2px;
  background: var(--accent);
}

/* .sec-head::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 17px;
  background: var(--accent);
} */

.sec-head h2 { margin-bottom: 0.35em; }

.sec-head p { color: var(--txt-dim); margin-bottom: 0; }

/* ----------------------------------------------- 捲動顯示動畫 --------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ----------------------------------------------- 無障礙與偏好 --------- */

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

.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;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--accent);
  color: #06101f;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; color: #06101f; }

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