/* ==========================================================================
   airevision design tokens + shared base
   --------------------------------------------------------------------------
   套用方法：<link rel="stylesheet" href="assets/airevision.css">
   --------------------------------------------------------------------------
   此檔提供：
   - 字型載入（Source Serif 4 + Noto Serif HK + Inter + JetBrains Mono）
   - 顏色 token（warm ochre + dark variant，用 [data-mode] 切換）
   - editorial 排版節奏（heading、間距、line-height）
   - 共用 component（callout / subhead / code / kbd / 按鈕基礎）
   - 頁面 chrome（header / footer 風格）
   --------------------------------------------------------------------------
   注意：此檔故意 *不會* 覆蓋 page-specific 嘅 --primary / --accent 等
   色彩變數 — 各頁仍可用自己嘅 theme（紫、藍、綠等）作為 accent，
   airevision 提供嘅係 typography + spacing + neutral tokens。
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400&family=Noto+Serif+HK:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* ---- Light (default) ---- */
  --av-bg:        oklch(0.985 0.006 75);
  --av-bg-elev:   oklch(1 0 0);
  --av-paper:     oklch(0.97 0.012 70);
  --av-ink:       oklch(0.22 0.012 60);
  --av-ink-soft:  oklch(0.40 0.012 60);
  --av-ink-muted: oklch(0.55 0.012 60);
  --av-rule:      oklch(0.90 0.012 70);
  --av-rule-soft: oklch(0.94 0.010 70);

  /* warm ochre — airevision 嘅特徵色 */
  --av-accent:        oklch(0.58 0.145 48);
  --av-accent-deep:   oklch(0.42 0.115 45);
  --av-accent-tint:   oklch(0.95 0.040 65);
  --av-accent-tint-2: oklch(0.91 0.060 60);

  /* type stacks */
  --av-serif-en: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --av-serif-zh: "Noto Serif HK", "Songti TC", "Source Han Serif TC", "Noto Serif CJK TC", serif;
  --av-sans:     "Inter", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", "PingFang HK", sans-serif;
  --av-mono:     "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* spacing scale */
  --av-radius-sm: 6px;
  --av-radius:    10px;
  --av-radius-lg: 14px;
}

/* ---- Dark variant ---- */
[data-mode="dark"], body.dark {
  --av-bg:        oklch(0.18 0.008 65);
  --av-bg-elev:   oklch(0.22 0.010 65);
  --av-paper:     oklch(0.24 0.012 65);
  --av-ink:       oklch(0.94 0.008 75);
  --av-ink-soft:  oklch(0.78 0.010 70);
  --av-ink-muted: oklch(0.62 0.012 70);
  --av-rule:      oklch(0.32 0.012 65);
  --av-rule-soft: oklch(0.28 0.010 65);

  --av-accent:        oklch(0.72 0.135 55);
  --av-accent-deep:   oklch(0.82 0.110 60);
  --av-accent-tint:   oklch(0.32 0.050 55);
  --av-accent-tint-2: oklch(0.40 0.060 55);
}

/* ==========================================================================
   Reset + base
   ========================================================================== */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--av-bg);
  color: var(--av-ink);
  font-family: var(--av-serif-zh), var(--av-serif-en);
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
  transition: background 0.2s, color 0.2s;
}

::selection { background: var(--av-accent-tint-2); color: var(--av-ink); }

/* ==========================================================================
   Typography rhythm
   ========================================================================== */

.av-eyebrow {
  font-family: var(--av-sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--av-accent-deep);
  font-weight: 500;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.av-eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--av-accent);
  display: inline-block;
}

.av-hero-title {
  font-family: var(--av-serif-zh), var(--av-serif-en);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  color: var(--av-ink);
  text-wrap: balance;
}

.av-lede {
  font-size: 18px;
  line-height: 1.65;
  color: var(--av-ink-soft);
  margin: 0 0 28px;
  max-width: 640px;
  text-wrap: pretty;
}

