/* Tater web — shared styles. Mirrors the React Native app's design system. */

:root {
  --bg: #000000;
  --surface: #141420;
  --surface-elevated: #1a1a2e;
  --bar: #0f0f1a;
  --border: #252535;
  --border-subtle: #1e1e30;
  --text: #f0f0f5;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --accent: #ffd166;
  --accent-secondary: #ffb347;
  --accent-muted: rgba(255, 209, 102, 0.12);
  --sprout: #6ee7b7;
  --sprout-secondary: #34d399;
  --danger: #ef4444;
  --danger-muted: rgba(239, 68, 68, 0.15);
  --warning: #fbbf24;
  --burlap: #a68b6b;
  --burlap-dot: rgba(166, 139, 107, 0.13);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.45);
  --glow-gold: 0 8px 32px rgba(255, 209, 102, 0.28);

  --maxw: 960px;
  --maxw-prose: 720px;
}

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

html, body { background: var(--bg); color: var(--text); }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  letter-spacing: -0.01em;
  position: relative;
  overflow-x: hidden;
}

/* Dot-matrix background — fixed, behind everything */
.dot-matrix-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, var(--burlap-dot) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  background-position: 0 0;
}

/* A soft warm glow behind the hero, drifts slowly */
.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(255, 209, 102, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 30% at 50% 110%, rgba(255, 179, 71, 0.08), transparent 60%);
  animation: aurora-drift 14s ease-in-out infinite;
}
@keyframes aurora-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  50% { transform: translate3d(0, -20px, 0) scale(1.05); opacity: 0.85; }
}

main, header.site, footer.site {
  position: relative;
  z-index: 1;
}

/* ─── Header ──────────────────────────────────── */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand img {
  width: 32px;
  height: 32px;
  display: block;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.brand:hover img { transform: rotate(-12deg) scale(1.08); }
.brand .wordmark {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  color: var(--accent);
}

nav.site {
  display: flex;
  align-items: center;
  gap: 22px;
}
nav.site a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: color 0.15s;
}
nav.site a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -4px;
  height: 1px;
  background: var(--accent);
  transition: right 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
nav.site a:hover { color: var(--text); }
nav.site a:hover::after { right: 0; }
nav.site a.active {
  color: var(--accent);
  text-shadow: 0 0 24px rgba(255, 209, 102, 0.25);
}
nav.site a.active::after { right: 0; }

@media (max-width: 640px) {
  header.site { padding: 14px 18px; }
  nav.site { gap: 14px; }
  nav.site a { font-size: 13px; }
}

/* ─── Layout containers ────────────────────────── */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: 560px; }
.container.prose { max-width: var(--maxw-prose); }

section { padding: 48px 0; }
section.hero { padding: 64px 0 40px; }

@media (max-width: 640px) {
  section { padding: 36px 0; }
  section.hero { padding: 36px 0 24px; }
  .container { padding: 0 18px; }
}

/* ─── Hero ────────────────────────────────────── */
.hero-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
/* Hero entrance — only hides children once JS adds .animating, so the hero
   is visible by default if site.js fails to load. */
.hero-inner.animating > * {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hero-inner.animating.in > * { opacity: 1; transform: translateY(0); }
.hero-inner.animating > *:nth-child(1) { transition-delay: 0.05s; }
.hero-inner.animating > *:nth-child(2) { transition-delay: 0.20s; }
.hero-inner.animating > *:nth-child(3) { transition-delay: 0.32s; }
.hero-inner.animating > *:nth-child(4) { transition-delay: 0.45s; }
.hero-inner.animating > *:nth-child(5) { transition-delay: 0.58s; }
.hero-inner.animating > *:nth-child(6) { transition-delay: 0.70s; }
.hero-inner.animating > *:nth-child(7) { transition-delay: 0.82s; }

.logo-glow {
  position: relative;
  width: 128px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.logo-glow::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.28), transparent 60%);
  filter: blur(10px);
  z-index: 0;
}
.logo-glow img {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}

h1.display {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.15;
  padding-bottom: 0.12em;
  /* Solid gold fallback — used if background-clip:text is unavailable */
  color: var(--accent);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1.display {
    background-image: linear-gradient(180deg, #fff 0%, #ffd166 55%, #ffb347 100%);
    background-size: 100% 220%;
    background-position: 0% 0%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: gold-shimmer 8s ease-in-out infinite;
  }
}
@keyframes gold-shimmer {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 0% 100%; }
}

.tagline {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-secondary);
  max-width: 520px;
  font-weight: 400;
}

/* ─── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, #ffd166, #ffb347);
  background-size: 200% 200%;
  background-position: 0% 0%;
  color: #0a0a0f;
  box-shadow: var(--glow-gold);
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  box-shadow: 0 16px 48px rgba(255, 209, 102, 0.5);
  background-position: 100% 100%;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
.btn-primary:hover::after {
  animation: btn-sheen 0.9s ease-out;
}
@keyframes btn-sheen {
  0% { left: -75%; }
  100% { left: 125%; }
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-elevated); border-color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border); }

.btn-disabled {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-tertiary);
  border: 1px dashed var(--border);
  cursor: not-allowed;
}
.btn-disabled:active { transform: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

/* ─── Features (bare, no tiles) ────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
  margin-top: 16px;
}
@media (max-width: 720px) {
  .features { grid-template-columns: 1fr; gap: 32px; }
}
.feature { text-align: left; }
.feature.animating {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.feature.animating.in { opacity: 1; transform: translateY(0); }
.feature.animating:nth-child(2) { transition-delay: 0.08s; }
.feature.animating:nth-child(3) { transition-delay: 0.16s; }
.feature .feature-icon {
  display: inline-block;
  font-size: 28px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 16px rgba(255, 209, 102, 0.25));
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.3s;
}
.feature:hover .feature-icon {
  transform: translateY(-4px) rotate(-8deg) scale(1.08);
  filter: drop-shadow(0 0 22px rgba(255, 209, 102, 0.55));
}
.feature h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
  color: var(--text);
}
.feature p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ─── QR (bare) ───────────────────────────────── */
.qr-block {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 32px auto 0;
}
.qr-block .qr {
  width: 124px;
  height: 124px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 0 rgba(255, 209, 102, 0));
  animation: qr-glow 4s ease-in-out infinite;
}
@keyframes qr-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.15)); }
  50% { filter: drop-shadow(0 0 22px rgba(255, 209, 102, 0.45)); }
}
.qr-block .qr svg { width: 100%; height: 100%; display: block; }
.qr-block .qr-text { text-align: left; max-width: 220px; }
.qr-block .qr-text .eyebrow { padding: 0; background: transparent; border: none; display: inline-block; margin-bottom: 6px; }
.qr-block .qr-text p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
@media (max-width: 520px) {
  .qr-block { flex-direction: column; text-align: center; gap: 14px; }
  .qr-block .qr-text { text-align: center; }
}

