:root {
  color-scheme: dark;
  --black: #060608;
  --panel: rgba(8, 8, 10, 0.92);
  --red: #e31e24;
  --red-glow: #ff2a2a;
  --red-dim: rgba(227, 30, 36, 0.65);
  --warn: #ff6b4a;
  --ok: #5ee87a;
  --text: #f0f0f2;
  --text-muted: #6b6b74;
  --brand: "Bebas Neue", Impact, "Arial Narrow Bold", sans-serif;
  --terminal: "VT323", ui-monospace, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html {
  min-height: 100%;
  background: var(--black);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--text);
  font-family: var(--terminal);
  font-size: 18px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  padding:
    var(--safe-top)
    var(--safe-right)
    var(--safe-bottom)
    var(--safe-left);
}

button,
input,
label {
  font: inherit;
}

#emberCanvas,
.grid-bg,
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#emberCanvas {
  z-index: 1;
  opacity: 0.85;
}

.grid-bg {
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(227, 30, 36, 0.06), transparent),
    linear-gradient(180deg, #0a0a0c 0%, #040404 100%);
}

.grid-bg::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(rgba(227, 30, 36, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(227, 30, 36, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
}

.scanlines {
  z-index: 2;
  opacity: 0.12;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.4) 2px,
    rgba(0, 0, 0, 0.4) 4px
  );
}

