/* ============================================================
   FIVE TRILLION ($5T) — golden ledger theatre
   two colours on black: gold #D4AF37 · cream #F5F2E8
   ============================================================ */

:root {
  --black: #050505;
  --gold: #D4AF37;
  --white: #F5F2E8;
  --dim: rgba(245, 242, 232, 0.62);
  --font-serif: "Cormorant Garamond", Georgia, serif;   /* ritual */
  --font-label: "Space Grotesk", system-ui, sans-serif; /* buttons, labels */
  --font-mono: "JetBrains Mono", ui-monospace, monospace; /* every figure */
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-label);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--black); }

.mono { font-family: var(--font-mono); }
.dim { color: var(--dim); }

img, video { max-width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.overline {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.72); /* dim, but AA on black */
}

/* ------------------------------------------------------------
   VEIL — grain 0.035 + deep vignette (static, silent)
   ------------------------------------------------------------ */

.veil {
  position: fixed;
  inset: 0;
  z-index: 21;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(0, 0, 0, 0.55) 100%);
}

.veil::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* ------------------------------------------------------------
   NAVBAR
   ------------------------------------------------------------ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(5, 5, 5, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.nav-logo { display: inline-flex; align-items: center; }
.nav-logo img { height: 40px; width: 40px; display: block; }

.nav-ca {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.22em;
}

.nav-ca:hover { text-decoration: underline; text-underline-offset: 6px; }

/* ------------------------------------------------------------
   CEREMONIAL LEDGER — left rail, behind the number
   ------------------------------------------------------------ */

.ledger {
  display: none;
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 320px;
  max-height: 68vh;
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.8s ease;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

@media (min-width: 1024px) {
  .ledger { display: block; }
}

.ledger.off { opacity: 0; }

.ledger .overline { margin-bottom: 14px; }

.ledger-lines {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  max-height: calc(68vh - 34px);
  overflow: hidden;
}

.ledger-line {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  line-height: 2;
  color: rgba(212, 175, 55, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: ledger-in 600ms ease both;
}

@keyframes ledger-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   1 · HERO
   ------------------------------------------------------------ */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  overflow: hidden;
}

/* single god-ray from above; the binary whisper lives inside it */
.ray {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: conic-gradient(from 180deg at 50% -8%,
    transparent 46.5%,
    rgba(212, 175, 55, 0.045) 48.8%,
    rgba(212, 175, 55, 0.085) 50%,
    rgba(212, 175, 55, 0.045) 51.2%,
    transparent 53.5%);
}

.ray-canvas {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: min(64vw, 720px);
  height: 100%;
}

.hero-core {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.hero-kicker {
  color: var(--white);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
}

/* ---------- the number: odometer ---------- */

.big-number {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: flex-start;
  white-space: nowrap;

  font-family: var(--font-mono);
  font-weight: 300;
  font-size: clamp(40px, 8.5vw, 120px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--gold);
  /* the only glow on the page (drop-shadow so reel clipping can't cut it) */
  filter: drop-shadow(0 0 26px rgba(212, 175, 55, 0.22));
}

.big-number:hover { filter: drop-shadow(0 0 34px rgba(212, 175, 55, 0.34)); }
.big-number:active { transform: translateY(1px); }

/* gold shimmer sweeping the face every 7s */
.big-number::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(245, 242, 232, 0.35) 50%, transparent 60%);
  mix-blend-mode: overlay;
  animation: od-shimmer 7s linear infinite;
}

@keyframes od-shimmer {
  0%   { transform: translateX(-120%); }
  14%  { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

.od { display: inline-flex; }

.od-digit {
  display: block;
  width: 1ch;
  height: 1em;
  overflow: hidden;
}

.od-reel {
  display: block;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.od-reel span,
.od-static {
  display: block;
  width: 1ch;
  height: 1em;
  line-height: 1;
  text-align: center;
}

/* glyphs live in pseudo-content so the button has no visible text node
   (its accessible name is the aria-label alone) */
.od-reel span::before { content: attr(data-d); }
.od-static::before { content: attr(data-c); }

.big-number.booting .od-reel {
  transition-duration: 90ms;
  transition-timing-function: linear;
}

/* ---------- lines beneath the number ---------- */

.hero-sub {
  position: relative;
  color: var(--white);
  font-size: 13px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.recalc-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  visibility: hidden;
}

.hero.is-recalc .hero-sub-content { visibility: hidden; }
.hero.is-recalc .recalc-msg { visibility: visible; }

/* checksum rail — one quiet line, 40% gold */
.checksum {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(212, 175, 55, 0.4);
  font-variant-numeric: tabular-nums;
}

/* rotating lore — Cormorant italic, fades every 10s */
.hero-lore {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: var(--dim);
  min-height: 1.6em;
  opacity: 1;
  transition: opacity 0.7s ease;
}

.hero-lore.fade { opacity: 0; }

.hud {
  position: absolute;
  z-index: 2;
  top: 72px;
  right: 20px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* 1px progress: $4.5T → $5T */
.progress {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(245, 242, 232, 0.12);
}

.progress-fill {
  height: 1px;
  width: 72%;
  background: var(--gold);
  transition: width 0.6s linear;
}

/* ------------------------------------------------------------
   sparkle + flash + toast
   ------------------------------------------------------------ */

.sparkle {
  position: fixed;
  z-index: 40;
  color: var(--gold);
  font-size: 14px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: sparkle-rise 0.8s ease-out forwards;
}

@keyframes sparkle-rise {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
  50%  { opacity: 1; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 24px)) scale(1.15); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 48px)) scale(0.4); }
}

.flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--gold);
  opacity: 0;
  pointer-events: none;
}

