/* ============================================================
   AI On-Chain Whale Radar — Landing Page Stylesheet
   Zero-dependency · Mobile-first · iOS 18 / Mobile WebKit tuned
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Palette — Stripe / Apple clean light mode */
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #94A3B8;

  --primary: #2563EB;
  --primary-strong: #1D4ED8;
  --primary-soft: #EFF6FF;

  --green: #10B981;
  --green-deep: #059669;
  --green-soft: #ECFDF5;

  --term-bg: #0F172A;
  --term-text: #CBD5E1;
  --term-time: #475569;
  --term-ok: #34D399;

  /* Shape & depth */
  --radius: 16px;
  --radius-sm: 14px;
  --radius-xs: 12px;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.05);

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.9, 0.32, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  min-height: 100%;
}

/* Full-screen lock for mobile Safari — 100dvh with vh fallback */
body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
  /* Subtle fintech dot texture */
  background-image: radial-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* Soft ambient light blobs (decorative, GPU-cheap) */
.bg-decor {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.bg-decor--blue {
  top: -120px;
  right: -140px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent 65%);
}
.bg-decor--green {
  bottom: -140px;
  left: -150px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.07), transparent 65%);
}

[hidden] {
  display: none !important;
}

button {
  font-family: inherit;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- Page Shell ---------- */
.page {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 20px
    calc(28px + env(safe-area-inset-bottom));
}

/* ---------- iOS Trust Badge ---------- */
.trust-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin: 0 auto;
  padding: 7px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.trust-badge svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
  flex-shrink: 0;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: livePulse 2s ease-in-out infinite;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  margin-top: 26px;
}
.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  background: var(--primary);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}
.logo-mark svg {
  width: 30px;
  height: 30px;
  color: #FFFFFF;
}
.hero h1 {
  margin-top: 16px;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero-sub {
  margin-top: 7px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
}
.hero-note {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------- Cards & Steps ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px 18px;
}
.step {
  margin-top: 22px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.step--exit {
  opacity: 0;
  transform: translateY(-8px);
}
.step--active {
  animation: fadeUp 0.45s var(--ease-out) both;
}

/* ---------- Fields ---------- */
.field + .field {
  margin-top: 20px;
}
.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.field-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.field-hint {
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- Network Chips ---------- */
.chip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease;
  touch-action: manipulation;
}
.chip svg {
  width: 22px;
  height: 22px;
  color: var(--ink-3);
  transition: color 0.15s ease;
}
.chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.chip-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.chip.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.chip.is-selected svg {
  color: var(--primary);
}
.chip-tick {
  position: absolute;
  top: -7px;
  right: -7px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  background: var(--primary);
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  color: #FFFFFF;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.chip-tick svg {
  width: 10px;
  height: 10px;
  color: #FFFFFF;
}
.chip.is-selected .chip-tick {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Threshold Options ---------- */
.opt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
}
.opt-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: #F1F5F9;
  border-radius: 10px;
  color: var(--ink-2);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.opt-icon svg {
  width: 17px;
  height: 17px;
}
.opt-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.opt-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}
.opt-desc {
  font-size: 12px;
  color: var(--ink-3);
}
.opt-radio {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.15s ease;
}
.opt-radio::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s var(--ease-out);
}
.opt.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.opt.is-selected .opt-icon {
  background: var(--primary-soft);
  color: var(--primary);
}
.opt.is-selected .opt-radio {
  border-color: var(--primary);
}
.opt.is-selected .opt-radio::after {
  transform: translate(-50%, -50%) scale(1);
}

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.btn--primary {
  margin-top: 22px;
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.btn--primary:active {
  background: var(--primary-strong);
  transform: translateY(1px);
}
.btn--pulse {
  animation: ctaPulse 2.2s ease-in-out infinite;
}

.micro-trust {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- Step 2: Radar Scanner ---------- */
.scan-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.radar {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 20px auto 16px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: radial-gradient(circle at center, #EFF6FF 0%, #FFFFFF 72%);
}
.radar-ring {
  position: absolute;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 50%;
}
.radar-ring--1 {
  inset: 17%;
}
.radar-ring--2 {
  inset: 34%;
}
.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: conic-gradient(
    from 0deg,
    rgba(37, 99, 235, 0.32),
    rgba(37, 99, 235, 0.04) 70deg,
    transparent 100deg
  );
  animation: spin 2.6s linear infinite;
}
.radar-blip {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
  opacity: 0;
  animation: blip 2.8s ease-in-out infinite;
}
.radar-blip--1 {
  top: 26%;
  left: 63%;
}
.radar-blip--2 {
  top: 58%;
  left: 30%;
  animation-delay: 0.9s;
}
.radar-blip--3 {
  top: 68%;
  left: 66%;
  animation-delay: 1.7s;
}
.radar-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.radar-core svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

/* Progress */
.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-track {
  flex: 1;
  height: 8px;
  background: #E8EDF3;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2563EB, #3B82F6);
  border-radius: 999px;
}
.progress-pct {
  min-width: 46px;
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

/* Terminal log */
.terminal {
  margin-top: 16px;
  background: var(--term-bg);
  border-radius: var(--radius-xs);
  padding: 12px 14px 14px;
  overflow: hidden;
}
.terminal-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 9px;
  margin-bottom: 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.term-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.term-dot--r {
  background: #F87171;
}
.term-dot--y {
  background: #FBBF24;
}
.term-dot--g {
  background: #34D399;
}
.terminal-title {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #64748B;
  letter-spacing: 0.03em;
}
.terminal-body {
  height: 148px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
}
.log-line {
  display: flex;
  gap: 8px;
  animation: logIn 0.3s ease both;
}
.log-time {
  flex-shrink: 0;
  color: var(--term-time);
}
.log-text {
  color: var(--term-text);
  word-break: break-word;
}
.log-line--ok .log-text {
  color: var(--term-ok);
  font-weight: 600;
}

/* ---------- Step 3: Whale Alert ---------- */
.alert-badge-row {
  text-align: center;
}
.alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  background: var(--green-soft);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--green-deep);
  animation: badgeGlow 2s ease-in-out infinite;
}
.alert-meta {
  margin-top: 10px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.metric-hero {
  text-align: center;
  padding: 14px 0 4px;
}
.metric-hero-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.metric-hero-value {
  display: block;
  margin-top: 5px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
}
.metric-hero-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-3);
}

