:root {
  --bg-0: #04070a;
  --bg-1: #090e14;
  --ink-0: #f0f6fc;
  --ink-1: #aec1d3;
  --ink-2: #849cb1;
  --accent: #5eacfa;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--ink-0);
  font-family: "IBM Plex Sans", sans-serif;
  background-color: var(--bg-0);
  background: radial-gradient(circle at 50% 10%, #0d1621 0%, #04070a 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ── Scroll Proxy ── */
/* Tall enough to allow 5+ scrolls for the decision sequence */
#scroll-proxy {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 600vh;
  z-index: -1;
  pointer-events: none;
}

/* ── Canvas Layers ── */
#hero-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  transition: opacity 2s ease;
}

/* ── Atmosphere ── */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 60%, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
  background-size: 200px 200px, 150px 180px;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(4, 7, 10, 0) 40%, rgba(4, 7, 10, 0.8) 100%);
}

body.tv-mode #custom-cursor {
  opacity: 0 !important;
}

/* ── TradingView Mock UI ── */
#tv-ui {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 85vw;
  max-width: 1200px;
  height: 75vh;
  transform: translate(-50%, -40%) scale(0.95);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
  color: #d1d4dc;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  background: rgba(19, 23, 34, 0.2);
  backdrop-filter: blur(8px);
}

#tv-ui.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tv-topbar {
  display: flex;
  align-items: center;
  height: 48px;
  background: #131722;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 16px;
  gap: 16px;
}

.tv-logo {
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -2px;
  color: #fff;
}

.tv-search {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.tv-timeframes {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #787b86;
  font-weight: 500;
  margin-left: 16px;
}

.tv-timeframes .active {
  color: #2962ff;
}

.tv-main {
  display: flex;
  flex: 1;
}

.tv-sidebar-left {
  width: 52px;
  background: #131722;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  gap: 16px;
}

.tv-sidebar-left .mock-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.tv-chart-area {
  flex: 1;
  position: relative;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.tv-sidebar-right {
  width: 60px;
  background: #131722;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: #787b86;
  padding-top: 200px;
  gap: 40px;
}

.tv-sidebar-right span {
  padding-left: 8px;
}

.tv-sidebar-right .active-price {
  background: #2962ff;
  color: white;
  padding: 2px 4px;
  margin-left: 4px;
  border-radius: 2px;
}

.tv-legend {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 14px;
}

.tv-legend .title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d1d4dc;
}

.tv-legend .prices {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.tv-legend .prices .sell {
  color: #f23645;
  padding: 4px;
  border: 1px solid rgba(242, 54, 69, 0.5);
  border-radius: 4px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.tv-legend .prices .buy {
  color: #2962ff;
  padding: 4px;
  border: 1px solid rgba(41, 98, 255, 0.5);
  border-radius: 4px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -12px;
}

.tv-legend .prices small {
  font-size: 10px;
  opacity: 0.7;
}

.tv-bottombar {
  height: 30px;
  background: #131722;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #787b86;
  gap: 16px;
}

/* ── Hero UI ── */
#hero-ui {
  position: fixed;
  top: 15vh;
  left: 12vw;
  width: min(520px, 90vw);
  z-index: 100;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1), transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-ui-hidden {
  opacity: 0 !important;
  transform: translateY(40px) !important;
  pointer-events: none !important;
  transition: none !important;
}

body.tv-mode #hero-ui {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important;
}

.hero-copy {
  padding-top: 4vh;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--ink-1);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(2.4rem, 4.5vw, 4.8rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 0%, #c4d4eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subhead {
  margin: 24px 0 36px;
  color: var(--ink-1);
  font-size: clamp(1rem, 1.25vw, 1.25rem);
  line-height: 1.6;
  text-wrap: pretty;
  font-weight: 400;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  color: #04080d;
  background: linear-gradient(135deg, #f0f6fc 0%, #aec1d3 100%);
  box-shadow: 0 8px 24px rgba(4, 10, 16, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: filter 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.cta:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

/* ── Custom Torch Cursor ── */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffffff;
  pointer-events: none;
  z-index: 200;
  mix-blend-mode: screen;
  box-shadow: 0 0 12px 2px #5eacfa;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

body:hover #custom-cursor {
  opacity: 1;
}

/* ── Skip Button ── */
#skip-btn {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  transition: opacity 0.5s ease, background 0.2s ease;
  backdrop-filter: blur(4px);
}

#skip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-0);
}

#skip-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

#skip-btn kbd {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-0);
  letter-spacing: 0.5px;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  #hero-ui {
    top: 50%;
    bottom: auto;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
  }

  #tv-ui {
    width: 95vw;
    height: 85vh;
  }

  .tv-sidebar-left {
    display: none;
  }

  .tv-sidebar-right {
    width: 45px;
    font-size: 10px;
    padding-top: 80px;
    gap: 30px;
  }

  .tv-timeframes span {
    display: none;
  }

  .tv-timeframes span.active {
    display: block;
  }

  .tv-bottombar {
    font-size: 10px;
    gap: 8px;
  }

  .tv-legend {
    font-size: 12px;
  }

  .tv-legend .prices {
    font-size: 11px;
    gap: 8px;
  }

  .tv-logo {
    font-size: 20px;
  }

  #skip-btn {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    padding: 5px 10px;
  }
}