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

:root {
  --navy: #010B1F;
  --cream: #F5EFDC;
  --grey: #6B7280;
  --grey-muted: #4A5568;
  --lime: #B7E00A;
  --border: rgba(245, 239, 220, 0.12);
  --border-dashed: rgba(245, 239, 220, 0.18);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--mono);
  background: var(--navy);
  color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Grain texture */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 100px 100px;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--cream);
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--grey);
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--cream);
}

.header-cta {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--grey);
  transition: color 0.2s, opacity 0.2s, transform 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  padding: 0;
}

.header-link {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--grey);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  padding: 0;
  transition: color 0.2s;
}

.header-link:hover {
  color: var(--cream);
}

.header-cta:hover,
.btn-pill--sm:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-pill--sm {
  font-size: 0.65rem;
  padding: 10px 18px;
  color: var(--navy);
  background: var(--cream);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--mono);
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--grey);
  border: 1px dashed var(--border-dashed);
  border-radius: 50%;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.header-x:hover {
  color: var(--cream);
  border-color: rgba(245, 239, 220, 0.35);
}

.auth-user-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-user {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--cream);
}

.auth-signout {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.auth-signout:hover {
  color: var(--cream);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 32px 80px;
  width: 100%;
  overflow: hidden;
}

.hero-wind {
  position: absolute;
  inset: -8% 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
  will-change: transform;
  mask-image:
    radial-gradient(ellipse 85% 70% at 50% 40%, transparent 15%, black 68%),
    linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}

.hero-wind-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 72% 58% at 50% 40%, rgba(1, 11, 31, 0.94) 0%, rgba(1, 11, 31, 0.72) 42%, transparent 72%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-headline,
.hero-sub,
.hero-cta,
.hero-partners {
  position: relative;
  z-index: 2;
}

.hero-headline {
  max-width: 900px;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--cream);
  margin-bottom: 28px;
  text-shadow: 0 2px 28px rgba(1, 11, 31, 0.85);
}

.hero-sub {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: #9CA3AF;
  max-width: 480px;
  margin-bottom: 48px;
  line-height: 1.7;
  text-shadow: 0 1px 16px rgba(1, 11, 31, 0.9);
}

.hero-cta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-ghost {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #B0B8C4;
  padding: 16px 24px;
  border: 1px dashed var(--border-dashed);
  border-radius: 999px;
  background: rgba(1, 11, 31, 0.45);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  color: var(--cream);
  border-color: rgba(245, 239, 220, 0.35);
}

.hero-partners {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px dashed var(--border-dashed);
  max-width: 720px;
  width: 100%;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(1, 11, 31, 0.55), transparent);
}

.partner-badge,
.auth-partner {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--grey);
}

.auth-partner {
  justify-content: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-dashed);
}

.partner-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  object-fit: contain;
  mix-blend-mode: lighten;
}

.partner-icon--feather {
  width: 34px;
  height: 42px;
}

.partner-icon--wc {
  width: 42px;
  height: 34px;
}

.partner-name {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--grey);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .hero-partners {
    gap: 24px;
  }

  .partner-name {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .partner-icon {
    width: 30px;
    height: 30px;
  }

  .partner-icon--feather {
    width: 30px;
    height: 38px;
  }

  .partner-icon--wc {
    width: 36px;
    height: 30px;
  }
}

.btn-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--navy);
  background: var(--cream);
  padding: 16px 36px;
  border-radius: 999px;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-pill:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Stats band */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px 120px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--border-dashed);
}

.stat-value {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--cream);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

.stat-value--accent {
  color: var(--lime);
}

.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--grey);
}

/* Sections */
.section {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px 120px;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--grey);
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--cream);
}

/* Leaderboard */
.leaderboard {
  border: 1px dashed var(--border-dashed);
}

.leaderboard-head,
.leaderboard-row {
  display: grid;
  grid-template-columns: 56px 1fr 140px 100px;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
}

.leaderboard-head {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--grey);
  border-bottom: 1px dashed var(--border-dashed);
}

.leaderboard-row {
  border-bottom: 1px dashed var(--border-dashed);
  transition: background 0.2s;
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-row:hover {
  background: rgba(245, 239, 220, 0.03);
}

.leaderboard-empty,
.feed-empty {
  padding: 32px 28px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--grey-muted);
  line-height: 1.6;
}

.rank {
  font-size: 0.75rem;
  color: var(--grey);
}

.trader {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trader-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--cream);
}

