/* Explain: Layout utilities for section flow, container spacing, and scroll-snap behavior. */
.container-narrow {
    width: 100%;
    max-width: 76rem;
    margin-inline: auto;
    padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}

/* ------------------------------------------------------------------ */
/* Viewport-based, full-screen section flow                           */
/* ------------------------------------------------------------------ */

/* Scroll snapping is a desktop-only enhancement. Tablets and phones
   keep the native, free touch scroll so long content is never trapped. */
@media (min-width: 1024px) and (min-height: 620px) and (prefers-reduced-motion: no-preference) {
    html {
        scroll-snap-type: y proximity;
    }

    main > section,
    #contact {
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
}

/* Keep a snapped / anchored section clear of the fixed masthead */
main > section,
#contact {
    scroll-margin-top: clamp(4rem, 8vh, 5.5rem);
}

/* One chapter per screen. min-height (never a fixed height) so a section
   that needs more room simply grows instead of clipping its content. */
.section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding-block: clamp(3.25rem, 8vh, 5.75rem);
}

.section-head {
    max-width: 42rem;
    margin-inline: auto;
    text-align: center;
}

/* Short viewports (landscape phones, small laptops): stop forcing a full
   screen and let the composition breathe instead of cramming. */
@media (max-height: 620px) {
    .section {
        min-height: 0;
        padding-block: clamp(2.75rem, 7vh, 3.5rem);
    }
}

/* Full-page section fade-in */
.snap-fade {
    opacity: 0;
    transition: opacity 1s cubic-bezier(.22, .61, .36, 1);
}

.snap-fade.is-inview {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .snap-fade {
        opacity: 1;
        transition: none;
    }
}