/* --------------------------------------------------------------
   Khromosome — HUD design system
   Deep navy + electric cyan; Inter + JetBrains Mono + Major Mono Display.
   Notched buttons, corner brackets, scanlines, grain — heads-up-display feel.
   Mirrors jdunn7/khrome — shared across every *.khromosome.network surface.

   File name retained as khrome-luxury.css to keep link refs stable; contents
   are now the HUD palette, not the prior fire/luxury theme.
-------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Major+Mono+Display&display=swap');

:root {
  /* base — deep navy stack */
  --bg-deep:       #04081a;
  --bg-card:       #0a1228;
  --bg-elev:       #0f1a36;
  --bg-hot:        #14224a;

  /* HUD cyan */
  --cyan:          #22c8ff;
  --cyan-soft:     #4ad5ff;
  --cyan-deep:     #0a8ec2;

  /* hairlines + foreground */
  --fg:            #ffffff;
  --fg-secondary:  rgba(255, 255, 255, 0.65);
  --fg-muted:      rgba(255, 255, 255, 0.40);
  --fg-faint:      rgba(255, 255, 255, 0.25);
  --hairline:      rgba(255, 255, 255, 0.10);
  --hairline-soft: rgba(255, 255, 255, 0.05);
  --hairline-cyan: rgba(34, 200, 255, 0.30);

  /* glow + shadow */
  --glow-cyan:        0 0 12px rgba(34, 200, 255, 0.70);
  --glow-cyan-soft:   0 0 24px rgba(34, 200, 255, 0.40);
  --glow-cyan-strong: 0 0 32px rgba(34, 200, 255, 0.55);
  --shadow-card:      0 8px 24px 0 rgba(0, 0, 0, 0.40);
  --shadow-deep:      0 20px 60px rgba(0, 0, 0, 0.55);

  /* motion */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-hud:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast:   180ms var(--ease-out);
  --t-base:   260ms var(--ease-out);
  --t-slow:   460ms var(--ease-out);

  /* geometry */
  --notch-sm: 14px;
  --notch-md: 18px;
  --notch-lg: 22px;

  /* type */
  --f-display:      'Space Grotesk', 'Inter', system-ui, sans-serif;
  --f-body:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-mono:         'JetBrains Mono', 'SF Mono', 'Cascadia Code', Menlo, monospace;
  --f-mono-display: 'Major Mono Display', 'JetBrains Mono', monospace;

  /* tracking presets (HUD signature) */
  --tk-tight:  -0.02em;
  --tk-wide:   0.22em;
  --tk-wider:  0.32em;
  --tk-widest: 0.42em;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg-deep);
  color: var(--fg);
  font-family: var(--f-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: var(--tk-tight);
  line-height: 1.08;
  color: var(--fg);
}

a { color: inherit; text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--cyan); }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

img, svg { display: block; max-width: 100%; }

::selection { background: rgba(34, 200, 255, 0.35); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--hairline-cyan); }

/* ---------- type utilities ---------- */
.font-display      { font-family: var(--f-display); }
.font-body         { font-family: var(--f-body); }
.font-mono         { font-family: var(--f-mono); }
.font-mono-display { font-family: var(--f-mono-display); }

.label,
.label-xs,
.label-sm {
  font-family: var(--f-mono);
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
}
.label-xs { font-size: 10px;   letter-spacing: var(--tk-wider); }
.label    { font-size: 10.5px; letter-spacing: var(--tk-wide); }
.label-sm { font-size: 11px;   letter-spacing: var(--tk-wide); }

.chapter-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: var(--tk-widest);
  text-transform: uppercase;
  color: var(--cyan);
}

/* ---------- HUD: clip-path notches (signature shape) ---------- */
.clip-notch-sm {
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px),
                     calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.clip-notch-md {
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px),
                     calc(100% - 18px) 100%, 0 100%, 0 18px);
}
.clip-notch-lg {
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px),
                     calc(100% - 22px) 100%, 0 100%, 0 22px);
}

/* ---------- HUD: corner brackets (decorative frame) ---------- */
.corner-brackets {
  position: absolute; inset: 0; pointer-events: none; z-index: 30;
}
.corner-brackets span {
  position: absolute; width: 20px; height: 20px;
  border-color: rgba(34, 200, 255, 0.60);
}
.corner-brackets .tl { top: 12px;    left: 12px;    border-left: 1px solid; border-top: 1px solid; }
.corner-brackets .tr { top: 12px;    right: 12px;   border-right:1px solid; border-top: 1px solid; }
.corner-brackets .bl { bottom: 12px; left: 12px;    border-left: 1px solid; border-bottom: 1px solid; }
.corner-brackets .br { bottom: 12px; right: 12px;   border-right:1px solid; border-bottom: 1px solid; }