.trader-meta {
  font-size: 0.65rem;
  color: var(--grey-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pnl,
.followers,
.feed-price,
.feed-pnl {
  font-variant-numeric: tabular-nums;
}

.pnl {
  text-align: right;
  font-size: 0.9rem;
}

.pnl.positive {
  color: var(--lime);
}

.followers {
  text-align: right;
  font-size: 0.85rem;
  color: var(--grey);
}

/* Feed */
.feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px dashed var(--border-dashed);
}

.feed-item {
  display: grid;
  grid-template-columns: 140px 100px 80px 1fr 80px;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px dashed var(--border-dashed);
  font-size: 0.8rem;
  animation: feed-in 0.4s ease;
}

.feed-item:last-child {
  border-bottom: none;
}

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

.feed-trader {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--cream);
}

.feed-action {
  color: var(--grey);
  text-transform: lowercase;
}

.feed-ticker {
  font-weight: 500;
  color: var(--cream);
}

.feed-price,
.feed-pnl {
  color: var(--grey);
}

.feed-pnl.positive {
  color: var(--lime);
}

.feed-meta {
  color: var(--grey-muted);
  font-size: 0.7rem;
}

.feed-time {
  text-align: right;
  color: var(--grey-muted);
  font-size: 0.7rem;
}

/* Steps */
.section--steps {
  padding-bottom: 160px;
}

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

.step {
  text-align: center;
  padding: 0 16px;
}

.step-num {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--grey);
  margin-bottom: 24px;
}

.step-num--accent {
  color: var(--lime);
}

.step-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-bottom: 16px;
}

.step-desc {
  font-size: 0.8rem;
  color: var(--grey);
  line-height: 1.7;
}

/* Footer */
.footer {
  text-align: center;
  padding: 64px 32px 48px;
  border-top: 1px dashed var(--border-dashed);
}

.footer .logo {
  display: inline-block;
  margin-bottom: 12px;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--grey);
  margin-bottom: 24px;
}

.footer-legal {
  font-size: 0.65rem;
  color: var(--grey-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 20px 24px;
  }

  .nav {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr;
    padding-bottom: 80px;
  }

  .stat {
    border-bottom: none;
  }

  .stat:last-child {
    border-bottom: 1px dashed var(--border-dashed);
  }

  .leaderboard-head {
    display: none;
  }

  .leaderboard-row {
    grid-template-columns: 40px 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 16px;
    padding: 24px 20px;
  }

  .rank {
    grid-row: 1 / 3;
    align-self: start;
    padding-top: 4px;
  }

  .trader {
    grid-column: 2 / 4;
  }

  .pnl {
    grid-column: 2;
    text-align: left;
    font-size: 0.85rem;
  }

  .followers {
    grid-column: 3;
    grid-row: 2;
    text-align: right;
    font-size: 0.7rem;
  }

  .feed-item {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .feed-time {
    grid-column: 2;
    text-align: right;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 64px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 100px 24px 60px;
  }

  .section {
    padding: 0 24px 80px;
  }
}

/* Auth modal */
body.modal-open {
  overflow: hidden;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(1, 11, 31, 0.88);
  backdrop-filter: blur(4px);
}

.auth-overlay[hidden] {
  display: none !important;
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  border: 1px dashed var(--border-dashed);
  background: var(--navy);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--grey);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.auth-close:hover {
  color: var(--cream);
}

.auth-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-bottom: 12px;
}

.auth-lead {
  font-size: 0.8rem;
  color: var(--grey);
  line-height: 1.6;
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 12px;
  background: none;
  border: 1px dashed var(--border-dashed);
  color: var(--grey);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.auth-tab.active,
.auth-tab:hover {
  color: var(--cream);
  border-color: rgba(245, 239, 220, 0.35);
}

.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--cream);
  padding: 14px 20px;
  border: 1px dashed var(--border-dashed);
  transition: border-color 0.2s, background 0.2s;
}

.btn-oauth:hover {
  border-color: rgba(245, 239, 220, 0.35);
  background: rgba(245, 239, 220, 0.04);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  color: var(--grey-muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-dashed);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--grey);
}

.field input {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--cream);
  background: rgba(245, 239, 220, 0.04);
  border: 1px dashed var(--border-dashed);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: rgba(245, 239, 220, 0.35);
}

.field-hint {
  font-size: 0.7rem;
  color: var(--grey-muted);
}

.field-hint.ok {
  color: var(--lime);
}

.auth-error {
  margin-top: 16px;
  font-size: 0.75rem;
  color: #f87171;
}

.btn-pill--full {
  width: 100%;
  text-align: center;
  border: none;
  cursor: pointer;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .auth-modal {
    padding: 32px 24px;
  }
}
