:root {
  --bg-dark: #0B0F14;
  --bg-panel: #121821;
  --border-muted: #1F2A36;
  --text-main: #E6EDF3;
  --text-muted: #A9B6C4;
  --accent-amber: #F5B83D;
  --accent-amber-hover: #FFD27A;
  --accent-up: #5AB0FF;
  --accent-down: #FF9A4D;

  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
}

.container {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero {
  text-align: center;
  padding: 80px 0 60px;
  position: relative;
  z-index: 1;
}

.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(245,184,61,0.1) 0%, rgba(11,15,20,0) 70%);
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
}

h1 {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.hero-word-wrap {
  display: inline-block;
  color: var(--accent-amber);
}

.quote {
  color: var(--text-muted);
}

.the-word {
  font-style: normal;
  display: inline-block;
}

.intro .the-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  animation: introRise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.intro .the-letter:nth-child(1) { animation-delay: 0.8s; }
.intro .the-letter:nth-child(2) { animation-delay: 0.9s; }
.intro .the-letter:nth-child(3) { animation-delay: 1.0s; }

.intro .trading-desk {
  clip-path: inset(0 100% 0 0);
  animation: introReveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 1.1s forwards;
}

.the-letter {
  display: inline-block;
}

.sub-text {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.intro .sub-text {
  opacity: 0;
  animation: fadeIn 0.8s ease-out 1.2s forwards;
}

.intro .supporting-line, .intro .primary-button {
  opacity: 0;
  animation: fadeIn 0.8s ease-out 1.4s forwards;
}

.today-word {
  color: var(--text-main);
  font-style: normal;
  font-weight: 600;
  position: relative;
  display: inline-block;
  background: linear-gradient(90deg, var(--text-main) 0%, var(--accent-amber) 50%, var(--text-main) 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

.supporting-line {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 40px;
  font-family: var(--font-mono);
}

.primary-button {
  display: inline-block;
  background-color: var(--accent-amber);
  color: var(--bg-dark);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-family: var(--font-mono);
  box-shadow: 0 4px 14px rgba(245, 184, 61, 0.2);
}

.primary-button:hover,
.primary-button:focus {
  background-color: var(--accent-amber-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 184, 61, 0.3);
  outline: none;
}

.primary-button:focus-visible {
  outline: 2px solid var(--text-main);
  outline-offset: 4px;
}

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 60px;
}

@media (min-width: 600px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  padding: 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.feature-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.intro .feature-card {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease-out 1.6s forwards, introRise 0.8s ease-out 1.6s forwards;
}

.feature-card h2 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border-top: 1px solid var(--border-muted);
}

@keyframes introRise {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes introReveal {
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes exitSweep {
  0%   { width: 0; opacity: 1; }
  70%  { width: 100vw; opacity: 1; }
  100% { width: 100vw; opacity: 1; box-shadow: 0 0 28px 4px var(--accent-amber); }
}

body.exit > *:not(.exit-sweep) {
  animation: dimBlur 0.5s ease-in forwards;
  pointer-events: none;
}

body.exit .exit-sweep {
  /* A thin glowing amber line drawn across the screen's centre: the desk's arrival animation starts from it. */
  position: fixed;
  top: 50%;
  left: 0;
  width: 0;
  height: 3px;
  transform: translateY(-50%);
  background: var(--accent-amber);
  box-shadow: 0 0 18px 2px var(--accent-amber);
  z-index: 9999;
  animation: exitSweep 0.65s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes dimBlur {
  to {
    opacity: 0;
    filter: blur(10px);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body.exit > *:not(.exit-sweep) {
    animation: none !important;
  }
  body.exit .exit-sweep {
    display: none !important;
  }

  .the-letter,
  .trading-desk {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  
  .today-word {
    animation: none !important;
    background: var(--accent-amber);
    -webkit-background-clip: text;
    background-clip: text;
  }

  .feature-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