/* ---------- HUD: scanline + grain overlays ---------- */
.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0px,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.12;
}

.grain {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 2px;
  opacity: 0.06; mix-blend-mode: overlay;
}

/* ---------- buttons (notched, mono-uppercase) ---------- */
.btn-notch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-family: var(--f-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: var(--tk-wide);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.30); backdrop-filter: blur(4px);
  cursor: pointer;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px),
                     calc(100% - 14px) 100%, 0 100%, 0 14px);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  min-height: 40px;
}
.btn-notch:hover {
  color: var(--fg);
  border-color: var(--hairline-cyan);
  background: rgba(255, 255, 255, 0.04);
}

.btn-notch.solid {
  background: rgba(255, 255, 255, 0.06);
}
.btn-notch.cyan {
  color: var(--cyan);
  border-color: var(--hairline-cyan);
  background: rgba(34, 200, 255, 0.06);
}
.btn-notch.cyan:hover {
  color: var(--fg);
  background: rgba(34, 200, 255, 0.14);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan-soft);
}

.btn-notch.primary {
  color: var(--bg-deep);
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan-soft);
}
.btn-notch.primary:hover {
  background: var(--cyan-soft);
  box-shadow: var(--glow-cyan-strong);
}

/* ---------- inputs ---------- */
.hud-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  color: var(--fg);
  font-family: var(--f-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: border-color var(--t-fast), background var(--t-fast);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px),
                     calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.hud-input::placeholder { color: rgba(255, 255, 255, 0.30); }
.hud-input:focus { outline: none; border-color: var(--hairline-cyan); background: rgba(34, 200, 255, 0.04); }

/* ---------- HUD card (notched, hairline border) ---------- */
.hud-card {
  background: rgba(10, 18, 40, 0.55);
  border: 1px solid var(--hairline);
  position: relative;
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px),
                     calc(100% - 18px) 100%, 0 100%, 0 18px);
  transition: border-color var(--t-base);
}
.hud-card:hover { border-color: var(--hairline-cyan); }

.hud-card-elev {
  background: rgba(15, 26, 54, 0.70);
  border: 1px solid var(--hairline);
  position: relative;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px),
                     calc(100% - 14px) 100%, 0 100%, 0 14px);
}

/* ---------- live dot ---------- */
.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 0px;
  background: var(--cyan); box-shadow: var(--glow-cyan);
  animation: hud-pulse 2s ease-in-out infinite;
}
@keyframes hud-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ---------- chain pill ---------- */
.chain-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px;
  font-family: var(--f-mono); font-size: 10px; font-weight: 500;
  letter-spacing: var(--tk-wider); text-transform: uppercase;
  border: 1px solid var(--hairline-cyan);
  background: rgba(34, 200, 255, 0.06);
  color: var(--cyan);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px),
                     calc(100% - 8px) 100%, 0 100%, 0 8px);
}

/* ---------- top-nav shell ---------- */
.hud-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(to bottom, rgba(4, 8, 20, 0.85), rgba(4, 8, 20, 0));
  pointer-events: none;
}
.hud-nav > * { pointer-events: auto; }

.brand-mark {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-mono-display);
  font-size: 22px;
  letter-spacing: 0.18em;
  color: var(--fg);
}
.brand-mark .dot {
  width: 5px; height: 5px;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  margin-left: 4px;
  display: inline-block;
}
@media (min-width: 768px) { .brand-mark { font-size: 26px; } }

.hud-nav-links {
  display: none;
  gap: 4px;
}
@media (min-width: 1024px) { .hud-nav-links { display: flex; } }
.hud-nav-links a {
  padding: 6px 12px;
  font-family: var(--f-mono);
  font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: var(--tk-wide);
  color: rgba(255, 255, 255, 0.65);
}
.hud-nav-links a:hover,
.hud-nav-links a.active { color: var(--fg); }

