/* Shared WOTO Architectural Design Tokens — Studio Light & Neutral Graphite Dark */
:root {
  color-scheme: light;

  /* Studio dark stage (Neutral Carbon Graphite — Hero & Service Strip) */
  --void: #0a0b0e;
  --navy: #111318;
  --navy-2: #161920;
  --navy-3: #222630;

  /* Light Mode: Serene gallery paper & cool architectural alabaster */
  --surface: #ffffff;
  --canvas: #f6f7f9;
  --surface-alt: #f0f2f5;
  --surface-hover: #e6e9ee;
  --input-bg: #ffffff;
  --mast-bg: rgba(255, 255, 255, 0.88);
  --studio-bg: radial-gradient(circle at 50% 44%, #ffffff 0%, #f3f4f6 100%);

  /* High-craft neutral ink & hairline borders (WCAG AA/AAA verified) */
  --ink: #111318;
  --ink-2: #374151;
  --muted: #5b6370;
  --subtle: #798290;
  --line: #e6e8ec;
  --line-strong: #d0d5dd;

  /* Primary solid control surface (Carbon Graphite on Light; Crisp Paper White on Dark) */
  --action: #14161b;
  --action-hover: #282c36;
  --action-ink: #ffffff;
  --action-muted: #9aa2b1;

  /* Restrained Industrial Cobalt Accent (used sparingly for text links & data) */
  --accent: #1d4ed8;
  --accent-bright: #2563eb;
  --accent-hover: #1e40af;
  --accent-soft: #eff4ff;
  --accent-line: #c7d7fe;
  --signal: #e2e8f0;
  --signal-bright: #ffffff;

  /* Selection */
  --selection-ink: #111318;
  --selection-bg: #dbeafe;

  /* Compatibility aliases */
  --teal: var(--accent);
  --teal-hover: var(--accent-hover);
  --teal-soft: var(--accent-soft);
  --electric: var(--signal);
  --electric-hover: var(--signal-bright);

  /* Calm, desaturated semantic status palette */
  --ok: #0f766e;
  --ok-bg: #f0fdfa;
  --ok-line: #b5ebe2;
  --warn: #a16207;
  --warn-bg: #fefce8;
  --warn-line: #f3df9b;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-line: #fecdca;
  --info: #1d4ed8;
  --info-bg: #eff4ff;
  --info-line: #c7d7fe;

  /* Spacing scale (4/8/12/16/24/32/48/64px) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-12: 3rem;
  --s-16: 4rem;

  /* Unified architectural radii & calm multi-layer ambient shadows */
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --shadow-xs: 0 1px 2px rgba(17, 19, 24, 0.04);
  --shadow-sm: 0 2px 6px -1px rgba(17, 19, 24, 0.06), 0 1px 2px rgba(17, 19, 24, 0.04);
  --shadow-md: 0 12px 28px -10px rgba(17, 19, 24, 0.11), 0 4px 10px -4px rgba(17, 19, 24, 0.05);
  --shadow-lg: 0 24px 56px -12px rgba(10, 11, 14, 0.24), 0 8px 20px -6px rgba(10, 11, 14, 0.12);

  /* Harmonized Latin-first + CJK system variable typography */
  --font-sans: "Segoe UI Variable Text", "Segoe UI Variable", "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-mono: "Cascadia Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Tactile motion & calm monochrome focus tokens (zero harsh cyan outlines) */
  --ease: 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-smooth: 260ms cubic-bezier(0.22, 1, 0.36, 1);
  --focus-ring: 2px solid rgba(17, 19, 24, 0.72);
  --focus-border: #374151;
  --focus-halo: 0 0 0 3px rgba(17, 19, 24, 0.08);
}

/* Architectural Neutral Charcoal Dark Mode — Explicit Toggle */
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #121418;
  --canvas: #0b0c0f;
  --surface-alt: #191c22;
  --surface-hover: #22262f;
  --input-bg: #0e1014;
  --mast-bg: rgba(11, 12, 15, 0.84);
  --studio-bg: radial-gradient(circle at 50% 44%, #f8fafc 0%, #e5e7eb 100%);

  --ink: #f3f4f6;
  --ink-2: #d1d5db;
  --muted: #9ca3af;
  --subtle: #747c8c;
  --line: #232730;
  --line-strong: #343a47;

  --action: #f3f4f6;
  --action-hover: #e5e7eb;
  --action-ink: #0b0c0f;
  --action-muted: #525866;

  --accent: #7aa7ff;
  --accent-bright: #6094fb;
  --accent-hover: #9ec0ff;
  --accent-soft: rgba(96, 148, 251, 0.12);
  --accent-line: rgba(96, 148, 251, 0.28);

  --selection-ink: #f8fafc;
  --selection-bg: #274489;

  --ok: #34d399;
  --ok-bg: rgba(16, 185, 129, 0.11);
  --ok-line: rgba(52, 211, 153, 0.26);
  --warn: #f5b942;
  --warn-bg: rgba(245, 158, 11, 0.11);
  --warn-line: rgba(245, 185, 66, 0.26);
  --danger: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.11);
  --danger-line: rgba(248, 113, 113, 0.26);
  --info: #7aa7ff;
  --info-bg: rgba(96, 148, 251, 0.11);
  --info-line: rgba(96, 148, 251, 0.26);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.36);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.44);
  --shadow-md: 0 14px 32px -8px rgba(0, 0, 0, 0.62);
  --shadow-lg: 0 28px 64px -12px rgba(0, 0, 0, 0.78);
  --focus-ring: 2px solid rgba(243, 244, 246, 0.76);
  --focus-border: #6b7280;
  --focus-halo: 0 0 0 3px rgba(243, 244, 246, 0.11);
}