.av-section-num {
  font-family: var(--av-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--av-accent-deep);
  margin: 0 0 12px;
  font-variant-numeric: tabular-nums;
}

.av-section-title {
  font-family: var(--av-serif-zh), var(--av-serif-en);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
  color: var(--av-ink);
  text-wrap: balance;
}

.av-subhead {
  font-family: var(--av-serif-zh), var(--av-serif-en);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 32px 0 12px;
  color: var(--av-ink);
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Callout / soft pull-quote */
.av-callout {
  margin: 24px 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--av-accent);
  color: var(--av-ink-soft);
  font-style: italic;
}
.av-callout strong { color: var(--av-ink); font-style: normal; }

/* Inline code / kbd */
.av-code {
  font-family: var(--av-mono);
  font-size: 0.88em;
  background: var(--av-paper);
  border: 1px solid var(--av-rule-soft);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--av-ink);
}

.av-kbd {
  font-family: var(--av-sans);
  background: var(--av-accent-tint);
  color: var(--av-accent-deep);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 500;
  border: 1px solid var(--av-accent-tint-2);
}

/* Bullets with the airevision dash */
.av-bullets {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.av-bullets li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--av-ink-soft);
}
.av-bullets li::before {
  content: "";
  position: absolute;
  left: 4px; top: 0.85em;
  width: 8px; height: 1px;
  background: var(--av-accent);
}

/* Numbered steps */
.av-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 16px 0 22px;
}
.av-steps li {
  counter-increment: step;
  padding: 6px 0 6px 38px;
  position: relative;
  margin-bottom: 4px;
  color: var(--av-ink-soft);
}
.av-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 6px;
  font-family: var(--av-serif-en);
  font-feature-settings: "lnum";
  font-size: 14px;
  width: 24px; height: 24px;
  border: 1px solid var(--av-accent);
  color: var(--av-accent-deep);
  border-radius: 50%;
  display: grid; place-items: center;
  line-height: 1;
}

/* Ghost button */
.av-btn-ghost {
  appearance: none;
  border: 1px solid var(--av-rule);
  background: var(--av-bg-elev);
  color: var(--av-ink-soft);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--av-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.av-btn-ghost:hover { border-color: var(--av-ink-muted); color: var(--av-ink); }

/* Mode switch (light/dark) — pill toggle */
.av-mode-switch {
  display: inline-flex;
  border: 1px solid var(--av-rule);
  border-radius: 999px;
  padding: 2px;
  background: var(--av-bg-elev);
}
.av-mode-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--av-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--av-ink-soft);
  cursor: pointer;
}
.av-mode-switch button.is-active {
  background: var(--av-ink);
  color: var(--av-bg);
}

/* ==========================================================================
   Page chrome — header / footer
   ========================================================================== */

.av-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--av-bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--av-rule);
}
.av-header__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.av-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--av-ink);
}
.av-brand__mark {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--av-accent);
  display: grid; place-items: center;
  color: oklch(0.99 0.01 70);
  font-family: var(--av-serif-en);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.av-brand__name {
  font-family: var(--av-serif-en);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  line-height: 1.2;
  color: var(--av-ink);
}
.av-brand__name small {
  display: block;
  font-family: var(--av-sans);
  font-weight: 400;
  font-size: 11.5px;
  color: var(--av-ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 1px;
}
.av-header__spacer { flex: 1; }
.av-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--av-sans);
  font-size: 13px;
}

.av-footer {
  border-top: 1px solid var(--av-rule);
  margin-top: 60px;
  padding: 32px 0 48px;
  font-family: var(--av-sans);
  font-size: 12.5px;
  color: var(--av-ink-muted);
}
.av-footer__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.av-footer strong { color: var(--av-ink-soft); font-weight: 500; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .av-header__inner { padding: 12px 20px; gap: 12px; }
  .av-brand__name small { display: none; }
  .av-footer__inner { padding: 0 20px; }
}
