/* app/assets/css/layout.css
   Page-level layout: nav, sections, hero, footer, wizard, dashboard. */

/* ── Navigation ──────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(16px, 4vw, 40px);
  transition: border-color .2s, background .2s;
}
.site-nav.scrolled { border-color: var(--border-hover); }

.nav-inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  height: 62px;
  display: flex; align-items: center; gap: 20px;
}

.nav-logo {
  font-weight: 800; font-size: 1rem; letter-spacing: -0.03em;
  color: var(--fg); text-decoration: none; flex-shrink: 0;
  display: flex; align-items: center; gap: 9px;
}
.nav-logo:hover { text-decoration: none; }

.nav-logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  font-size: 0.78rem; color: #fff; font-weight: 800; letter-spacing: 0;
  flex-shrink: 0;
}

.nav-links {
  display: none; gap: 2px; list-style: none; margin: 0; padding: 0;
}
@media (min-width: 640px) { .nav-links { display: flex; } }

.nav-links a {
  color: var(--fg-muted); text-decoration: none;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--fg); background: var(--bg-card); }
.nav-links a[aria-current="page"] { color: var(--fg); background: var(--bg-elevated); }

.nav-spacer { flex: 1; }

/* ── Mobile hamburger (<640px) ───────────────────────────────
   nav.js injects .nav-toggle when a page has nav links. Hidden ≥640px (the
   inline links show instead); below that it toggles a dropdown of the links. */
.nav-toggle { display: none; }
@media (max-width: 639px) {
  .nav-inner { gap: 10px; }
  /* The hero immediately repeats this action; hiding the duplicate in the
     narrow header leaves the logo and menu comfortably inside the viewport. */
  .site-nav .nav-primary-cta { display: none; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center;
    gap: 4px; width: 40px; height: 40px; flex-shrink: 0;
    align-items: center; border-radius: var(--radius-sm);
  }
  .nav-toggle span { width: 20px; height: 2px; background: var(--fg); border-radius: 2px; }
  .site-nav.nav-open .nav-links {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; right: clamp(16px, 4vw, 40px); left: clamp(16px, 4vw, 40px);
    margin-top: 4px; padding: 8px; gap: 2px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  }
  .site-nav.nav-open .nav-links a { display: block; }
}

/* ── Page sections ───────────────────────────────────────── */
.section {
  padding: clamp(64px, 9vw, 112px) clamp(16px, 4vw, 40px);
}
.section-inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
}
.section--alt  { background: var(--bg-elevated); }
.section--dark { background: var(--bg-card); }

.section-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.73rem; font-weight: 700; letter-spacing: .10em;
  text-transform: uppercase; color: var(--accent-light);
  margin-bottom: 18px;
}

.section-heading {
  font-size: clamp(1.8rem, 4.5vw, 2.9rem);
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1.05rem; color: var(--fg-muted);
  max-width: 540px; line-height: 1.7;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  padding: clamp(80px, 12vw, 140px) clamp(16px, 4vw, 40px) clamp(64px, 9vw, 112px);
  text-align: center;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}
.hero-inner {
  max-width: var(--maxw-prose);
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--fg) 30%, color-mix(in srgb, var(--fg) 60%, var(--fg-muted)));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--fg-muted); margin-bottom: 44px; line-height: 1.7;
}
.hero-ctas {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}

/* ── Feature grid ────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
  margin-top: 52px;
}

/* ── Steps row ───────────────────────────────────────────── */
.steps-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 32px;
  margin-top: 52px;
}

/* ── Theme showcase ──────────────────────────────────────── */
.theme-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 44px;
}

/* ── Pricing grid ────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 380px));
  gap: 20px;
  justify-content: center;
  margin-top: 52px;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px clamp(16px, 4vw, 40px);
}
.footer-inner {
  max-width: var(--maxw-wide); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 24px;
  justify-content: space-between; align-items: center;
}
.footer-copy { color: var(--fg-muted); font-size: 0.85rem; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--fg-muted); font-size: 0.85rem; text-decoration: none; }
.footer-links a:hover { color: var(--fg); }

/* ── Wizard layout ───────────────────────────────────────── */
.wizard-page { min-height: 100vh; display: flex; flex-direction: column; }

.wizard-header {
  border-bottom: 1px solid var(--border);
  padding: 14px clamp(16px, 4vw, 40px);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.wizard-body {
  flex: 1;
  display: grid; grid-template-columns: 1fr;
  width: 100%;
}
@media (min-width: 960px) {
  .wizard-body { grid-template-columns: 420px 1fr; }
}

.wizard-form-pane {
  padding: clamp(24px, 4vw, 44px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
@media (min-width: 960px) {
  .wizard-form-pane {
    position: sticky; top: 65px;
    max-height: calc(100vh - 65px);
    align-self: start;
  }
}
@media (max-width: 959px) {
  .wizard-form-pane { border-right: none; border-bottom: 1px solid var(--border); }
  .wizard-page :is(input, button, select, textarea, a) { scroll-margin-top: 120px; }
}

.wizard-preview-pane {
  padding: clamp(24px, 4vw, 40px);
  display: flex; flex-direction: column; gap: 20px;
  background: var(--bg-elevated);
}

/* ── Dashboard layout ────────────────────────────────────── */
.dash-page {
  min-height: 100vh;
}
.dash-content {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 60px) clamp(16px, 4vw, 40px);
}
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

/* ── Checkout layout ─────────────────────────────────────── */
.checkout-page {
  min-height: 100vh;
}
.checkout-content {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 60px) clamp(16px, 4vw, 40px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 700px) {
  .checkout-content { grid-template-columns: 1fr 380px; }
}
