﻿/* ============================================================
   UnderHost Docs-Design System
   Built on the official UnderHost brand guidelines (DESIGN.md)
   Dark navy + cyan infrastructure identity.
   Reading surface: light (white body) · chrome: dark navy.
   ============================================================ */

:root {
  /* Brand color foundation (DESIGN.md §5) */
  --uh-primary: #00D4FF;
  --uh-primary-light: #38E1FF;
  --uh-primary-dark: #0091D6;
  --uh-primary-darker: #0A1220;

  --uh-secondary: #0091D6;
  --uh-secondary-light: #00D4FF;
  --uh-secondary-dark: #0078B8;

  --uh-accent: #64748B;
  --uh-accent-light: #94A3B8;
  --uh-accent-dark: #334155;

  --uh-surface: #FFFFFF;
  --uh-surface-soft: #F6F8FB;
  --uh-surface-softer: #EEF3F9;
  --uh-border: #E5E7EB;
  --uh-border-soft: #F1F4F8;

  --uh-dark-base: #0A1220;
  --uh-dark-mid: #0D1B30;
  --uh-dark-panel: #0F2040;
  --uh-dark-deep: #071428;

  --uh-ink: #0B1A2E;        /* primary body text on light */
  --uh-ink-soft: #3D4D61;   /* secondary text on light */
  --uh-ink-faint: #6B7A8D;  /* muted text on light */

  --uh-border-primary: rgba(0, 212, 255, 0.20);
  --uh-border-secondary: rgba(0, 145, 214, 0.18);

  --uh-gradient-horizontal: linear-gradient(90deg, #00D4FF, #0091D6);
  --uh-gradient-primary: linear-gradient(135deg, #0A1220 0%, #0D1B30 40%, #0F2040 70%, #071428 100%);
  --uh-gradient-card-header: linear-gradient(135deg, #0A1220 0%, #0D1B30 60%, #0F2040 100%);
  --uh-gradient-accent-overlay: linear-gradient(90deg, rgba(0,145,214,0.18) 0%, transparent 60%);

  --uh-shadow-sm: 0 1px 3px rgba(10,18,32,0.06);
  --uh-shadow-md: 0 4px 16px rgba(0, 145, 214, 0.18);
  --uh-shadow-lg: 0 6px 22px rgba(0, 145, 214, 0.30);
  --uh-shadow-xl: 0 20px 50px rgba(10, 18, 32, 0.14);
  --uh-shadow-glow: 0 0 30px rgba(0, 212, 255, 0.25);
  --uh-shadow-card: 0 2px 14px rgba(10,18,32,0.05);
  --uh-shadow-card-hover: 0 18px 40px rgba(10,18,32,0.10);

  --uh-success: #16A34A;
  --uh-success-soft: #E7F7EE;
  --uh-warning: #D97706;
  --uh-warning-soft: #FEF3E2;
  --uh-error: #DC2626;
  --uh-error-soft: #FCEAEA;

  --uh-radius-sm: 8px;
  --uh-radius-md: 12px;
  --uh-radius-lg: 16px;
  --uh-radius-xl: 20px;
  --uh-radius-2xl: 24px;

  --uh-container: 1200px;
  --uh-container-wide: 1320px;

  --uh-font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --uh-font-display: Inter, Manrope, "Plus Jakarta Sans", system-ui, sans-serif;
  --uh-font-mono: "JetBrains Mono", "IBM Plex Mono", SFMono-Regular, Consolas, monospace;

  --uh-header-h: 68px;
  --uh-sidebar-w: 286px;
  --uh-toc-w: 232px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--uh-header-h) + 24px); }
body {
  margin: 0;
  font-family: var(--uh-font-sans);
  color: var(--uh-ink);
  background: var(--uh-surface);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--uh-font-display);
  color: var(--uh-ink);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--uh-secondary-dark); text-decoration: none; transition: color 150ms ease; }
