/* =========================================================
   JINJJA — LANDING PAGE
   ========================================================= */


/* ---------------------------------------------------------
   DESIGN VARIABLES
   --------------------------------------------------------- */

:root {
    --color-background: #353E43;
    --color-surface: #000000;
    --color-text: #ffffff;
    --color-muted: #ffffff;
    --color-accent: #c79a3b;
    --color-placeholder: #151515;
    --color-border: rgba(17, 17, 17, 0.14);

    --page-width: 1400px;
    --text-width: 720px;

    --section-padding: clamp(5rem, 10vw, 9rem);
    --page-padding: clamp(1.25rem, 4vw, 4rem);

    --transition-fast: 180ms ease;
    --transition-medium: 400ms cubic-bezier(0.22, 1, 0.36, 1);
    --transition-slow: 650ms cubic-bezier(0.22, 1, 0.36, 1);
}


/* ---------------------------------------------------------
   RESET
   --------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background-color: var(--color-background);
    color: var(--color-text);

    font-family:
        "Noto Sans",
        Arial,
        Helvetica,
        sans-serif;

    line-height: 1.6;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button {
    border: 0;
}


/* ---------------------------------------------------------
   ACCESSIBILITY
   --------------------------------------------------------- */

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;
    clip: rect(0, 0, 0, 0);

    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 5px;
}


/* ---------------------------------------------------------
   SHARED LAYOUT
   --------------------------------------------------------- */

.section-container {
    width: min(
        calc(100% - (var(--page-padding) * 2)),
        var(--page-width)
    );

    margin-inline: auto;
}

.section-title {
    margin: 0 0 1rem;

    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 750;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

main {
    overflow: hidden;
}


/* ---------------------------------------------------------
   SITE HEADER
   --------------------------------------------------------- */

.site-header {
    position: relative;
    z-index: 100;

    display: flex;
    align-items: flex-start;

    padding:
        clamp(1.75rem, 3vw, 3rem)
        var(--page-padding)
        0;
}

.site-logo {
    display: inline-block;

    width: clamp(190px, 19vw, 310px);

    text-decoration: none;

    transition:
        transform var(--transition-medium),
        opacity var(--transition-fast);
}

.site-logo img {
    width: 100%;
    height: auto;
}

.site-logo:hover {
    transform: scale(1.025);
}

.site-logo:active {
    transform: scale(0.98);
}


/* ---------------------------------------------------------
   GAMES SECTION
   --------------------------------------------------------- */

.games {
    padding:
        clamp(2.5rem, 5vw, 4.5rem)
        0
        clamp(3rem, 6vw, 5rem);
}

.games .section-title {
    margin-bottom: 1rem;

    text-align: center;
}


/* ---------------------------------------------------------
   CAROUSEL
   --------------------------------------------------------- */

.game-carousel {
    position: relative;

    width: 100%;
    min-height: clamp(360px, 42vw, 540px);

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

    perspective: 1400px;

    user-select: none;
    touch-action: pan-y;
}

.carousel-viewport {
    position: relative;

    width: 100%;
    height: clamp(360px, 42vw, 600px);

    overflow: visible;
}

.carousel-track {
    position: relative;

    width: 100%;
    height: 100%;

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

    transform-style: preserve-3d;
}


/* ---------------------------------------------------------
   GAME CARDS
   --------------------------------------------------------- */

.game-card {
    position: absolute;
    top: 50%;
    left: 50%;

    width: clamp(230px, 30vw, 380px);
    aspect-ratio: 2 / 3;

    overflow: hidden;

    background-color: var(--color-surface);
    border-radius: 2px;

    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.08),
        0 30px 70px rgba(0, 0, 0, 0.1);

    cursor: pointer;

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

    opacity: 0;
    pointer-events: none;

    transition:
        transform var(--transition-slow),
        opacity var(--transition-medium),
        filter var(--transition-medium),
        box-shadow var(--transition-medium);

    will-change: transform, opacity;
}

