/*
 * R15 recipes home four-scene sequence.
 * Mobile-first, scoped to .r15-* plus the page-scoped Astra wrapper reset
 * below. Motion uses transform/opacity and is gated behind the .r15-js
 * class that home-sequence.js adds after the DOM exists, so SSR / no-JS /
 * reduced-motion all render the final state.
 */

/* Astra wrapper reset (front page only): let the scenes span full width. */
body.home .site-content > .ast-container {
    max-width: none;
    padding: 0;
    display: block;
}

.r15-home {
    --r15-ink: #2c211a;
    --r15-muted: #6d5f55;
    --r15-bg: #faf6f0;
    --r15-card: #ffffff;
    --r15-accent: #b5533c;
    --r15-accent-ink: #ffffff;
    --r15-line: #e8ded4;
    background: var(--r15-bg);
    color: var(--r15-ink);
    line-height: 1.7;
}

.r15-scene {
    max-width: 1120px;
    margin: 0 auto;
    padding: 56px 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: center;
    box-sizing: border-box;
}

.r15-scene + .r15-scene {
    border-top: 1px solid var(--r15-line);
}

.r15-kicker {
    margin: 0 0 12px;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: var(--r15-accent);
    font-weight: 600;
}

.r15-title {
    margin: 0 0 16px;
    font-size: clamp(1.9rem, 6vw, 3rem);
    line-height: 1.25;
    font-weight: 700;
}

.r15-heading {
    margin: 0 0 14px;
    font-size: clamp(1.4rem, 4.5vw, 2rem);
    line-height: 1.35;
    font-weight: 700;
}

.r15-lead {
    margin: 0;
    font-size: 1.05rem;
    color: var(--r15-muted);
    max-width: 34em;
}

.r15-text {
    margin: 0 0 20px;
    font-size: 1rem;
    color: var(--r15-muted);
    max-width: 36em;
}

.r15-note {
    margin: 20px 0 0;
    font-size: 0.85rem;
    color: var(--r15-muted);
    border-left: 3px solid var(--r15-line);
    padding-left: 12px;
    max-width: 40em;
}

/* Art-directed pictures: reserve the aspect of the actually served source. */
.r15-scene__media {
    margin: 0;
}

.r15-scene__picture {
    display: block;
}

.r15-scene__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    max-height: 78vh;
    object-fit: cover;
    border-radius: 12px;
    background: var(--r15-line);
}

/* Tool list cards. */
.r15-card-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.r15-card {
    background: var(--r15-card);
    border: 1px solid var(--r15-line);
    border-radius: 10px;
    padding: 16px 18px;
}

.r15-card__title {
    margin: 0 0 6px;
    font-size: 1.02rem;
    font-weight: 600;
}

.r15-card__text {
    margin: 0;
    font-size: 0.92rem;
    color: var(--r15-muted);
}

/* Category navigation row. */
.r15-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 4px;
}

.r15-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid var(--r15-accent);
    border-radius: 9999px;
    color: var(--r15-accent);
    text-decoration: none;
    font-weight: 600;
    background: var(--r15-card);
    box-sizing: border-box;
}

.r15-nav__link:hover {
    background: var(--r15-accent);
    color: var(--r15-accent-ink);
}

/* CTA buttons: 44px touch targets, visible keyboard focus. */
.r15-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
}

.r15-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 22px;
    border-radius: 9999px;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
}

.r15-cta--primary {
    background: var(--r15-accent);
    color: var(--r15-accent-ink);
}

.r15-cta--secondary {
    background: var(--r15-card);
    color: var(--r15-accent);
    border: 1px solid var(--r15-accent);
}

.r15-cta:hover {
    filter: brightness(0.94);
}

.r15-cta:focus-visible,
.r15-nav__link:focus-visible {
    outline: 3px solid var(--r15-ink);
    outline-offset: 2px;
}

/* Motion: initial states exist only once JS has marked the page. */
.r15-js [data-r15-motion="fade"],
.r15-js [data-r15-motion="card"] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.r15-js [data-r15-motion="card"] {
    transform: translateY(8px);
    transition-duration: 0.25s;
}

.r15-js [data-r15-motion].r15-in {
    opacity: 1;
    transform: none;
}

/* CSS-side stagger for the tool cards (<=60ms per card). */
.r15-js .r15-card-list .r15-card:nth-child(2) { transition-delay: 0.05s; }
.r15-js .r15-card-list .r15-card:nth-child(3) { transition-delay: 0.10s; }
.r15-js .r15-card-list .r15-card:nth-child(4) { transition-delay: 0.15s; }

@media (min-width: 768px) {
    .r15-scene {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        gap: 48px;
        padding: 72px 32px;
    }

    .r15-scene--tools .r15-scene__body,
    .r15-scene--table .r15-scene__body {
        order: 2;
    }

    .r15-scene--tools .r15-scene__media,
    .r15-scene--table .r15-scene__media {
        order: 1;
    }

    .r15-scene__img {
        aspect-ratio: 8 / 5;
        max-height: none;
    }

    .r15-card-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .r15-js [data-r15-motion],
    .r15-js [data-r15-motion].r15-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
