/* ─────────────────────────────────────────────────────────────────
 * Landing page styles
 *
 * Lives in a dedicated file because /index.html is the highest-traffic
 * conversion surface in the app and the new section system (hero
 * device mock-up, benefits row, template showcase, mini-FAQ, scroll
 * reveal, parallax) doubled the original inline stylesheet. Static
 * middleware already serves /css/* with long cache headers, so this
 * file gets the same treatment as dashboard.css / marketplace.css.
 *
 * Theme tokens (`:root` and `[data-theme="light"]`) intentionally
 * stay inline in /index.html — drift between pages would be worse
 * than a few extra KB.
 * ────────────────────────────────────────────────────────────────
 */

/* ── Hero — two-column grid + animated device mock-up ── */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 90px 40px 70px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
  text-align: left;
  --scroll-y: 0px;
}
.hero-copy { max-width: 560px; }
.hero h1 .line2 {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { text-align: left; max-width: none; margin: 0 0 36px; }
.hero-actions { justify-content: flex-start; }

/* Background grid used by the parallax layer (pseudo-element so the
 * parallax transform does NOT affect normal children — scroll-revealed
 * cards stay anchored to the page flow). */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center center;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  opacity: 0.45;
  transform: translate3d(0, calc(var(--scroll-y) * -0.05), 0);
  transform-origin: center top;
  pointer-events: none;
  z-index: -1;
}

/* ── Device mock-up — portrait phone with animated status ── */
.device-mockup {
  width: 280px;
  height: 560px;
  margin: 0 auto;
  background: linear-gradient(145deg, #161d28 0%, #111820 100%);
  border-radius: 36px;
  border: 6px solid #131320;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 30px 60px rgba(0, 0, 0, 0.4),
    0 0 80px rgba(0, 212, 255, 0.08);
  position: relative;
  padding: 18px;
  overflow: hidden;
}
.device-mockup::before {
  /* notch */
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #050508;
  border-radius: 0 0 14px 14px;
  z-index: 3;
}
.device-screen {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.08) 0%, rgba(0, 153, 204, 0.06) 100%);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.device-status {
  padding: 56px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: 'ui-monospace', monospace;
  font-size: 0.82rem;
  color: var(--text);
  animation: device-status-cycle 9s ease-in-out infinite;
}
.device-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}
.device-status-line .icon { font-size: 1rem; }
.device-status-line.dim { color: var(--muted); font-family: 'Outfit', sans-serif; font-size: 0.82rem; }
.device-progress {
  margin-top: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
}
.device-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 100px;
  animation: device-progress 4.5s ease-in-out infinite;
}
.device-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 212, 255, 0.18) 50%, transparent 100%);
  animation: device-scanline 4s linear infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes device-scanline {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(560px); opacity: 0; }
}
@keyframes device-progress {
  0%   { width: 0; }
  65%  { width: 95%; }
  100% { width: 95%; }
}
/* Status line makes one slot fade-in/fade-out every 3s so it feels
 * like AI narrating its build steps. */
@keyframes device-status-cycle {
  0%, 100% { opacity: 1; }
  30%      { opacity: 0.55; }
}
.device-status-line:nth-child(1) { animation-delay: 0s; }
.device-status-line:nth-child(2) { animation-delay: 0.6s; }
.device-status-line:nth-child(3) { animation-delay: 1.2s; }

/* ── Benefits row (replaces 6-card feature grid) ── */
.benefits {
  max-width: 1060px;
  margin: 0 auto;
  padding: 70px 40px 70px;
}
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 40px;
}
.benefit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
}
.benefit-card:hover {
  border-color: var(--border-bright);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.benefit-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 18px 0 8px;
  letter-spacing: -0.02em;
}
.benefit-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.65; }

/* ── First-timer walkthrough ── */
.walkthrough {
  max-width: 1100px;
  margin: 0 auto;
  padding: 70px 40px 90px;
  scroll-margin-top: 88px;
}
.walkthrough-panel {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 64px 52px 52px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 212, 255, 0.08), transparent 44%),
    var(--surface);
}
.walkthrough-intro {
  max-width: 650px;
  margin: -28px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}
.walkthrough-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 54px 0 0;
  padding: 0;
  list-style: none;
  position: relative;
}
.walkthrough-steps::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 9%;
  right: 9%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-bright) 10%, var(--accent) 50%, var(--border-bright) 90%, transparent);
  z-index: 0;
}
.walkthrough-step {
  min-width: 0;
  transition: transform 0.2s ease;
}
.walkthrough-step:hover,
.walkthrough-step:focus-within {
  transform: translateY(-3px);
}
.walkthrough-marker {
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  box-shadow: 0 0 0 6px var(--bg2), 0 0 24px rgba(0, 212, 255, 0.16);
  color: var(--accent);
  font-family: 'ui-monospace', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  z-index: 1;
}
.walkthrough-step h3 {
  min-height: 2.7em;
  margin-bottom: 16px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.walkthrough-roles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.walkthrough-role {
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.1);
}
.walkthrough-role.visitor { border-left: 2px solid var(--accent); }
.walkthrough-role.platform {
  border-left: 2px solid var(--accent2);
  background: rgba(0, 153, 204, 0.08);
}
.walkthrough-role-label {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}
.walkthrough-role.platform .walkthrough-role-label { color: var(--text); }
.walkthrough-role p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}
.walkthrough-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 50px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.walkthrough-cta strong,
.walkthrough-cta span {
  display: block;
}
.walkthrough-cta strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.walkthrough-cta span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.85rem;
}
.walkthrough-cta-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.walkthrough-cta-actions .btn-primary,
.walkthrough-cta-actions .btn-secondary {
  white-space: nowrap;
}

