:root {
  color-scheme: dark;
}

html, body {
  background: #0D2A70;
  color: #F5F5F7;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
  width: 100%;
}
html {
  overflow-x: hidden;
  overflow-y: auto;
}
body {
  overflow-x: hidden;
  min-width: 100vw;
}

/* Three.js hero canvas container */
#three-hero {
  position: absolute;
  inset: 0;
  z-index: 0;
}
#three-hero canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Signal tabs */
.signal-tab {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #B4C0E0;
  border-radius: 9999px;
  border: 1px solid #2B4A8E;
  background: transparent;
  transition: all 150ms ease;
  cursor: pointer;
}
.signal-tab:hover {
  color: #F5F5F7;
  border-color: #3A60B2;
}
.signal-tab-active {
  color: #0D2A70;
  background: #5EEAD4;
  border-color: #5EEAD4;
}

/* Plotly chart container */
.chart-frame {
  border: 1px solid #2B4A8E;
  border-radius: 1rem;
  background: #163A8C;
  padding: 0.75rem;
  min-height: 360px;
}
.chart-frame .plotly-graph-div {
  width: 100% !important;
  min-height: 340px;
}

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms ease, transform 600ms ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Hide scrollbar but keep scrolling */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

/* Selection */
::selection {
  background: #5EEAD4;
  color: #0D2A70;
}

/* Small-screen polish */
@media (max-width: 640px) {
  .chart-frame { min-height: 300px; padding: 0.5rem; }
  .chart-frame .plotly-graph-div { min-height: 280px; }
}

/* Language dropdown */
.lang-dropdown { position: relative; }
.lang-trigger {
    background: none; border: 1px solid transparent; border-radius: .35rem;
    cursor: pointer; font-size: 1.15rem; line-height: 1; padding: .25rem .4rem;
    transition: border-color .15s;
}
.lang-trigger:hover { border-color: #3A60B2; }
.lang-dd-menu {
    position: absolute !important; right: 0; top: calc(100% + 4px);
    background: #163A8C; border: 1px solid #2B4A8E; border-radius: .6rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.3); z-index: 100;
    min-width: 150px; padding: .3rem; max-height: 300px; overflow-y: auto;
    flex-direction: column;
}
.lang-dd-menu:not(.hidden) { display: flex !important; }
.lang-dd-item {
    display: flex; align-items: center; gap: .5rem;
    padding: .4rem .6rem; background: none; border: none; border-radius: .3rem;
    cursor: pointer; font-size: .78rem; color: #C2CEE8;
    transition: background .12s, color .12s; white-space: nowrap;
}
.lang-dd-item:hover { background: #1F4BAC; color: #F5F5F7; }
.lang-dd-item.active { color: #5EEAD4; font-weight: 600; }
.lang-dd-flag { font-size: 1rem; }
.lang-dd-label { font-family: 'Inter', sans-serif; }

/* Reduce flash of unstyled Tailwind CDN load */
body { min-height: 100vh; }
