/* ==========================================================================
   Haider's 20th - crypto / trading terminal theme
   ========================================================================== */

:root {
  --bg: #05080d;
  --panel: rgba(12, 20, 30, 0.72);
  --border: rgba(0, 255, 157, 0.18);
  --text: #d7e3ee;
  --muted: #7d8da0;
  --green: #00ff9d;
  --red: #ff3b5c;
  --gold: #ffc83d;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --display: "Space Grotesk", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2 {
  font-family: var(--display);
  margin: 0;
}

.green {
  color: var(--green);
}
.up {
  color: var(--green);
}
.down {
  color: var(--red);
}
.gold {
  color: var(--gold);
}

/* ---------- Fixed layers ---------- */

#backdrop,
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
#backdrop {
  z-index: 0;
  opacity: 0.55;
}
#confetti {
  z-index: 60;
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
}

main,
.footer {
  position: relative;
  z-index: 2;
}

/* ---------- Ticker ---------- */

.ticker {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: hidden;
  background: rgba(5, 8, 13, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  font-size: 0.8rem;
}
.ticker__track {
  display: flex;
  width: max-content;
  gap: 2.5rem;
  padding: 0.55rem 0;
  animation: marquee 32s linear infinite;
}
.tick {
  white-space: nowrap;
  font-weight: 600;
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Layout ---------- */

.section {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(4rem, 12vw, 8rem) 1.25rem;
}
.section__head {
  margin-bottom: 2.5rem;
}
.section__head h2 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}
.sub {
  color: var(--muted);
  max-width: 52ch;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
    transform: scale(0.7);
  }
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Hero ---------- */

.hero {
  min-height: calc(100svh - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.25rem 5rem;
  gap: 1.75rem;
}
.hero .eyebrow {
  justify-content: center;
  margin: 0;
}
.hero__title {
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  font-size: clamp(2.4rem, 10vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.line {
  display: block;
}
.line--accent {
  color: var(--green);
  text-shadow: 0 0 28px rgba(0, 255, 157, 0.55), 0 0 80px rgba(0, 255, 157, 0.25);
  font-size: 1.25em;
}
.char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em) rotate(6deg) scale(0.8);
  animation: char-in 0.7s cubic-bezier(0.2, 1.2, 0.3, 1) forwards;
  animation-delay: calc(var(--i) * 45ms + 200ms);
}
@keyframes char-in {
  to {
    opacity: 1;
    transform: none;
  }
}

.price-card {
  width: min(100%, 360px);
  padding: 1.4rem 1.5rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 60px rgba(0, 255, 157, 0.08);
  text-align: left;
}
.price-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.price-card__label {
  font-weight: 800;
  letter-spacing: 0.08em;
}
.badge {
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: #021008;
  background: var(--green);
  border-radius: 999px;
  animation: badge 1.8s ease-in-out infinite;
}
@keyframes badge {
  50% {
    box-shadow: 0 0 18px var(--green);
  }
}
.price-card__price {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.price {
  font-size: clamp(2.6rem, 12vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.price.is-bump {
  animation: bump 0.25s ease;
}
@keyframes bump {
  40% {
    transform: scale(1.08);
    color: var(--green);
    text-shadow: 0 0 22px var(--green);
  }
}
.price-card__unit {
  color: var(--muted);
}
.price-card__change {
  margin: 0.25rem 0 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hint {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}
.scroll-cue__arrow {
  font-size: 1.2rem;
  color: var(--green);
  animation: bounce 1.4s ease-in-out infinite;
}
@keyframes bounce {
  50% {
    transform: translateY(6px);
  }
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  font: 800 1rem var(--mono);
  letter-spacing: 0.04em;
  color: #021008;
  text-decoration: none;
  background: var(--green);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  box-shadow: 0 0 32px rgba(0, 255, 157, 0.6);
  transform: translateY(-2px);
}
.btn:active {
  transform: scale(0.96);
}
.btn:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.btn--pump {
  width: 100%;
  font-size: 1.15rem;
  user-select: none;
}
.btn__icon {
  display: inline-block;
}
.btn--pump:hover .btn__icon {
  animation: wiggle 0.4s ease infinite;
}
@keyframes wiggle {
  50% {
    transform: translate(3px, -3px) rotate(8deg);
  }
}
.btn__count {
  min-width: 2.2ch;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  background: rgba(2, 16, 8, 0.18);
  border-radius: 999px;
}
.btn--ghost {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  color: var(--green);
  background: transparent;
  border: 1px solid var(--green);
}
.btn--gift {
  margin-top: 0.5rem;
  padding: 1.1rem 2rem;
  font-size: clamp(1rem, 4vw, 1.25rem);
  color: #1a1200;
  background: linear-gradient(110deg, var(--gold), #fff1b8, var(--gold));
  background-size: 200% 100%;
  animation: shine 2.6s linear infinite, glow 2s ease-in-out infinite;
}
@keyframes shine {
  to {
    background-position: -200% 0;
  }
}
@keyframes glow {
  50% {
    box-shadow: 0 0 40px rgba(255, 200, 61, 0.65);
  }
}

/* ---------- Chart ---------- */

.chart-wrap {
  position: relative;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(10px);
}
.chart-wrap__bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}
#age-chart {
  display: block;
  width: 100%;
  height: clamp(260px, 50vw, 420px);
  cursor: crosshair;
  touch-action: pan-y;
}
.chart-tooltip {
  position: absolute;
  z-index: 3;
  padding: 0.45rem 0.7rem;
  font-size: 0.75rem;
  white-space: nowrap;
  background: #0b141e;
  border: 1px solid var(--green);
  border-radius: 8px;
  pointer-events: none;
  transform: translate(-50%, -120%);
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  perspective: 900px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 210px;
  padding: 1.4rem;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.15s ease-out, border-color 0.25s, box-shadow 0.25s, opacity 0.8s ease;
  overflow: hidden;
}
.card.reveal {
  transform: translateY(28px);
}
.card.reveal.is-visible {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(0, 255, 157, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.card:hover {
  border-color: var(--green);
  box-shadow: 0 0 36px rgba(0, 255, 157, 0.15);
}
.card:hover::after {
  opacity: 1;
}
.card__signal {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.card__title {
  font: 700 1.7rem var(--display);
}
.card__front,
.card__back {
  color: var(--muted);
  font-size: 0.9rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.card__back {
  position: absolute;
  left: 1.4rem;
  right: 1.4rem;
  bottom: 1.4rem;
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
}
.card[aria-pressed="true"] .card__front {
  opacity: 0;
  transform: translateY(-12px);
}
.card[aria-pressed="true"] .card__back {
  opacity: 1;
  transform: none;
}
.card[aria-pressed="true"] {
  border-color: var(--green);
}

/* ---------- Terminal / gift ---------- */

.terminal {
  max-width: 720px;
  margin: 0 auto;
  background: rgba(3, 7, 11, 0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0, 255, 157, 0.08);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border);
}
.terminal__dots {
  display: inline-flex;
  gap: 6px;
}
.terminal__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
}
.terminal__dots i:nth-child(2) {
  background: var(--gold);
}
.terminal__dots i:nth-child(3) {
  background: var(--green);
}
.terminal__body {
  min-height: 210px;
  padding: 1rem 1.1rem;
  font-size: clamp(0.72rem, 2.6vw, 0.88rem);
  line-height: 1.9;
}
.terminal__body .row {
  animation: row-in 0.3s ease both;
}
@keyframes row-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
}
.terminal__body .caret::after {
  content: "▋";
  margin-left: 2px;
  animation: blink 0.9s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.gift {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  margin-top: 3rem;
  text-align: center;
}
.gift[hidden] {
  display: none;
}
.gift.is-open {
  animation: pop 0.9s cubic-bezier(0.2, 1.3, 0.3, 1) both;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(30px);
  }
}
.gift__lead {
  margin: 0;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
}
.wallet {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: min(100%, 720px);
  padding: 0.9rem 1rem;
  background: var(--panel);
  border: 1px dashed var(--green);
  border-radius: 14px;
}
.wallet__label {
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: #021008;
  background: var(--green);
  border-radius: 6px;
}
.wallet__address {
  flex: 1 1 260px;
  min-width: 0;
  font-size: clamp(0.7rem, 2.8vw, 0.92rem);
  color: var(--green);
  word-break: break-all;
}
.signoff {
  margin: 1.5rem 0 0;
  font-size: 1.1rem;
}

/* ---------- Footer / toast ---------- */

.footer {
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 70;
  padding: 0.7rem 1.1rem;
  font-size: 0.85rem;
  color: #021008;
  background: var(--green);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 250%);
  transition: transform 0.35s cubic-bezier(0.2, 1.2, 0.3, 1), opacity 0.25s ease;
}
.toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .ticker__track {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
