/* =============================================================================
   Project Landing — a mini product page for flagship projects
   Editorial · monotone-dark · flat surfaces, hairline rules, one solid accent
   (--lp-accent, set inline by the page template).
   ============================================================================= */

/* Widen the reading column into the editorial grid for landing pages */
.container:has(.project-landing) {
    max-width: var(--max-width-wide);
}

.project-landing {
    --lp-accent: var(--accent-warm);
}

/* ---- Back link ---------------------------------------------------------- */
.lp-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: var(--spacing-xl);
    font-family: var(--font-family-mono);
    font-size: var(--font-size-x-small);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.18s ease, gap 0.18s ease;
}

.lp-back svg {
    width: 14px;
    height: 14px;
}

.lp-back:hover {
    color: var(--text-primary);
    gap: 0.55rem;
}

/* =============================================================================
   Hero
   ============================================================================= */
.lp-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);
    padding: clamp(1rem, 3vw, 2.5rem) 0 clamp(2.5rem, 5vw, 4.5rem);
    border-bottom: 1px solid var(--border-color);
}

.lp-hero-main,
.lp-hero-aside {
    min-width: 0;
}

.lp-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1.1rem;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-x-small);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--lp-accent);
}

.lp-hero-eyebrow::before {
    content: "";
    width: 1.75rem;
    height: 1px;
    background: var(--lp-accent);
}

.lp-hero-title {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 1.5vw, 1.1rem);
    margin: 0;
    font-family: var(--font-family-display);
    font-size: clamp(2.6rem, 1.6rem + 4.4vw, 4.75rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    text-wrap: balance;
}

.lp-hero-logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(2.6rem, 5vw, 3.8rem);
    height: clamp(2.6rem, 5vw, 3.8rem);
    padding: 0.5rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
}

.lp-hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lp-hero-tagline {
    margin: 1.4rem 0 0;
    max-width: 40ch;
    font-size: clamp(1.05rem, 1rem + 0.45vw, 1.3rem);
    line-height: 1.55;
    color: var(--text-secondary);
    letter-spacing: var(--tracking-snug);
    text-wrap: pretty;
}

/* ---- Badges ------------------------------------------------------------- */
.lp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.6rem;
}

.lp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.6rem;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    line-height: 1.2;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* sapi-driven stars carry no static fallback: hide the whole element until JS
   fills it from sapi (and keep it hidden on fetch error / missing repo). */
.lp-badge--star:has([data-sapi-star]:empty),
.lp-metric:has([data-sapi-star]:empty) {
    display: none;
}

.lp-badge--star {
    color: var(--text-primary);
}

.lp-badge--star .lp-badge-star-icon {
    color: var(--lp-accent);
}

.lp-badge--soft {
    color: var(--lp-accent);
    border-color: var(--lp-accent);
}

/* ---- Actions / buttons -------------------------------------------------- */
.lp-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.lp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.3rem;
    border-radius: 6px;
    font-family: var(--font-family-sans);
    font-size: var(--font-size-x-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    line-height: 1;
    border: 1px solid transparent;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        gap 0.2s ease;
    white-space: nowrap;
}

.lp-btn svg {
    width: 13px;
    height: 13px;
}

.lp-btn--primary {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.lp-btn--primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    gap: 0.75rem;
}

.lp-btn--ghost {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: transparent;
}

.lp-btn--ghost:hover {
    border-color: var(--lp-accent);
    color: var(--lp-accent);
}

.lp-btn--text {
    padding: 0.8rem 0.4rem;
    color: var(--text-secondary);
    border-color: transparent;
}

.lp-btn--text:hover {
    color: var(--text-primary);
}

/* ---- Hero aside (visual) ------------------------------------------------ */
.lp-hero-figure {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    aspect-ratio: 16 / 11;
}

.lp-hero-figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(60%) contrast(1.04);
    transition: filter 0.45s ease;
}

.lp-hero-figure:hover img {
    filter: grayscale(0%) contrast(1);
}

.lp-hero-medallion {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    max-width: 320px;
    margin-inline: auto;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.lp-hero-medallion img {
    width: 76%;
    height: 76%;
    object-fit: contain;
}

/* Typographic monogram medallion for projects without a logo/image */
.lp-hero-mono span {
    font-family: var(--font-family-display);
    font-weight: 800;
    font-size: clamp(2.4rem, 1.4rem + 4.5vw, 3.8rem);
    letter-spacing: -0.05em;
    line-height: 1;
    color: var(--lp-accent);
}

/* When a project has no hero visual at all, let the text span full width */
.lp-hero:not(:has(.lp-hero-aside)) {
    grid-template-columns: 1fr;
}

/* =============================================================================
   Metrics row
   ============================================================================= */
.lp-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    margin: 0;
    padding: clamp(1.75rem, 3vw, 2.5rem) 0;
    border-bottom: 1px solid var(--border-color);
}

.lp-metric {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.25rem clamp(1rem, 2.5vw, 2rem);
    position: relative;
}

