/* ==========================================================================
   Product page — “the room inside the terracotta door”
   Refinement within DESIGN.md / PRODUCT.md. Shared tokens live in site.css.
   ========================================================================== */

.product-page {
    --prod-shot-radius: 14px;
    --prod-shot-shadow: 0 14px 32px rgb(var(--ink-rgb) / 0.11);
    --prod-shot-shadow-soft: 0 10px 22px rgb(var(--ink-rgb) / 0.08);
    --prod-niche: rgb(var(--terracotta-rgb) / 0.14);
    --prod-section-pad: clamp(56px, 7vw, 96px);
    --prod-gap: clamp(18px, 2vw, 28px);
}

.product-page .u-section.prod-section {
    padding-block: var(--prod-section-pad);
}

/* --------------------------------------------------------------------------
   Shared product shots — UI as furniture, not device chrome
   -------------------------------------------------------------------------- */

.prod-shot {
    margin: 0;
    position: relative;
    border-radius: var(--prod-shot-radius);
    overflow: hidden;
    background: var(--warm-neutral);
    box-shadow: var(--prod-shot-shadow);
    pointer-events: none;
    user-select: none;
}

.prod-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.prod-archive__label {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgb(var(--ink-rgb) / 0.62);
    text-align: center;
}

.prod-swipe-cue {
    display: none;
}

/* --------------------------------------------------------------------------
   1 · Hero — flat paper + layered archive / conversation / review
   -------------------------------------------------------------------------- */

.prod-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(48px, 6vw, 88px) clamp(56px, 7vw, 110px);
    background: var(--paper);
}

.prod-hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: center;
}

.prod-hero__title {
    max-width: 14ch;
}

.prod-hero__lede {
    margin-top: clamp(18px, 2.2vw, 28px);
    max-width: 42ch;
}

.prod-hero__actions {
    margin-top: clamp(24px, 2.8vw, 36px);
}

.prod-hero__stage {
    position: relative;
    min-height: clamp(340px, 42vw, 480px);
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1fr) minmax(0, 0.88fr);
    gap: var(--prod-gap);
    align-items: end;
    justify-items: center;
    padding: 8px 0 0;
}

.prod-hero__niche {
    position: absolute;
    inset: 10% 8% 0;
    border-radius: 24px 24px 12px 12px;
    background: var(--prod-niche);
    box-shadow: inset 0 0 0 1px rgb(var(--terracotta-rgb) / 0.16);
    z-index: 0;
    pointer-events: none;
}

.prod-shot--hero-main,
.prod-shot--hero-left,
.prod-shot--hero-right {
    position: relative;
    z-index: 1;
    aspect-ratio: 473 / 1024;
    width: 100%;
    margin: 0;
}

.prod-shot--hero-main {
    z-index: 3;
    max-width: 264px;
    box-shadow: var(--prod-shot-shadow);
}

.prod-shot--hero-left,
.prod-shot--hero-right {
    z-index: 2;
    max-width: 228px;
    box-shadow: var(--prod-shot-shadow-soft);
}

/* --------------------------------------------------------------------------
   Beat layout — copy + large UI
   -------------------------------------------------------------------------- */

.prod-beat {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(28px, 4.5vw, 72px);
    align-items: end;
}

.prod-beat--flip .prod-beat__copy {
    order: 2;
}

.prod-beat--flip .prod-beat__visual {
    order: 1;
}

.prod-beat__title {
    max-width: 16ch;
    margin-bottom: 16px;
}

.prod-beat__copy .u-body {
    max-width: 40ch;
}

.prod-note {
    margin-top: 18px;
    max-width: 36ch;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.45;
    color: rgb(var(--ink-rgb) / 0.72);
}

.prod-captions {
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
    display: grid;
    gap: 14px;
    max-width: 38ch;
}

.prod-captions li {
    padding-top: 12px;
    border-top: 1px solid var(--rule);
    font-size: 0.94rem;
    line-height: 1.55;
    color: rgb(var(--ink-rgb) / 0.68);
}

.prod-captions__label {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--terracotta);
}

/* Conversation cluster — primary + support, shared baseline, no tilt */
.prod-cluster {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
    gap: clamp(16px, 1.6vw, 24px);
    align-items: end;
    justify-items: center;
}

.prod-shot--cluster-primary,
.prod-shot--cluster-support {
    aspect-ratio: 473 / 1024;
    width: 100%;
    margin: 0;
}

