/* Landing page. Builds on the tokens and components in style.css. */

:root {
  /* The app's sky blue palette (style.css), plus the sky blue swatch itself */
  --sky: #9ccbea;
  --glass: color-mix(in srgb, var(--surface) 68%, transparent);
  --glass-border: color-mix(in srgb, var(--surface) 55%, var(--border));
  --float-shadow: rgba(15, 40, 65, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky: #7fbde6;
    --glass: color-mix(in srgb, var(--surface) 58%, transparent);
    --glass-border: rgba(255, 255, 255, 0.09);
    --float-shadow: rgba(0, 0, 0, 0.55);
  }
}

html { scroll-behavior: smooth; }
body.landing { overflow-x: hidden; }

/* ---------- Top bar: transparent over the hero, solid once scrolled ---------- */

.landing-bar {
  position: fixed; left: 0; right: 0;
  background: transparent; border-bottom: 1px solid transparent; box-shadow: none; color: var(--text);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  transition: background-color 0.25s, border-color 0.25s, backdrop-filter 0.25s;
}
/* The app's header is a dark bar with white text; this one sits over the
   light hero, so it uses the page's text colours. */
.landing-bar .brand { color: var(--text); }
.landing-bar .btn-ghost { color: var(--text); }
.landing-bar :focus-visible { box-shadow: var(--ring); }
.landing-bar.scrolled {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border-bottom-color: var(--border);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.landing-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  color: var(--text); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  padding: 8px 12px; border-radius: 9px; opacity: 0.8; transition: opacity 0.15s, background-color 0.15s;
}
.nav-link:hover { opacity: 1; background: color-mix(in srgb, var(--surface) 50%, transparent); }
.landing-nav .btn { text-decoration: none; }
.landing-nav .btn-ghost { background: var(--glass); border-color: var(--glass-border); }

/* ---------- Buttons only used here ---------- */

.btn { text-decoration: none; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 1rem; border-radius: 13px; }
.btn-primary.btn-lg { box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary.btn-lg .icon { transition: transform 0.2s; }
.btn-primary.btn-lg:hover .icon { transform: translateX(3px); }
.btn-glass {
  background: var(--glass); color: var(--text); border-color: var(--glass-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.btn-glass:hover { background: color-mix(in srgb, var(--surface) 85%, transparent); }
.btn-light { background: #fff; color: #1d5c7c; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4); }
.btn-light:hover { background: #f2f8fc; }

/* ---------- Hero ---------- */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100vh, 900px);
  display: flex; align-items: center;
  padding: 120px 0 96px;
}
.hero-canvas {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; display: block;
  /* Shown if WebGL isn't available */
  background:
    radial-gradient(40% 50% at 70% 40%, color-mix(in srgb, var(--accent) 35%, transparent), transparent),
    radial-gradient(40% 50% at 30% 70%, color-mix(in srgb, var(--sky) 40%, transparent), transparent),
    var(--bg);
}
/* Keeps the headline readable and fades the shader into the page below */
.hero-scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 70% at 18% 50%, color-mix(in srgb, var(--bg) 62%, transparent), transparent 70%),
    linear-gradient(to bottom, transparent 70%, var(--bg));
}

.hero-inner {
  display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 48px;
  width: 100%;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 0.82rem; font-weight: 600;
}
.eyebrow-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 6%, transparent); } }

