/*
 * front-page.css
 * トップページ専用スタイル
 */

.front-page {
    overflow: hidden;
}

/* ---------- Hero (mv) ---------- */
.hero {
    position: relative;
    aspect-ratio: 1440 / 800;
    padding: 24px;
}

.hero__bg {
    position: absolute;
    inset: 24px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(23, 26, 30, 0.3);
}

.hero__inner {
    position: absolute;
    left: 48px;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-white);
}

.hero__title {
    font-family: var(--font-mincho);
    font-weight: 600;
    font-size: 40px;
    letter-spacing: 0.2em;
}

.hero__subtitle {
    font-family: var(--font-en);
    font-weight: 300;
    font-size: 20px;
    letter-spacing: 0.2em;
}

/* ---------- News section ---------- */
.news-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
    padding: 80px 0;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    width: 100%;
    padding-inline: var(--spacing-md);
}

/* ---------- About section ---------- */
.about-section {
    position: relative;
    padding: 120px 0;
    background: var(--color-white);
    overflow: hidden;
}

/* Figma: Rectangle 2 (node 146:251) - diagonal-cut panel, not a flat rectangle.
   height:100% (rather than a hardcoded px matching one specific Figma frame's
   content height) so it always spans exactly .about-section's own rendered
   height - including the banner photo below the text/photo row - regardless
   of how tall the actual copy renders at a given viewport/breakpoint. */
.about-section__bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 1080px;
    height: 100%;
    background: linear-gradient(to right, var(--color-blue), #8ab3d4);
    clip-path: polygon(0 0, 100% 0, 58.47% 100%, 0 100%);
    z-index: 0;
}

.about-section__watermark {
    position: absolute;
    z-index: 1;
    left: 48px;
    top: 41px;
    font-family: var(--font-en);
    font-weight: 700;
    font-size: clamp(48px, 6vw, 88px);
    letter-spacing: 0.1em;
    color: var(--color-white);
    opacity: 0.5;
    margin: 0;
    white-space: nowrap;
}

.about-section__row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 48px;
}

.about-section__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xl);
    max-width: 560px;
    color: var(--color-white);
}

.about-section__heading {
    font-weight: 700;
    font-size: var(--font-size-heading);
    letter-spacing: 0.05em;
    line-height: 1.8;
    white-space: nowrap;
}

.about-section__lead {
    font-weight: 700;
    font-size: var(--font-size-body);
    letter-spacing: 0.05em;
    line-height: 2;
}

.about-section__photo {
    width: 55%;
    aspect-ratio: 800 / 534;
    overflow: hidden;
}

.about-section__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-section__banner {
    position: relative;
    z-index: 1;
    margin-top: 48px;
    padding: 0 48px;
}

.about-section__banner img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

/* ---------- Product section ---------- */
.product-section {
    position: relative;
    padding: 120px 0 0;
}

/* .container's padding-inline is for the mobile fallback; on the 1000px desktop
   box these should sit flush at the edges like Figma, matching news-section's
   pattern. Sets its own max-width (rather than inheriting .container's, which
   is content-width + padding, see base.css) so it stays at the true 1000px
   content width now that padding-inline is zeroed out here. */
.product-section__title-wrap {
    max-width: var(--container-width);
    padding-inline: 0;
}

.product-intro {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-top: 60px;
    max-width: var(--container-width);
    padding-inline: 0;
}

.product-intro__image {
    width: 600px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.product-intro__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-intro__card {
    position: absolute;
    left: 0;
    top: 67px;
    width: 506px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 2px 2px 25px rgba(8, 48, 140, 0.1);
    padding: 80px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xl);
    text-align: center;
}

.product-intro__heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.product-intro__kana {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.25em;
}

.product-intro__name {
    font-weight: 600;
    font-size: 58px;
    color: var(--color-blue);
    letter-spacing: 0.05em;
    line-height: 1;
    margin-top: -0.25em;
}

.product-intro__catch {
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.05em;
    line-height: 1.65;
    text-align: center;
}

.product-intro__catch strong {
    color: var(--color-blue);
}

.product-intro__divider {
    width: 100%;
    border: none;
    border-top: 1px solid var(--color-gray);
    margin: 0;
}

.product-intro__desc {
    width: 100%;
    font-weight: 500;
    line-height: 2;
    letter-spacing: 0.05em;
    text-align: left;
}

.product-feature {
    margin-top: 120px;
    padding: 80px 0 180px;
    background: linear-gradient(to bottom, var(--color-white), var(--color-gray));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xl);
}

.product-feature__header {
    text-align: center;
}

.product-feature__label {
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.1em;
    color: var(--color-lightblue);
    margin-bottom: 4px;
}

