/* =========================================
   BASIC
========================================= */

* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;

    width: 100%;
    height: 100%;

    background: #ffffff;
    color: #111111;
}


body {
    position: relative;

    width: 100%;

    min-height: 100vh;
    min-height: 100dvh;

    overflow: hidden;

    font-family:
        "Helvetica Neue",
        Helvetica,
        Arial,
        sans-serif;

    font-weight: 400;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


a {
    color: inherit;

    text-decoration: none;
}



/* =========================================
   MAIN WEBSITE VISIBILITY
========================================= */

.top,
.image-area,
.bottom {
    opacity: 0;

    transition:
        opacity 0.8s ease;
}


body.site-ready .top,
body.site-ready .image-area,
body.site-ready .bottom {
    opacity: 1;
}



/* =========================================
   INTRO SCREEN
========================================= */

.intro-screen {
    position: fixed;

    inset: 0;

    z-index: 1000;

    background: #ffffff;

    opacity: 1;

    pointer-events: all;

    transition:
        opacity 0.75s ease;
}


.intro-screen.exit {
    opacity: 0;

    pointer-events: none;
}



/* =========================================
   INTRO NAMES
========================================= */

.intro-name {
    position: absolute;

    top: 50%;

    z-index: 2;

    white-space: nowrap;

    font-size: 22px;

    line-height: 1.1;

    font-weight: 600;

    letter-spacing: -0.025em;

    will-change:
        left,
        top,
        transform;

    transition:
        left 1.35s cubic-bezier(0.76, 0, 0.24, 1),
        top 1.35s cubic-bezier(0.76, 0, 0.24, 1),
        transform 1.35s cubic-bezier(0.76, 0, 0.24, 1);
}



/* LEFT NAME

Initial right edge sits exactly
at centre of screen.
*/

.intro-name-left {
    left: 50%;

    transform:
        translate(-100%, -50%);
}



/* RIGHT NAME

Initial left edge sits exactly
at centre of screen.
*/

.intro-name-right {
    left: 50%;

    transform:
        translate(0, -50%);
}



/* =========================================
   INITIAL LETTERS
========================================= */

.intro-initial {
    display: inline;

    opacity: 1;
}



/* =========================================
   HIDDEN NAME CHARACTERS
========================================= */

.intro-rest {
    display: inline-block;

    overflow: hidden;

    vertical-align: bottom;

    white-space: nowrap;

    max-width: 0;

    opacity: 0;

    transition:
        max-width 1s cubic-bezier(0.76, 0, 0.24, 1),
        opacity 0.75s ease;
}



/* =========================================
   PLUS
========================================= */

.intro-plus {
    position: absolute;

    top: 50%;
    left: 50%;

    z-index: 3;

    transform:
        translate(-50%, -50%);

    opacity: 0;

    font-size: 23px;

    line-height: 1;

    font-weight: 600;

    text-align: center;

    will-change:
        top,
        transform;

    transition:
        top 1.35s cubic-bezier(0.76, 0, 0.24, 1),
        transform 1.35s cubic-bezier(0.76, 0, 0.24, 1),
        opacity 0.6s ease;
}



/* =========================================
   STAGE 2
   RY + TK
========================================= */

.intro-screen.stage-2 .intro-name-left {
    left: calc(50% - 34px);
}


.intro-screen.stage-2 .intro-name-right {
    left: calc(50% + 34px);
}


.intro-screen.stage-2 .intro-plus {
    opacity: 1;
}



/* =========================================
   STAGE 3A
   INITIALS SPREAD INTO THEIR FINAL
   POSITIONS BEFORE REST OF NAME APPEARS
========================================= */

.intro-screen.stage-spread .rest-r1 {
    max-width: 105px;
}


.intro-screen.stage-spread .rest-r2 {
    max-width: 105px;
}


.intro-screen.stage-spread .rest-t1 {
    max-width: 105px;
}


.intro-screen.stage-spread .rest-t2 {
    max-width: 105px;
}



/* =========================================
   STAGE 3B
   REST OF CHARACTERS FADE IN
========================================= */

.intro-screen.stage-reveal .intro-rest {
    opacity: 1;
}



/* =========================================
   STAGE 4
   MOVE DIAGONALLY TO EXACT HEADER POSITIONS
========================================= */

/* Riichiro → exact top-left */

.intro-screen.stage-header .intro-name-left {
    top: 26px;

    left: 26px;

    transform:
        translate(0, 0);
}



/* Thomas → exact top-right */

.intro-screen.stage-header .intro-name-right {
    top: 26px;

    left: calc(100% - 26px);

    transform:
        translate(-100%, 0);
}



/* Plus → exact top-centre */

.intro-screen.stage-header .intro-plus {
    top: 26px;

    transform:
        translate(-50%, 0);
}



/* =========================================
   FINAL HEADER
========================================= */

.top {
    position: fixed;

    top: 0;
    left: 0;

    z-index: 10;

    display: grid;

    grid-template-columns:
        1fr
        auto
        1fr;

    align-items: center;

    width: 100%;

    padding:
        26px
        26px
        0;
}


.person {
    font-size: 22px;

    line-height: 1.1;

    font-weight: 600;

    letter-spacing: -0.025em;
}


.person-left {
    text-align: left;
}


.person-right {
    text-align: right;
}


.plus {
    padding:
        0
        32px;

    font-size: 23px;

    line-height: 1;

    font-weight: 600;

    text-align: center;
}



/* =========================================
   IMAGE AREA
========================================= */

.image-area {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;

    height: 100vh;
    height: 100dvh;

    padding:
        110px
        220px
        120px;
}



/* =========================================
   SLIDESHOW FRAME
========================================= */

.slideshow-frame {
    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: min(720px, 100%);

    height: 55vh;

    cursor: pointer;

    background: #ffffff;

    overflow: visible;
}



/* =========================================
   SLIDES
========================================= */

.slide {
    position: absolute;

    top: 50%;
    left: 50%;

    display: block;

    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 100%;

    object-fit: contain;

    transform:
        translate3d(-50%, -50%, 0);

    opacity: 0;

    transition:
        opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1);

    will-change: opacity;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    pointer-events: none;

    user-select: none;
    -webkit-user-drag: none;
}


