@property --home-scrollbar-opacity {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

html {
    --home-scrollbar-opacity: 0;
    background: #fff;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    transition: --home-scrollbar-opacity .7s ease;
}

html.home-intro-running {
    overflow: hidden;
    scrollbar-gutter: auto;
    overscroll-behavior: none;
}

/* Keep the page underneath at its final width while the cover uses the
   entire viewport. Unlocking the scrollbar must not move the revealed page. */
html.home-intro-running body {
    padding-right: var(--home-scrollbar-width, 0px);
}

html.home-intro-complete {
    --home-scrollbar-opacity: .34;
}

html::-webkit-scrollbar { width: 11px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
    min-height: 48px;
    border: 3px solid transparent;
    border-radius: 999px;
    background-color: rgba(17,17,17,var(--home-scrollbar-opacity));
    background-clip: padding-box;
}
html.home-intro-complete::-webkit-scrollbar-thumb:hover {
    background-color: rgba(17,17,17,.55);
}

.home-intro {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    pointer-events: auto;
    animation: homeCoverHide .01s linear 2.52s forwards;
}

.home-intro__panel {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    overflow: hidden;
    isolation: isolate;
    background: #111;
    border: 0;
    box-shadow: none;
    will-change: transform;
}

/* Overlap backgrounds at fractional grid edges without moving the letters. */
.home-intro__panel:not(:last-child) {
    margin-right: -1px;
    padding-right: 1px;
}

.home-intro__panel::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 1;
    background: #fff;
    transform: scaleY(0);
    transform-origin: bottom;
    animation: homeCoverToneFlip .62s cubic-bezier(.76,0,.24,1) .68s forwards;
}
.home-intro__panel:nth-child(2)::after { transform-origin: top; animation-delay: .74s; }
.home-intro__panel:nth-child(3)::after { animation-delay: .8s; }
.home-intro__panel:nth-child(4)::after { transform-origin: top; animation-delay: .86s; }

.home-intro__panel span {
    position: relative;
    z-index: 2;
    display: block;
    color: #fff;
    mix-blend-mode: difference;
    font-family: "Times New Roman", serif;
    font-size: clamp(110px,16vw,245px);
    font-weight: 400;
    line-height: .75;
    opacity: 0;
    transform: translateY(120%) skewY(7deg);
    animation: homeCoverLetterIn .72s cubic-bezier(.16,1,.3,1) forwards;
}
.home-intro__panel:nth-child(1) span { animation-delay: .05s; }
.home-intro__panel:nth-child(2) span { animation-delay: .12s; }
.home-intro__panel:nth-child(3) span { animation-delay: .19s; }
.home-intro__panel:nth-child(4) span { animation-delay: .26s; }

.home-intro__panel--1 { animation: homeCoverPanelUp .82s cubic-bezier(.76,0,.24,1) 1.5s forwards; }
.home-intro__panel--2 { animation: homeCoverPanelDown .82s cubic-bezier(.76,0,.24,1) 1.56s forwards; }
.home-intro__panel--3 { animation: homeCoverPanelUp .82s cubic-bezier(.76,0,.24,1) 1.62s forwards; }
.home-intro__panel--4 { animation: homeCoverPanelDown .82s cubic-bezier(.76,0,.24,1) 1.68s forwards; }

body > header { animation: homeCoverHeaderIn .65s cubic-bezier(.22,1,.36,1) 1.8s both; }
.home-person-feature { animation: homeCoverFeatureIn .95s cubic-bezier(.16,1,.3,1) 1.7s both; }
.hero { animation: homeCoverSectionIn .8s cubic-bezier(.22,1,.36,1) 2s both; }

@keyframes homeCoverLetterIn { to { opacity: 1; transform: translateY(0) skewY(0); } }
@keyframes homeCoverToneFlip { to { transform: scaleY(1); } }
@keyframes homeCoverPanelUp { to { transform: translateY(-105%); } }
@keyframes homeCoverPanelDown { to { transform: translateY(105%); } }
@keyframes homeCoverHide { to { visibility: hidden; pointer-events: none; } }
@keyframes homeCoverHeaderIn {
    from { opacity: 0; transform: translateY(-18px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes homeCoverFeatureIn {
    from { opacity: 0; transform: translateY(46px) scale(.985); clip-path: inset(0 0 100% 0); }
    to { opacity: 1; transform: translateY(0) scale(1); clip-path: inset(0); }
}
@keyframes homeCoverSectionIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .home-intro__panel span { font-size: clamp(68px,22vw,96px); }
}

html.home-intro-complete .home-intro { display: none; }

@media (prefers-reduced-motion: reduce) {
    html { --home-scrollbar-opacity: .34; transition: none; }
    .home-intro { display: none; }
    body > header, .home-person-feature, .hero { animation: none; }
}
