/* ==========================================================================
   Landing page styles
   Page-specific. Loaded after base.css.
   ========================================================================== */

/* ──────────────────────────────────────────────────────────────────────────
   HERO
   ────────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(5rem, 12vw, 9rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
/* Grid items default to min-content sizing — set min-width:0 to allow shrinking
   below intrinsic width when content is wider than the column (long monospace
   strings, code blocks, etc.). */
.hero-grid > * { min-width: 0; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding: 0.45rem 1rem 0.45rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  max-width: 100%;
}
.hero-eyebrow-text {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.hero-eyebrow-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--accent-green-glow);
  color: var(--accent-green-bright);
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.hero-eyebrow .arrow {
  margin-left: 0.25rem;
  opacity: 0.5;
  transition: transform var(--d-fast) var(--ease-out), opacity var(--d-fast) var(--ease-out);
}
.hero-eyebrow:hover .arrow { transform: translateX(3px); opacity: 1; }

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 7vw, 5rem);
  line-height: 1.0;
  font-weight: 300;
  letter-spacing: -0.04em;
  margin: 0 0 1.75rem;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.hero-headline .accent {
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-green-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-sub {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 52ch;
  margin-bottom: 2.5rem;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-bottom: 3rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.hero-meta-item svg { color: var(--accent-teal); flex-shrink: 0; }

/* ──────────────────────────────────────────────────────────────────────────
   HERO VISUAL — Stylized "ledger book" with code page
   The "memorable thing" the user takes away.
   ────────────────────────────────────────────────────────────────────────── */
.hero-visual {
  position: relative;
  perspective: 2000px;
}

.hero-visual-glow {
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at 60% 40%, var(--accent-teal-glow), transparent 60%);
  filter: blur(40px);
  z-index: 0;
}

/* ──────────────────────────────────────────────────────────────────────────
   HERO — Ledger app surface mockup

   This is rendered to look like a real screenshot of the Ledger admin UI:
   brand mark + breadcrumb + header chips on top, real tab bar with icons,
   the SQL editor body, and a result strip. No fake browser chrome — the
   tool runs in the browser, so wrapping it in fake browser chrome was
   doubly confusing. Subtle vertical drift keeps it alive without skewing.
   ────────────────────────────────────────────────────────────────────────── */

.app-surface {
  position: relative;
  background: linear-gradient(165deg, #0c1426 0%, #0a1020 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(94, 234, 212, 0.08);
  z-index: 1;
  animation: floatGently 8s ease-in-out infinite;
}

@keyframes floatGently {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .app-surface { animation: none; }
}

/* ─── Top bar (brand + breadcrumb + chips) ──────────────────────────── */
.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.app-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #16a34a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-brand-mark svg { display: block; }
.app-brand-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-brand-crumb {
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* Header chips — matches the v1.0.1-beta chip redesign in the real app */
.app-chips {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-shrink: 0;
}
.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 22px;
  padding: 0 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}
.app-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green-bright, #4ade80);
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.18);
  animation: chipPulse 2.8s ease-in-out infinite;
}
@keyframes chipPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.18); }
  50%      { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.04); }
}
@media (prefers-reduced-motion: reduce) {
  .app-chip-dot { animation: none; }
}
.app-chip--db svg    { color: #60a5fa; }
.app-chip--count svg { color: #a78bfa; }

/* ─── Tab bar ────────────────────────────────────────────────────────── */
.app-tabs {
  display: flex;
  gap: 0;
  padding: 0 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.app-tabs::-webkit-scrollbar { display: none; }
.app-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.8rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.app-tab svg { opacity: 0.7; }
.app-tab--active {
  color: var(--accent-teal);
  border-bottom-color: var(--accent-teal);
}
.app-tab--active svg { opacity: 1; color: var(--accent-teal); }

/* ─── Editor body (the SQL code area) ────────────────────────────────── */
.app-editor {
  padding: 1.1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  min-height: 220px;
}

.code-line { display: flex; gap: 1rem; white-space: pre; }
.code-line .num {
  color: var(--text-faint);
  user-select: none;
  width: 1.5em;
  text-align: right;
  flex-shrink: 0;
}
.code-kw  { color: #c084fc; font-weight: 600; }
.code-fn  { color: var(--accent-teal); }
.code-str { color: #fbbf24; }
.code-num { color: var(--accent-green-bright); }
.code-tbl { color: #f97316; }
.code-col { color: #60a5fa; }
.code-cmt { color: var(--text-faint); font-style: italic; }

/* ─── Result strip (post-execute card) ──────────────────────────────── */
.app-result {
  margin: 0 1.25rem 1.1rem;
  padding: 0.7rem 0.95rem;
  background: rgba(94, 234, 212, 0.06);
  border: 1px solid rgba(94, 234, 212, 0.18);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.app-result-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.app-result-left svg {
  color: var(--accent-green-bright);
}
.app-result-left strong {
  color: var(--accent-green-bright);
  font-weight: 600;
}
.app-result-sep {
  color: var(--text-faint);
}
.app-result-muted {
  color: var(--text-muted);
}

/* Responsive: collapse the breadcrumb on small screens so the brand
   doesn't get clipped */
@media (max-width: 980px) {
  .app-brand-crumb { display: none; }
  .app-chips .app-chip--count { display: none; }
}

/* ──────────────────────────────────────────────────────────────────────────
   MARQUEE — "powering databases of" type strip
   ────────────────────────────────────────────────────────────────────────── */
.marquee-strip {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(6, 9, 18, 0.6);
}
.marquee-label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.marquee-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-muted);
  opacity: 0.85;
  letter-spacing: -0.01em;
}
.marquee-row .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
}

/* ──────────────────────────────────────────────────────────────────────────
   FEATURE SECTION — three-up showcase
   ────────────────────────────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 980px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--d-mid) var(--ease-out), transform var(--d-mid) var(--ease-out);
}
.feature-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-teal);
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}
.feature-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* ──────────────────────────────────────────────────────────────────────────
   SPLIT — alternating image + text blocks
   ────────────────────────────────────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  margin: clamp(3rem, 6vw, 5rem) 0;
}
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }

.split.reverse .split-text { order: 2; }
.split.reverse .split-visual { order: 1; }
@media (max-width: 880px) {
  .split.reverse .split-text { order: 1; }
  .split.reverse .split-visual { order: 2; }
}

.split-text h3 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.025em;
  margin: 0.75rem 0 1.25rem;
}
.split-text p {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

.split-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.75rem;
}
.split-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.split-list li::before {
  content: '';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border-radius: 50%;
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid var(--border-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235eead4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

/* Split visuals — schematic illustrations */
.visual-frame {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.visual-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(94, 234, 212, 0.06), transparent 60%);
  pointer-events: none;
}

/* ──────────────────────────────────────────────────────────────────────────
   STATS STRIP
   ────────────────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}
@media (max-width: 720px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat {
  padding: 2.5rem 2rem;
  border-right: 1px solid var(--border);
  text-align: left;
  position: relative;
}
.stat:last-child { border-right: none; }
@media (max-width: 720px) {
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  display: block;
  margin-bottom: 0.5rem;
}
.stat-num .unit {
  font-size: 0.5em;
  color: var(--accent-teal);
  margin-left: 0.15em;
  font-style: italic;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ──────────────────────────────────────────────────────────────────────────
   CTA — install / get started footer block
   ────────────────────────────────────────────────────────────────────────── */
.cta-block {
  position: relative;
  padding: clamp(4rem, 8vw, 6rem) clamp(2rem, 5vw, 4rem);
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.04), rgba(34, 197, 94, 0.04));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  text-align: center;
  overflow: hidden;
  margin-top: 2rem;
}
.cta-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(94, 234, 212, 0.1), transparent 70%);
  pointer-events: none;
}