.hero-title {
  margin: 20px 0 18px;
  font-size: clamp(2.5rem, 5.6vw, 4.4rem); line-height: 1.02; font-weight: 800; letter-spacing: -0.045em;
  text-wrap: balance;
}
.shimmer {
  background: linear-gradient(100deg, var(--accent) 0%, var(--sky) 35%, #c9a35c 60%, var(--accent) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 8s linear infinite;
}
@keyframes shimmer { to { background-position: -250% 0; } }

.hero-sub { font-size: 1.15rem; line-height: 1.6; color: var(--muted); max-width: 33em; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-hint { margin-top: 22px; font-size: 0.85rem; color: var(--muted); opacity: 0.8; }

/* ---------- Hero product preview (tilts with the mouse) ---------- */

.hero-preview {
  position: relative;
  --rx: 0deg; --ry: 0deg;
  transform: perspective(1400px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.preview-card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 22px;
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 40px 80px -30px var(--float-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  padding: 18px;
}
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.preview-stat {
  background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--border);
  border-radius: 13px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.preview-stat span { font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.preview-stat strong { font-size: 1.35rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.preview-stat.ready { background: var(--ready-soft); border-color: var(--ready-border); }
.preview-stat.ready strong { color: var(--ready-text); }
.preview-stat.gain strong { color: var(--gain); }

.preview-series { display: flex; align-items: center; gap: 8px; margin: 2px 2px 10px; font-size: 0.92rem; }
.preview-line { flex: 1; height: 1px; background: var(--border-strong); }
.preview-dolls { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 10px; align-items: stretch; }
.preview-doll {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px; font-size: 0.82rem;
}
.preview-doll.ready { background: var(--ready-soft); border-color: var(--ready-border); box-shadow: inset 3px 0 0 var(--ready); }
.preview-doll-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.preview-doll-head b { font-size: 0.92rem; }
.preview-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.preview-pills .pill { font-size: 0.64rem; padding: 3px 6px; }
.preview-doll-meta { margin-top: -6px; font-size: 0.72rem; color: var(--muted); }
.preview-doll .doll-accessories { margin-top: 0; grid-template-columns: 1fr 1fr; gap: 8px; }
.preview-doll .acc-list li { font-size: 0.72rem; }
.preview-tiles { display: flex; gap: 6px; }
.preview-tile {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
  background: var(--surface-2); border-radius: 9px; padding: 6px 8px;
}
.preview-doll.ready .preview-tile { background: var(--ready-tile); }
.preview-tile span { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.preview-tile b { font-size: 0.82rem; }
.preview-tile small { font-size: 0.66rem; color: var(--muted); }
.preview-action {
  margin-top: auto; text-align: center;
  font-size: 0.75rem; font-weight: 600; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
}

.float-chip {
  position: absolute; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 14px; font-size: 0.82rem; font-weight: 600; white-space: nowrap;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px -18px var(--float-shadow);
  transform: translateZ(60px);
  animation: bob 6s ease-in-out infinite;
}
.chip-a { top: -22px; right: 18px; }
.chip-b { bottom: -20px; left: -24px; animation-delay: -3s; }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; }
.chip-dot.ready { background: var(--ready); box-shadow: 0 0 12px var(--ready); }
.chip-dot.gain { background: var(--gain); box-shadow: 0 0 12px var(--gain); }
@keyframes bob { 50% { translate: 0 -8px; } }

/* ---------- Sections ---------- */

.section { padding: 96px 24px 24px; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-kicker {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.12; font-weight: 800; letter-spacing: -0.035em; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s, border-color 0.25s;
}
.feature-card::after {
  /* Soft spotlight that follows the cursor (position set in landing.js) */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.feature-card:hover::after { opacity: 1; }
.feature-card h3 { margin: 18px 0 8px; font-size: 1.05rem; letter-spacing: -0.01em; }
.feature-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.feature-icon .icon { width: 22px; height: 22px; }
.feature-icon.accent { background: var(--accent-soft); color: var(--accent); }
.feature-icon.secondary { background: var(--secondary-soft); color: var(--secondary); }
.feature-icon.gain { background: var(--gain-soft); color: var(--gain); }
.feature-icon.ready { background: var(--ready-chip); color: var(--ready-text); }

.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step;
}
.step {
  position: relative; padding: 28px 24px 24px; border-radius: 18px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 40%, var(--bg)));
  border: 1px solid var(--border);
}
.step-num {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #9ccbea, #2b7ba4); color: #fff; font-weight: 700;
  box-shadow: 0 8px 20px -6px rgba(43, 123, 164, 0.55);
}
.step h3 { margin: 18px 0 6px; font-size: 1.05rem; }
.step p { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }

.cta-band {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 96px 0 64px; padding: 48px;
  border-radius: 26px; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(120deg, #1d5c7c 0%, #2b7ba4 55%, #3a8fc0 100%);
  box-shadow: 0 30px 70px -30px rgba(29, 92, 124, 0.65);
}
.cta-band::before, .cta-band::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(50px); opacity: 0.6;
}
.cta-band::before { width: 340px; height: 340px; background: #9ccbea; top: -160px; right: 10%; }
.cta-band::after { width: 280px; height: 280px; background: #d4b77c; bottom: -180px; left: 5%; opacity: 0.35; }
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.03em; }
.cta-band p { margin-top: 6px; opacity: 0.85; }

.landing-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px;
  padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--border);
}
.brand-sm { font-size: 0.95rem; }
.landing-credit { margin: 0; font-size: 0.8rem; color: var(--muted); }
.landing-credit a { color: inherit; }
.brand-sm .logo { width: 28px; height: 28px; border-radius: 8px; }
.brand-sm .logo svg { width: 16px; height: 16px; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; gap: 64px; }
  .hero-copy { text-align: center; }
  .hero-sub { margin: 0 auto; }
  .hero-ctas { justify-content: center; }
  .hero-preview { max-width: 560px; margin: 0 auto; width: 100%; }
  .hero-scrim {
    background:
      radial-gradient(80% 50% at 50% 30%, color-mix(in srgb, var(--bg) 60%, transparent), transparent 75%),
      linear-gradient(to bottom, transparent 75%, var(--bg));
  }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-link { display: none; }
  .landing-nav .btn-ghost { display: none; }
  .hero { padding: 104px 0 72px; min-height: 0; }
  .hero-hint { display: none; }
  .hero-sub { font-size: 1.02rem; }
  .btn-lg { height: 48px; padding: 0 20px; font-size: 0.95rem; }
  .preview-card { padding: 12px; }
  .preview-stats { gap: 6px; }
  .preview-stat { padding: 10px; }
  .preview-stat strong { font-size: 1.05rem; }
  .preview-dolls { grid-template-columns: 1fr; }
  .preview-doll.ready { display: none; }
  .chip-b { left: 8px; }
  .chip-a { right: 8px; }
  .section { padding: 72px 16px 16px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .cta-band { padding: 32px 24px; margin-top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .shimmer, .eyebrow-dot, .float-chip { animation: none; }
  .hero-preview { transition: none; }
  html { scroll-behavior: auto; }
}
