/* ============================================================
   PromptCrunch shared design system
   Used by base.html and all new marketing pages.
   Legacy index.html keeps its inline styles for now.
   ============================================================ */

:root {
    --bg: #0C0F18;
    --surface: #151A28;
    --surface2: #1C2235;
    --surface3: #242A3D;
    --border: #2A3045;
    --text: #E2E5EF;
    --text-dim: #8891A8;
    --text-faint: #5A6380;
    --primary: #34D399;
    --primary-dim: rgba(52, 211, 153, 0.12);
    --accent: #00e5a0;
    --green: #34D399;
    --green-dim: rgba(52, 211, 153, 0.12);
    --warning: #F59E0B;
    --warning-dim: rgba(245, 158, 11, 0.12);
    --error: #EF4444;
    --surface-grad: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 92%, var(--bg)) 100%);
    --surface-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04),
                      0 1px 3px rgba(0, 0, 0, 0.4),
                      0 8px 24px rgba(0, 0, 0, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Calm fixed atmosphere: single soft halo + barely-perceptible wash */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 1400px 700px at 50% -10%,
          rgba(52, 211, 153, 0.07) 0%,
          transparent 65%),
        linear-gradient(180deg,
          transparent 0%,
          rgba(255, 255, 255, 0.012) 50%,
          transparent 100%);
}

.wrap, nav, footer, main { position: relative; z-index: 1; }

.mono { font-family: 'JetBrains Mono', monospace; }

.wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 28px;
    position: relative;
}

.wrap-narrow {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ─── NAV ─── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2.5px;
    text-decoration: none;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}
.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-links a.btn { color: var(--bg); }
.nav-links a.btn:hover { color: var(--bg); }

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 18px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary);
    color: var(--bg);
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset,
                0 1px 2px rgba(0, 0, 0, 0.3);
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset,
                0 10px 28px rgba(52, 211, 153, 0.35),
                0 2px 4px rgba(0, 0, 0, 0.25);
    filter: brightness(1.06);
}
.btn:active { transform: translateY(0); filter: brightness(0.98); }
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.12);
    filter: none;
}
.btn-sm { padding: 7px 18px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 14px; }
.btn-green { background: var(--green); color: var(--bg); }
.btn-block { width: 100%; display: block; text-align: center; }

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    line-height: 1.15;
}
h1 { font-size: 52px; font-weight: 700; letter-spacing: -1.2px; }
h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.6px; margin-bottom: 18px; }
h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.2px; margin-bottom: 10px; }
h4 { font-size: 15px; font-weight: 600; letter-spacing: -0.1px; }

p { color: var(--text-dim); font-size: 15px; line-height: 1.65; }
p strong { color: var(--text); font-weight: 600; }
p code, li code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.88em;
    color: var(--text);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.accent { color: var(--primary); }
.eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 1.6px;
    font-weight: 600;
}

/* ─── SECTIONS ─── */
section.section {
    padding: 80px 0;
    position: relative;
}
section.section + section.section { border-top: 1px solid var(--border); }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 { margin-bottom: 14px; }
.section-head p { color: var(--text-dim); font-size: 16px; max-width: 640px; margin: 0 auto; }

/* ─── PAGE HEADER (used by sub-pages) ─── */
.page-header {
    padding: 72px 0 56px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
}
/* Lighter aurora than the homepage signature: a centered green glow with two
   faint side blooms. Fades within itself, so the body's overflow-x clips any
   horizontal bleed and no hard edge appears (no overflow:hidden / mask needed). */
.page-header::before {
    content: '';
    position: absolute;
    top: -150px; left: 50%;
    width: 920px; height: 560px;
    transform: translateX(-50%);
    background:
        radial-gradient(44% 60% at 50% 14%, rgba(52, 211, 153, 0.16), transparent 72%),
        radial-gradient(30% 46% at 26% 32%, rgba(0, 229, 160, 0.10), transparent 74%),
        radial-gradient(30% 46% at 74% 34%, rgba(16, 185, 129, 0.10), transparent 74%);
    filter: blur(48px);
    pointer-events: none;
    z-index: 0;
}
.page-header > * { position: relative; z-index: 1; }
.page-header h1 { font-size: clamp(34px, 4.6vw, 50px); margin-bottom: 14px; letter-spacing: -1px; line-height: 1.08; }
.page-header .lede {
    color: var(--text-dim);
    font-size: 17px;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
}
.page-header .eyebrow { margin-bottom: 14px; display: inline-block; }

/* ─── CARDS / SURFACES ─── */
.card {
    background: var(--surface-grad);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--surface-shadow);
}
.card-tight { padding: 20px; }

/* Tier-2 elevated surface for supporting / grid cards.
   Lighter shadow than `.card`, same gradient. Used on step / pillar /
   store-col / metric / perk style cards across the sub-pages so they
   inherit the homepage depth recipe without competing with primary
   surfaces like .tier, .calc-wrap, .code-tabs. */
.card-soft {
    background: var(--surface-grad);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03),
                0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card-soft:hover, .card:hover {
    transform: translateY(-2px);
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: var(--surface-shadow),
                0 12px 32px rgba(52, 211, 153, 0.08);
}

/* Per-section radial halo, applied via class on any `section.section`.
   Pairs with `.halo-left` or `.halo-right` to bias placement. */
