/* ================================================================
   Kardomom Landing Page — Static CSS
   Design tokens borrowed from the main SolidJS frontend
   ================================================================ */

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

/* ── Design tokens ── */
:root {
  /* Colors — dark mode (default, only mode for landing) */
  --surface-0: #0a0d0b;
  --surface-1: #111613;
  --surface-2: #191f1b;
  --surface-3: #212923;
  --border: #2a332c;
  --border-subtle: #1e2620;
  --text-primary: #e4ece6;
  --text-secondary: #8a9b8e;
  --text-muted: #566259;

  --cardamom: #5B9A6B;
  --cardamom-light: #72B085;
  --cardamom-dim: #478556;
  --cardamom-glow: oklch(0.60 0.12 155 / 0.15);
  --seed: #8B7355;

  --bg-glow-1: oklch(0.25 0.06 155 / 0.20);
  --bg-glow-2: oklch(0.18 0.04 155 / 0.12);
  --orb-color: oklch(0.30 0.08 155 / 0.12);
  --grain-opacity: 0.025;

  /* Typography */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--surface-0);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--bg-glow-1), transparent),
    radial-gradient(ellipse 50% 40% at 90% 80%, var(--bg-glow-2), transparent);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── Ambient green orb ── */
body::after {
  content: "";
  position: fixed;
  top: 15%;
  left: 25%;
  width: 600px;
  height: 600px;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orb-color), transparent 70%);
  filter: blur(100px);
  animation: orb-drift 25s ease-in-out infinite alternate;
}

@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(80px, -50px) scale(1.08); }
  66%  { transform: translate(-40px, 40px) scale(0.94); }
  100% { transform: translate(20px, -20px) scale(1.02); }
}

/* ── Selection ── */
::selection {
  background-color: oklch(0.60 0.12 155 / 0.3);
  color: var(--text-primary);
}

/* ── Container ── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ================================================================
   FLOATING PODS — Ambient decoration
   ================================================================ */
