/* ====================================================================
   Landing page styles — applied on top of common.css + theme.
   Scoped to body.landing.
   ==================================================================== */

body.landing {
    margin: 0;
    line-height: 1.5;
}

/* Override common.css's flex column layout for the landing's free flow. */
body.landing > header,
body.landing > main,
body.landing > footer,
body.landing > section {
    display: block;
}

/* ---------- Site header (sticky brand + nav) ----------- */
/* Solid background — no backdrop-filter (it interacts badly with the
   CRT scanlines on the terminal theme). */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 32px;
    border-bottom: 1px solid currentColor;
}
body.theme-terminal .site-header { background: #060606; }
body.theme-modern   .site-header { background: #fafaf7; }

.brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.brand-mark {
    font-weight: bold;
    letter-spacing: 0.10em;
    font-size: 1.05em;
}
.brand-tag {
    font-size: 0.78em;
    opacity: 0.7;
    letter-spacing: 0.04em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.site-nav a {
    color: inherit;
    text-decoration: none;
    font-size: 0.92em;
    opacity: 0.85;
}
.site-nav a:hover {
    opacity: 1;
}

.btn-ghost,
.btn-primary {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid currentColor;
    text-decoration: none;
    font: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
}
.site-nav .btn-ghost {
    padding: 6px 14px;
    font-size: 0.9em;
}

/* ---------- Hero ----------- */
.hero {
    padding: 120px 32px 96px;
    text-align: center;
    max-width: 980px;
    margin: 0 auto;
}
.hero-eyebrow {
    margin: 0 0 24px;
    opacity: 0.7;
    font-size: 0.92em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.hero-title {
    margin: 0 0 40px;
    font-size: clamp(2.4em, 6vw, 4em);
    line-height: 1.1;
    letter-spacing: -0.015em;
    font-weight: bold;
}
.hero-lede {
    font-size: 1.3em;
    line-height: 1.65;
    margin: 0 auto 40px;
    max-width: 720px;
}
.hero-lede code {
    font-size: 1.05em;
    padding: 2px 10px;
    font-weight: 500;
}
.hero-cta {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.hero-cta .btn-primary,
.hero-cta .btn-ghost {
    padding: 12px 22px;
    font-size: 1em;
}
.hero-foot {
    font-size: 0.85em;
    opacity: 0.65;
    margin: 12px 0 0;
}

/* ---------- Generic section ----------- */
.section {
    padding: 80px 32px;
}
.section-inner {
    max-width: 1080px;
    margin: 0 auto;
}
/* Plain sections still get the inner constraint via .section-inner OR
   by themselves. Keep backwards compat. */
.section > *:not(.section-inner) {
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}
.section h2 {
    text-align: center;
    margin: 0 0 48px;
    font-size: clamp(1.6em, 3.6vw, 2.2em);
    letter-spacing: 0.02em;
}

/* Alternating section backgrounds — barely brighter on terminal
   (a darker overlay would crush already-low contrast). */
body.theme-terminal .section-alt {
    background: rgba(255, 255, 255, 0.025);
    border-top: 1px solid rgba(125, 167, 125, 0.25);
    border-bottom: 1px solid rgba(125, 167, 125, 0.25);
}
body.theme-modern .section-alt {
    background: #f3f3ed;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* ---------- Decimal table ----------- */
.decimal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto 32px;
    font-variant-numeric: tabular-nums;
}
.decimal-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.75;
    border-bottom: 2px solid currentColor;
}
.decimal-table tbody th {
    text-align: left;
    font-weight: 500;
    padding: 14px;
    border-top: 1px solid currentColor;
    opacity: 0.85;
}
.decimal-table tbody td {
    padding: 14px;
    border-top: 1px solid currentColor;
    vertical-align: middle;
}
.decimal-table .bad code {
    color: #ff6666;
    border-color: #ff6666;
}
.decimal-table .ok code {
    color: #66ff66;
    border-color: #66ff66;
    font-weight: bold;
}
body.theme-modern .decimal-table .bad code {
    color: #b3261e;
    background: rgba(179, 38, 30, 0.08);
    border-color: #f1c4c0;
}
body.theme-modern .decimal-table .ok code {
    color: #1e7d52;
    background: rgba(30, 125, 82, 0.10);
    border-color: #c4e1d2;
}

.decimal-prose {
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.65;
    opacity: 0.92;
}

/* ---------- Feature grid ----------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.feature-card {
    padding: 22px 24px;
    border: 1px solid currentColor;
    border-radius: 4px;
}
.feature-card h3 {
    margin: 0 0 10px;
    font-size: 1.05em;
    letter-spacing: 0.02em;
}
.feature-card p {
    margin: 0;
    line-height: 1.6;
    opacity: 0.92;
    font-size: 0.95em;
}
body.theme-modern .feature-card {
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ---------- Stack row ----------- */
.stack-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.stack-cell {
    padding: 20px;
    border: 1px solid currentColor;
    border-radius: 4px;
    position: relative;
}
.stack-name {
    display: block;
    font-size: 1.2em;
    letter-spacing: 0.05em;
}
.stack-year {
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 0.78em;
    opacity: 0.55;
    letter-spacing: 0.06em;
}
.stack-cell p {
    margin: 12px 0 0;
    font-size: 0.9em;
    opacity: 0.88;
    line-height: 1.55;
}
body.theme-modern .stack-cell {
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stack-quote {
    text-align: center;
    font-style: italic;
    font-size: 1.1em;
    line-height: 1.7;
    margin: 0 auto;
    max-width: 640px;
    border: 0;
    padding: 24px;
    opacity: 0.9;
}

/* ---------- Pricing ----------- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    align-items: stretch;
}
.price-card {
    padding: 32px 28px 28px;
    border: 1px solid currentColor;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}
.price-card h3 {
    margin: 0;
    font-size: 1.2em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
}
.price-card .price {
    font-size: 3.4em;
    font-weight: bold;
    margin: 4px 0 8px;
    letter-spacing: -0.02em;
    line-height: 1;
}
.price-card .price span {
    font-size: 0.32em;
    font-weight: normal;
    opacity: 0.55;
    margin-left: 6px;
    letter-spacing: 0;
}
.price-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}
.price-card li {
    padding: 4px 0;
    font-size: 0.92em;
    opacity: 0.92;
}
.price-card li::before {
    content: "✓ ";
    margin-right: 4px;
    opacity: 0.7;
}
.price-card a {
    text-align: center;
    margin-top: 12px;
    padding: 12px 16px;
    font-size: 1em;
    font-weight: bold;
}
.price-card--featured {
    border-width: 2px;
    transform: scale(1.04);
    z-index: 1;
}
body.theme-terminal .price-card--featured {
    box-shadow: 0 0 24px rgba(102, 255, 102, 0.18);
}
body.theme-modern .price-card--featured {
    box-shadow: 0 6px 24px rgba(15, 52, 96, 0.12);
}
.badge-featured {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 12px;
    font-size: 0.75em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    background: var(--bg, #0a0a0a);
}
body.theme-modern .price-card {
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* ---------- About ----------- */
.about {
    max-width: 760px;
}
.about p {
    line-height: 1.7;
    opacity: 0.92;
    margin-bottom: 16px;
}

/* ---------- Footer ----------- */
.site-footer {
    border-top: 1px solid currentColor;
    padding: 48px 32px 32px;
    margin-top: 48px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 32px;
    max-width: 1080px;
    margin: 0 auto;
}
.footer-cols div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.footer-cols strong {
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}
.footer-cols a {
    color: inherit;
    text-decoration: none;
    opacity: 0.75;
    font-size: 0.92em;
}
.footer-cols a:hover { opacity: 1; }
.footer-tag { opacity: 0.7; font-size: 0.9em; }
.copyright {
    text-align: center;
    margin: 32px auto 0;
    opacity: 0.55;
    font-size: 0.82em;
}

/* ---------- Product preview ----------- */
.preview {
    text-align: center;
}
.preview-frame {
    display: inline-block;
    margin-top: 8px;
    padding: 16px;
    border: 1px solid currentColor;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    max-width: 560px;
    width: 100%;
}
.preview-frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
body.theme-modern .preview-frame {
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10);
    border-color: var(--border);
}
.preview-caption {
    margin-top: 16px;
    opacity: 0.75;
    font-size: 0.92em;
}

/* ---------- Mobile tweaks ----------- */
@media (max-width: 640px) {
    /* Drop the sticky header — too noisy on phones; navigation is
       still reachable by scrolling back up. */
    .site-header {
        position: static;
        padding: 10px 16px;
        flex-wrap: wrap;
    }
    .brand-tag { display: none; }
    .site-nav {
        gap: 12px;
        flex-basis: 100%;
        justify-content: center;
    }
    .site-nav a { font-size: 0.85em; }

    .hero { padding: 56px 18px 48px; }
    .hero-title { letter-spacing: 0; }
    .hero-lede { font-size: 1.05em; }
    .hero-lede code { font-size: 0.9em; padding: 1px 6px; }

    .section { padding: 48px 18px; }
    .section h2 { margin-bottom: 28px; }

    .decimal-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .price-card--featured { transform: none; }
    .price-card .price { font-size: 2.6em; }

    .preview-frame { padding: 8px; }
}
