/* ============================================================
   Command Center — shared styles
   ============================================================ */

:root {
  --bg-0: #05070a;
  --bg-1: #0a0e14;
  --bg-2: #0f141b;
  --bg-3: #161c26;
  --line: #1c2431;
  --line-2: #2a3444;
  --ink-0: #e6edf5;
  --ink-1: #a9b3c1;
  --ink-2: #6b7689;
  --ink-3: #3e4656;

  --accent: #9d7cff;
  --accent-dim: #6f52c9;
  --accent-glow: 157 124 255;        /* rgb triplet for shadows */

  --warn: #ffb547;
  --danger: #ff5d5d;
  --info: #7ab7ff;

  --radius: 4px;
  --radius-lg: 8px;

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Inter Tight', ui-sans-serif, system-ui, sans-serif;
}

html[data-accent="cyan"]   { --accent: #00d4ff; --accent-dim: #0096b8; --accent-glow: 0 212 255; }
html[data-accent="teal"]   { --accent: #14f195; --accent-dim: #0fb374; --accent-glow: 20 241 149; }
html[data-accent="violet"] { --accent: #9d7cff; --accent-dim: #6f52c9; --accent-glow: 157 124 255; }
html[data-accent="amber"]  { --accent: #ffb547; --accent-dim: #c98626; --accent-glow: 255 181 71; }
html[data-accent="rose"]   { --accent: #ff6b9a; --accent-dim: #c84775; --accent-glow: 255 107 154; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(var(--accent-glow), 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 100%, rgba(var(--accent-glow), 0.05), transparent 60%),
    linear-gradient(180deg, #05070a 0%, #070a10 100%);
  background-attachment: fixed;
}

/* subtle grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
}

/* scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0.012) 0px,
    rgba(255,255,255,0.012) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 1;
  mix-blend-mode: overlay;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(var(--accent-glow), 0.35); color: white; }

/* ============================================================
   Top system bar
   ============================================================ */

.sysbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.sysbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-0);
  font-weight: 600;
}

.sysbar__brand-mark {
  width: 22px;
  height: 22px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 10px;
  box-shadow: 0 0 12px rgba(var(--accent-glow), 0.5), inset 0 0 8px rgba(var(--accent-glow), 0.15);
}

.sysbar__nav {
  display: flex;
  gap: 4px;
  justify-self: center;
  padding: 3px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sysbar__nav a {
  padding: 6px 14px;
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.05em;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.sysbar__nav a:hover { color: var(--ink-0); background: rgba(255,255,255,0.03); }
.sysbar__nav a[aria-current="page"] {
  color: var(--accent);
  background: rgba(var(--accent-glow), 0.08);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-glow), 0.25);
}

.sysbar__status {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-2);
}

.sysbar__status-item { display: flex; align-items: center; gap: 6px; }

.led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-glow), 0.8), inset 0 0 2px rgba(255,255,255,0.4);
  animation: led-pulse 2s ease-in-out infinite;
}
.led.warn { background: var(--warn); box-shadow: 0 0 8px rgba(255,181,71,0.8); }
.led.info { background: var(--info); box-shadow: 0 0 8px rgba(122,183,255,0.8); }

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ============================================================
   Layout
   ============================================================ */

main { position: relative; z-index: 2; }

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

section { padding: 64px 0; position: relative; }

/* section header */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-head__id {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.section-head__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--ink-0);
  margin: 0;
}
.section-head__meta {
  margin-left: auto;
  color: var(--ink-2);
  font-size: 11px;
}

/* ============================================================
   Panel
   ============================================================ */

.panel {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.01);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  text-transform: uppercase;
}
.panel__head .led { margin-right: 2px; }
.panel__head-title { color: var(--ink-1); }
.panel__head-meta { margin-left: auto; color: var(--ink-3); }

.panel__body { padding: 18px; }

.panel--accent {
  border-color: rgba(var(--accent-glow), 0.35);
  box-shadow: 0 0 0 1px rgba(var(--accent-glow), 0.1), 0 0 40px -10px rgba(var(--accent-glow), 0.15);
}

/* corner ticks */
.panel--ticks::before,
.panel--ticks::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid var(--accent);
  opacity: 0.6;
}
.panel--ticks::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.panel--ticks::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ============================================================
   Typography helpers
   ============================================================ */

.kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-1);
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.015);
  color: var(--ink-1);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tag--accent {
  color: var(--accent);
  border-color: rgba(var(--accent-glow), 0.3);
  background: rgba(var(--accent-glow), 0.06);
}

.hrule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 24px 0;
  border: 0;
}

.mono { font-family: var(--mono); }
.sans { font-family: var(--sans); }
.dim { color: var(--ink-2); }
.dim2 { color: var(--ink-3); }
.accent { color: var(--accent); }

/* ============================================================
   Button
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-0);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .18s ease;
  text-transform: uppercase;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--accent-glow), 0.06);
  box-shadow: 0 0 20px -5px rgba(var(--accent-glow), 0.4);
}
.btn--primary {
  background: rgba(var(--accent-glow), 0.1);
  border-color: rgba(var(--accent-glow), 0.5);
  color: var(--accent);
}
.btn--primary:hover {
  background: rgba(var(--accent-glow), 0.18);
  box-shadow: 0 0 28px -6px rgba(var(--accent-glow), 0.6);
}
.btn svg { width: 13px; height: 13px; }

/* ============================================================
   Tweaks panel
   ============================================================ */

.tweaks {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  z-index: 100;
  background: rgba(15, 20, 27, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(var(--accent-glow), 0.2);
  font-family: var(--mono);
  font-size: 11px;
  display: none;
}
.tweaks.active { display: block; }
.tweaks__head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
}
.tweaks__body { padding: 14px; }
.tweaks__label { color: var(--ink-2); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.tweaks__swatches { display: flex; gap: 8px; }
.tweaks__swatch {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: transform .15s;
  position: relative;
}
.tweaks__swatch:hover { transform: translateY(-2px); }
.tweaks__swatch.active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid currentColor;
  border-radius: 6px;
}

