/* ==========================================================================
   PAGE: HOME (index.php)
   ========================================================================== */

/* --- Hero: the main project --------------------------------------------------
   Fills the first screen; the chapter strip sits at its bottom edge. */
.home-hero {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
}

.home-hero__intro {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.875rem, 0.5rem + 1.8svh, 1.75rem);
    padding-block: clamp(1.5rem, 4svh, 3.5rem) clamp(1.75rem, 4svh, 3rem);
    text-align: center;
}

.home-hero__stage {
    width: 100%;
    container-type: inline-size;
}

/* The longest line, AUFKLÄRUNG, is 4.65em wide in Anton: at 20.8cqi it fills
   the width on phones. On wide screens the height cap takes over, so lead,
   buttons and the chapter strip still fit on the first screen. */
.home-hero__title {
    font-size: min(19vw, 20vh, 15rem);         /* fallback for browsers without cqi/svh */
    font-size: min(20.8cqi, 20svh, 15rem);
    line-height: 1.06;
    letter-spacing: 0;
}

/* Laptops: the browser bar leaves little height, keep the buttons in view. */
@media (min-width: 900px) and (max-height: 760px) {
    .home-hero__title {
        font-size: min(20.8cqi, 17svh);
    }
}

.home-hero__link {
    display: block;
    border-radius: var(--radius-md);
}

.home-hero__line {
    display: block;
    width: fit-content;
    margin-inline: auto;
}

/* A line-end hyphen hangs: equal room on the left (Anton's hyphen is 0.31em)
   keeps the word itself centred. */
.home-hero__line--hyphen {
    padding-left: 0.31em;
}

/* Photos inside the letters. The title stays real text (search engines, screen
   readers); browsers without background-clip: text show it in ink. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .home-hero__line {
        background-color: var(--ink);
        background-image: linear-gradient(rgba(36, 36, 36, 0.22), rgba(36, 36, 36, 0.22)), var(--photo-small);
        background-position: var(--photo-focus);
        background-size: cover;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        transition: filter var(--duration-slow) var(--ease-out);
    }

    .home-hero__link:hover .home-hero__line {
        filter: saturate(1.25) brightness(1.08);
    }

    @media (min-width: 900px) {
        .home-hero__line {
            background-image: linear-gradient(rgba(36, 36, 36, 0.22), rgba(36, 36, 36, 0.22)), var(--photo);
        }
    }
}

.home-hero__lead {
    max-width: 54ch;
    font-size: var(--text-lead);
}

.home-hero__actions {
    justify-content: center;
    margin-top: 0.25rem;
}

/* Phones: two equal buttons side by side, like a native app — stacked only
   where they don't fit (the smallest screens). */
@media (max-width: 599px) {
    .home-hero__actions {
        width: 100%;
        gap: 0.5rem;
    }

    .home-hero__actions .btn {
        flex: 1 1 0;
        min-width: fit-content;
        padding-inline: 1rem;
        font-size: var(--text-xs);  /* side by side from 360px wide */
    }
}

/* --- Chapter strip: the five slides of the main project --------------------- */
.chapters {
    position: relative;
}

.chapters::before {
    content: '';
    position: absolute;
    top: 0;
    right: var(--gutter);
    left: var(--gutter);
    border-top: 1px solid var(--color-line);
}

.chapters__list {
    display: flex;
    gap: 0.5rem;
    margin-inline: calc(-1 * var(--gutter));
    padding: 1rem var(--gutter) 1.25rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
}

.chapters__list::-webkit-scrollbar {
    display: none;
}

.chapter {
    flex: 0 0 min(82vw, 19rem);
    scroll-snap-align: start;
}

.chapter__link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    height: 100%;
    padding: 0.5rem 0.625rem 0.5rem 0.5rem;
    border-radius: 2.25rem;
    transition: background-color var(--duration-fast) ease;
}

.chapter__link:hover {
    background: var(--color-surface);
}

.chapter__thumb {
    flex: none;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    object-fit: cover;
}

.chapter__text {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
    text-align: left;
}

.chapter__label {
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--color-accent-text);
}

.chapter__title {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.3;
    hyphens: auto;
}

.chapter__arrow {
    margin-left: auto;
}

.chapter__link:hover .chapter__arrow {
    background: var(--ink);
    color: var(--cream);
}

/* Wide screens: all five chapters in one row — the whole story at a glance. */
@media (min-width: 1200px) {
    .chapters__list {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.75rem;
        margin-inline: 0;
        padding-inline: 0;
        overflow: visible;
    }

    .chapter__thumb {
        width: 2.875rem;
        height: 2.875rem;
    }

    .chapter__arrow {
        display: none;
    }
}

/* --- Further projects ------------------------------------------------------
   Swipeable on small screens, three columns from 900px. */
