/* ============================================================
   Legislative OS — Landing page (public entry surface)
   ============================================================ */

/* When logged out, allow the page to scroll (app view is fixed-viewport) */
body:not(.authed) { overflow-y: auto; overflow-x: hidden; height: auto; }
body:not(.authed) .app-container { display: none; }
body.authed #landing { display: none; }

#landing { display: block; min-height: 100vh; position: relative; }

/* Session restore — avoid landing flash on reload */
.auth-boot-splash {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 14px;
}
html.auth-loading .auth-boot-splash { display: flex; }
html.auth-loading #landing,
html.auth-loading .app-container { visibility: hidden; }
html.has-session #landing { display: none !important; }
html.has-session .app-container { display: flex !important; visibility: visible !important; }
html.has-session.auth-loading .app-container { visibility: visible !important; }

/* ---- Ambient background ---- */
.landing-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.landing-bg .blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.landing-bg .blob-1 { width: 520px; height: 520px; background: #7c3aed; top: -160px; left: -120px; animation: float1 18s ease-in-out infinite; }
.landing-bg .blob-2 { width: 460px; height: 460px; background: #3b82f6; top: 120px; right: -140px; animation: float2 22s ease-in-out infinite; }
.landing-bg .blob-3 { width: 400px; height: 400px; background: #06b6d4; bottom: -180px; left: 30%; opacity: .35; animation: float1 26s ease-in-out infinite; }
.landing-bg .grid { position: absolute; inset: 0; background-image:
    linear-gradient(var(--border-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%); opacity: .5; }
@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px,-30px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-50px,40px); } }

.landing-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ---- Nav ---- */
.landing-nav { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg-primary) 72%, transparent); border-bottom: 1px solid var(--border-color); }
.landing-nav-inner { max-width: 1180px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 20px; }
.landing-nav .brand { margin: 0; }
.landing-nav .brand h2 { font-size: 20px; }
.landing-nav-links { display: flex; gap: 26px; margin-left: 24px; }
.landing-nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s; }
.landing-nav-links a:hover { color: var(--text-primary); }
.landing-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ---- Hero ---- */
.hero { padding: 90px 0 70px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--accent-primary);
  background: var(--badge-score-bg); border: 1px solid var(--border-color); padding: 6px 14px; border-radius: 30px; margin-bottom: 22px; }
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; }
.hero h1 { font-family: 'Outfit', sans-serif; font-size: 52px; line-height: 1.06; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 22px; }
.hero h1 .grad { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lead { font-size: 18px; line-height: 1.6; color: var(--text-secondary); max-width: 560px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 34px; margin-top: 42px; }
.hero-stats .stat .num { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 700;
  background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-stats .stat .lbl { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }

/* Big CTA buttons */
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 12px; font-weight: 600; }
.btn-hero { background: var(--accent-gradient); color: #fff; border: none; box-shadow: 0 10px 30px var(--accent-shadow); cursor: pointer; }
.btn-hero:hover { transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border-hover); cursor: pointer; }
.btn-outline:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* ---- Hero preview card (stylized pipeline) ---- */
.hero-preview { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 20px;
  padding: 22px; box-shadow: var(--card-shadow); backdrop-filter: blur(10px); }
.hero-preview .pv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.hero-preview .pv-dots { display: flex; gap: 6px; }
.hero-preview .pv-dots span { width: 11px; height: 11px; border-radius: 50%; background: var(--badge-bg); }
.hero-preview .pv-dots span:nth-child(1) { background: #f87171; }
.hero-preview .pv-dots span:nth-child(2) { background: #fbbf24; }
.hero-preview .pv-dots span:nth-child(3) { background: #34d399; }
.hero-preview .pv-title { font-size: 12.5px; color: var(--text-secondary); }
.pv-stage { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-color); }
.pv-stage:last-child { border-bottom: none; }
.pv-ico { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.pv-ico.done { background: rgba(16,185,129,.16); color: #34d399; }
.pv-ico.run { background: rgba(59,130,246,.16); color: #60a5fa; }
.pv-ico.wait { background: var(--badge-bg); color: var(--text-secondary); }
.pv-stage .pv-name { font-size: 13px; font-weight: 500; flex: 1; }
.pv-stage .pv-meta { font-size: 11px; color: var(--text-secondary); }
.pv-bar { height: 5px; border-radius: 5px; background: var(--badge-bg); overflow: hidden; margin-top: 14px; }
.pv-bar span { display: block; height: 100%; width: 68%; background: var(--accent-gradient); animation: pvgrow 2.4s ease-in-out infinite alternate; }
@keyframes pvgrow { from { width: 40%; } to { width: 82%; } }

/* ---- Section scaffolding ---- */
.section { padding: 70px 0; position: relative; z-index: 1; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 46px; }
.section-head .eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-primary); }
.section-head h2 { font-family: 'Outfit', sans-serif; font-size: 34px; font-weight: 700; margin: 10px 0 12px; letter-spacing: -0.01em; }
.section-head p { color: var(--text-secondary); font-size: 15.5px; line-height: 1.6; }

/* ---- Feature grid ---- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 18px; padding: 26px;
  transition: transform .2s, border-color .2s; backdrop-filter: blur(8px); }
.feature-card:hover { transform: translateY(-4px); border-color: var(--border-hover); }
.feature-card .fico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-gradient); color: #fff; margin-bottom: 16px; }
.feature-card .fico svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }

/* ---- Roles ---- */
.roles-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.role-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 16px; padding: 22px 18px; text-align: center;
  transition: transform .2s, border-color .2s; }
.role-card:hover { transform: translateY(-4px); border-color: var(--accent-primary); }
.role-card .r-ico { width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--badge-score-bg); color: var(--accent-primary); font-size: 18px; font-weight: 700; }
.role-card h4 { font-size: 15px; margin-bottom: 6px; }
.role-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ---- Pipeline showcase ---- */
.pipe-flow { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pipe-node { flex: 1; min-width: 140px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 14px; padding: 16px; text-align: center; }
.pipe-node .pn-num { font-family: 'Outfit', sans-serif; font-size: 12px; color: var(--accent-primary); font-weight: 700; }
.pipe-node h5 { font-size: 13.5px; margin: 6px 0 4px; }
.pipe-node p { font-size: 11.5px; color: var(--text-secondary); }

/* ---- CTA band ---- */
.cta-band { text-align: center; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 24px; padding: 54px 30px; margin: 20px 0 0; }
.cta-band h2 { font-family: 'Outfit', sans-serif; font-size: 32px; margin-bottom: 12px; }
.cta-band p { color: var(--text-secondary); margin-bottom: 26px; }

/* ---- Footer ---- */
.landing-footer { border-top: 1px solid var(--border-color); margin-top: 70px; padding: 34px 0; position: relative; z-index: 1; }
.landing-footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.landing-footer .muted { font-size: 12.5px; color: var(--text-secondary); }

/* ---- Auth modal (launched from landing CTAs) ---- */
.auth-modal { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; padding: 20px; }
.auth-modal.open { display: flex; }
.auth-modal-backdrop { position: absolute; inset: 0; background: rgba(4,7,15,.72); backdrop-filter: blur(6px); }
.auth-modal .auth-card { position: relative; z-index: 1; animation: authIn .28s cubic-bezier(.4,0,.2,1); }
.auth-card .auth-close { position: absolute; top: 18px; right: 18px; background: none; border: none; color: var(--text-secondary); cursor: pointer; }
.auth-card .auth-close svg { width: 20px; height: 20px; }
@keyframes authIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 40px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .roles-grid { grid-template-columns: 1fr 1fr; }
  .landing-nav-links { display: none; }
}
@media (max-width: 620px) {
  .feature-grid, .roles-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px; }
}