/* ============================================================
   Utility: number reveal
   ============================================================ */

.metric-num {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 44px;
  letter-spacing: -0.02em;
  color: var(--ink-0);
  line-height: 1;
}
.metric-num .unit { color: var(--ink-2); font-size: 20px; margin-left: 4px; font-weight: 400; }
.metric-label {
  color: var(--ink-2);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ============================================================
   Cards, lists
   ============================================================ */

.bullet {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  color: var(--ink-1);
  font-size: 12.5px;
  line-height: 1.55;
}
.bullet::before {
  content: '▸';
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 28px 32px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-3);
  font-size: 11px;
}
.footer__hash { color: var(--ink-2); letter-spacing: 0.08em; }

/* ============================================================
   Hamburger + mobile nav
   ============================================================ */

.sysbar .sysbar__menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  color: var(--ink-0);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sysbar .sysbar__menu-btn svg { width: 18px !important; height: 18px !important; flex: 0 0 auto; }
.sysbar .sysbar__menu-btn:active { background: rgba(var(--accent-glow), 0.08); border-color: var(--accent); color: var(--accent); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 7, 10, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  flex-direction: column;
  padding: 70px 20px 32px;
  gap: 6px;
  overflow-y: auto;
}
.mobile-menu.active { display: flex; animation: menu-in .22s ease; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.mobile-menu a {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--ink-0);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}
.mobile-menu a[aria-current="page"] {
  border-color: var(--accent);
  background: rgba(var(--accent-glow), 0.08);
  color: var(--accent);
  box-shadow: 0 0 24px -8px rgba(var(--accent-glow), 0.5);
}
.mobile-menu a .mi-mark { color: var(--accent); font-size: 14px; text-align: center; }
.mobile-menu a .mi-sub { color: var(--ink-2); font-size: 11px; letter-spacing: 0.08em; display: block; margin-top: 3px; text-transform: uppercase; }
.mobile-menu a .mi-go { color: var(--ink-3); font-size: 14px; }
.mobile-menu .mm-foot {
  margin-top: auto;
  padding: 18px 4px 0;
  border-top: 1px dashed var(--line);
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  display: flex; justify-content: space-between;
}

body.menu-open { overflow: hidden; }

/* ============================================================
   Tablet & Mobile (mobile-first polish)
   ============================================================ */

@media (max-width: 1024px) {
  .sysbar__nav { display: none; }
  .sysbar .sysbar__menu-btn { display: inline-flex; }
  .sysbar {
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    padding: 10px 14px;
  }
  .sysbar__status { gap: 10px; font-size: 10.5px; }
  .container { padding: 0 16px; }
  section { padding: 44px 0; }

  .section-head { flex-wrap: wrap; gap: 10px; margin-bottom: 22px; padding-bottom: 12px; }
  .section-head__title { font-size: 20px; }
  .section-head__meta { margin-left: 0; width: 100%; order: 3; font-size: 10.5px; }

  .footer { margin-top: 40px; padding: 22px 16px; flex-wrap: wrap; font-size: 10.5px; }
}

@media (max-width: 720px) {
  html, body { font-size: 14px; }
  body {
    background-size: auto;
  }
  /* remove fixed-size grid overlay that looked too busy on small screens */
  body::before { background-size: 32px 32px; opacity: 0.6; }
  body::after { opacity: 0.5; }

  .sysbar { padding: 9px 12px; gap: 10px; }
  .sysbar__brand { gap: 8px; font-size: 11px; }
  .sysbar__brand > span:last-child { display: none; }
  .sysbar__status-item:not(#clock) span:not(.led) { display: inline; }
  #clock { display: none; }

  .container { padding: 0 14px; }
  section { padding: 36px 0; }

  /* section heads more compact */
  .section-head__id { font-size: 10px; }
  .section-head__title { font-size: 18px; }

  /* panel padding */
  .panel__body { padding: 14px; }

  /* buttons full-width and bigger hit targets */
  .btn {
    padding: 13px 16px;
    font-size: 12px;
    min-height: 46px;
    width: 100%;
    justify-content: center;
  }
  .hero-cta, .contact-channels, .flagship .hero-cta { width: 100%; }
  .hero-cta { flex-direction: column; gap: 8px; }

  /* metric num scaling */
  .metric-num { font-size: 36px; }
  .metric-num .unit { font-size: 16px; }

  /* tweaks panel bottom-sheet on mobile */
  .tweaks {
    left: 12px; right: 12px; bottom: 12px;
    width: auto;
  }

  /* Mobile menu uses brand + hamburger + single status led */
  .sysbar__status { gap: 8px; }
  .sysbar__status-item.collapse-mobile { display: none; }
}

@media (max-width: 420px) {
  .container { padding: 0 12px; }
  section { padding: 30px 0; }
  .section-head__title { font-size: 17px; }
  .panel__body { padding: 12px; }
  .sysbar { padding: 8px 10px; }
  .sysbar__brand-mark { width: 26px; height: 26px; font-size: 11px; }
  .metric-num { font-size: 32px; }
  .metric-num .unit { font-size: 14px; }
}

/* Reduced-motion: strip pulses, animations */
@media (prefers-reduced-motion: reduce) {
  .led, #boot .boot-progress::after, .hero-name em::after, .term__caret {
    animation: none !important;
  }
  * { transition-duration: .01ms !important; }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  .btn:hover { transform: none; }
  .sys-card:hover { transform: none; }
  .unit:hover { transform: none; }
}