/* ── Social proof showcase grid (Built with App Dev in A Box) ── */
.showcase {
  max-width: 1100px;
  margin: 0 auto;
  padding: 70px 40px 90px;
  border-top: 1px solid var(--border);
}
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.showcase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 22px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.showcase-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--card-accent, var(--accent)) 0%, transparent 70%);
  opacity: 0.06;
  pointer-events: none;
  transition: opacity 0.2s;
}
.showcase-card:hover {
  border-color: var(--border-bright);
  background: var(--surface-hover);
  transform: translateY(-3px);
}
.showcase-card:hover::after { opacity: 0.12; }
.showcase-emoji {
  font-size: 1.85rem;
  line-height: 1;
}
.showcase-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.showcase-tagline {
  font-size: 0.825rem;
  color: var(--muted);
  line-height: 1.55;
}
.showcase-tags {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.showcase-tag {
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.02);
}
.showcase-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
}

/* ── Testimonials section ── */
.testimonials {
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 40px;
  border-top: 1px solid var(--border);
}
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}
.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.testimonial-card.featured {
  border-color: rgba(0, 212, 255, 0.25);
  background: linear-gradient(160deg, rgba(0, 212, 255, 0.05), transparent);
}
.testimonial-stars { color: #fbbf24; font-size: 0.9rem; letter-spacing: 2px; }
.testimonial-quote {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
  font-style: italic;
  flex: 1;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.testimonial-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #04151d;
}
.testimonial-avatar.purple { background: linear-gradient(135deg, var(--accent2), #7c3aed); color: #fff; }
.testimonial-avatar.blue   { background: linear-gradient(135deg, #60a5fa, var(--accent2)); color: #fff; }
.testimonial-name { font-size: 0.85rem; font-weight: 700; }
.testimonial-role { font-size: 0.75rem; color: var(--muted); }

/* ── Mini FAQ accordion ── */
.faq {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 40px 72px;
  border-top: 1px solid var(--border);
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 32px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.faq-item[open] { border-color: rgba(0, 212, 255, 0.3); background: var(--surface-hover); }
.faq-item summary {
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  letter-spacing: -0.01em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: 'ui-monospace', monospace;
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--accent);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--accent); }
.faq-item[open] summary { color: var(--accent); }
.faq-answer {
  padding: 0 22px 20px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}
.faq-cta {
  text-align: center;
  margin-top: 28px;
  font-size: 0.9rem;
}
.faq-cta a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}
.faq-cta a:hover { opacity: 0.8; }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--i, 0) * 80ms);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding: 80px 28px 60px;
    text-align: center;
  }
  .hero-copy { margin: 0 auto; text-align: center; }
  .hero h1 { font-size: clamp(2.1rem, 8vw, 3rem); }
  .hero-sub { text-align: center; margin-bottom: 28px; }
  .hero-actions { justify-content: center; }
  .hero::before { opacity: 0.25; }
  .walkthrough { padding: 60px 28px 75px; }
  .walkthrough-panel { padding: 54px 32px 38px; }
  .walkthrough-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 42px;
  }
  .walkthrough-steps::before {
    top: 24px;
    bottom: 24px;
    left: 24px;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, var(--accent), var(--border-bright) 88%, transparent);
  }
  .walkthrough-step {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 18px;
    padding-bottom: 26px;
  }
  .walkthrough-step:last-child { padding-bottom: 0; }
  .walkthrough-marker { margin: 0; }
  .walkthrough-step h3 { min-height: 0; }
  .walkthrough-cta { align-items: flex-start; flex-direction: column; }
  .walkthrough-cta-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .benefits { padding: 50px 24px; }
  .benefits-grid { grid-template-columns: 1fr; gap: 14px; }
  .showcase { padding: 50px 24px 60px; }
  .showcase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .testimonials { padding: 50px 24px; }
  .faq { padding: 50px 24px; }
  .device-mockup {
    width: 220px;
    height: 440px;
    padding: 14px;
  }
  .device-mockup::before { width: 70px; height: 18px; }
  .device-status { padding: 42px 16px 18px; font-size: 0.74rem; gap: 12px; }
  .walkthrough { padding: 50px 24px 60px; }
  .walkthrough-panel { padding: 42px 20px 28px; border-radius: 18px; }
  .walkthrough-intro { margin-top: -28px; font-size: 0.9rem; }
  .walkthrough-steps { margin-top: 36px; }
  .walkthrough-step { grid-template-columns: 42px minmax(0, 1fr); gap: 14px; }
  .walkthrough-steps::before { left: 21px; }
  .walkthrough-marker { width: 42px; height: 42px; font-size: 0.72rem; }
  .walkthrough-role { padding: 11px 12px; }
  .walkthrough-role p { font-size: 0.76rem; }
  .walkthrough-cta { margin-top: 36px; padding-top: 24px; }
  .walkthrough-cta-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .walkthrough-cta-actions .btn-primary,
  .walkthrough-cta-actions .btn-secondary { width: 100%; text-align: center; }
  @keyframes device-scanline {
    0%   { transform: translateY(-100%); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(440px); opacity: 0; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .walkthrough-step { transition: none !important; }
  .device-scanline,
  .device-progress-fill,
  .device-status { animation: none !important; }
  .hero::before { transform: none !important; }
}