.prod-shot--cluster-primary {
    max-width: 272px;
    z-index: 2;
    box-shadow: var(--prod-shot-shadow);
}

.prod-shot--cluster-support {
    max-width: 248px;
    z-index: 1;
    box-shadow: var(--prod-shot-shadow-soft);
}

/* Review shelf — terracotta ledge */
.prod-shelf {
    position: relative;
    display: grid;
    place-items: end center;
    min-height: clamp(340px, 46vw, 480px);
    padding-bottom: 36px;
}

.prod-shelf__ledge {
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: 8%;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(
        180deg,
        rgb(var(--terracotta-rgb) / 0.24) 0%,
        rgb(var(--deep-rust-rgb) / 0.4) 100%
    );
    box-shadow: 0 8px 22px rgb(var(--ink-rgb) / 0.1);
}

.prod-shot--featured {
    width: min(70%, 280px);
    aspect-ratio: 473 / 1024;
    z-index: 1;
    margin: 0;
    box-shadow: var(--prod-shot-shadow);
}

/* --------------------------------------------------------------------------
   Private archive — central product proof
   -------------------------------------------------------------------------- */

.prod-archive__head {
    max-width: 720px;
}

.prod-archive__title {
    max-width: 16ch;
}

.prod-archive__lede {
    margin-top: 1.2rem;
    max-width: 52ch;
}

.prod-archive__grid {
    margin-top: clamp(36px, 4.5vw, 56px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--prod-gap);
    align-items: end;
    justify-items: center;
}

.prod-archive__col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.prod-archive__col .prod-archive__label {
    width: 100%;
}

.prod-shot--archive {
    aspect-ratio: 473 / 1024;
    width: 100%;
    max-width: 210px;
    margin: 0;
    box-shadow: var(--prod-shot-shadow-soft);
}

/* --------------------------------------------------------------------------
   Living archive — copy column + equal phone row
   -------------------------------------------------------------------------- */

.prod-grow {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 1.6vw, 24px);
    align-items: end;
    justify-items: center;
}

.prod-shot--grow {
    aspect-ratio: 473 / 1024;
    width: 100%;
    max-width: 220px;
    margin: 0;
    box-shadow: var(--prod-shot-shadow-soft);
}

.prod-grow__layers {
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
    max-width: 38ch;
}

.prod-grow__layers li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
    font-size: 0.94rem;
    line-height: 1.55;
    color: rgb(var(--ink-rgb) / 0.68);
}

.prod-grow__layers li::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--terracotta);
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Story modes
   -------------------------------------------------------------------------- */

.prod-modes__title {
    max-width: 16ch;
}

.prod-modes__grid {
    margin-top: clamp(24px, 2.8vw, 36px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 760px;
    gap: clamp(20px, 3vw, 40px);
}

.prod-modes .principles__item {
    align-items: start;
}

/* --------------------------------------------------------------------------
   Privacy and control
   -------------------------------------------------------------------------- */

.prod-privacy {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(28px, 4vw, 72px);
    align-items: start;
}

.prod-privacy .u-h2 {
    max-width: 18ch;
}

.prod-privacy__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
}

.prod-privacy__list li {
    display: grid;
    gap: 6px;
    padding: clamp(18px, 2vw, 24px) 0;
    border-top: 1px solid var(--rule);
}

.prod-privacy__list li:last-child {
    border-bottom: 1px solid var(--rule);
}

.prod-privacy__list strong {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--ink);
}

.prod-privacy__list span {
    font-size: 0.94rem;
    line-height: 1.55;
    color: rgb(var(--ink-rgb) / 0.68);
    max-width: 42ch;
}

/* --------------------------------------------------------------------------
   Final CTA — dark band (shared u-section--dark)
   -------------------------------------------------------------------------- */

.prod-endcta {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    text-align: left;
}

.prod-endcta__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.7fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: center;
}

.prod-endcta__title {
    max-width: 14ch;
    color: var(--paper);
}

.prod-endcta .u-actions {
    margin-top: clamp(24px, 3vw, 36px);
    justify-content: flex-start;
}

.prod-shot--end {
    width: min(100%, 240px);
    aspect-ratio: 473 / 1024;
    justify-self: end;
    box-shadow: 0 24px 56px rgb(0 0 0 / 0.35);
}

