/* One cinematic surface. All chapters share the same continuous footage. */
:root {
    --ivory: #faf7ef;
    --champagne: #efd6a5;
    --gutter: clamp(24px, 4vw, 76px);
}

* {
    box-sizing: border-box;
}

html {
    background: #111918;
}

body {
    margin: 0;
    color: var(--ivory);
    font: 16px/1.5 Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

button:focus-visible, a:focus-visible {
    outline: 2px solid var(--champagne);
    outline-offset: 7px;
}

.skip {
    position: fixed;
    top: -100px;
    z-index: 20;
    background: #111918;
    padding: 12px;
}

.skip:focus {
    top: 0;
}

.masthead {
    position: fixed;
    inset: 0 0 auto;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px var(--gutter);
    background: linear-gradient(#0007, transparent);
}

.brand {
    font: 23px/1 Georgia, serif;
    letter-spacing: .16em;
}

.brand span {
    display: block;
    font: 10px/1.4 Arial, sans-serif;
    letter-spacing: .52em;
    margin-top: 8px;
}

.edition {
    font-size: 11px;
    letter-spacing: .18em;
}

#motion {
    background: #11191855;
    border: 1px solid #ffffff60;
    padding: 10px 16px;
    font-size: 12px;
}

.cinema {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #111918;
}

.cinema canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 48%;
}

.shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #0007, transparent 45%, #0003), linear-gradient(90deg, #0004, transparent 70%);
}

.frame {
    position: absolute;
    inset: 100px 24px 78px;
    border: 1px solid #ffffff21;
    pointer-events: none;
}

main {
    position: relative;
    height: 850svh;
}

.scene {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 130px var(--gutter) 120px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    will-change: opacity, transform;
}

.scene:first-child {
    opacity: 1;
    visibility: visible;
}

.copy {
    width: 100%;
}

.opening, .closing, .retreat {
    text-align: center;
}

.eyebrow {
    margin: 0 0 24px;
    font-size: 12px;
    letter-spacing: .25em;
    text-transform: uppercase;
    text-shadow: 0 2px 14px #000;
}

h1, h2 {
    font: 400 clamp(74px, 9vw, 150px)/.96 Georgia, serif;
    letter-spacing: -.055em;
    margin: 0;
    text-shadow: 0 3px 45px #0005;
}

em {
    font-weight: 400;
    color: var(--champagne);
}

.support {
    font-size: 17px;
    line-height: 1.65;
    margin-top: 28px;
    text-shadow: 0 2px 14px #000;
}

.wide-word h2 {
    font: 500 clamp(75px, 12vw, 195px)/.95 Arial, sans-serif;
    letter-spacing: -.065em;
}

.wide-word h2 em {
    color: transparent;
    -webkit-text-stroke: 1px var(--ivory);
    font-style: normal;
}

.left .copy {
    max-width: 900px;
    margin-right: auto;
}

.right {
    text-align: right;
}

.right .copy {
    max-width: 900px;
    margin-left: auto;
}

.closing h2 {
    font-size: clamp(100px, 13vw, 205px);
}

.restart {
    margin-top: 16px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--champagne);
    padding: 12px 0;
    font-size: 14px;
    pointer-events: auto;
}

.restart span {
    padding-left: 32px;
}

.hud {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 26px var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    z-index: 10;
    font-size: 10px;
    letter-spacing: .18em;
    background: linear-gradient(transparent, #0007);
}

.arrow {
    display: inline-block;
    margin-left: 16px;
    animation: drift 1.7s ease-in-out infinite;
}

.track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ffffff25;
}

#progress {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--champagne);
    transform-origin: left;
    transform: scaleX(0);
}

#status {
    position: fixed;
    bottom: 76px;
    left: var(--gutter);
    right: var(--gutter);
    z-index: 12;
    font-size: 13px;
}

@keyframes drift {
    50% {
        transform: translateY(6px);
    }

}

@media (min-aspect-ratio: 13/9) {
    /* Preserve more of the portrait yacht interior on wide monitors. */
  .cinema canvas {
        object-fit: contain;
    }

    .cinema {
        background: radial-gradient(ellipse at center, #3b443b, #111918 75%);
    }

    .left .copy {
        max-width: 70%;
    }

    .right .copy {
        max-width: 70%;
    }

}

@media (max-width: 600px) {
    .masthead {
        padding-top: 24px;
    }

    .brand {
        font-size: 19px;
    }

    .brand span {
        font-size: 9px;
    }

    .edition {
        display: none;
    }

    #motion {
        font-size: 12px;
        padding: 9px 11px;
    }

    main {
        height: 750svh;
    }

    .frame {
        inset: 96px 14px 78px;
    }

    .scene {
        padding: 120px 28px 130px;
        align-items: flex-end;
    }

    .opening {
        align-items: center;
        padding-top: 230px;
    }

    h1, h2 {
        font-size: clamp(48px, 12vw, 76px);
        line-height: 1.02;
    }

    .eyebrow {
        font-size: 10px;
        letter-spacing: .17em;
        margin-bottom: 18px;
    }

    .support {
        font-size: 15px;
        margin-top: 20px;
    }

    .wide-word h2 {
        font-size: 13.5vw;
    }

    .right {
        text-align: left;
    }

    .retreat {
        text-align: left;
    }

    .closing {
        align-items: center;
    }

    .closing h2 {
        font-size: 24vw;
    }

    .hud {
        font-size: 9px;
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }

    #scroll-hint {
        font-size: 0;
    }

    #scroll-hint .arrow {
        font-size: 18px;
    }

}

@media (prefers-reduced-motion: reduce) {
    .arrow {
        animation: none;
    }

}

/* Isolate the fixed canvas from the scrolling text layers. */
.cinema {
    z-index: 0;
    transform: translateZ(0);
    pointer-events: none;
}

.cinema canvas {
    display: block;
    background: url("media/yacht.jpg") center / cover no-repeat;
}

main {
    z-index: 1;
}