.lp-metric + .lp-metric::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 2.4rem;
    width: 1px;
    background: var(--border-color);
}

.lp-metric-value {
    font-family: var(--font-family-display);
    font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.9rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.lp-metric-label {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
}

/* =============================================================================
   Generic landing block + section heading
   ============================================================================= */
.lp-block {
    padding: clamp(2.5rem, 5vw, 4.5rem) 0;
    border-bottom: 1px solid var(--border-color);
}

.lp-section-head {
    max-width: 60ch;
    margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
}

.lp-eyebrow {
    margin: 0 0 0.75rem;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-x-small);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--lp-accent);
}

.lp-section-title {
    margin: 0;
    font-family: var(--font-family-display);
    font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.3rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--text-primary);
    text-wrap: balance;
}

.lp-section-intro {
    margin: 1rem 0 0;
    font-size: var(--font-size-lg);
    line-height: 1.6;
    color: var(--text-secondary);
    text-wrap: pretty;
}

/* =============================================================================
   Feature grid
   ============================================================================= */
.lp-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--spacing-md);
}

.lp-feature {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.lp-feature::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    border-radius: 8px 8px 0 0;
    background: var(--lp-accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lp-feature:hover {
    border-color: var(--rule-strong);
    background: var(--bg-tertiary);
}

.lp-feature:hover::before {
    opacity: 1;
}

.lp-feature-index {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    font-weight: 500;
    letter-spacing: var(--tracking-wide);
    color: var(--lp-accent);
    font-variant-numeric: tabular-nums;
}

.lp-feature-title {
    margin: 0;
    font-family: var(--font-family-display);
    font-size: var(--font-size-lg);
    font-weight: 700;
    letter-spacing: -0.012em;
    line-height: 1.25;
    color: var(--text-primary);
}

.lp-feature-desc {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.6;
    color: var(--text-secondary);
    text-wrap: pretty;
}

/* =============================================================================
   Terminal showcase
   ============================================================================= */
.lp-terminal {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-recess);
}

.lp-terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.lp-terminal-dots {
    display: inline-flex;
    gap: 0.4rem;
}

.lp-terminal-dots i {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--border-light);
}

.lp-terminal-dots i:first-child {
    background: var(--lp-accent);
}

.lp-terminal-name {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
}

.lp-terminal-body {
    padding: clamp(1rem, 2.5vw, 1.6rem) clamp(1.1rem, 2.5vw, 1.8rem);
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    line-height: 1.85;
    overflow-x: auto;
}

.lp-term-line {
    white-space: pre;
}

.lp-term-cmd {
    color: var(--text-primary);
}

.lp-term-comment {
    color: var(--text-muted);
    font-style: italic;
}

.lp-term-out {
    color: var(--text-secondary);
}

.lp-terminal-caption {
    margin: var(--spacing-md) 0 0;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
}

/* =============================================================================
   Closing CTA band
   ============================================================================= */
.lp-cta {
    margin-top: clamp(2.5rem, 5vw, 4.5rem);
    padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3.5rem);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    background: var(--bg-secondary);
}

.lp-cta-inner {
    max-width: 46ch;
    margin-inline: auto;
}

.lp-cta-title {
    margin: 0;
    font-family: var(--font-family-display);
    font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
    text-wrap: balance;
}

.lp-cta-text {
    margin: 1rem 0 0;
    font-size: var(--font-size-lg);
    line-height: 1.6;
    color: var(--text-secondary);
    text-wrap: pretty;
}

.lp-cta .lp-actions {
    justify-content: center;
}

/* =============================================================================
   Screenshots strip (App Store-style)
   ============================================================================= */
.lp-shots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.lp-shot {
    margin: 0;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    transition: border-color 0.2s ease;
}

.lp-shot:hover {
    border-color: var(--rule-strong);
}

.lp-shot img {
    display: block;
    width: 100%;
    height: auto;
}

/* =============================================================================
   Prose (rich markdown body kept under the hero/metrics)
   ============================================================================= */
.lp-prose {
    max-width: 760px;
    color: var(--text-secondary);
}

.lp-prose > *:first-child {
    margin-top: 0;
}

.lp-prose h2,
.lp-prose h3,
.lp-prose h4,
.lp-prose strong {
    color: var(--text-primary);
}

.lp-prose a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-underline-offset: 3px;
    transition:
        color 0.18s ease,
        text-decoration-color 0.18s ease;
}

.lp-prose a:hover {
    color: var(--lp-accent);
    text-decoration-color: var(--lp-accent);
}

.lp-prose img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: var(--spacing-xl) 0;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.lp-prose hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: var(--spacing-xxl) 0;
}

/* =============================================================================
   Responsive
   ============================================================================= */
@media (max-width: 860px) {
    .lp-hero {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .lp-hero-aside {
        order: -1;
    }

    .lp-hero-medallion {
        max-width: 220px;
    }

    .lp-hero-figure {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 520px) {
    .lp-metric + .lp-metric::before {
        display: none;
    }

    .lp-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg) 0;
    }

    .lp-actions .lp-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}