.prod-endcta .prod-shot--end {
    background: rgb(var(--ink-rgb) / 0.4);
}

/* --------------------------------------------------------------------------
   Motion — restrained depth; RM respected
   -------------------------------------------------------------------------- */

/* Shot groups use shared [data-u-reveal] — slightly taller rise for product proof */
@media (prefers-reduced-motion: no-preference) {
    .reveal-on .product-page .prod-hero__stage[data-u-reveal],
    .reveal-on .product-page .prod-cluster[data-u-reveal],
    .reveal-on .product-page .prod-archive__grid[data-u-reveal],
    .reveal-on .product-page .prod-grow[data-u-reveal],
    .reveal-on .product-page .prod-shelf[data-u-reveal] {
        transform: translateY(18px);
    }

    .reveal-on .product-page .prod-hero__stage[data-u-reveal].is-in,
    .reveal-on .product-page .prod-cluster[data-u-reveal].is-in,
    .reveal-on .product-page .prod-archive__grid[data-u-reveal].is-in,
    .reveal-on .product-page .prod-grow[data-u-reveal].is-in,
    .reveal-on .product-page .prod-shelf[data-u-reveal].is-in {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .prod-shot--hero-left,
    .prod-shot--hero-right,
    .prod-shot--hero-main,
    .prod-shot--cluster-primary,
    .prod-shot--cluster-support,
    .prod-shot--archive,
    .prod-shot--grow,
    .prod-shot--featured {
        transform: none;
    }

    .prod-hero__niche,
    .prod-shelf__ledge {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   Responsive — tablet less overlap; mobile stack
   -------------------------------------------------------------------------- */

@media (max-width: 1050px) {
    .prod-hero__inner,
    .prod-beat,
    .prod-privacy,
    .prod-endcta__inner {
        grid-template-columns: 1fr;
    }

    .prod-beat--flip .prod-beat__copy,
    .prod-beat--flip .prod-beat__visual {
        order: 0;
    }

    .prod-hero__room {
        opacity: 0.3;
        right: -16%;
        width: min(90vw, 720px);
    }

    .prod-hero__stage,
    .prod-cluster,
    .prod-shelf {
        min-height: clamp(300px, 62vw, 440px);
        margin-top: 8px;
    }

    .prod-grow {
        margin-top: 8px;
    }

    .prod-hero__stage {
        gap: 12px;
    }

    .prod-shot--hero-main,
    .prod-shot--cluster-primary,
    .prod-shot--featured {
        max-width: 240px;
    }

    .prod-shot--hero-left,
    .prod-shot--hero-right,
    .prod-shot--cluster-support {
        max-width: 180px;
    }

    .prod-shot--archive {
        max-width: 180px;
    }

    .prod-shot--grow {
        max-width: 200px;
    }

    .prod-archive__grid {
        gap: 14px;
    }

    .prod-modes__grid {
        grid-template-columns: 1fr 1fr;
    }

    .prod-shot--end {
        justify-self: start;
        width: min(52%, 200px);
    }
}

@media (max-width: 700px) {
    .product-page {
        --prod-section-pad: clamp(48px, 12vw, 72px);
    }

    .prod-hero {
        padding-block: 40px 56px;
    }

    .prod-hero__title {
        max-width: 100%;
    }

    .prod-hero__lede {
        max-width: 36ch;
    }

    .prod-hero__room {
        right: auto;
        left: 8%;
        top: auto;
        bottom: -6%;
        width: 130%;
        opacity: 0.34;
        mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
        -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
    }

    .prod-hero__actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .prod-hero__actions .u-btn {
        width: fit-content;
        max-width: 100%;
        padding-inline: 28px;
    }

    /* Coherent beat blocks: copy then full-width media, no viewport rooms */
    .prod-beat,
    .prod-privacy,
    .prod-endcta__inner {
        grid-template-columns: 1fr;
        gap: 20px;
        align-items: start;
        justify-content: start;
        min-height: 0;
    }

    .prod-beat--flip .prod-beat__copy,
    .prod-beat--flip .prod-beat__visual {
        order: 0;
    }

    .prod-beat__copy,
    .prod-beat__visual,
    .prod-beat__title,
    .prod-beat__copy .u-body,
    .prod-note,
    .prod-captions {
        width: 100%;
        max-width: none;
    }

    .prod-section {
        min-height: 0;
        justify-content: flex-start;
    }

    .prod-hero__stage,
    .prod-cluster,
    .prod-shelf,
    .prod-grow {
        position: relative;
        inset: auto;
        transform: none;
        min-height: 0;
        width: 100%;
        margin-top: 8px;
        justify-content: start;
        justify-items: stretch;
        align-items: start;
    }

    .prod-hero__stage {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        place-items: center;
    }

    .prod-hero__niche {
        inset: 8% 10% auto;
        height: 70%;
    }

    .prod-shot--hero-main,
    .prod-shot--hero-left,
    .prod-shot--hero-right,
    .prod-shot--cluster-primary,
    .prod-shot--cluster-support,
    .prod-shot--featured,
    .prod-shot--grow,
    .prod-shot--end {
        position: relative;
        inset: auto;
        transform: none;
        width: min(100%, 280px);
        max-width: 280px;
        margin-inline: auto;
    }

    .prod-shot--hero-left,
    .prod-shot--hero-right,
    .prod-shot--cluster-support {
        display: none;
    }

    .prod-cluster {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .prod-shelf {
        place-items: center;
        padding-bottom: 20px;
    }

    .prod-shelf__ledge {
        left: 8%;
        right: 8%;
        bottom: 4%;
    }

    .prod-archive__grid {
        grid-template-columns: 1fr;
        gap: 28px;
        justify-items: center;
    }

    .prod-shot--archive {
        width: min(100%, 240px);
        max-width: 240px;
    }

    .prod-grow {
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .prod-shot--grow {
        order: 2;
    }

    .prod-modes__grid {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .prod-modes .principles__item {
        padding-block: 28px;
    }

    .prod-endcta__inner {
        gap: 28px;
    }

    .prod-endcta .u-actions {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .prod-endcta .u-actions .u-btn {
        width: fit-content;
        max-width: 100%;
        padding-inline: 28px;
        flex: 0 1 auto;
        min-width: 0;
    }

    .prod-endcta__title {
        max-width: 100%;
    }

    .prod-shot--end {
        justify-self: start;
        margin-inline: 0;
    }

    /* App screens are product proof, not a squeezed desktop collage. Native
       scrolling keeps each screen readable and exposes every item by swipe,
       trackpad, scrollbar, or keyboard focus. */
    .prod-mobile-gallery {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: min(82vw, 320px);
        grid-template-columns: none;
        align-items: start;
        justify-items: stretch;
        gap: 16px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        scroll-snap-type: inline mandatory;
        scrollbar-width: thin;
        padding: 4px 0 18px;
        margin: 8px 0 0;
        -webkit-overflow-scrolling: touch;
    }

    .prod-mobile-gallery > .prod-shot,
    .prod-mobile-gallery > .prod-archive__col {
        display: block;
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 0;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .prod-cluster.prod-mobile-gallery .prod-shot--cluster-support,
    .prod-cluster.prod-mobile-gallery .prod-shot--cluster-primary {
        display: block;
    }

    .prod-shelf.prod-mobile-gallery {
        min-height: 0;
        padding-top: 4px;
        padding-bottom: 18px;
    }

    .prod-shelf.prod-mobile-gallery .prod-shelf__ledge {
        display: none;
    }

    .prod-shelf.prod-mobile-gallery .prod-shot--featured {
        width: 100%;
        max-width: none;
    }

    .prod-archive__grid.prod-mobile-gallery {
        align-items: start;
        justify-items: stretch;
        gap: 16px;
    }

    .prod-archive__grid.prod-mobile-gallery .prod-archive__col {
        display: grid;
        gap: 10px;
        align-items: start;
    }

    .prod-archive__grid.prod-mobile-gallery .prod-shot--archive {
        width: 100%;
        max-width: none;
    }

    .prod-swipe-cue {
        display: none;
    }

    .prod-cluster.prod-mobile-gallery + .prod-swipe-cue {
        display: inline-flex;
        width: max-content;
        margin: -8px 0 0;
        padding-top: 4px;
        font-size: 0.72rem;
        letter-spacing: 0.06em;
        color: rgb(var(--ink-rgb) / 0.58);
        pointer-events: none;
    }

    .prod-swipe-cue span {
        margin-left: 6px;
        font-size: 1rem;
    }
}

@media (max-width: 520px) {
    .prod-endcta .u-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .prod-endcta .u-actions .u-btn {
        width: 100%;
    }
}
