/* =====================================================================
   LEGEND product page — sits on the awaio theme (nav/footer from
   ../style.css) but uses Legend's own look: black, white and greys,
   JetBrains Mono, and the figure brings the colour.
   Tokens mirror project_legend/src/App.css.
   ===================================================================== */
.legend-page {
    --lg-bg: #000;
    --lg-ink: #c8c8c8;
    --lg-muted: #6e6e6e;
    --lg-line: #262626;
    --lg-accent: #f2f2f2;
    --lg-mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
    background: var(--lg-bg);
}

.legend-page .nav.aw-nav {
    background: rgba(0, 0, 0, 0.7);
}

/* ---------- Hero: full-bleed render loop ---------- */
.lg-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    padding: 0 3rem 6rem;
    overflow: hidden;
    isolation: isolate;
}

.lg-hero video,
.lg-hero .lg-hero-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.lg-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.55) 35%, transparent 65%),
        linear-gradient(to right, rgba(0, 0, 0, 0.6) 0%, transparent 55%);
}

.lg-hero-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.lg-mark {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--lg-mono);
    font-size: clamp(2.75rem, 7vw, 5.5rem);
    color: var(--lg-accent);
    letter-spacing: -0.02em;
    line-height: 1;
    margin: 0 0 1.25rem;
    font-weight: 400;
}

.lg-mark img {
    height: 1.25em;
    width: auto;
}

.lg-tagline {
    font-family: var(--lg-mono);
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    color: var(--lg-ink);
    max-width: 34ch;
    line-height: 1.5;
    margin: 0 0 2rem;
}

.lg-meta {
    font-family: var(--lg-mono);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--lg-muted);
    margin-bottom: 1.25rem;
    display: block;
}

.lg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.lg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.4rem;
    border-radius: 999px;
    font-family: var(--lg-mono);
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid var(--lg-line);
    color: var(--lg-ink);
    background: rgba(0, 0, 0, 0.5);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lg-btn:hover {
    color: #fff;
    border-color: #555;
    background: rgba(255, 255, 255, 0.07);
}

.lg-btn.primary {
    background: var(--lg-accent);
    color: #000;
    border-color: var(--lg-accent);
}

.lg-btn.primary:hover {
    background: #fff;
    color: #000;
}

/* ---------- Sections ---------- */
.lg-section {
    padding: 7rem 3rem;
    border-top: 1px solid var(--lg-line);
}

.lg-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.lg-label {
    display: block;
    font-family: var(--lg-mono);
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--lg-muted);
    margin-bottom: 1.25rem;
}

.lg-h2 {
    font-family: var(--lg-mono);
    font-weight: 400;
    font-size: clamp(1.6rem, 3.2vw, 2.5rem);
    letter-spacing: -0.02em;
    color: var(--lg-accent);
    line-height: 1.2;
    margin: 0 0 1.5rem;
    max-width: 26ch;
}

.lg-body {
    color: var(--lg-ink);
    font-size: 1.08rem;
    line-height: 1.75;
    max-width: 62ch;
    margin: 0 0 1.25rem;
}

/* Head / heart / gut / spirit */
.lg-regions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--lg-line);
    margin-top: 3rem;
}

.lg-region {
    padding: 1.75rem;
    border-right: 1px solid var(--lg-line);
}

.lg-region:last-child {
    border-right: 0;
}

.lg-region h3 {
    font-family: var(--lg-mono);
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--lg-accent);
    margin: 0 0 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lg-region h3::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
}

.lg-region p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--lg-muted);
    margin: 0;
}

/* Gallery */
.lg-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 3rem;
}

.lg-gallery figure {
    margin: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #050505;
}

.lg-gallery figure.wide {
    grid-column: span 2;
}

.lg-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.lg-gallery figure:hover img {
    transform: scale(1.03);
}

/* Feature table */
.lg-features {
    margin-top: 3rem;
    border-top: 1px solid var(--lg-line);
}

.lg-feature {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--lg-line);
}

.lg-feature dt {
    font-family: var(--lg-mono);
    font-size: 0.85rem;
    color: var(--lg-accent);
}

.lg-feature dd {
    margin: 0;
    color: var(--lg-ink);
    font-size: 1rem;
    line-height: 1.6;
}

.lg-rule {
    font-family: var(--lg-mono);
    font-size: clamp(1.5rem, 3.5vw, 2.6rem);
    color: var(--lg-accent);
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0 0 1.5rem;
}

.lg-code {
    font-family: var(--lg-mono);
    font-size: 0.9rem;
    color: var(--lg-ink);
    background: #0a0a0a;
    border: 1px solid var(--lg-line);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
    line-height: 1.8;
}

.lg-code .c {
    color: var(--lg-muted);
}

.legend-page .footer.aw-footer {
    background: #000;
}

@media (max-width: 900px) {
    .lg-regions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lg-region:nth-child(2) {
        border-right: 0;
    }

    .lg-region:nth-child(-n+2) {
        border-bottom: 1px solid var(--lg-line);
    }

    .lg-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .lg-hero {
        padding: 0 1.5rem 4rem;
    }

    .lg-section {
        padding: 4.5rem 1.5rem;
    }

    .lg-regions,
    .lg-gallery {
        grid-template-columns: 1fr;
    }

    .lg-region {
        border-right: 0;
        border-bottom: 1px solid var(--lg-line);
    }

    .lg-region:last-child {
        border-bottom: 0;
    }

    .lg-gallery figure.wide {
        grid-column: auto;
    }

    .lg-feature {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
}

/* Renders come out on Legend's grey stage; push that grey toward black
   so the figure floats on the page instead of sitting in a box. */
.lg-hero video,
.lg-hero .lg-hero-poster,
.lg-frame video,
.lg-gallery img {
    filter: brightness(0.72) contrast(1.4) saturate(1.15);
}

.lg-split {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

.lg-frame {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--lg-line);
}

.lg-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 900px) {
    .lg-split {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .lg-frame {
        max-width: 420px;
    }
}

/* ---------- Built by an agent: daily / weekly / always ---------- */
.lg-cadence {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--lg-line);
    margin-top: 3rem;
}

.lg-cadence > div {
    padding: 1.75rem;
    border-right: 1px solid var(--lg-line);
}

.lg-cadence > div:last-child {
    border-right: 0;
}

.lg-when {
    display: inline-block;
    font-family: var(--lg-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #000;
    background: var(--lg-accent);
    padding: 0.25rem 0.55rem;
    margin-bottom: 1rem;
}

.lg-cadence h3 {
    font-family: var(--lg-mono);
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--lg-accent);
    margin: 0 0 0.5rem;
}

.lg-cadence p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--lg-muted);
    margin: 0;
}

@media (max-width: 760px) {
    .lg-cadence {
        grid-template-columns: 1fr;
    }

    .lg-cadence > div {
        border-right: 0;
        border-bottom: 1px solid var(--lg-line);
    }

    .lg-cadence > div:last-child {
        border-bottom: 0;
    }
}