.cta-block h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  position: relative;
}
.cta-block p { max-width: 50ch; margin: 0 auto 2rem; position: relative; }
.cta-block .cta-row { position: relative; display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }

.install-snippet {
  margin: 2rem auto 0;
  max-width: 720px;
  text-align: left;
  position: relative;
}
.install-snippet pre {
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--border-strong);
}

/* (Copy button moved to base.css since it's used on every page) */

/* ──────────────────────────────────────────────────────────────────────────
   MOBILE HARDENING — fixes for narrow viewports
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  /* Hero eyebrow pill: allow wrapping and use smaller text */
  .hero-eyebrow {
    display: flex;
    flex-wrap: wrap;
    font-size: 0.7rem;
    padding: 0.4rem 0.85rem 0.4rem 0.4rem;
    gap: 0.5rem;
  }
  .hero-eyebrow-text { font-size: 0.7rem; }

  /* Hero CTA row stacks on mobile so buttons don't overflow */
  .hero-cta-row { flex-direction: column; align-items: stretch; }
  .hero-cta-row .btn { width: 100%; }

  /* Hero visual sits within its container — no negative positioning */
  .hero-visual { padding: 0 0.25rem; }

  /* Hero meta wraps two columns instead of overflowing a single row */
  .hero-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem 1rem;
    padding-top: 1.25rem;
  }
  .hero-meta-item { font-size: 0.75rem; }

  /* Marquee row text stays compact on mobile */
  .marquee-row { font-size: 1.1rem; gap: 1rem; }

  /* Feature grid stacks (already 1fr at this width, just confirm) */
  .features-grid { grid-template-columns: 1fr; gap: 1rem; }
  .feature-card { padding: 1.5rem; }
  .feature-icon { width: 40px; height: 40px; margin-bottom: 1rem; }
  .feature-card h3 { font-size: 1.25rem; }

  /* Stats grid stays 2-col but with tighter padding */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 1.5rem 1rem; }

  /* CTA block padding shrinks */
  .cta-block { padding: 2.5rem 1.25rem; border-radius: var(--radius-lg); }
  .install-snippet pre { font-size: 0.75rem; padding-right: 4rem; }
}

/* Universal min-width:0 fix — prevents long content from blowing grid cells out */
.features-grid > *,
.split > *,
.stats-grid > * { min-width: 0; }