.confidence {
  margin-top: 14px;
  padding: 13px 14px;
  background: #F8FAFC;
  border: 1px solid #EEF2F7;
  border-radius: var(--radius-xs);
}
.confidence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.confidence-pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.confidence-track {
  margin-top: 9px;
  height: 8px;
  background: #E8EDF3;
  border-radius: 999px;
  overflow: hidden;
}
.confidence-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #10B981, #34D399);
  border-radius: 999px;
  transition: width 1.4s var(--ease-out);
}
.confidence-sub {
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.stat-list {
  list-style: none;
  margin-top: 14px;
  border-top: 1px solid #F1F5F9;
}
.stat-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 13px;
}
.stat-list li > span {
  color: var(--ink-2);
}
.stat-list strong {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  text-align: right;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 26px;
  text-align: center;
}
.footer p {
  font-size: 12px;
  color: var(--ink-3);
}
.footer .footer-note {
  margin-top: 4px;
  font-size: 11px;
  color: #A6B2C2;
}

.noscript-note {
  margin-top: 20px;
  padding: 12px 16px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: #92400E;
  text-align: center;
}

/* ---------- Hover (pointer devices) ---------- */
@media (hover: hover) {
  .chip:hover,
  .opt:hover {
    border-color: var(--border-strong);
  }
  .btn--primary:hover {
    background: var(--primary-strong);
  }
}

/* ---------- Keyframes ---------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes blip {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.4);
  }
  12% {
    opacity: 1;
    transform: scale(1);
  }
  45% {
    opacity: 0.9;
  }
  70% {
    opacity: 0;
  }
}
@keyframes livePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}
@keyframes badgeGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(16, 185, 129, 0);
  }
}
@keyframes ctaPulse {
  0%,
  100% {
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28),
      0 0 0 0 rgba(37, 99, 235, 0.35);
  }
  50% {
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28),
      0 0 0 12px rgba(37, 99, 235, 0);
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes logIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .radar-sweep,
  .radar-blip,
  .live-dot,
  .alert-badge,
  .btn--pulse,
  .step--active,
  .log-line {
    animation: none;
  }
  .step,
  .confidence-fill,
  .opt-radio::after {
    transition: none;
  }
}