a:hover { color: var(--uh-primary-dark); }
img { max-width: 100%; display: block; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin: 0.3em 0; }
code, kbd, pre { font-family: var(--uh-font-mono); }
.uh-mono, .uh-spec, .uh-code { font-family: var(--uh-font-mono); }
::selection { background: rgba(0,212,255,0.22); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(0,212,255,0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Containers ---------- */
.uh-container { width: min(100% - 32px, var(--uh-container)); margin-inline: auto; }
.uh-container-wide { width: min(100% - 32px, var(--uh-container-wide)); margin-inline: auto; }
.uh-container-narrow { width: min(100% - 32px, 900px); margin-inline: auto; }

/* ============================================================
   HEADER
   ============================================================ */
.uh-site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--uh-header-h);
  display: flex; align-items: center;
  background: rgba(10, 18, 32, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.uh-header-inner {
  width: min(100% - 32px, var(--uh-container-wide));
  margin-inline: auto;
  display: flex; align-items: center; gap: 22px;
}
.uh-logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.uh-logo-img { display: block; height: 34px; width: auto; }
.uh-docs-tag {
  font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--uh-primary); padding: 3px 8px; margin-left: 2px;
  border: 1px solid var(--uh-border-primary); border-radius: 6px;
  background: rgba(0,212,255,0.07); align-self: center;
}
.uh-header-nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.uh-header-nav a {
  color: rgba(255,255,255,0.78); font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px; transition: all 150ms ease;
}
.uh-header-nav a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.uh-header-nav a.is-active { color: var(--uh-primary); }
.uh-header-spacer { flex: 1; }

/* compact header search */
.uh-header-search {
  position: relative; display: flex; align-items: center;
  width: 260px; max-width: 30vw;
}
.uh-header-search input {
  width: 100%; height: 38px; padding: 0 14px 0 38px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px; color: #fff; font: inherit; font-size: 13.5px;
  transition: border-color 150ms ease, background 150ms ease;
}
.uh-header-search input::placeholder { color: rgba(255,255,255,0.5); }
.uh-header-search input:focus {
  outline: none; border-color: var(--uh-primary);
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.15);
}
.uh-header-search > i {
  position: absolute; left: 13px; color: rgba(255,255,255,0.55); font-size: 13px; pointer-events: none;
}
.uh-header-search kbd {
  position: absolute; right: 9px; font-family: var(--uh-font-mono); font-size: 11px;
  color: rgba(255,255,255,0.55); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 5px; padding: 1px 6px; background: rgba(255,255,255,0.04);
}