section.section.has-halo { position: relative; }
section.section.has-halo::before {
    content: '';
    position: absolute;
    width: 640px; height: 460px;
    background: radial-gradient(closest-side,
                  rgba(52, 211, 153, 0.10) 0%,
                  rgba(52, 211, 153, 0.02) 50%,
                  transparent 75%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}
section.section.has-halo.halo-left::before  { top: -80px; left: -180px; }
section.section.has-halo.halo-right::before { top: -80px; right: -200px; }
section.section.has-halo > .wrap,
section.section.has-halo > .wrap-narrow { position: relative; z-index: 1; }

/* Shared keyframes promoted from index.html so sub-pages can use them. */
@media (prefers-reduced-motion: no-preference) {
    @keyframes fadeUp {
        from { opacity: 0; transform: translateY(8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    @keyframes haloPulse {
        0%, 100% { opacity: 1; }
        50%      { opacity: 0.85; }
    }
    .page-header::before { animation: haloPulse 6s ease-in-out infinite; }
    .page-header > * { animation: fadeUp 0.7s ease-out both; }
    .page-header h1   { animation-delay: 0.05s; }
    .page-header .lede { animation-delay: 0.15s; }
}

/* Asymmetric sub-page hero scaffold. Used by security, self-hosted,
   and how-it-works to pair a left-column text block with a right-column
   signature visual (data flow / VPC architecture / token-shrink pills).
   Mirrors the homepage hero's 1.05fr / 0.95fr split. The outer .sub-hero
   carries the halo backdrop and padding; the grid lives on the inner
   `.wrap` so the 1040px width and 28px gutter still apply. */
.sub-hero {
    padding: 80px 0 64px;
    position: relative;
}
.sub-hero::before {
    content: '';
    position: absolute;
    top: -140px; right: -180px;
    width: 820px; height: 820px;
    background:
        radial-gradient(40% 46% at 70% 28%, rgba(52, 211, 153, 0.18), transparent 70%),
        radial-gradient(30% 40% at 88% 52%, rgba(0, 229, 160, 0.12), transparent 72%),
        radial-gradient(42% 50% at 54% 80%, rgba(16, 185, 129, 0.08), transparent 74%);
    filter: blur(50px);
    pointer-events: none;
    z-index: 0;
}
.sub-hero > .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 56px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.sub-hero-left { min-width: 0; }
.sub-hero-left .eyebrow { display: inline-block; margin-bottom: 14px; }
.sub-hero-left h1 {
    font-size: clamp(34px, 4.6vw, 50px);
    margin-bottom: 16px;
    line-height: 1.08;
    letter-spacing: -1.1px;
}
.sub-hero-left .lede {
    color: var(--text-dim);
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 520px;
}
.sub-hero-left .cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.sub-hero-visual {
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.45))
            drop-shadow(0 0 36px rgba(52, 211, 153, 0.06));
    min-width: 0;
}
@media (prefers-reduced-motion: no-preference) {
    .sub-hero::before { animation: haloPulse 6s ease-in-out infinite; }
    .sub-hero-left > * { animation: fadeUp 0.7s ease-out both; }
    .sub-hero-left h1   { animation-delay: 0.05s; }
    .sub-hero-left .lede { animation-delay: 0.12s; }
    .sub-hero-left .cta-row { animation-delay: 0.20s; }
    .sub-hero-visual { animation: fadeUp 0.9s 0.10s ease-out both; }
}
@media (max-width: 880px) {
    .sub-hero { padding: 56px 0 40px; }
    .sub-hero > .wrap {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .sub-hero-left h1 { font-size: 34px; }
    .sub-hero-visual { order: -1; }
}

/* ─── FOOTER ─── */
footer {
    padding: 40px 0 56px;
    border-top: 1px solid var(--border);
    margin-top: 80px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
.footer-col h5 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-faint);
    font-weight: 600;
    margin-bottom: 14px;
}
.footer-col a {
    display: block;
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 8px;
    transition: color 0.15s;
}
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-tagline {
    color: var(--text-faint);
    font-size: 12px;
    line-height: 1.5;
    margin-top: 8px;
    max-width: 240px;
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-faint);
}
.footer-bottom a { color: var(--text-faint); }
.footer-bottom a:hover { color: var(--text-dim); text-decoration: none; }

/* ─── CODE BLOCKS ─── */
.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text);
    overflow-x: auto;
    position: relative;
}
.code-block code { color: var(--text); }
.code-block .copy-btn {
    position: absolute;
    top: 10px; right: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.code-block .copy-btn:hover { color: var(--primary); border-color: var(--primary); }

/* ─── BADGES / PILLS ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--primary-dim);
    color: var(--primary);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.badge-warn { background: var(--warning-dim); color: var(--warning); border-color: rgba(245, 158, 11, 0.25); }
.badge-muted { background: var(--surface2); color: var(--text-dim); border-color: var(--border); }

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .btn-outline { transition: none; }
    .btn:hover, .btn-outline:hover { transform: none; }
    .card-soft, .card { transition: none; }
    .card-soft:hover, .card:hover { transform: none; }
    .code-block .copy-btn { transition: none; }
    .nav-links a, .footer-col a { transition: none; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 760px) {
    .mobile-menu-btn { display: block; }
    .nav-links {
        position: absolute;
        top: 100%;
        right: 28px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 12px 0;
        min-width: 180px;
        box-shadow: var(--surface-shadow);
        display: none;
        z-index: 10;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 10px 18px; font-size: 13px; }
    .nav-links a.btn { margin: 8px 14px 4px; text-align: center; }

    h1 { font-size: 36px; }
    h2 { font-size: 26px; }
    .page-header { padding: 48px 0 40px; }
    .page-header h1 { font-size: 32px; }
    section.section { padding: 56px 0; }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 8px;
    }
}
