﻿@layer foundation, layout, component, project, utility;

@layer foundation {
    /* ----------------------------------------------------
    　Design Token
    ---------------------------------------------------- */
    :root {
        --color-text        : #111111;
        --color-accent      : #e60012;
        --duration-hover    : 0.45s;
        --duration-marquee  : 60s;
        --radius-card       : 8px;
        --radius-pill       : 999px;
        --font-family-jp    : "Noto Sans JP", serif;
        --font-family-en    : "Afacad", sans-serif;
    }

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

    html,
    body {
        min-height: 100%;
    }

    body {
        margin: 0;
        font-family: var(--font-family-jp);
        color: var(--color-text);
        background-image: url('../images/bg.png');
        background-repeat: no-repeat;
        background-size: 100% 100%;
        background-position: top bottom;
        background-attachment: fixed;
        background-color: #FFFFFF;
        padding-bottom: 40px;
    }

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

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

@layer component {
    /* ----------------------------------------------------
    　Card
    ---------------------------------------------------- */
    .c-card {
        display: block;
        overflow: hidden;
        border-radius: var(--radius-card);
        background: #FFFFFF;
        box-shadow: 0 6px 22px rgb(0 0 0 / 0.1);
        animation: card-fade-in 0.7s ease both;
    }

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

    @media (min-width: 641px) {
        .c-card {
            transition:
                transform var(--duration-hover) ease,
                box-shadow var(--duration-hover) ease;
        }

        .c-card:hover,
        .c-card:focus-visible {
            transform: translateY(-3px);
            box-shadow: 0 10px 24px rgb(0 0 0 / 0.12);
        }
    }

    .p-hiring-index__cards > li:nth-child(2) .c-card {
        animation-delay: 0.12s;
    }

    .p-hiring-index__cards > li:nth-child(3) .c-card {
        animation-delay: 0.24s;
    }

    @keyframes card-fade-in {
        from {
            opacity: 0;
            transform: translateY(-18px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .c-card__media {
        display: block;
        overflow: hidden;
        aspect-ratio: 347 / 194;
    }

    .c-card__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    @media (min-width: 641px) {
        .c-card__media img {
            transition: transform var(--duration-hover) ease;
        }

        .c-card:hover .c-card__media img,
        .c-card:focus-visible .c-card__media img {
            transform: scale(1.04);
        }
    }

    .c-card__body {
        display: flex;
        align-items: center;
        height: clamp(56px, 3.75vw, 72px);
        max-height: clamp(56px, 3.75vw, 72px);
        padding: 0 20px;
    }

    @media (max-width: 640px) {
        .c-card__body {
            padding: 14px 14px 15px;
        }
    }

    .c-card__lead {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        min-height: 22px;
    }

    .c-card__label {
        display: inline-flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 4px;
        font-size: clamp(15px, 1.25vw, 20px);
        line-height: 1.4;
        font-weight: 700;
    }

    .c-card__label-accent {
        color: var(--color-accent);
    }

    .c-card__label-main {
        color: var(--color-text);
    }

    @media (min-width: 641px) {
        .c-card__label-main {
            transition: color var(--duration-hover) ease;
        }

        .c-card:hover .c-card__label-main,
        .c-card:focus-visible .c-card__label-main {
            color: var(--color-accent);
        }
    }

    .c-card__arrow {
        position: relative;
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
        border-radius: 50%;
        background: var(--color-accent);
    }

    @media (min-width: 641px) {
        .c-card__arrow {
            transition: transform var(--duration-hover) ease;
        }

        .c-card:hover .c-card__arrow,
        .c-card:focus-visible .c-card__arrow {
            transform: translateX(2px);
        }
    }

    .c-card__arrow::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 5px;
        height: 5px;
        border-top: 1.5px solid #FFFFFF;
        border-right: 1.5px solid #FFFFFF;
        transform: translate(-68%, -50%) rotate(45deg);
    }
}

@layer project {
    /* ----------------------------------------------------
    　Hiring Index
    ---------------------------------------------------- */
    .p-hiring-index {
        overflow-x: hidden;
    }

    @media (max-width: 960px) {
        .p-hiring-index {
            padding: 24px 20px 48px;
        }
    }

    @media (max-width: 640px) {
        .p-hiring-index {
            padding: 20px 14px 36px;
        }
    }

    .p-hiring-index__background-text {
        position: absolute;
        top: clamp(-48px, -3.34vw, -10px);
        left: 0;
        overflow: hidden;
        z-index: 0;
        width: 100%;
        height: clamp(70px, 11.46vw, 220px);
        color: #FAECED;
        font-size: clamp(80px, 14.6vw, 280px);
        font-family: var(--font-family-en);
        line-height: 0.88;
        font-weight: 800;
        letter-spacing: 0.02em;
        pointer-events: none;
        user-select: none;
        white-space: nowrap;
    }

    .p-hiring-index__background-track {
        display: inline-flex;
        width: max-content;
        animation: hiring-background-marquee var(--duration-marquee) linear infinite;
    }

    .p-hiring-index__background-item {
        flex: 0 0 auto;
        padding-right: 0.24em;
    }

    @keyframes hiring-background-marquee {
        from {
            transform: translateX(0);
        }

        to {
            transform: translateX(-50%);
        }
    }

    .p-hiring-index__header {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: 128px;
    }

    @media (max-width: 960px) {
        .p-hiring-index__header {
            padding-top: 54px;
        }
    }

    @media (max-width: 640px) {
        .p-hiring-index__header {
            padding-top: 48px;
        }
    }

    .p-hiring-index__logo {
        width: 206px;
    }

    @media (max-width: 640px) {
        .p-hiring-index__logo {
            width: 136px;
        }
    }

    .p-hiring-index__title {
        margin: 10px 0 0;
        font-size: clamp(16px, 1.25vw, 24px);
        font-weight: 400;
        letter-spacing: 0.02em;
    }

    .p-hiring-index__cards {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 22px;
        margin-top: 62px;
        max-width: 1680px;
        margin-inline: auto;
        padding: 0 clamp(24px, 3.34vw, 64px);
        list-style: none;
    }

    @media (max-width: 960px) {
        .p-hiring-index__cards {
            grid-template-columns: 1fr;
            max-width: 500px;
            margin: 42px auto 0;
        }
    }

    @media (max-width: 640px) {
        .p-hiring-index__cards {
            gap: 16px;
            margin-top: 34px;
            padding: 0;
        }
    }

    .p-hiring-index__footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 78px;
    }

    @media (max-width: 960px) {
        .p-hiring-index__footer {
            margin-top: 48px;
        }
    }

    .p-hiring-index__corporate-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 252px;
        min-height: 53px;
        padding: 0 36px;
        border: 1px solid #CFCFCF;
        border-radius: var(--radius-pill);
        background: #FFFFFF;
        font-size: clamp(14px, 0.84vw, 16px);
        font-weight: 700;
    }

    .p-hiring-index__corporate-link:focus-visible {
        outline: 3px solid var(--color-accent);
        outline-offset: 3px;
    }

    @media (min-width: 641px) {
        .p-hiring-index__corporate-link {
            transition:
                border-color var(--duration-hover) ease,
                color var(--duration-hover) ease;
        }

        .p-hiring-index__corporate-link:hover,
        .p-hiring-index__corporate-link:focus-visible {
            border-color: var(--color-accent);
            color: var(--color-accent);
        }
    }

    @media (max-width: 640px) {
        .p-hiring-index__corporate-link {
            min-width: 220px;
            min-height: 48px;
        }
    }

    .p-hiring-index__copyright {
        margin: 58px 0 0;
        font-size: clamp(8px, 0.53vw, 10px);
        font-family: var(--font-family-en);
        line-height: 1.4;
    }

    @media (max-width: 960px) {
        .p-hiring-index__copyright {
            margin-top: 36px;
        }
    }

    @media (max-width: 640px) {
        .p-hiring-index__copyright {
            text-align: center;
        }
    }
}

@layer utility {
    /* ----------------------------------------------------
    　Screen Reader Text
    ---------------------------------------------------- */
    .u-visually-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    @layer component {
        .c-card,
        .c-card__media img,
        .c-card__label-main,
        .c-card__arrow {
            animation: none;
            transition: none;
        }

        .c-card:hover,
        .c-card:focus-visible,
        .c-card:hover .c-card__media img,
        .c-card:focus-visible .c-card__media img,
        .c-card:hover .c-card__arrow,
        .c-card:focus-visible .c-card__arrow {
            transform: none;
        }
    }

    @layer project {
        .p-hiring-index__corporate-link {
            transition: none;
        }

        .p-hiring-index__background-track {
            animation: none;
        }
    }
}
