/* ============================================================
   VACANT — Shared design tokens + top navigation
============================================================ */

:root {
  --bg:           oklch(98% 0.005 255);
  --bg-2:         oklch(94% 0.010 255);
  --bg-3:         oklch(91% 0.016 255);
  --bg-card:      oklch(100% 0 0);
  --text:         oklch(15% 0.05 258);
  --text-2:       oklch(40% 0.06 258);
  --text-3:       oklch(60% 0.04 258);
  --border:       oklch(86% 0.025 258);
  --border-2:     oklch(75% 0.04 258);
  --indigo:       oklch(48% 0.25 268);
  --indigo-soft:  oklch(94% 0.05 268);
  --amber:        oklch(70% 0.19 62);
  --amber-soft:   oklch(95% 0.04 62);
  --red:          oklch(58% 0.22 22);
  --red-soft:     oklch(95% 0.04 22);
  --green:        oklch(55% 0.16 145);
  --green-soft:   oklch(94% 0.05 145);
  --blue:         oklch(55% 0.18 240);
  --blue-soft:    oklch(94% 0.05 240);

  --ff-head: 'Space Grotesk', 'Noto Sans TC', sans-serif;
  --ff-body: 'Noto Sans TC', 'DM Sans', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --ff-mono: 'IBM Plex Mono', 'DM Sans', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--ff-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top nav (shared across all pages) ──
   Layout: brand (left, fixed) — links (center, flex) — actions (right, fixed)
   This three-zone layout ensures the link cluster stays in the same visual
   position regardless of whether actions zone has content. */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  height: 56px;
  background: rgba(252, 252, 252, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  /* Isolate from page-level body line-height/letter-spacing variations */
  line-height: 1;
  font-feature-settings: "kern" 1;
}
.site-nav, .site-nav * { line-height: 1; }
.site-nav-brand {
  flex: 0 0 auto;
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  display: flex; align-items: center; gap: 0.4rem;
  letter-spacing: -0.01em;
}
.site-nav-brand:hover { text-decoration: none; }
.site-nav-brand .dot { color: var(--indigo); }
.site-nav-brand .tagline {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-left: 0.5rem;
}
.site-nav-links {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 0.15rem;
}
.site-nav-links a {
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  text-decoration: none;
  padding: 0.45em 0.95em;
  letter-spacing: 0.04em;
  border-radius: 999px;
  transition: all 0.12s;
}
.site-nav-links a:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
.site-nav-links a.active {
  color: var(--indigo);
  background: var(--indigo-soft);
  font-weight: 600;
}
.site-nav-actions {
  flex: 0 0 auto;
  min-width: 90px;
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  align-items: center;
}
.lang-toggle {
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  color: var(--text-3);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.32em 0.7em;
  cursor: pointer;
  letter-spacing: 0.04em;
  border-radius: 999px;
  transition: all 0.12s;
  user-select: none;
  display: inline-flex;
  gap: 0.35em;
  align-items: center;
}
.lang-toggle:hover { color: var(--text); border-color: var(--border-2); }
.lang-toggle .active { color: var(--indigo); font-weight: 600; }
.lang-toggle .lang-sep,
.lang-toggle .sep { color: var(--text-3); opacity: 0.5; }

/* ── Page-specific sub-bar (under site-nav) ──
   For pages that need additional in-page controls (simulator's run button,
   technical's section anchors). Visually distinct from site-nav so the
   "menu" remains unambiguous. */
.subbar {
  position: sticky; top: 56px; z-index: 99;
  height: 44px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 0.5rem;
  overflow-x: auto;
}
.subbar-label {
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-right: 0.5rem;
}
.subbar-spacer { flex: 1; }
.subbar-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

/* ── Site footer (shared across all pages) ── */
.site-footer {
  text-align: center;
  padding: 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
  background: var(--bg);
}
.site-footer a { color: var(--text-3); text-decoration: none; }
.site-footer a:hover { color: var(--indigo); }
.site-footer .dot-sep { margin: 0 0.6em; opacity: 0.4; }

@media (max-width: 760px) {
  .site-nav { padding: 0 0.85rem; }
  .site-nav-brand .tagline { display: none; }
  .site-nav-links a { padding: 0.4em 0.7em; font-size: 0.72rem; }
  .site-nav-actions { min-width: 60px; }
  .subbar { padding: 0 0.85rem; }
}