.game-card__link {
    display: block;

    width: 100%;
    height: 100%;

    text-decoration: none;
}

.game-card__image {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* Active card */

.game-card--active,
.game-card.is-active {
    z-index: 5;

    transform:
        translate(-50%, -50%)
        translateZ(100px)
        scale(1);

    opacity: 1;
    filter: brightness(1);

    pointer-events: auto;
    cursor: pointer;

    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.12),
        0 45px 100px rgba(0, 0, 0, 0.16);
}


/* Previous card */

.game-card.is-previous {
    z-index: 3;

    transform:
        translate(-50%, -50%)
        translateX(clamp(-400px, -32vw, -280px))
        rotateY(24deg)
        scale(0.78);

    opacity: 0.7;
    filter: brightness(0.72);

    pointer-events: auto;
    cursor: pointer;
}


/* Next card */

.game-card.is-next {
    z-index: 3;

    transform:
        translate(-50%, -50%)
        translateX(clamp(280px, 32vw, 400px))
        rotateY(-24deg)
        scale(0.78);

    opacity: 0.7;
    filter: brightness(0.72);

    pointer-events: auto;
    cursor: pointer;
}


/* Hidden cards */

.game-card.is-hidden-left {
    z-index: 1;

    transform:
        translate(-50%, -50%)
        translateX(clamp(-520px, -45vw, -360px))
        rotateY(35deg)
        scale(0.6);

    opacity: 0;
}

.game-card.is-hidden-right {
    z-index: 1;

    transform:
        translate(-50%, -50%)
        translateX(clamp(360px, 45vw, 520px))
        rotateY(-35deg)
        scale(0.6);

    opacity: 0;
}


/* Card hover effects */

.game-card.is-previous:hover,
.game-card.is-next:hover {
    opacity: 0.9;
    filter: brightness(0.88);
}

.game-card.is-previous:hover {
    transform:
        translate(-50%, -50%)
        translateX(clamp(-400px, -32vw, -280px))
        rotateY(20deg)
        scale(0.81);
}

.game-card.is-next:hover {
    transform:
        translate(-50%, -50%)
        translateX(clamp(280px, 32vw, 400px))
        rotateY(-20deg)
        scale(0.81);
}

.game-card.is-active:hover {
    transform:
        translate(-50%, -50%)
        translateZ(115px)
        scale(1.015);
}


/* ---------------------------------------------------------
   PLACEHOLDER CARDS
   --------------------------------------------------------- */

.game-card--placeholder {
    background:
        linear-gradient(
            145deg,
            #202020,
            var(--color-placeholder)
        );
}

.game-card__placeholder {
    width: 100%;
    height: 100%;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255, 255, 255, 0.07);
}

.game-card__placeholder-logo {
    width: clamp(6rem, 45%, 11rem);
    height: auto;

    object-fit: contain;

    opacity: 0.85;
}


/* ---------------------------------------------------------
   CAROUSEL ARROWS
   --------------------------------------------------------- */

.carousel-button {
    position: absolute;
    top: 50%;
    z-index: 20;

    width: 3.5rem;
    height: 3.5rem;

    display: grid;
    place-items: center;

    padding: 0;

    background-color: rgba(14, 13, 10, 0.86);
    color: var(--color-text);

    border: 1px solid var(--color-border);
    border-radius: 50%;

    font-size: 1.35rem;

    opacity: 0;
    cursor: pointer;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    transform:
        translateY(-50%)
        scale(0.9);

    transition:
        opacity var(--transition-fast),
        transform var(--transition-medium),
        background-color var(--transition-fast);
}

.carousel-button--previous {
    left: clamp(0rem, 3vw, 2rem);
}

.carousel-button--next {
    right: clamp(0rem, 3vw, 2rem);
}

.game-carousel:hover .carousel-button,
.carousel-button:focus-visible {
    opacity: 1;

    transform:
        translateY(-50%)
        scale(1);
}

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