.slide.active {
    opacity: 1;
}



/* =========================================
   CONTACT
========================================= */

.bottom {
    position: fixed;

    bottom: 0;
    left: 0;

    z-index: 10;

    display: flex;

    justify-content: space-between;
    align-items: flex-end;

    width: 100%;

    padding:
        0
        26px
        26px;
}


.contact {
    display: flex;

    flex-direction: column;

    gap: 3px;

    font-size: 15px;

    line-height: 1.25;

    font-weight: 400;

    letter-spacing: -0.015em;
}


.contact-left {
    text-align: left;
}


.contact-right {
    text-align: right;
}


.contact a:first-child {
    font-weight: 500;
}


.contact a {
    transition:
        opacity 0.25s ease;
}


.contact a:hover {
    opacity: 0.45;
}



/* =========================================
   TABLET
========================================= */

@media (max-width: 1000px) {

    .image-area {
        padding:
            100px
            100px
            120px;
    }


    .slideshow-frame {
        width: min(680px, 100%);

        height: 52vh;
    }

}



/* =========================================
   MOBILE
========================================= */

@media (max-width: 700px) {

    .intro-name {
        font-size: 15px;

        letter-spacing: -0.02em;
    }


    .intro-plus {
        font-size: 16px;
    }



    /* RY + TK spacing */

    .intro-screen.stage-2 .intro-name-left {
        left: calc(50% - 25px);
    }


    .intro-screen.stage-2 .intro-name-right {
        left: calc(50% + 25px);
    }



    /* Missing-character widths */

    .intro-screen.stage-spread .intro-rest {
        max-width: 80px;
    }



    /* Exact mobile header positions */

    .intro-screen.stage-header .intro-name-left {
        top: 18px;

        left: 16px;
    }


    .intro-screen.stage-header .intro-name-right {
        top: 18px;

        left: calc(100% - 16px);
    }


    .intro-screen.stage-header .intro-plus {
        top: 18px;
    }



    .top {
        padding:
            18px
            16px
            0;
    }


    .person {
        font-size: 15px;

        font-weight: 600;

        letter-spacing: -0.02em;
    }


    .plus {
        padding:
            0
            12px;

        font-size: 16px;

        font-weight: 600;
    }


    .image-area {
        padding:
            90px
            20px
            120px;
    }


    .slideshow-frame {
        width: 100%;

        height: 48vh;
    }


    .bottom {
        padding:
            0
            16px
            18px;
    }


    .contact {
        font-size: 11px;

        gap: 2px;

        letter-spacing: -0.01em;
    }

}



/* =========================================
   VERY SMALL MOBILE
========================================= */

@media (max-width: 420px) {

    .intro-name {
        font-size: 13px;
    }


    .intro-plus {
        font-size: 14px;
    }


    .intro-screen.stage-2 .intro-name-left {
        left: calc(50% - 22px);
    }


    .intro-screen.stage-2 .intro-name-right {
        left: calc(50% + 22px);
    }


    .intro-screen.stage-spread .intro-rest {
        max-width: 70px;
    }


    .person {
        font-size: 13px;
    }


    .plus {
        padding:
            0
            8px;

        font-size: 14px;
    }


    .contact {
        font-size: 10px;
    }


    .image-area {
        padding-left: 15px;
        padding-right: 15px;
    }

}