.site-shell {
  position: relative;
  z-index: 3;
  width: min(920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.top-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(227, 30, 36, 0.2);
}

.hud-pill {
  color: var(--text-muted);
  font-size: clamp(0.8rem, 2.8vw, 1rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hud-pill.urgent {
  color: var(--red-glow);
  text-shadow: 0 0 12px rgba(255, 42, 42, 0.6);
  animation: textFlicker 4s steps(1, end) infinite;
}

.hud-pill.dim {
  color: rgba(107, 107, 116, 0.7);
}

.hero {
  display: grid;
  align-content: start;
  gap: clamp(20px, 4vw, 28px);
  min-height: calc(100vh - 80px);
  padding-top: clamp(20px, 5vw, 36px);
}

.hero-lockup {
  text-align: center;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vw, 16px);
}

.brand-icon {
  width: clamp(52px, 14vw, 72px);
  height: clamp(52px, 14vw, 72px);
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(227, 30, 36, 0.35);
}

.brand-title {
  margin: 0;
  color: #fff;
  font-family: var(--brand);
  font-size: clamp(3rem, 13vw, 5.5rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.tagline {
  margin: 10px 0 6px;
  color: var(--red-glow);
  font-size: clamp(1.2rem, 4.5vw, 1.85rem);
  letter-spacing: 0.08em;
  text-shadow:
    0 0 8px rgba(255, 42, 42, 0.8),
    0 0 24px rgba(227, 30, 36, 0.5),
    1px 0 0 rgba(255, 80, 80, 0.3),
    -1px 0 0 rgba(80, 120, 255, 0.15);
}

.glitch-text {
  animation: glitchShift 5s steps(1, end) infinite;
}

.fomo-line {
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(0.9rem, 3vw, 1.05rem);
  letter-spacing: 0.06em;
}

.terminal-deck {
  display: grid;
  gap: 14px;
}

.presale-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(16px, 4vw, 28px);
  padding: clamp(18px, 4vw, 26px) clamp(16px, 4vw, 28px);
  border: 1px solid rgba(227, 30, 36, 0.35);
  background: var(--panel);
  box-shadow: 0 0 40px rgba(227, 30, 36, 0.08);
}

.corner {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-color: var(--red);
  pointer-events: none;
}

.top-left {
  top: 10px;
  left: 10px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.top-right {
  top: 10px;
  right: 10px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.bottom-left {
  bottom: 10px;
  left: 10px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.bottom-right {
  right: 10px;
  bottom: 10px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.card-header,
.section-heading,
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.micro-label,
.section-kicker {
  margin: 0;
  color: var(--red-dim);
  font-size: clamp(0.85rem, 2.8vw, 1rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.terminal-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: clamp(0.8rem, 2.6vw, 0.95rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.terminal-state.dim {
  color: var(--red-dim);
}

.terminal-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
  background: var(--red-glow);
  box-shadow: 0 0 8px var(--red-glow);
  animation: livePulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.terminal-state.dim::before {
  background: var(--red);
  animation: livePulse 1.2s ease-in-out infinite;
}

.raised-block {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.raised-block strong {
  color: #fff;
  font-family: var(--brand);
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 0 20px rgba(227, 30, 36, 0.35);
  word-break: break-word;
}

.scarcity-note {
  margin: 4px 0 0;
  color: var(--red-dim);
  font-size: clamp(0.85rem, 2.8vw, 0.95rem);
  letter-spacing: 0.06em;
}

.progress-area {
  margin-top: 18px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(227, 30, 36, 0.3);
  background: rgba(0, 0, 0, 0.5);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b8181d, var(--red), var(--red-glow));
  box-shadow: 0 0 12px rgba(227, 30, 36, 0.6);
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-meta {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: clamp(0.75rem, 2.5vw, 0.9rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contribution-zone {
  display: grid;
  gap: 12px;
  grid-row: 2 / span 2;
  grid-column: 2;
  padding-left: clamp(0px, 4vw, 28px);
  border-left: 1px solid rgba(227, 30, 36, 0.2);
}

.limits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.limits span {
  padding: 10px 12px;
  border: 1px solid rgba(227, 30, 36, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-muted);
  font-size: clamp(0.8rem, 2.6vw, 0.95rem);
  letter-spacing: 0.06em;
  text-align: center;
}

.limits b {
  margin-right: 4px;
  color: var(--red-dim);
}

.input-shell {
  display: grid;
  gap: 6px;
}

.input-shell label {
  color: var(--text-muted);
  font-size: clamp(0.8rem, 2.6vw, 0.95rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.input-shell input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(227, 30, 36, 0.35);
  outline: none;
  background: rgba(0, 0, 0, 0.55);
  color: var(--red-glow);
  font-size: clamp(1.05rem, 4vw, 1.2rem);
  letter-spacing: 0.08em;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -moz-appearance: textfield;
}

.input-shell input::-webkit-outer-spin-button,
.input-shell input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-shell input::placeholder {
  color: rgba(107, 107, 116, 0.5);
}

.input-shell input:focus {
  border-color: var(--red-glow);
  box-shadow: 0 0 16px rgba(227, 30, 36, 0.25);
}

.input-shell.is-error input {
  border-color: var(--warn);
  box-shadow: 0 0 12px rgba(255, 107, 74, 0.25);
  color: var(--warn);
}

.input-shell.is-valid input {
  border-color: var(--ok);
  box-shadow: 0 0 12px rgba(94, 232, 122, 0.15);
  color: var(--ok);
}

.amount-warning {
  margin: 0;
  color: var(--warn);
  font-size: clamp(0.8rem, 2.6vw, 0.9rem);
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.amount-warning[hidden] {
  display: none;
}

.wallet-button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: 1px solid var(--red-glow);
  border-radius: 2px;
  background: var(--red);
  color: #fff;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease,
    opacity 150ms ease;
  animation: ctaPulse 2.5s ease-in-out infinite;
}

.wallet-button:hover:not(:disabled) {
  background: var(--red-glow);
  transform: translateY(-1px);
  box-shadow: 0 0 32px rgba(227, 30, 36, 0.55);
}

.wallet-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.wallet-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  animation: none;
  box-shadow: none;
  border-color: rgba(227, 30, 36, 0.35);
  background: rgba(227, 30, 36, 0.35);
}

.wallet-button.is-ready:not(:disabled) {
  opacity: 1;
  animation: ctaPulse 2.5s ease-in-out infinite;
}

.btn-label {
  font-family: var(--brand);
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.btn-sub {
  font-size: clamp(0.75rem, 2.5vw, 0.85rem);
  letter-spacing: 0.1em;
  opacity: 0.9;
  text-transform: lowercase;
}

.status-line {
  min-height: 20px;
  margin: 0;
  color: var(--red-dim);
  font-size: clamp(0.8rem, 2.6vw, 0.95rem);
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.status-line.is-ready {
  color: var(--ok);
}

.status-line.is-warning {
  color: var(--warn);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat-card {
  padding: 16px 14px;
  border: 1px solid rgba(227, 30, 36, 0.18);
  background: var(--panel);
}

.stat-card.highlight {
  border-color: rgba(227, 30, 36, 0.45);
  box-shadow: 0 0 20px rgba(227, 30, 36, 0.1);
}

.stat-card span {
  display: block;
  color: var(--text-muted);
  font-size: clamp(0.7rem, 2.4vw, 0.85rem);
  letter-spacing: 0.08em;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-family: var(--brand);
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.stat-card.highlight strong {
  color: var(--red-glow);
  text-shadow: 0 0 12px rgba(255, 42, 42, 0.4);
}

@keyframes livePulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes textFlicker {
  0%,
  92%,
  100% {
    opacity: 1;
  }
  93% {
    opacity: 0.7;
  }
  94% {
    opacity: 1;
  }
  96% {
    opacity: 0.8;
  }
}

@keyframes glitchShift {
  0%,
  94%,
  100% {
    transform: translate(0);
    text-shadow:
      0 0 8px rgba(255, 42, 42, 0.8),
      0 0 24px rgba(227, 30, 36, 0.5);
  }
  95% {
    transform: translate(-2px, 0);
    text-shadow:
      2px 0 rgba(255, 42, 42, 0.6),
      -2px 0 rgba(80, 120, 255, 0.3),
      0 0 24px rgba(227, 30, 36, 0.5);
  }
  96% {
    transform: translate(2px, 0);
  }
}

@keyframes ctaPulse {
  0%,
  100% {
    box-shadow: 0 0 16px rgba(227, 30, 36, 0.35);
  }
  50% {
    box-shadow: 0 0 28px rgba(227, 30, 36, 0.55);
  }
}

@media (min-width: 769px) {
  .top-hud {
    justify-content: space-between;
    flex-wrap: nowrap;
  }
}

@media (max-width: 768px) {
  .presale-card {
    grid-template-columns: 1fr;
  }

  .contribution-zone {
    grid-row: auto;
    grid-column: auto;
    margin-top: 4px;
    padding-top: 20px;
    padding-left: 0;
    border-top: 1px solid rgba(227, 30, 36, 0.2);
    border-left: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .site-shell {
    padding-inline: 12px;
  }

  .card-header,
  .section-heading,
  .progress-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .limits {
    grid-template-columns: 1fr;
  }

  .brand-row {
    flex-direction: column;
  }

  .wallet-button {
    min-height: 52px;
  }
}

@media (max-width: 360px) {
  .hud-pill {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