/* ---------- HUD chain footer ---------- */
.chain-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 20px;
  background: linear-gradient(to top, rgba(4, 8, 20, 0.88), rgba(4, 8, 20, 0.40));
  border-top: 1px solid var(--hairline-soft);
  font-family: var(--f-mono); font-size: 10px; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: var(--tk-wider);
  display: flex; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap;
}
.chain-footer .sep { width: 4px; height: 4px; border-radius: 0; background: var(--fg-faint); }

/* ---------- progress bar (top edge cyan) ---------- */
.hud-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 50;
  background: rgba(255, 255, 255, 0.05);
}
.hud-progress .bar {
  height: 100%; background: var(--cyan); box-shadow: var(--glow-cyan);
  transition: width 80ms linear;
}

/* ---------- chapter rail (left side) ---------- */
.chapter-rail {
  display: none;
  position: fixed; left: 24px; top: 50%; z-index: 30;
  transform: translateY(-50%);
  flex-direction: column; gap: 18px;
}
@media (min-width: 900px) { .chapter-rail { display: flex; } }
.chapter-rail .item {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: var(--tk-widest); text-transform: uppercase;
  color: rgba(255, 255, 255, 0.40);
  transition: color var(--t-base);
}
.chapter-rail .item .pip {
  width: 7px; height: 7px;
  background: rgba(255, 255, 255, 0.25);
  transition: background var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}
.chapter-rail .item:hover { color: rgba(255, 255, 255, 0.85); }
.chapter-rail .item:hover .pip { background: rgba(255, 255, 255, 0.65); }
.chapter-rail .item.active {
  color: var(--fg);
}
.chapter-rail .item.active .pip {
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  transform: scale(1.15);
}

/* ---------- portal/portal-slice fallback (legacy support) ---------- */
.portal { display: flex; flex-direction: column; min-height: 100vh; width: 100%; }
@media (min-width: 900px) { .portal { flex-direction: row; height: 100vh; } }
.slice  { position: relative; flex: 1; overflow: hidden; cursor: pointer; min-height: 25vh; transition: flex var(--t-base); }

/* ---------- table ---------- */
.hud-table { width: 100%; border-collapse: collapse; font-family: var(--f-mono); font-size: 12px; }
.hud-table thead th { text-align: left; padding: 12px 14px; font-size: 10px; font-weight: 500;
  letter-spacing: var(--tk-wider); text-transform: uppercase; color: var(--fg-muted);
  border-bottom: 1px solid var(--hairline); }
.hud-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--hairline-soft); }
.hud-table tbody tr:hover { background: rgba(34, 200, 255, 0.03); }

/* ---------- key-value row ---------- */
.kv-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0;
  border-bottom: 1px solid var(--hairline-soft); }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { font-family: var(--f-mono); font-size: 11px; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: var(--tk-wide); }
.kv-row .v { font-family: var(--f-mono); font-size: 13px; color: var(--fg); }
.kv-row .v.cyan { color: var(--cyan); }

/* ---------- stat tile ---------- */
.stat-tile { padding: 22px 24px; position: relative; }
.stat-tile .label { display: block; margin-bottom: 12px; color: var(--fg-muted); }
.stat-tile .value {
  font-family: var(--f-mono-display);
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.stat-tile .value.cyan { color: var(--cyan); text-shadow: var(--glow-cyan-soft); }
.stat-tile .note { display: block; margin-top: 14px; color: var(--fg-muted); }

/* ---------- responsive tweaks ---------- */
@media (max-width: 768px) {
  .hud-nav { padding: 12px 14px; gap: 8px; flex-wrap: wrap; }
  .hud-nav .brand-mark { font-size: 18px; }
  .hud-nav-links { display: none; }  /* hidden on mobile; Menu drawer takes over */
  .btn-notch { padding: 8px 12px; font-size: 10px; min-height: 36px; white-space: nowrap; }

  /* Chain footer wraps on narrow screens, so reserve more padding below content */
  .page { padding-bottom: calc(180px + env(safe-area-inset-bottom)) !important; }
  .chain-footer { padding: 10px 12px; gap: 10px; font-size: 9px; }

  /* Tighten big titles + headlines on mobile */
  h1.title, h1.hero { font-size: clamp(1.7rem, 7vw, 2.4rem) !important; line-height: 1.06; }
  p.lede { font-size: 14px !important; }

  /* Don't crowd the stat tiles */
  .stat-tile { padding: 16px 18px; }
}

@media (max-width: 480px) {
  /* Aggressive collapse on phones: kill the second nav button (back-to-network),
     leave only KHROME mark + Menu trigger, prevent wrap-induced two-row nav */
  .hud-nav { padding: 10px 12px; flex-wrap: nowrap; }
  .hud-nav > .btn-notch:not(.menu-btn):not([class*="primary"]) { display: none; }

  /* Chain footer line-wrap budget — clamp height so it can't eat half the screen */
  .chain-footer { max-height: 64px; overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}

/* ---------- HUD menu drawer (shared across all .khromosome.network surfaces) ---------- */

.menu-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: var(--tk-wide); text-transform: uppercase;
  color: var(--fg-secondary);
  background: rgba(0, 0, 0, 0.30); backdrop-filter: blur(4px);
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px),
                     calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.menu-btn:hover { color: var(--fg); border-color: var(--hairline-cyan); background: rgba(255,255,255,0.04); }

.menu-overlay {
  position: fixed; inset: 0; z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.menu-overlay.open { opacity: 1; pointer-events: auto; }
.menu-overlay .menu-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 8, 20, 0.85); backdrop-filter: blur(12px);
}
.menu-overlay .menu-drawer {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 100%; max-width: 520px;
  background: var(--bg-card);
  border-left: 1px solid var(--hairline);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--t-base);
}
.menu-overlay.open .menu-drawer { transform: translateX(0); }