.uh-header-cta { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.uh-burger {
  display: none; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06); border-radius: 10px; color: #fff; cursor: pointer;
  align-items: center; justify-content: center; font-size: 17px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.uh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 20px; border-radius: 12px;
  font-family: var(--uh-font-sans); font-size: 14px; font-weight: 700; line-height: 1;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
  white-space: nowrap;
}
.uh-btn-primary { background: linear-gradient(90deg, #0078B8, #00568A); color: #fff !important; box-shadow: var(--uh-shadow-md); border-color: transparent; }
.uh-btn-primary:hover { background: linear-gradient(90deg, #0087CC, #00619E); color: #fff !important; transform: translateY(-1px); box-shadow: var(--uh-shadow-lg); }
.uh-btn-primary:visited,
.uh-btn-primary:active,
.uh-btn-primary:focus { color: #fff !important; }
.uh-btn-secondary { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.18); }
.uh-btn-secondary:hover { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.3); }
.uh-btn-ghost { background: var(--uh-surface); color: var(--uh-ink); border-color: var(--uh-border); box-shadow: var(--uh-shadow-sm); }
.uh-btn-ghost:hover { color: var(--uh-primary-dark); border-color: var(--uh-border-secondary); transform: translateY(-1px); }
.uh-btn-sm { min-height: 38px; padding: 9px 15px; font-size: 13px; border-radius: 10px; }
.uh-btn-lg { min-height: 52px; padding: 15px 26px; font-size: 15.5px; border-radius: 14px; }
.uh-btn-block { width: 100%; }

/* ============================================================
   PILLS / BADGES / TAGS
   ============================================================ */
.uh-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  padding: 6px 13px; border-radius: 999px;
  background: rgba(0,212,255,0.10); color: var(--uh-primary);
  border: 1px solid var(--uh-border-primary);
}
.uh-pill-dark { background: rgba(0,212,255,0.10); color: var(--uh-primary); }
.uh-pill-light { background: rgba(0,145,214,0.08); color: var(--uh-secondary-dark); border-color: var(--uh-border-secondary); }
.uh-pill i { font-size: 11px; }

.uh-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 7px;
  background: var(--uh-surface-soft); color: var(--uh-ink-soft); border: 1px solid var(--uh-border);
}
.uh-tag i { font-size: 10px; color: var(--uh-secondary-dark); }

/* difficulty badges */
.uh-diff { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.uh-diff::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.uh-diff-beginner { background: #E7F7EE; color: #138A47; }
.uh-diff-beginner::before { background: #16A34A; }
.uh-diff-intermediate { background: #E6F4FB; color: #0078B8; }
.uh-diff-intermediate::before { background: #0091D6; }
.uh-diff-advanced { background: #FEF3E2; color: #B26206; }
.uh-diff-advanced::before { background: #D97706; }
.uh-diff-expert { background: #F3E9FB; color: #7A3CB0; }
.uh-diff-expert::before { background: #9B4DD4; }

/* meta line (reading time / updated) */
.uh-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--uh-ink-faint); font-weight: 500; }
.uh-meta i { font-size: 12px; opacity: 0.8; }
.uh-meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }

/* ============================================================
   DARK SECTION + DIVIDER
   ============================================================ */
.uh-section-dark {
  background:
    radial-gradient(circle at 18% 22%, rgba(0,212,255,0.16), transparent 36%),
    radial-gradient(circle at 88% 0%, rgba(0,145,214,0.16), transparent 40%),
    var(--uh-gradient-primary);
  color: rgba(255,255,255,0.86);
}
.uh-section-divider {
  width: min(100% - 32px, var(--uh-container));
  margin: 52px auto; display: grid; grid-template-columns: 1fr 32px 1fr;
  align-items: center; gap: 18px; pointer-events: none;
}
.uh-section-divider-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.38), rgba(0,145,214,0.26), transparent);
}
.uh-section-divider-icon {
  width: 32px; height: 32px; display: block; border-radius: 8px;
  filter: drop-shadow(0 0 14px rgba(0,212,255,0.30));
}
.uh-section-dark .uh-section-divider-line {
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.48), rgba(255,255,255,0.16), transparent);
}

/* ============================================================
   FOOTER
   ============================================================ */
.uh-footer {
  background:
    radial-gradient(circle at 12% 0%, rgba(0,212,255,0.10), transparent 40%),
    var(--uh-gradient-primary);
  color: rgba(255,255,255,0.7);
  border-top: 1px solid rgba(0,212,255,0.18);
  padding: 64px 0 36px;
  margin-top: 0;
}
.uh-footer-top { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 40px; }
.uh-footer-brand .uh-logo-img { height: 34px; margin-bottom: 16px; }
.uh-footer-brand p { font-size: 14px; line-height: 1.6; max-width: 38ch; color: rgba(255,255,255,0.62); }
.uh-footer-status {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 18px;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85);
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04);
}
.uh-footer-status .dot { width: 9px; height: 9px; border-radius: 50%; background: #34D399; box-shadow: 0 0 10px #34D399; }
.uh-footer-col h4 { color: #fff; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 16px; font-weight: 700; }
.uh-footer-col ul { list-style: none; margin: 0; padding: 0; }
.uh-footer-col li { margin: 0; }
.uh-footer-col a { display: block; color: rgba(255,255,255,0.62); font-size: 14px; padding: 6px 0; transition: color 150ms ease; }
.uh-footer-col a:hover { color: var(--uh-primary); }
.uh-footer-bottom {
  margin-top: 44px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  font-size: 13px; color: rgba(255,255,255,0.5);
}
.uh-footer-bottom nav { display: flex; gap: 20px; flex-wrap: wrap; }
.uh-footer-bottom a { color: rgba(255,255,255,0.55); }
.uh-footer-bottom a:hover { color: var(--uh-primary); }

/* ============================================================
   UTILITIES
   ============================================================ */
.uh-eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--uh-primary-dark);
}
.uh-section-head { max-width: 720px; margin-bottom: 36px; }
.uh-section-head .uh-eyebrow { margin-bottom: 12px; display: block; }
.uh-section-head h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; margin-bottom: 12px; }
.uh-section-head p { font-size: 17px; color: var(--uh-ink-soft); margin: 0; }
.uh-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.uh-hide { display: none !important; }

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

/* ============================================================
   RESPONSIVE-header, mobile drawer, footer
   ============================================================ */

@media (max-width: 600px) {
  .uh-header-cta .uh-btn-secondary { display: none; }
  .uh-docs-tag { display: none; }
  .uh-logo-img { height: 30px; }
}

/* ============================================================
   STACKING-main site nav must always clear docs content
   ============================================================ */

/* Main site nav header on docs pages.
   We mark it with data-docs-nav (a unique attribute the CDN CSS never targets)
   so our overrides can't be outgunned by CDN specificity or !important rules. */
header[data-docs-nav] {
  position: relative !important;
  top: auto !important;
  z-index: 9000;
}
/* Neutralise the scroll-triggered .headertop class (added by head.js)
   which would otherwise make the header fixed via CDN CSS. */
header[data-docs-nav].headertop {
  position: relative !important;
  top: auto !important;
  animation: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  padding: 0 !important;
}
header[data-docs-nav] .nav-dd,
header[data-docs-nav] .nav-dd-mega {
  z-index: 9001;
}

/* footer */
@media (max-width: 900px) {
  .uh-footer-top { grid-template-columns: 1fr 1fr; gap: 30px; }
  .uh-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .uh-footer-top { grid-template-columns: 1fr; }
  .uh-footer-bottom { flex-direction: column; align-items: flex-start; }
}