/* ---------------------------------------------------------
   GAME DESCRIPTION
   --------------------------------------------------------- */

.game-description {
    min-height: 5rem;
    max-width: 680px;

    margin: 1rem auto 0;

    text-align: center;
}

.game-description__title {
    margin: 0;

    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.game-description__text {
    margin: 1rem auto 0;

    color: var(--color-muted);

    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    line-height: 1.8;
}


/* Description transition */

.game-description.is-changing {
    animation: description-change 350ms ease;
}

@keyframes description-change {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    45% {
        opacity: 0;
        transform: translateY(8px);
    }

    55% {
        opacity: 0;
        transform: translateY(-8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ---------------------------------------------------------
   PAGINATION
   --------------------------------------------------------- */

.carousel-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;

    margin-top: 1.75rem;
}

.carousel-dot {
    width: 0.55rem;
    height: 0.55rem;

    padding: 0;

    background-color: transparent;
    border: 1px solid var(--color-text);
    border-radius: 50%;

    cursor: pointer;

    transition:
        transform var(--transition-medium),
        background-color var(--transition-fast),
        opacity var(--transition-fast);
}

.carousel-dot:hover {
    transform: scale(1.25);
}

.carousel-dot--active,
.carousel-dot.is-active {
    background-color: var(--color-text);

    transform: scale(1.15);
}


/* ---------------------------------------------------------
   TEAM
   --------------------------------------------------------- */

.team {
    padding:
        clamp(2.5rem, 5vw, 4.5rem)
        0
        var(--section-padding);

    background:
        linear-gradient(
            180deg,
            var(--color-background) 0%,
            #22282c 58%,
            var(--color-surface) 100%
        );
}

.team .section-title {
    margin-bottom: clamp(3rem, 6vw, 5.5rem);

    text-align: center;
}

.team-profile {
    width: min(100%, 1000px);

    display: grid;
    grid-template-columns:
        minmax(240px, 320px)
        minmax(0, 1fr);

    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: center;

    margin-inline: auto;
}

.team-profile__portrait-frame {
    width: 75%;
    aspect-ratio: 1;

    padding: 4px;

    background-color: var(--color-text);
    border-radius: 50%;

    box-shadow:
        0 22px 55px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

.team-profile__portrait-mask {
    width: 100%;
    height: 100%;

    overflow: hidden;
    border-radius: 50%;

    background-color: var(--color-placeholder);
    background-image: url("../assets/images/jinjja/Jook_Portrait.png");
    background-repeat: no-repeat;
    background-size: 150%;
    background-position: 45% -1%;
}

.team-profile__portrait {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 150%;
    height: 150%;

    max-width: none;
    object-fit: cover;

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

.team-profile__content {
    max-width: none;
    width: 100%;
}

.team-profile__name {
    margin: 0;

    font-size: clamp(2.25rem, 4.5vw, 4rem);
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -0.035em;
}

.team-profile__role {
    margin: 1.15rem 0 0;

    color: var(--color-accent);

    font-size: clamp(0.95rem, 1.6vw, 1.25rem);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.team-profile__description {
    width: 100%;
    max-width: none;

    margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;

    color: var(--color-muted);

    font-size: clamp(1rem, 1.4vw, 1.1rem);
    line-height: 1.85;
}


/* ---------------------------------------------------------
   ABOUT AND CONTACT
   --------------------------------------------------------- */

.studio-info {
    padding:
        var(--section-padding)
        0;

    background-color: var(--color-surface);
}

.studio-info__grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.4fr)
        minmax(260px, 0.8fr);

    gap: clamp(4rem, 10vw, 9rem);

    align-items: start;
}

.studio-info .section-title {
    margin-bottom: 2rem;

    font-size: clamp(1.5rem, 3vw, 2.35rem);
}

.about p,
.contact p {
    margin-top: 0;

    color: var(--color-muted);

    font-size: clamp(1rem, 1.4vw, 1.1rem);
    line-height: 1.85;
}

.about__mark {
    width: clamp(3.5rem, 6vw, 5rem);

    margin-top: 3rem;

    opacity: 0.95;
}


/* ---------------------------------------------------------
   CONTACT
   --------------------------------------------------------- */

.contact__email {
    display: inline-block;

    margin-top: 0.25rem;

    font-size: clamp(1rem, 1.7vw, 1.2rem);
    font-weight: 700;

    text-decoration-thickness: 1px;
    text-underline-offset: 0.35em;

    transition:
        color var(--transition-fast),
        text-decoration-color var(--transition-fast);
}

.contact__email:hover {
    color: var(--color-accent);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;

    margin-top: 2.5rem;
}

.social-links a {
    position: relative;

    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;

    text-decoration: none;
    text-transform: uppercase;
}

.social-links a::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: -0.35rem;

    width: 100%;
    height: 1px;

    background-color: currentColor;

    transform: scaleX(0);
    transform-origin: right;

    transition: transform var(--transition-medium);
}

.social-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}


/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */

.site-footer {
    padding:
        2rem
        var(--page-padding);

    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);

    text-align: center;
}

.site-footer p {
    margin: 0;

    color: var(--color-muted);

    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}


/* ---------------------------------------------------------
   TABLET
   --------------------------------------------------------- */

@media (max-width: 900px) {
    .site-logo {
        width: clamp(180px, 30vw, 250px);
    }

    .studio-info__grid {
        grid-template-columns: 1fr;
        gap: 5rem;
    }

    .team-profile {
        grid-template-columns:
            minmax(220px, 320px)
            minmax(0, 1fr);

        gap: clamp(2.5rem, 7vw, 4.5rem);
    }

    .carousel-button {
        opacity: 1;
    }

    .carousel-button--previous {
        left: 0;
    }

    .carousel-button--next {
        right: 0;
    }
}


/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */

@media (max-width: 650px) {
    :root {
        --section-padding: 5.5rem;
    }

    .site-header {
        padding-top: 1.5rem;
    }

    .site-logo {
        width: min(55vw, 220px);
    }

    .games {
        padding-top: 3.5rem;
    }

    .section-title {
        margin-bottom: 2rem;

        font-size: 1.8rem;
    }

    .game-carousel,
    .carousel-viewport {
        min-height: 430px;
        height: 430px;
    }

    .game-card {
        width: min(62vw, 265px);
    }

    .game-card.is-previous {
        transform:
            translate(-50%, -50%)
            translateX(-48vw)
            rotateY(18deg)
            scale(0.7);
    }

    .game-card.is-next {
        transform:
            translate(-50%, -50%)
            translateX(48vw)
            rotateY(-18deg)
            scale(0.7);
    }

    .game-card.is-previous:hover {
        transform:
            translate(-50%, -50%)
            translateX(-48vw)
            rotateY(18deg)
            scale(0.7);
    }

    .game-card.is-next:hover {
        transform:
            translate(-50%, -50%)
            translateX(48vw)
            rotateY(-18deg)
            scale(0.7);
    }

    .carousel-button {
        width: 3rem;
        height: 3rem;

        background-color: rgba(246, 244, 239, 0.94);
    }

    .game-description {
        min-height: 10rem;

        padding-inline: 1rem;
        margin-top: 2rem;
    }

    .studio-info__grid {
        gap: 4.5rem;
    }

    .team .section-title {
        margin-bottom: 3rem;
    }

    .team-profile {
        grid-template-columns: 1fr;
        gap: 2.5rem;

        text-align: center;
    }

    .team-profile__portrait-frame {
        width: min(74vw, 310px);

        margin-inline: auto;
    }

    .team-profile__content,
    .team-profile__description {
        margin-inline: auto;
    }

    .team-profile__name {
        font-size: clamp(2.75rem, 14vw, 4.25rem);
    }
}


/* ---------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}