.menu-drawer .menu-header {
  padding: 28px 30px 22px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.menu-drawer .menu-header .label {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: var(--tk-wider); text-transform: uppercase; color: var(--fg-muted);
}
.menu-drawer .menu-close {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--fg-secondary);
  cursor: pointer; font-size: 18px; line-height: 1;
  transition: color var(--t-fast);
}
.menu-drawer .menu-close:hover { color: var(--cyan); }

.menu-drawer .menu-section {
  padding: 26px 30px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.menu-drawer .menu-section:last-child { border-bottom: 0; }
.menu-drawer .menu-section-title {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: var(--tk-widest); text-transform: uppercase;
  color: var(--cyan); margin-bottom: 18px; display: block;
}
.menu-drawer .menu-section-title.muted { color: var(--fg-muted); }

.menu-drawer .menu-list { list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 16px; }
.menu-drawer .menu-list.surfaces { gap: 0; }

.menu-drawer .menu-chapter {
  display: flex; align-items: center; gap: 14px;
  background: transparent; border: 0; padding: 0; cursor: pointer;
  font-family: var(--f-mono); font-size: 12px;
  letter-spacing: var(--tk-wider); text-transform: uppercase;
  color: var(--fg-secondary);
  transition: color var(--t-fast);
  text-decoration: none;
}
.menu-drawer .menu-chapter:hover { color: var(--fg); }
.menu-drawer .menu-chapter .pip {
  display: block; width: 8px; height: 8px;
  background: rgba(255, 255, 255, 0.25);
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.menu-drawer .menu-chapter:hover .pip { background: rgba(255, 255, 255, 0.60); }
.menu-drawer .menu-chapter.active .pip {
  background: var(--cyan); box-shadow: var(--glow-cyan); transform: scale(1.15);
}
.menu-drawer .menu-chapter.active { color: var(--fg); }

.menu-drawer .menu-surface {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--fg);
  text-decoration: none;
  transition: color var(--t-fast);
}
.menu-drawer .menu-surface:last-child { border-bottom: 0; }
.menu-drawer .menu-surface .name {
  font-family: var(--f-display); font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em;
  transition: color var(--t-fast);
}
.menu-drawer .menu-surface .tag {
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: var(--tk-wide); text-transform: uppercase;
  color: var(--fg-muted);
  transition: color var(--t-fast);
}
.menu-drawer .menu-surface:hover .name,
.menu-drawer .menu-surface:hover .tag { color: var(--cyan); }

.menu-drawer .menu-footer {
  padding: 18px 30px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--f-mono); font-size: 10px;
  letter-spacing: var(--tk-wider); text-transform: uppercase;
  color: var(--fg-muted);
}
.menu-drawer .menu-footer a { color: var(--fg-muted); }
.menu-drawer .menu-footer a:hover { color: var(--cyan); }

@media (max-width: 600px) {
  .menu-drawer .menu-section { padding: 22px 24px; }
  .menu-drawer .menu-header { padding: 22px 24px 18px; }
  .menu-drawer .menu-surface .name { font-size: 19px; }
}
