:root {
  color-scheme: light;
  --ink: #111a2a;
  --muted: #667085;
  --line: #d9e1ea;
  --paper: #f7f9fc;
  --forest: #0052ff;
  --mint: #3b82f6;
  --soft: #eaf1f8;
}

.dark {
  color-scheme: dark;
  --ink: #f0f4f8;
  --muted: #8896a8;
  --line: #1c2638;
  --paper: #000000;
  --forest: #0052ff;
  --mint: #3b82f6;
  --soft: #0a0f1a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Instrument Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--soft);
}

::-webkit-scrollbar-thumb {
  background: var(--line);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.display {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  font-style: normal;
  letter-spacing: -0.028em;
}

.hero-headline {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  font-style: normal;
  letter-spacing: -0.028em;
  color: #ffffff;
  line-height: 1.04;
}

.eyebrow {
  letter-spacing: .2em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
}

/* Full-viewport Hero System (100svh) */
.hero-viewport {
  min-height: 100svh;
  position: relative;
  background-color: #050811;
  width: 100%;
  overflow-x: hidden;
}

@supports (height: 100svh) {
  .hero-viewport {
    min-height: 100svh;
  }
}

/* Video & Poster Fallback Engine */
.hero-media-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  background-color: #050811;
}

.hero-poster-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/hero-poster.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 1;
  transform: scale(1.01);
}

.hero-video-node {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 2;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

.hero-video-node.is-active {
  opacity: 1;
}

/* Directional Dark Overlay */
.hero-cinematic-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(4, 7, 13, 0.85) 0%,
      rgba(4, 7, 13, 0.76) 32%,
      rgba(4, 7, 13, 0.50) 54%,
      rgba(4, 7, 13, 0.18) 72%,
      rgba(4, 7, 13, 0.08) 100%),
    linear-gradient(180deg,
      rgba(4, 7, 13, 0.58) 0%,
      rgba(4, 7, 13, 0.14) 20%,
      rgba(4, 7, 13, 0.04) 55%,
      rgba(4, 7, 13, 0.45) 85%,
      rgba(4, 7, 13, 0.88) 100%);
}

/* Primary and Secondary CTA Button Refinements */
.btn-hero-primary {
  background: #0052ff;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-hero-primary:hover {
  background: #0045d8;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -5px rgba(0, 82, 255, 0.4);
}

.btn-hero-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .hero-video-node {
    display: none !important;
  }

  .hero-poster-fallback {
    opacity: 1 !important;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Horizontal scroll fix for inner tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.btn-primary {
  background: var(--forest);
  color: #f7fbf8;
  transition: transform .2s, background .2s;
}

.btn-primary:hover {
  background: #0045d8;
  transform: translateY(-2px);
}

.btn-light {
  background: #f4f7f3;
  color: #17201c;
  transition: transform .2s, background .2s;
}

.btn-light:hover {
  background: #dce9df;
  transform: translateY(-2px);
}

.btn-outline {
  border: 1px solid var(--line);
  transition: background .2s, border .2s;
}

.btn-outline:hover {
  background: var(--soft);
  border-color: #3b82f6;
}

.chart-grid {
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 28px 28px;
}

.photo-strip {
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 16px;
  margin: 72px auto 0;
  max-width: 900px;
}

.photo-strip figure {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  background: #0a0f1a;
}

.photo-strip figure:first-child {
  min-height: 310px;
}

.photo-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(.75) contrast(1.05);
  transition: transform .6s ease, filter .6s ease;
}

.photo-strip figure:hover img {
  transform: scale(1.04);
  filter: saturate(.95) contrast(1.05);
}

.photo-strip figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 20px 18px;
  color: #fff;
  font-size: 11px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .85));
}

@media (max-width: 640px) {
  .photo-strip {
    grid-template-columns: 1fr;
    margin-top: 52px;
  }

  .photo-strip figure,
  .photo-strip figure:first-child {
    min-height: 220px;
  }
}

[x-cloak] {
  display: none !important;
}

/* Legal prose styling for Terms / Privacy */
.legal-prose h1,
.legal-prose h2,
.legal-prose h3,
.legal-prose h4 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.legal-prose h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-prose h3 {
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-prose p {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.legal-prose ul,
.legal-prose ol {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.75;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  list-style-type: disc;
}

.legal-prose li {
  margin-bottom: 0.4rem;
}

.legal-prose strong,
.legal-prose b {
  color: var(--ink);
  font-weight: 600;
}

/* Live Trading Activity Notification Popup */
.notification-popup {
  position: fixed;
  z-index: 1000;
  bottom: 72px;
  right: 20px;
  background: #070b14;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 14px 18px;
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  max-width: 340px;
  min-width: 270px;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f0f4f8;
}

.notification-popup.show {
  transform: translateX(0);
  opacity: 1;
}

.notification-popup .notification-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.notification-popup .notification-icon {
  width: 24px;
  height: 24px;
  background: rgba(0, 82, 255, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  font-size: 11px;
  color: #3b82f6;
}

.notification-popup .notification-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.notification-popup .notification-content {
  color: rgba(240, 244, 248, 0.85);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.notification-popup .notification-content b {
  font-weight: 600;
  color: #ffffff;
}

.notification-popup .notification-content a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

.notification-popup .notification-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: rgba(240, 244, 248, 0.5);
}

.notification-popup .notification-close {
  background: none;
  border: none;
  color: rgba(240, 244, 248, 0.55);
  font-size: 13px;
  cursor: pointer;
  padding: 2px;
  margin-left: auto;
  transition: color 0.2s ease;
}

.notification-popup .notification-close:hover {
  color: #ffffff;
}

.notification-popup .progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #0052ff;
  transition: width linear;
}

@media (max-width: 640px) {
  .notification-popup {
    right: 12px;
    bottom: 76px;
    max-width: calc(100vw - 24px);
    min-width: auto;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.notification-popup.animate-in {
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.notification-popup.animate-out {
  animation: slideOutRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