.flash.active { animation: flash-blink 1s ease-out; }

@keyframes flash-blink {
  0%   { opacity: 0; }
  10%  { opacity: 0.9; }
  25%  { opacity: 0.1; }
  40%  { opacity: 0.8; }
  60%  { opacity: 0.15; }
  75%  { opacity: 0.6; }
  100% { opacity: 0; }
}

.toasts {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}

.toast {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--white);
  background: #0b0b09;
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 10px 16px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.in { opacity: 1; transform: translateY(0); }
.toast.out { opacity: 0; transform: translateY(-6px); }

/* ------------------------------------------------------------
   2 · ONE NUMBER. ONE ADDRESS.
   ------------------------------------------------------------ */

.ca {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 128px auto 0;
  padding: 44px 28px;
  background: var(--black);
  border: 2px solid var(--gold);
  text-align: center;
}

.ca .overline,
.how .overline { margin-bottom: 14px; }

.ca h2,
.how h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(26px, 3.8vw, 40px);
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-transform: lowercase;
  margin-bottom: 18px;
  color: var(--gold);
}

.how h2 { color: var(--white); }

.ca h2::first-letter,
.how h2::first-letter { font-size: 1.3em; }

.ca-warning {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--dim);
  line-height: 1.7;
  margin-bottom: 26px;
}

.ca-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}

