/* Chi Rho Code home page. Shared colours, fonts, header, panes, buttons and footer are in
   brand.css, linked before this file. The first screen is the one centred moment on the site:
   the window itself. The products follow the window's own order, emerald on the left (Gospel
   Getter) and cyan on the right (Server Sanctuary). No scripts. */

/* ---------- The first screen ---------- */

.pane-rose {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: max(36rem, calc(100svh - 6.5rem));
    padding-block: clamp(2rem, 4vh, 3.5rem);
    background: #000;
    text-align: center;
}

.pane-rose > * + * {
    margin-top: 0;
}

.rose {
    width: min(28vh, 64vw, 24rem);
    aspect-ratio: 1;
}

/* The tagline, then the verse under it. */
.hero-verse {
    margin: 1.25rem 0 0;
    max-width: 46ch;
}

.hero-verse blockquote {
    margin: 0;
}

.hero-verse p {
    font-family: var(--serif);
    font-size: var(--s-state);
    line-height: 1.35;
}

.hero-verse figcaption {
    margin-top: 0.5rem;
    font-size: var(--s-small);
    color: var(--ink-soft);
}

.home-hero h1 {
    margin-top: clamp(1.25rem, 3vh, 2.25rem);
    max-width: 15em;
    font-size: clamp(2.1rem, 0.9rem + 5.2vw, 6.25rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    font-weight: 620;
}

/* Each phrase stays whole: a line never breaks at its hyphen. */
.home-hero h1 span {
    white-space: nowrap;
}

.home-hero .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem 2rem;
    margin-top: 1.75rem;
}

/* ---------- What we make ---------- */

.products-head {
    grid-column: 1 / 13;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem var(--gap);
    align-items: end;
}

.products-head h2 {
    grid-column: 1 / 8;
}

.products-head p {
    grid-column: 8 / 13;
    margin: 0;
    color: var(--ink-soft);
}

.product {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.product > * + * {
    margin-top: 0;
}

.product-shot {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--black);
}

.product-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 900ms var(--ease-out);
}

.product-shot-gg img {
    object-position: 50% 0;
}

.product-shot-ss {
    background: var(--term);
}

.product-shot-ss img {
    object-fit: contain;
    padding: clamp(0.75rem, 2vw, 1.75rem);
}

.product:hover .product-shot img {
    transform: scale(1.03);
}

.product-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--pad);
}

.product h3 {
    font-size: var(--s-head);
    line-height: 1;
    letter-spacing: -0.02em;
}

.pitch {
    margin-top: 1rem;
    font-family: var(--serif);
    font-size: var(--s-state);
    line-height: 1.25;
    max-width: 30ch;
}

.product ul {
    margin-top: 1.5rem;
}

.product-action {
    margin-top: auto;
    padding-top: 2rem;
}

.product .pane-teal-deep li::marker,
.pane-teal-deep li::marker {
    color: var(--cyan);
}

/* ---------- Why we build ---------- */

.why-head {
    grid-column: 1 / 7;
    padding-top: calc(var(--pad) + 1.5rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
}

.why-head > * + * {
    margin-top: 0;
}

.why-head .statement {
    font-family: var(--serif);
    font-size: var(--s-state);
    line-height: 1.25;
    max-width: 42ch;
}

.why-head p:last-child {
    color: var(--ink-soft);
}

.practice-list {
    grid-column: 7 / 13;
    display: grid;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.practice-list > * + * {
    margin-top: 0;
}

.practice {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 1rem 2rem;
    align-items: baseline;
    padding: 1.5rem 0;
}

.practice + .practice {
    border-top: 4px solid var(--lead);
}

.practice p {
    margin: 0;
    color: var(--ink-soft);
}

.verse {
    grid-column: 1 / 13;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.5rem var(--gap);
    align-items: end;
    padding-block: clamp(2.5rem, 2rem + 3vw, 5rem);
}

.verse blockquote {
    grid-column: 1 / 10;
    margin: 0;
}

.verse blockquote p {
    max-width: 34ch;
    font-family: var(--serif);
    font-size: var(--s-state);
    line-height: 1.35;
}

.verse figcaption {
    grid-column: 10 / 13;
    justify-self: end;
    font-size: var(--s-small);
    color: var(--ink-soft);
}

/* ---------- Contact ---------- */

.contact-main {
    grid-column: 1 / 9;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 20rem;
}

.contact-main p {
    max-width: 52ch;
    color: var(--ink-dark-soft);
}

.contact-main a:not(.button) {
    color: var(--ink-dark);
    font-weight: 600;
}

.contact-main .button {
    margin-top: 1.75rem;
}

.contact-side {
    grid-column: 9 / 13;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.contact-side p {
    color: var(--ink-soft);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
    .rose {
        animation:
            settle 1800ms var(--ease-out) both,
            breathe 16s ease-in-out 1800ms infinite alternate;
    }

    .home-hero h1 { animation: rise 1000ms var(--ease-out) 120ms both; }
    .hero-verse { animation: rise 1000ms var(--ease-out) 220ms both; }
    .home-hero .actions { animation: rise 1000ms var(--ease-out) 320ms both; }

    @keyframes settle {
        from { transform: scale(1.1) rotate(-4deg); }
    }

    @keyframes breathe {
        to { transform: scale(1.035) rotate(1.5deg); }
    }

    @keyframes rise {
        from { transform: translateY(28px); }
    }

    @supports (animation-timeline: view()) {
        /* What is inside each pane rises into place; the lead lines never move. */
        .board:not(.home-hero) > .pane > *,
        .product-text > * {
            animation: enter linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 75%;
        }

        .board:not(.home-hero) > .pane > :nth-child(2),
        .product-text > :nth-child(2) { animation-range: entry 8% entry 83%; }
        .board:not(.home-hero) > .pane > :nth-child(n + 3),
        .product-text > :nth-child(n + 3) { animation-range: entry 16% entry 91%; }

        .foot-window img {
            animation: dawn linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 100%;
        }

        @keyframes enter {
            from { transform: translateY(40px); }
        }

        @keyframes dawn {
            from { transform: translateY(18%) rotate(-6deg); }
        }
    }
}

/* ---------- Tablet ---------- */

@media (max-width: 68rem) {
    .products-head h2,
    .products-head p { grid-column: 1 / 13; }

    .product { grid-column: 1 / 13; }

    .why-head,
    .practice-list { grid-column: 1 / 13; }

    .verse blockquote,
    .verse figcaption { grid-column: 1 / 13; justify-self: start; }

    .contact-main { grid-column: 1 / 13; min-height: 0; }
    .contact-side { grid-column: 1 / 13; }
}

/* ---------- Phone ---------- */

@media (max-width: 46rem) {
    .pane-rose {
        min-height: 0;
        padding-block: 2rem;
    }

    /* Smaller on a phone, so the verse and the tagline both fit on the first screen. */
    .rose {
        width: min(48vw, 14rem);
    }

    .hero-verse p {
        font-size: 1.125rem;
    }

    .home-hero .actions .button {
        width: 100%;
    }

    .products-head,
    .verse {
        display: block;
    }

    .products-head p,
    .verse figcaption {
        margin-top: 1rem;
    }

    .practice {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}