/* ─── Closer (bare centered) ───────────────────── */
section.closer { text-align: center; }
section.closer .eyebrow { display: inline-block; margin-bottom: 12px; }
section.closer h2 {
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
section.closer p { color: var(--text-secondary); font-size: 15px; }
section.closer a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 209, 102, 0.3);
}
section.closer a:hover { border-bottom-color: var(--accent); }

/* ─── Magic link page ──────────────────────────── */
.magic-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}
.magic-card {
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.pulse-logo {
  position: relative;
  width: 136px;
  height: 136px;
  margin: 0 auto 18px;
}
.pulse-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  animation: float 3.2s ease-in-out infinite;
}
.pulse-logo .ring {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 2px solid rgba(255, 209, 102, 0.5);
  animation: pulse-ring 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  z-index: 1;
}
.pulse-logo .ring.r2 { animation-delay: 0.6s; }
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}

.potato-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}
.subtitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.fomo-text {
  font-size: 14px;
  font-weight: 600;
  color: #ffb347;
  margin-bottom: 18px;
}
.fomo-text .urgent { color: var(--danger); }

.stats-line {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 15px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.stats-line strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}
.stats-line strong.gold { color: var(--accent); }
.stats-line .dot { color: var(--text-tertiary); }

.founder {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 22px;
}
.founder strong { color: var(--text-secondary); }

.error-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--danger);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.error-msg {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 22px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 600;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ─── Prose (legal, about) ─────────────────────── */
.prose {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}
.prose .effective-date {
  color: var(--text-tertiary);
  font-size: 13px;
  margin: 4px 0 28px;
  font-weight: 500;
}
.prose h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 4px;
  color: var(--text);
}
.prose h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-top: 40px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--accent);
}
.prose h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 22px;
  margin-bottom: 8px;
  color: var(--text);
}
.prose p { margin-bottom: 14px; color: var(--text-secondary); }
.prose ul { padding-left: 22px; margin-bottom: 14px; }
.prose li { margin-bottom: 6px; color: var(--text-secondary); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 209, 102, 0.3);
  transition: border-color 0.15s;
}
.prose a:hover { border-bottom-color: var(--accent); }

/* ─── About — numbered steps (bare) ────────────── */
.steps {
  list-style: none;
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  counter-reset: step;
}
.steps li {
  display: grid;
  grid-template-columns: 64px 1fr;
  column-gap: 22px;
  row-gap: 4px;
  align-items: start;
  position: relative;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
}
.steps li.animating {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.steps li.animating.in { opacity: 1; transform: translateY(0); }
.steps li.animating:nth-child(2) { transition-delay: 0.10s; }
.steps li.animating:nth-child(3) { transition-delay: 0.20s; }
.steps li:last-child { border-bottom: none; padding-bottom: 0; }
.steps .num {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 40px;
  font-weight: 200;
  color: var(--accent);
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.steps li:hover .num { transform: translateY(-2px) scale(1.05); }
.steps h3 {
  grid-column: 2;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
  color: var(--text);
}
.steps p {
  grid-column: 2;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 56ch;
}
@media (max-width: 520px) {
  .steps li { grid-template-columns: 48px 1fr; column-gap: 14px; }
  .steps .num { font-size: 30px; }
}

/* ─── About — manifesto (bare) ─────────────────── */
.manifesto { text-align: center; }
.manifesto .eyebrow { margin-bottom: 14px; }
.manifesto h2 {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 800;
  letter-spacing: -0.6px;
  margin-bottom: 14px;
  color: var(--text);
}
.manifesto p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 540px;
  margin: 0 auto 24px;
}

/* ─── Feedback form (bare, no card) ────────────── */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.input, .textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 2px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:focus, .textarea:focus { border-bottom-color: var(--accent); }
.textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.form-hint {
  margin-top: 18px;
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
}
.form-hint a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 209, 102, 0.3);
}
.form-hint a:hover { border-bottom-color: var(--accent); }

/* ─── Footer ──────────────────────────────────── */
footer.site {
  border-top: 1px solid var(--border-subtle);
  padding: 32px 24px;
  margin-top: 64px;
  text-align: center;
}
footer.site .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-bottom: 14px;
}
footer.site a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
footer.site a:hover { color: var(--accent); }
footer.site .meta {
  color: var(--text-tertiary);
  font-size: 12px;
}
footer.site .meta strong { color: var(--text-secondary); font-weight: 600; }

/* Respect users who don't want motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-inner.animating > *,
  .feature.animating,
  .steps li.animating { opacity: 1 !important; transform: none !important; }
}