.ca-address {
  display: block;
  background: #0a0a08;
  padding: 16px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(15px, 2.4vw, 24px);
  letter-spacing: 0.03em;
  color: var(--white);
  word-break: break-all;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  font-family: var(--font-label);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-copy {
  min-width: 48px;
  min-height: 48px;
  background: none;
  border: 1px solid rgba(245, 242, 232, 0.35);
  color: var(--white);
}

.btn-copy:hover { border-color: var(--gold); color: var(--gold); }

.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn-outline {
  border: 2px solid var(--gold);
  background: none;
  color: var(--white);
  min-width: 220px;
}

.btn-outline:hover { background: rgba(212, 175, 55, 0.1); color: var(--gold); }

.btn-fill {
  border: 2px solid var(--gold);
  background: var(--gold);
  color: var(--black);
  min-width: 220px;
  animation: buy-breathe 3s ease-in-out infinite;
}

.btn-fill:hover { background: #e2c14f; border-color: #e2c14f; }

@keyframes buy-breathe {
  0%, 100% { box-shadow: 0 0 0 rgba(212, 175, 55, 0); }
  50%      { box-shadow: 0 0 26px rgba(212, 175, 55, 0.4); }
}

/* floating BUY — desktop, hidden while #ca is on screen */
.btn-float {
  display: none;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 44;
  min-width: 0;
  transition: opacity 0.5s ease;
}

@media (min-width: 769px) {
  .btn-float { display: inline-flex; }
}

.btn-float.off { opacity: 0; pointer-events: none; }

/* ------------------------------------------------------------
   3 · VIDEO STRIP
   ------------------------------------------------------------ */

.video-strip {
  max-width: 960px;
  margin: 0 auto;
  padding: 96px 24px 0;
}

.video-strip video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0a0a08;
  border-radius: 12px;
}

.video-fallback {
  display: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
}

.video-strip.video-error video { display: none; }
.video-strip.video-error .video-fallback { display: block; }

/* ------------------------------------------------------------
   4 · LORE
   ------------------------------------------------------------ */

.lore {
  max-width: 720px;
  margin: 0 auto;
  padding: 112px 24px;
  text-align: center;
}

.lore p {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: 0.01em;
  line-height: 1.7;
  text-transform: lowercase;
  color: var(--white);
}

.lore p::first-letter { font-size: 1.3em; }

/* ------------------------------------------------------------
   5 · HOW TO BUY
   ------------------------------------------------------------ */

.how {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 112px;
  text-align: center;
}

.how h2 { margin-bottom: 36px; }

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: left;
}

.step {
  border-top: 1px solid rgba(245, 242, 232, 0.14);
  padding-top: 20px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.2em;
}

.step h3 {
  font-family: var(--font-label);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin: 10px 0 8px;
  color: var(--white);
}

.step p {
  font-size: 14px;
  color: var(--dim);
  line-height: 1.7;
}

/* ------------------------------------------------------------
   6 · FOOTER
   ------------------------------------------------------------ */

.footer {
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  padding: 40px 24px 48px;
  text-align: center;
}

.footer-logo {
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto 16px;
  opacity: 0.85;
}

.footer p {
  font-size: 13px;
  color: var(--dim);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ------------------------------------------------------------
   STICKY CA BAR — mobile only
   ------------------------------------------------------------ */

.sticky-ca {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: #0b0b09;
  border-top: 1px solid rgba(212, 175, 55, 0.5);
}

.sticky-ca.closed { display: none !important; }

.sticky-ca-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.sticky-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.sticky-close {
  border-color: rgba(245, 242, 232, 0.3);
  color: var(--white);
  font-size: 18px;
  padding: 0;
}

/* ------------------------------------------------------------
   responsive
   ------------------------------------------------------------ */

@media (max-width: 768px) {
  .sticky-ca { display: flex; }
  .footer { padding-bottom: 120px; }
  .toasts { bottom: 88px; }
}

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }

  .cta-row { flex-direction: column; }
  .btn-outline, .btn-fill { min-width: 0; width: 100%; }

  .ca { margin: 96px 16px 0; padding: 32px 18px; }

  .hud {
    right: 0; left: 0;
    text-align: center;
    padding: 0 16px;
  }
}

/* ------------------------------------------------------------
   reduced motion — everything still; the number updates in steps
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sparkle { display: none; }
  .flash { display: none; }
  .ray-canvas { display: none; }
  .progress-fill { transition: none; }
  .toast { transition: opacity 0.01ms; }
  .od-reel { transition: none; }
  .big-number::after { animation: none; }
  .btn-fill { animation: none; }
  .ledger-line { animation: none; }
  .hero-lore { transition: none; }
  .ledger { transition: none; }
}
