/*
  AppForge Public Website Permanent Minimum Vertical Spacing Rule

  Purpose:
  - Reduce vertical gaps between all public page sections.
  - Reduce navbar-to-hero gap.
  - Reduce hero-to-section gap.
  - Reduce section-to-section gap.
  - Reduce panel/card/footer spacing.
  - Keep pages compact, premium, readable, and commercially focused.
*/

:root {
  --appforge-public-min-gap-xs: 6px;
  --appforge-public-min-gap-sm: 10px;
  --appforge-public-min-gap-md: 14px;
  --appforge-public-min-gap-lg: 20px;
  --appforge-public-min-gap-xl: 28px;
}

/* Navbar must not create excessive top rhythm. */
.public-nav,
.nav {
  min-height: 58px !important;
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

/* Main content starts close to navbar. */
.public-main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Hero blocks are compact. */
.page-hero,
.public-main > .page-hero:first-child,
.hero {
  padding-top: clamp(12px, 1.8vw, 22px) !important;
  padding-bottom: clamp(14px, 2.1vw, 26px) !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Hero internal elements are compact. */
.page-hero .eyebrow,
.hero .eyebrow,
.eyebrow {
  margin-bottom: 0 !important;
}

.page-hero h1,
.hero h1,
.public-main h1,
h1 {
  margin-top: 8px !important;
  margin-bottom: 0 !important;
}

.page-hero .lead,
.hero .lead,
.lead {
  margin-top: 9px !important;
  margin-bottom: 0 !important;
}

.page-hero .actions,
.hero .actions,
.actions {
  margin-top: 12px !important;
  margin-bottom: 0 !important;
}

/* All public sections must be compact. */
.section,
.appforge-public-section,
.ai-determinism-section,
.appcloud-marketplace,
section {
  padding-top: clamp(14px, 2.2vw, 26px) !important;
  padding-bottom: clamp(14px, 2.2vw, 26px) !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Consecutive sections must not create blank corridors. */
section + section,
.section + .section,
.appforge-public-section + .appforge-public-section,
.page-hero + .section,
.page-hero + section,
.big-panel + .section,
.grid + .section {
  margin-top: 0 !important;
}

/* Section heads compact. */
.section-head {
  margin-top: 0 !important;
  margin-bottom: var(--appforge-public-min-gap-md) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.section-head h2,
section h2,
.public-main h2 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.section-head p,
section .section-head p {
  margin-top: 7px !important;
  margin-bottom: 0 !important;
}

/* Grids and cards must be dense. */
.grid,
.grid.four,
.appforge-section-grid,
.appcloud-grid,
.appcloud-stats,
.market-toolbar,
.flow {
  gap: 9px !important;
  margin-top: var(--appforge-public-min-gap-sm) !important;
  margin-bottom: 0 !important;
}

.card,
.market-card,
.appforge-info-card,
.appcloud-card,
.appcloud-stat,
.appcloud-pulse-item,
.flow-step {
  padding: 13px !important;
  min-height: unset !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Reduce paragraph/list internal vertical inflation. */
.card p,
.card ul,
.card ol,
.appforge-info-card p,
.market-card p,
.appcloud-card p,
.big-panel p {
  margin-top: 6px !important;
  margin-bottom: 0 !important;
}

.card h3,
.appforge-info-card h3,
.market-card h3,
.appcloud-card h3 {
  margin-top: 0 !important;
  margin-bottom: 6px !important;
}

/* Pill rows should not push cards downward. */
.pills,
.pill-row,
.appcloud-badges,
.market-badges {
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  gap: 5px !important;
}

/* Big panels are compact but readable. */
.big-panel,
.appcloud-feature-band,
.appcloud-live-panel,
.appcloud-seller-band,
.ai-det-stage {
  padding: clamp(14px, 2vw, 22px) !important;
  margin-top: var(--appforge-public-min-gap-sm) !important;
  margin-bottom: 0 !important;
}

/* Intelligence page compactness. */
.intelligence-stage,
.ai-det-head,
.ai-det-comparison,
.ai-det-badges {
  gap: 10px !important;
  margin-top: var(--appforge-public-min-gap-sm) !important;
  margin-bottom: 0 !important;
}

.intel-side,
.intel-engine,
.ai-det-ai-orb-panel,
.ai-det-engine-panel {
  min-height: 260px !important;
}

/* How-it-works flow should not create vertical inflation. */
.flow {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.flow-step {
  min-height: 68px !important;
}

/* AppCloud marketplace compactness. */
.appcloud-hero {
  gap: 16px !important;
  margin-bottom: var(--appforge-public-min-gap-md) !important;
}

.appcloud-title,
.ai-det-title {
  margin-top: 10px !important;
  margin-bottom: 0 !important;
}

.appcloud-lead,
.ai-det-lead {
  margin-top: 9px !important;
  margin-bottom: 0 !important;
}

.appcloud-actions,
.appcloud-trend-strip,
.appcloud-toolbar,
.appcloud-seller-band {
  margin-top: var(--appforge-public-min-gap-md) !important;
  margin-bottom: 0 !important;
}

.appcloud-pulse-list {
  margin-top: var(--appforge-public-min-gap-sm) !important;
  gap: 8px !important;
}

.appcloud-card-bottom {
  margin-top: var(--appforge-public-min-gap-sm) !important;
}

/* Footer should be modest. */
.public-footer,
footer {
  margin-top: var(--appforge-public-min-gap-lg) !important;
  padding-top: var(--appforge-public-min-gap-lg) !important;
  padding-bottom: var(--appforge-public-min-gap-lg) !important;
}

/* Remove accidental top margins from first child of sections/panels. */
.section > :first-child,
.page-hero > :first-child,
.big-panel > :first-child,
.card > :first-child,
.appforge-info-card > :first-child,
.market-card > :first-child,
.appcloud-card > :first-child {
  margin-top: 0 !important;
}

/* Remove accidental bottom margins from last child of sections/panels. */
.section > :last-child,
.page-hero > :last-child,
.big-panel > :last-child,
.card > :last-child,
.appforge-info-card > :last-child,
.market-card > :last-child,
.appcloud-card > :last-child {
  margin-bottom: 0 !important;
}

/* Mobile: even tighter top behavior. */
@media (max-width: 760px) {
  .public-nav,
  .nav {
    min-height: 54px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  .page-hero,
  .public-main > .page-hero:first-child,
  .hero {
    padding-top: 10px !important;
    padding-bottom: 16px !important;
  }

  .section,
  .appforge-public-section,
  .ai-determinism-section,
  .appcloud-marketplace,
  section {
    padding-top: 12px !important;
    padding-bottom: 16px !important;
  }

  .grid,
  .grid.four,
  .appforge-section-grid,
  .appcloud-grid,
  .appcloud-stats,
  .market-toolbar,
  .flow {
    gap: 8px !important;
    margin-top: 8px !important;
  }

  .big-panel,
  .appcloud-feature-band,
  .appcloud-live-panel,
  .appcloud-seller-band,
  .ai-det-stage {
    padding: 12px !important;
    margin-top: 8px !important;
  }
}