.projects__list {
    display: grid;
    grid-auto-columns: min(82vw, 22rem);
    grid-auto-flow: column;
    gap: 0.875rem;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
}

.projects__list::-webkit-scrollbar {
    display: none;
}

.projects__list > * {
    scroll-snap-align: start;
}

@media (min-width: 900px) {
    .projects__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-flow: row;
        gap: 1.25rem;
        margin-inline: 0;
        padding-inline: 0;
        overflow: visible;
    }
}

/* --- Event announcement: dark card, the date set large ---------------------- */
.event-section {
    padding-bottom: var(--space-section);
}

.event {
    display: grid;
    gap: clamp(1.75rem, 1rem + 2.5vw, 3rem);
    padding: clamp(1.75rem, 0.75rem + 4.5vw, 5rem);
    border-radius: var(--radius-lg);
    background: var(--color-inverse);
    color: var(--color-on-inverse);
}

@media (min-width: 900px) {
    .event {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        column-gap: clamp(3rem, 7vw, 7rem);
    }
}

.event__date {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

@media (min-width: 900px) {
    .event__date {
        flex-direction: column;
        align-items: flex-start;
    }
}

.event__day {
    font-family: var(--font-display);
    font-size: clamp(4.5rem, 2.4rem + 9vw, 11rem);
    line-height: 0.9;
}

.event__time {
    padding: 0.5rem 1rem;
    border: 1.5px solid rgba(241, 242, 235, 0.4);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
}

.event__body {
    display: grid;
    justify-items: start;
    gap: 1rem;
}

.event__title {
    font-size: var(--text-display-md);
}

.event__text {
    max-width: 54ch;
    font-size: var(--text-lead);
    color: var(--color-on-inverse-muted);
}

.event__body .btn {
    margin-top: 0.75rem;
}

/* --- Team gallery -----------------------------------------------------------
   Small screens: swipeable cards, everything visible.
   From 1200px: capsules — a narrow pill per person; the active one opens up
   (main.js moves .is-active on hover, focus and tap). */
.team-gallery {
    display: flex;
    gap: 0.75rem;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
}

.team-gallery::-webkit-scrollbar {
    display: none;
}

/* Small screens: photo on top, text below — nothing covers a face. */
.member {
    position: relative;
    display: flex;
    flex: 0 0 min(80vw, 20rem);
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--ink);
    color: var(--color-on-inverse);
    scroll-snap-align: start;
}

.member:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.member__photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: 50% 30%;
}

.member__info {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 0.25rem;
    padding: 1.25rem 1.375rem 1.5rem;
}

.member__name {
    font-size: 1.75rem;
}

.member__role {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-on-inverse-muted);
}

.member__bio {
    margin-top: 0.5rem;
    font-size: var(--text-small);
    line-height: 1.5;
    color: rgba(241, 242, 235, 0.88);
}

.member__link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 2.25rem;
    margin-top: 0.75rem;
    padding: 0.375rem 0.875rem;
    border: 1.5px solid rgba(241, 242, 235, 0.5);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.member__link:hover {
    border-color: var(--cream);
    background: var(--cream);
    color: var(--ink);
}

@media (min-width: 1200px) {
    .team-gallery {
        gap: 0.875rem;
        height: clamp(30rem, 70svh, 38rem);
        margin-inline: 0;
        padding-inline: 0;
        overflow: visible;
    }

    .member {
        display: block;
        flex: 0 0 8rem;         /* closed: a capsule… */
        border-radius: 4rem;    /* …with perfectly round ends (half its width) */
        cursor: pointer;
        transition: flex-grow var(--duration-slow) var(--ease-out);
    }

    .member.is-active {
        flex-grow: 1;           /* open: takes all the remaining width */
        cursor: auto;
    }

    .member__photo {
        position: absolute;
        inset: 0;
        height: 100%;
        aspect-ratio: auto;
        object-position: 50% 28%;
    }

    /* Shade behind the text of the open capsule. */
    .member::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(18, 18, 18, 0.92) 0%, rgba(18, 18, 18, 0.6) 32%, rgba(18, 18, 18, 0) 60%);
        pointer-events: none;
        transition: opacity var(--duration) ease;
    }

    .member__info {
        position: absolute;
        inset: auto 0 0;
        z-index: 1;
        width: 30rem;           /* fixed, so the text never reflows while opening */
        padding: 2.5rem 3rem;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--duration) ease;
    }

    .member.is-active .member__info {
        opacity: 1;
        pointer-events: auto;
        transition-delay: 0.25s;
    }

    .member:not(.is-active)::after {
        opacity: 0;
    }

    .member__name {
        font-size: 2.5rem;
    }

    .member__bio {
        font-size: var(--text-body);
    }
}