.floating-pods {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.pod {
  position: absolute;
  color: var(--cardamom);
}

.pod-1 {
  top: 8%;
  left: 12%;
  width: 22px;
  height: 48px;
  opacity: 0.04;
  transform: rotate(-15deg);
  animation: drift-a 34s ease-in-out -4s infinite alternate;
}

.pod-2 {
  top: 18%;
  left: 78%;
  width: 18px;
  height: 40px;
  opacity: 0.035;
  transform: rotate(25deg);
  animation: drift-b 28s ease-in-out -8s infinite alternate;
}

.pod-3 {
  top: 42%;
  left: 5%;
  width: 20px;
  height: 44px;
  opacity: 0.04;
  transform: rotate(-40deg);
  animation: drift-c 22s ease-in-out -2s infinite alternate;
}

.pod-4 {
  top: 55%;
  left: 88%;
  width: 18px;
  height: 40px;
  opacity: 0.035;
  transform: rotate(10deg);
  animation: drift-a 36s ease-in-out -12s infinite alternate;
}

.pod-5 {
  top: 75%;
  left: 35%;
  width: 16px;
  height: 35px;
  opacity: 0.03;
  transform: rotate(55deg);
  animation: drift-b 26s ease-in-out -6s infinite alternate;
}

.pod-6 {
  top: 88%;
  left: 65%;
  width: 20px;
  height: 44px;
  opacity: 0.04;
  transform: rotate(-30deg);
  animation: drift-c 38s ease-in-out -20s infinite alternate;
}

@keyframes drift-a {
  0%   { transform: translate(0, 0) rotate(-15deg); }
  25%  { transform: translate(40px, -30px) rotate(-3deg); }
  50%  { transform: translate(-20px, -60px) rotate(-23deg); }
  75%  { transform: translate(30px, -20px) rotate(0deg); }
  100% { transform: translate(-10px, -50px) rotate(-10deg); }
}

@keyframes drift-b {
  0%   { transform: translate(0, 0) rotate(25deg); }
  25%  { transform: translate(-35px, 25px) rotate(15deg); }
  50%  { transform: translate(15px, 50px) rotate(33deg); }
  75%  { transform: translate(-25px, 15px) rotate(11deg); }
  100% { transform: translate(20px, 40px) rotate(31deg); }
}

@keyframes drift-c {
  0%   { transform: translate(0, 0) rotate(-40deg); }
  33%  { transform: translate(50px, 20px) rotate(-22deg); }
  66%  { transform: translate(25px, -35px) rotate(-46deg); }
  100% { transform: translate(60px, -10px) rotate(-28deg); }
}

/* ================================================================
   HERO SECTION
   ================================================================ */
.hero {
  position: relative;
  z-index: 1;
  padding: 7rem 0 5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .hero {
    padding: 10rem 0 6rem;
  }
}

.overline {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  max-width: 720px;
  margin: 0 auto;
}

/* Shimmer gradient text — matches main app */
.text-shimmer {
  background: linear-gradient(135deg, #3D7A54, #5B9A6B, #72B085, #5B9A6B);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 1.5rem auto 0;
}

/* ================================================================
   FLOW DEMO — Visual mockup of URL -> Card recommendation
   ================================================================ */
.flow-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 3rem auto 0;
  max-width: 700px;
  flex-wrap: wrap;
}

@media (max-width: 639px) {
  .flow-demo {
    flex-direction: column;
    gap: 0.75rem;
  }
  .flow-arrow {
    transform: rotate(90deg);
  }
}

.flow-step {
  flex: 1;
  min-width: 240px;
  max-width: 320px;
}

.flow-step-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.flow-step-content {
  background: linear-gradient(145deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.flow-step--url .flow-step-content {
  text-align: left;
}

.flow-url {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.flow-arrow {
  color: var(--cardamom);
  flex-shrink: 0;
  opacity: 0.6;
}

.flow-step--card .flow-step-content {
  border-color: oklch(0.60 0.12 155 / 0.4);
  box-shadow: 0 0 32px oklch(0.60 0.12 155 / 0.08), inset 0 1px 0 oklch(1 0 0 / 0.03);
}

.flow-card-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
}

.flow-card-rank {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: oklch(0.60 0.12 155 / 0.2);
  color: var(--cardamom);
  border: 1px solid oklch(0.60 0.12 155 / 0.4);
  font-size: 0.75rem;
  font-weight: 700;
}

.flow-card-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.flow-card-reward {
  font-size: 0.75rem;
  color: var(--cardamom-light);
  margin-top: 0.125rem;
}

/* ================================================================
   CTA BUTTONS
   ================================================================ */
.cta-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.btn-primary {
  background: var(--cardamom);
  color: #fff;
  box-shadow: 0 0 24px oklch(0.60 0.12 155 / 0.15);
}

.btn-primary:hover {
  background: var(--cardamom-light);
  box-shadow: 0 0 32px oklch(0.60 0.12 155 / 0.25);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--cardamom);
  color: var(--cardamom-light);
  transform: translateY(-1px);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* ================================================================
   FEATURES SECTION
   ================================================================ */
.features {
  position: relative;
  z-index: 1;
  padding: 5rem 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .feature-card {
    grid-column: span 3;
  }
  /* Center the 5th card on tablet (2-col) */
  .feature-card:nth-child(5) {
    grid-column: 2 / 5;
  }
}

@media (min-width: 960px) {
  .feature-card {
    grid-column: span 2;
  }
  /* Bottom row: 2 cards centered under the top 3 */
  .feature-card:nth-child(4) {
    grid-column: 2 / 4;
  }
  .feature-card:nth-child(5) {
    grid-column: 4 / 6;
  }
}

.feature-card {
  background: linear-gradient(145deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  border-color: oklch(0.60 0.12 155 / 0.3);
  box-shadow: 0 0 24px oklch(0.60 0.12 155 / 0.06);
  transform: translateY(-2px);
}

.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  color: var(--cardamom);
}

.feature-icon svg {
  width: 100%;
  height: 100%;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ================================================================
   URL TRICK SECTION
   ================================================================ */
.url-trick {
  position: relative;
  z-index: 1;
  padding: 3rem 0 5rem;
}

.url-trick-card {
  background: linear-gradient(145deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.url-trick-card:hover {
  border-color: oklch(0.60 0.12 155 / 0.3);
}

.url-trick-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.url-trick-desc code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  color: var(--cardamom-light);
  background: oklch(0.60 0.12 155 / 0.1);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.url-trick-demo {
  display: inline-block;
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.875rem 1.5rem;
  max-width: 100%;
  overflow-x: auto;
}

.url-trick-example {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.85rem;
  white-space: nowrap;
}

.url-trick-prefix {
  color: var(--cardamom-light);
  font-weight: 600;
}

.url-trick-merchant {
  color: var(--text-muted);
}

/* ================================================================
   EARLY ACCESS SECTION
   ================================================================ */
.early-access {
  position: relative;
  z-index: 1;
  padding: 2rem 0 4rem;
}

.early-access-card {
  background: linear-gradient(145deg, var(--surface-2), var(--surface-3));
  border: 1px solid oklch(0.60 0.12 155 / 0.4);
  border-radius: 24px;
  padding: 3rem 1.5rem;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
  box-shadow:
    0 0 80px oklch(0.60 0.12 155 / 0.1),
    0 0 0 1px oklch(0.60 0.12 155 / 0.08),
    inset 0 1px 0 oklch(1 0 0 / 0.05);
}

@media (min-width: 640px) {
  .early-access-card {
    padding: 3.5rem 2.5rem;
  }
}

.early-access-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--cardamom);
  background: oklch(0.60 0.12 155 / 0.1);
  border: 1px solid oklch(0.60 0.12 155 / 0.25);
  border-radius: 100px;
  padding: 0.35rem 1rem;
  margin-bottom: 1.5rem;
}

.early-access-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.early-access-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 440px;
  margin: 0 auto 2rem;
}

.early-access-perks {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  align-items: center;
  margin-bottom: 2rem;
}

.perk {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.perk-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  max-width: 16px;
  color: var(--cardamom);
  flex-shrink: 0;
}

.btn-lg {
  padding: 0.875rem 2.25rem;
  font-size: 0.95rem;
}

.early-access-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--cardamom-light);
}

.footer-icon {
  width: 16px;
  height: 16px;
}

/* ================================================================
   ENTRANCE ANIMATIONS
   ================================================================ */

/* Hero elements: animate immediately on page load with staggered delays */
.hero-title,
.hero-subtitle,
.overline,
.flow-demo,
.cta-group {
  opacity: 0;
  transform: translateY(20px);
  animation: fade-in-up 0.7s ease forwards;
}

.overline        { animation-delay: 0.05s; }
.hero-title      { animation-delay: 0.15s; }
.hero-subtitle   { animation-delay: 0.3s; }
.flow-demo       { animation-delay: 0.45s; }
.cta-group       { animation-delay: 0.55s; }

/* Below-the-fold elements: hidden until intersection observer triggers */
.feature-card,
.url-trick-card,
.early-access-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-card.is-visible,
.url-trick-card.is-visible,
.early-access-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger feature cards when they become visible */
.feature-card:nth-child(2) { transition-delay: 0.08s; }
.feature-card:nth-child(3) { transition-delay: 0.16s; }
.feature-card:nth-child(4) { transition-delay: 0.24s; }
.feature-card:nth-child(5) { transition-delay: 0.32s; }

@keyframes fade-in-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fallback for users with reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-title,
  .hero-subtitle,
  .overline,
  .flow-demo,
  .cta-group {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .feature-card,
  .url-trick-card,
  .early-access-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ================================================================
   MOBILE REFINEMENTS
   ================================================================ */
@media (max-width: 639px) {
  .hero {
    padding: 5rem 0 3rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .flow-step {
    min-width: 0;
    max-width: 100%;
  }

  .url-trick-card {
    padding: 2rem 1.25rem;
  }

  .url-trick-example {
    font-size: 0.75rem;
  }

  .url-trick-demo {
    padding: 0.75rem 1rem;
  }

  .early-access-title {
    font-size: 1.4rem;
  }

  .early-access-desc {
    font-size: 0.9rem;
  }

  .footer-inner {
    justify-content: center;
  }
}

/* ================================================================
   SCROLLBAR (dark mode)
   ================================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--surface-0); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