.product-feature__title {
    font-weight: 700;
    font-size: var(--font-size-heading);
    color: var(--color-blue);
}

.product-feature__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 44px 56px;
    max-width: 900px;
    width: 100%;
}

/* Figma: 右列(2番目・4番目のカード = 02/04)は左列より60px下にずれた
   互い違い(2列マソンリー風)のレイアウト。translateYはグリッドの行の高さ計算に
   影響しないため、行の実サイズはそのままに見た目だけをずらせる。
   下の@media (max-width:1096px)で1列に折り返す際はこのずれもキャンセルする。 */
.feature-card:nth-child(2n) {
    transform: translateY(60px);
}

/* reveal-item のtransformが上のマソンリーオフセットを上書きしてしまうため、
   スクロールインの前後どちらの状態でも60pxオフセットを保った形に上書きする。 */
.product-feature__grid.reveal-group .feature-card.reveal-item:nth-child(2n) {
    transform: translateY(calc(60px + 28px));
}

.product-feature__grid.reveal-group.is-in-view .feature-card.reveal-item:nth-child(2n) {
    transform: translateY(60px);
}

.feature-card {
    position: relative;
    background: var(--color-white);
    min-height: 360px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.feature-card:hover {
    box-shadow: 0 12px 28px rgba(8, 48, 140, 0.15);
}

.feature-card__icon {
    position: absolute;
    right: 24px;
    bottom: 32px;
    height: 120px;
    aspect-ratio: 200 / 140;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.5;
}

.feature-card__icon--economy {
    background-image: url("../images/icon-feature-economy.svg");
}

.feature-card__icon--insulation {
    background-image: url("../images/icon-feature-insulation.svg");
}

.feature-card__icon--soundproof {
    background-image: url("../images/icon-feature-soundproof.svg");
}

.feature-card__icon--condensation {
    background-image: url("../images/icon-feature-condensation.svg");
}

.feature-card__body {
    position: relative;
    z-index: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-card__head {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.feature-card__title {
    font-weight: 700;
    font-size: 24px;
    white-space: nowrap;
}

.feature-card__line {
    flex: 1 0 0;
    height: 1px;
    background: var(--color-lightblue);
}

.feature-card__num {
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 52px;
    color: rgba(90, 201, 254, 0.5);
    letter-spacing: 0.05em;
    line-height: 1.25;
}

.feature-card__desc {
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: 0.05em;
}

/* ---------- Recruit section ---------- */
.recruit-section {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--color-lightblue);
    overflow: hidden;
}

.recruit-section__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recruit-section__body {
    /* z-index:0 (not just position:relative) is required here, not decorative:
       it makes __body establish its own stacking context, so __decoration's
       z-index:-1 below is scoped/clipped to *this* element only - it stays
       behind __body's own plain-text children (which would otherwise, being
       unpositioned, still paint above a position:absolute sibling regardless
       of DOM order) without escaping to compete against unrelated content
       elsewhere on the page. */
    position: relative;
    z-index: 0;
    overflow: hidden;
    padding: 120px 48px 80px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xl);
    color: var(--color-white);
}

/* Figma: Ellipse 2 (node 146:281) - soft white radial glow bleeding behind the
   RECRUIT copy. Positioned/clipped relative to __body (not the whole section)
   so it never visually reaches over the photo column on the left - the part
   of the circle that would bleed past __body's own left edge is simply cut
   off by __body's own overflow:hidden. */
.recruit-section__decoration {
    position: absolute;
    z-index: -1;
    left: -30.3%;
    top: -113px;
    width: 87.5%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.recruit-section__watermark {
    position: absolute;
    top: 48px;
    right: 48px;
    font-family: var(--font-en);
    font-weight: 700;
    line-height: 1;
    font-size: clamp(48px, 6vw, 88px);
    letter-spacing: 0.1em;
    opacity: 0.5;
    white-space: nowrap;
}

.recruit-section__heading {
    font-weight: 700;
    font-size: 32px;
    letter-spacing: 0.05em;
    line-height: 1.8;
    margin-top: 24px;
}

.recruit-section__heading strong {
    font-family: var(--font-mincho);
    color: var(--color-blue);
    font-size: 40px;
}

.recruit-section__lead {
    font-weight: 700;
    line-height: 2.5;
    letter-spacing: 0.05em;
    max-width: 572px;
}

@media (max-width: 1096px) {

    .about-section__row,
    .product-intro,
    .recruit-section {
        flex-direction: column;
    }

    .recruit-section {
        grid-template-columns: 1fr;
    }

    .product-intro__card {
        position: static;
        width: 100%;
    }

    .product-feature__grid {
        grid-template-columns: 1fr;
    }

    .feature-card:nth-child(2n) {
        transform: none;
    }

    /* These reveal-state rules have higher specificity than the plain
       nth-child rule above, so they must be cancelled separately - otherwise
       cards 2/4 still jump 60px down once scroll-reveal marks them
       is-in-view, breaking the single-column stack's spacing. Reset to the
       same plain fade-slide values as every other reveal-item (rather than
       "none") so cards 2/4 keep the same reveal animation as cards 1/3. */
    .product-feature__grid.reveal-group .feature-card.reveal-item:nth-child(2n) {
        transform: translateY(28px);
    }

    .product-feature__grid.reveal-group.is-in-view .feature-card.reveal-item:nth-child(2n) {
        transform: translateY(0);
    }
}

/* ---------- SP (Figma: TOP_SP, node 240:125) ---------- */
@media (max-width: 600px) {

    /* Hero (mv) */
    .hero {
        aspect-ratio: 400 / 790;
        padding: 16px;
    }

    .hero__bg {
        inset: 16px;
    }

    .hero__inner {
        left: 24px;
        right: 24px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 48px;
    }

    .hero__title {
        font-size: 24px;
    }

    .hero__subtitle {
        font-size: 12px;
        opacity: 0.8;
    }

    /* News section */
    .news-section {
        gap: 48px;
        padding: 80px 16px;
    }

    .news-item__title {
        font-size: 14px;
    }

    .news-item__cat {
        min-width: 0;
    }

    /* About section */
    .about-section {
        padding-bottom: 48px;
    }

    /* Figma (TOP_SP): the diagonal panel is far less steep on mobile than on
       desktop (bottom-right corner at ~67.8% of its own width, not 58.47%),
       and proportionally wider relative to the viewport. */
    .about-section__bg {
        width: 115%;
        clip-path: polygon(0 0, 100% 0, 67.8% 100%, 0 100%);
    }

    .about-section__watermark {
        left: 16px;
        top: 24px;
    }

    .about-section__row {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
        padding: 10px 16px 0;
    }

    .about-section__photo {
        order: -1;
        width: 100%;
    }

    .about-section__text {
        max-width: none;
    }

    .about-section__heading {
        font-size: 28px;
        line-height: 1.5;
        white-space: normal;
    }

    .about-section__lead {
        font-size: 14px;
    }

    .about-section__banner {
        padding: 0 16px;
        margin-top: 24px;
    }

    .about-section__banner img {
        height: 200px;
    }

    /* Product section */
    .product-section {
        padding-top: 80px;
    }

    .product-section__title-wrap {
        padding-inline: 16px;
    }

    .product-intro {
        margin-top: 24px;
        padding-inline: 16px;
    }

    .product-intro__card {
        padding: 48px 20px;
        gap: var(--spacing-md);
    }

    /* Figma (TOP_SP): "ツーイン" sits tight against "TWOIN" almost like a
       ruby annotation, not spaced out with the desktop gap. Both also inherit
       body's 1.75 line-height by default, which pads a lot of empty space
       above/below the glyphs on their own single line at these sizes. */
    .product-intro__heading {
        gap: 4px;
    }

    .product-intro__kana {
        line-height: 1;
    }

    .product-intro__name {
        font-size: 48px;
        line-height: 1.2;
    }

    .product-intro__catch {
        font-size: 16px;
        line-height: 1.65;
    }

    .product-intro__desc {
        font-size: 14px;
        text-align: center;
    }

    .product-feature {
        margin-top: 48px;
        padding: 48px 16px 80px;
        gap: var(--spacing-lg);
    }

    .product-feature__grid {
        gap: var(--spacing-lg);
        padding-inline: 16px;
    }

    .feature-card {
        min-height: 320px;
    }

    .feature-card__head {
        gap: 40px;
    }

    .feature-card__title {
        font-size: 20px;
    }

    .feature-card__num {
        font-size: 48px;
    }

    .feature-card__icon {
        width: 160px;
        height: 112px;
    }

    /* Recruit section */
    .recruit-section__body {
        padding: 80px 16px 48px;
    }

    .recruit-section__body .btn {
        align-self: center;
    }

    .recruit-section__watermark {
        top: 24px;
        right: 16px;
    }

    .recruit-section__decoration {
        left: -55%;
        top: -90px;
        width: 136%;
    }

    .recruit-section__heading {
        font-size: 22px;
        margin-top: 0;
    }

    .recruit-section__heading strong {
        font-size: 32px;
    }

    .recruit-section__lead {
        font-size: 14px;
        max-width: none;
    }
}