/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(6,8,15,0.92) 0%, rgba(6,8,15,0.4) 70%, transparent 100%);
  backdrop-filter: blur(8px);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.06em;
}

.nav__brand-mark {
  width: 28px; height: 28px;
  position: relative;
  display: inline-block;
}

.nav__brand-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gate-energy);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  filter: drop-shadow(0 0 8px var(--gate-violet));
}

.nav__brand-mark::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--bg-deep);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.nav__title {
  background: var(--gate-energy);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav__links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav__link {
  display: inline-block;
  padding: 8px 18px;
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--fg-secondary);
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.25s var(--ease-out);
  position: relative;
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--fg-primary);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.04);
}

.nav__link.is-active::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -1px;
  width: 60%; height: 1px;
  transform: translateX(-50%);
  background: var(--gate-energy);
  box-shadow: 0 0 8px var(--gate-violet);
}

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 12, 0.78);
  backdrop-filter: blur(8px) saturate(120%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: backdropIn 0.3s ease;
}

.modal-backdrop.closing {
  animation: backdropOut 0.3s ease forwards;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 1000px;
  max-height: calc(100vh - 64px);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 0 80px -10px color-mix(in srgb, var(--modal-accent, #7C3AED) 50%, transparent),
    0 30px 80px -20px rgba(0,0,0,0.8);
}

.modal-backdrop.closing .modal {
  animation: modalOut 0.3s ease forwards;
}

.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--modal-accent, var(--gate-violet)), transparent);
  box-shadow: 0 0 16px var(--modal-accent, var(--gate-violet));
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0,0,0,0.2);
}

.modal__category {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-secondary);
}

.modal__category::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--modal-accent, var(--gate-violet));
  box-shadow: 0 0 8px var(--modal-accent, var(--gate-violet));
  animation: livePulse 1.5s ease-in-out infinite;
}

.modal__close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--fg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  transition: all 0.2s var(--ease-out);
}

.modal__close:hover {
  color: var(--fg-primary);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.05);
}

.modal__close kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}

.modal__body {
  padding: 32px;
  overflow-y: auto;
  flex: 1;
}

.modal__body--split {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) 1.2fr;
  gap: 32px;
  padding: 0;
}

.modal__image-pane {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  background: var(--bg-deep);
}

.modal__image-pane img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.05);
}

.modal__image-pane::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 60%, var(--bg-glass) 100%),
    linear-gradient(180deg, transparent 70%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

.modal__content-pane {
  padding: 32px 32px 32px 0;
  overflow-y: auto;
  max-height: 80vh;
}

@media (max-width: 800px) {
  .modal__body--split { grid-template-columns: 1fr; }
  .modal__image-pane { min-height: 300px; }
  .modal__content-pane { padding: 24px; max-height: none; }
}

/* ===== TICKER ===== */
.ticker {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 44px;
  background: rgba(6, 8, 15, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  z-index: 90;
  overflow: hidden;
}

.ticker__label {
  flex-shrink: 0;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--gate-energy);
  color: white;
  position: relative;
  z-index: 2;
}

.ticker__label::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: white;
  animation: livePulse 1.2s ease-in-out infinite;
}

.ticker__label::after {
  content: '';
  position: absolute;
  right: -16px;
  top: 0;
  width: 0; height: 0;
  border-left: 16px solid var(--gate-cyan);
  border-top: 22px solid transparent;
  border-bottom: 22px solid transparent;
}

.ticker__track {
  display: flex;
  white-space: nowrap;
  animation: scrollX 80s linear infinite;
  padding-left: 32px;
}

.ticker:hover .ticker__track { animation-play-state: paused; }

.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  font-size: 13px;
  color: var(--fg-secondary);
  border-right: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.ticker__item--alert { color: #F472B6; }
.ticker__item--real {
  color: var(--gate-cyan);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s;
}
.ticker__item--real:hover { text-decoration-color: currentColor; }

.ticker__item-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  color: var(--fg-muted);
}

/* Breaking news flash */
.news-flash {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 14px 24px;
  background: rgba(6, 8, 15, 0.95);
  border: 1px solid #F472B6;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: white;
  max-width: 600px;
  box-shadow: 0 0 32px rgba(244, 114, 182, 0.4);
  animation: flashIn 4s ease-out forwards;
}

.news-flash__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 3px 8px;
  background: #F472B6;
  color: white;
  border-radius: 3px;
}

/* ===== HUD (right sidebar) ===== */
.hud {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 80;
  display: flex;
}

.hud__panel {
  width: 260px;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-right: 0;
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  padding: 16px;
  transition: transform 0.4s var(--ease-out);
}

.hud.is-collapsed .hud__panel {
  transform: translateX(100%);
}

.hud__toggle {
  align-self: center;
  width: 28px;
  height: 60px;
  margin-right: -1px;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--fg-secondary);
}

.hud__toggle:hover { color: var(--fg-primary); }

.hud__title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud__title::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--gate-cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--gate-cyan);
}

.hud__rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.hud__rank-num {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--rank-d);
  text-shadow: 0 0 12px currentColor;
}

.hud__rank-meta { font-size: 11px; color: var(--fg-secondary); line-height: 1.4; }
.hud__rank-meta strong { color: var(--fg-primary); display: block; }

.hud__price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.hud__price-name { color: var(--fg-secondary); }
.hud__price-val { font-family: var(--font-mono); color: var(--fg-primary); }
.hud__price-delta--up { color: #06B6D4; }
.hud__price-delta--down { color: #F472B6; }

.hud__alert {
  margin-top: 12px;
  padding: 10px;
  background: rgba(244, 114, 182, 0.08);
  border: 1px solid rgba(244, 114, 182, 0.3);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: #F9A8D4;
  display: flex;
  gap: 8px;
}

.hud__alert-icon { color: #F472B6; font-weight: 700; }

@media (max-width: 900px) {
  .hud { display: none; }
}

/* ===== BUTTON ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  color: var(--fg-primary);
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gate-energy);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.btn:hover {
  border-color: var(--gate-cyan);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 24px -4px var(--gate-cyan);
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--gate-energy);
  border-color: transparent;
  color: white;
  box-shadow: 0 0 32px -8px var(--gate-violet);
}

.btn--primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 40px -4px var(--gate-violet);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--fg-secondary);
}

.btn--ghost:hover {
  color: var(--fg-primary);
  background: rgba(255,255,255,0.04);
  border-color: var(--border-subtle);
  box-shadow: none;
  transform: none;
}

/* ===== SECTION DIVIDER (territorial diagonal crack) ===== */
.section-divider {
  position: relative;
  height: 60px;
  overflow: hidden;
  margin: var(--space-10) 0;
}

.section-divider::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 49%, var(--accent, var(--gate-violet)) 49.6%, var(--gate-cyan) 50.4%, transparent 51%);
  opacity: 0.5;
  filter: drop-shadow(0 0 8px var(--gate-violet));
}

.section-divider::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.02), transparent);
  clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
  border-top: 1px solid var(--border-subtle);
}

/* Section heading */
.section-heading {
  text-align: center;
  margin-bottom: var(--space-8);
}

.section-heading__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent, var(--gate-cyan));
  margin-bottom: 12px;
}

.section-heading__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.section-heading__sub {
  color: var(--fg-secondary);
  font-size: 15px;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}