/* Architectural Neutral Charcoal Dark Mode — Follows OS preference automatically */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #121418;
    --canvas: #0b0c0f;
    --surface-alt: #191c22;
    --surface-hover: #22262f;
    --input-bg: #0e1014;
    --mast-bg: rgba(11, 12, 15, 0.84);
    --studio-bg: radial-gradient(circle at 50% 44%, #f8fafc 0%, #e5e7eb 100%);

    --ink: #f3f4f6;
    --ink-2: #d1d5db;
    --muted: #9ca3af;
    --subtle: #747c8c;
    --line: #232730;
    --line-strong: #343a47;

    --action: #f3f4f6;
    --action-hover: #e5e7eb;
    --action-ink: #0b0c0f;
    --action-muted: #525866;

    --accent: #7aa7ff;
    --accent-bright: #6094fb;
    --accent-hover: #9ec0ff;
    --accent-soft: rgba(96, 148, 251, 0.12);
    --accent-line: rgba(96, 148, 251, 0.28);

    --selection-ink: #f8fafc;
    --selection-bg: #274489;

    --ok: #34d399;
    --ok-bg: rgba(16, 185, 129, 0.11);
    --ok-line: rgba(52, 211, 153, 0.26);
    --warn: #f5b942;
    --warn-bg: rgba(245, 158, 11, 0.11);
    --warn-line: rgba(245, 185, 66, 0.26);
    --danger: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.11);
    --danger-line: rgba(248, 113, 113, 0.26);
    --info: #7aa7ff;
    --info-bg: rgba(96, 148, 251, 0.11);
    --info-line: rgba(96, 148, 251, 0.26);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.36);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.44);
    --shadow-md: 0 14px 32px -8px rgba(0, 0, 0, 0.62);
    --shadow-lg: 0 28px 64px -12px rgba(0, 0, 0, 0.78);
    --focus-ring: 2px solid rgba(243, 244, 246, 0.76);
    --focus-border: #6b7280;
    --focus-halo: 0 0 0 3px rgba(243, 244, 246, 0.11);
  }
}

/* Theme toggle icon visibility (instant first paint) */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Keep transparent crimson WOTO wordmark crisp & luminous on Charcoal Dark */
:root[data-theme="dark"] .brand img,
:root[data-theme="dark"] .desk-brand img,
:root[data-theme="dark"] .desk-login-head img { filter: brightness(1.1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand img,
  :root:not([data-theme="light"]) .desk-brand img,
  :root:not([data-theme="light"]) .desk-login-head img { filter: brightness(1.1); }
}

/* Keep black-line technical diagrams & QR codes readable in Dark Mode (skip full-bleed dark studio photography) */
:root[data-theme="dark"] .prose img:not([src^="/static/media/anetcall/"]) { background: #f8fafc; padding: 0.35rem; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prose img:not([src^="/static/media/anetcall/"]) { background: #f8fafc; padding: 0.35rem; }
}

.num,
time,
table,
.spec-val,
.channel-sets,
code {
  font-variant-numeric: tabular-nums;
}
