/*
 * トップページ (home.blade.php) と共通ヘッダー・フッター (components/top) のスタイル
 * 値は Figma「Desktop」フレーム (gPuWEsrR1Xm2r5Z66GGZf8 / 0:22) に準拠。site.css の後に読み込む。単位は rem (16px = 1rem)。
 */
/* 色・文字などのトークンは site.css で定義 */

.top-home {
    line-height: normal;
}

.top-home a,
.top-header a,
.top-footer a {
    color: inherit;
    text-decoration: none;
}

.top-home p,
.top-header p,
.top-footer p {
    margin: 0;
}

.top-container {
    max-width: var(--dh-max-width);
    margin: 0 auto;
}

.top-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 1rem;
}

.top-section__title {
    margin: 0;
    font-size: var(--dh-fs-h2);
    font-weight: 700;
}

.top-center {
    display: flex;
    justify-content: center;
    padding: 1rem;
}

/* ---------- ボタン (Figma: button / button-white) ---------- */
.top-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 0.0625rem solid var(--dh-pink);
    border-radius: var(--dh-radius-pill);
    background: transparent;
    color: var(--dh-pink) !important;
    font-family: inherit;
    font-size: var(--dh-fs-body);
    font-weight: 700;
    line-height: normal;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, filter 0.15s, transform 0.1s;
}

.top-pill-btn:hover,
.top-pill-btn.is-active {
    background: var(--dh-pink);
    color: var(--dh-white) !important;
}

.top-pill-btn--solid {
    background: var(--dh-pink);
    color: var(--dh-white) !important;
}

.top-pill-btn--blue {
    border-color: var(--dh-blue);
    background: var(--dh-blue);
    color: var(--dh-white) !important;
}

.top-pill-btn--solid:hover,
.top-pill-btn--blue:hover {
    filter: brightness(1.05);
}

.top-pill-btn--blue:hover {
    background: var(--dh-blue);
}

.top-pill-btn--white {
    border-color: var(--dh-white);
    background: var(--dh-white);
    color: var(--dh-pink) !important;
}

.top-pill-btn--white:hover {
    background: var(--dh-white);
    color: var(--dh-pink) !important;
    filter: brightness(0.96);
}

.top-pill-btn--outline-white {
    border-color: var(--dh-white);
    color: var(--dh-white) !important;
}

.top-pill-btn--outline-white:hover {
    background: var(--dh-white);
    color: var(--dh-pink) !important;
}

/* ---------- 背景の円グラデーション (Figma: Ellipse 4 / 5) ---------- */
.top-home {
    position: relative;
    overflow: hidden;
}

.top-home::before,
.top-home::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 50rem;
    height: 50rem;
    border-radius: 50%;
    pointer-events: none;
}

.top-home::before {
    top: 15.9375rem;
    left: -11.5rem;
    background: radial-gradient(circle, rgba(237, 80, 132, 0.1) 0%, transparent 70%);
}

.top-home::after {
    top: -17.625rem;
    left: calc(50% - 4rem);
    background: radial-gradient(circle, rgba(250, 225, 181, 0.35) 0%, transparent 70%);
}

/* ---------- ヘッダー ---------- */
.top-header {
    border-bottom: 0.0625rem solid rgba(0, 0, 0, 0.1);
}

.top-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem;
}

.top-header__logo img {
    display: block;
    width: auto;
    height: 2rem;
}

.top-header__nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    font-size: var(--dh-fs-body);
    white-space: nowrap;
}

.top-header__badge {
    display: inline-block;
    min-width: 1.25rem;
    padding: 0 0.375rem;
    border-radius: var(--dh-radius-pill);
    background: var(--dh-pink);
    color: var(--dh-white);
    font-size: var(--dh-fs-caption);
    text-align: center;
}

/* ---------- ヒーロー ---------- */
.top-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: var(--dh-max-width);
    margin: 0 auto;
    padding: 8rem 1rem;
    text-align: center;
}

.top-hero__text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.top-hero__title {
    margin: 0;
    color: var(--dh-foreground-thin);
    font-size: var(--dh-fs-display);
    font-weight: 700;
    line-height: normal;
}

.top-hero__title em {
    font-style: normal;
    color: var(--dh-pink);
}

.top-hero__lead {
    font-size: var(--dh-fs-body);
}

.top-hero__actions {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* 装飾ケーキ画像 (Figma: Group 2) */
.top-hero__deco {
    position: absolute;
    width: 7.5rem;
    height: 7.5rem;
    border-radius: var(--dh-radius-pill);
    object-fit: cover;
    pointer-events: none;
}

.top-hero__deco--lg {
    width: 15rem;
    height: 15rem;
}

.top-hero__deco--1 { top: 0; left: 0; }
.top-hero__deco--2 { top: 0; left: 15rem; }
.top-hero__deco--3 { top: 15rem; left: 0; }
.top-hero__deco--4 { bottom: 15rem; right: 0; }
.top-hero__deco--5 { bottom: 0; right: 0; }
.top-hero__deco--6 { bottom: 0; right: 15rem; }

/* ---------- 15秒診断 ---------- */
.top-diagnosis-section {
    align-items: center;
}

.top-diagnosis {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
    padding: var(--dh-pad-panel);
    border-radius: var(--dh-radius-lg);
    background: var(--dh-white);
}

/* display: flex より hidden を優先する (結果は2問答えるまで隠す) */
.top-diagnosis [hidden] {
    display: none !important;
}

.top-diagnosis__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 0;
}

.top-diagnosis__q {
    font-size: var(--dh-fs-h3);
}

.top-diagnosis__choices {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.top-diagnosis__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.top-diagnosis__arrow img {
    transform: rotate(180deg);
}

.top-diagnosis__result-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding-top: 1rem;
}

.top-diagnosis__result-label {
    font-size: var(--dh-fs-body);
}

.top-diagnosis__result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
    border-radius: var(--dh-radius-pill);
    background: var(--dh-pink);
    color: var(--dh-white) !important;
    transition: filter 0.15s;
}

.top-diagnosis__result:hover {
    filter: brightness(1.05);
}

.top-diagnosis__result-label-text {
    flex: 1 0 0;
    font-size: var(--dh-fs-h2);
    font-weight: 700;
    text-align: center;
}

/* ---------- フル/セミ 説明カード ---------- */
.top-order-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 2rem 1rem;
}

.top-order-type {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    min-height: 18.8125rem;
    box-sizing: border-box;
    padding: var(--dh-pad-panel);
    border-radius: var(--dh-radius-lg);
    background: var(--dh-white);
}

.top-order-type__head {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: var(--dh-fs-h3);
    font-weight: 700;
}

.top-order-type__icon {
    display: flex;
    padding: 0.5rem;
    border-radius: var(--dh-radius-pill);
    background: var(--dh-pink);
}

.top-order-type--semi .top-order-type__icon {
    background: var(--dh-blue);
}

.top-order-type__body {
    font-size: var(--dh-fs-h3);
}

/* ---------- 注文の流れ ---------- */
.top-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    padding: 2rem 1rem;
}

.top-flow__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--dh-radius-lg);
    background: var(--dh-white);
    text-align: center;
}

.top-flow__img {
    display: flex;
    justify-content: center;
    width: 100%;
    aspect-ratio: 288 / 144;
    overflow: hidden;
    border-radius: var(--dh-radius-md);
}

.top-flow__img--photo {
    background: var(--dh-yellow);
}

.top-flow__img--photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-flow__img--illust img {
    height: 100%;
}

.top-flow__label {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: var(--dh-fs-body);
}

.top-flow__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--dh-radius-pill);
    background: var(--dh-pink);
    color: var(--dh-white);
    font-size: var(--dh-fs-body);
    font-weight: 700;
}

.top-flow__desc {
    font-size: var(--dh-fs-caption);
}

/* ---------- カードグリッド (キャスト・投稿) ---------- */
.top-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.top-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--dh-radius-md);
    background: var(--dh-white);
    box-shadow: var(--dh-shadow);
    transition: transform 0.15s;
}

.top-card:hover {
    transform: translateY(-0.125rem);
}

.top-card__img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--dh-yellow);
}

.top-card__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: var(--dh-pad-card);
}

.top-card__profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.375rem 0;
}

.top-card__profile-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.top-card--post .top-card__profile-text {
    gap: 0;
}

.top-card__avatar {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    border-radius: var(--dh-radius-pill);
    object-fit: cover;
}

.top-card__name {
    font-size: var(--dh-fs-body);
}

.top-card__caption {
    font-size: var(--dh-fs-caption);
}

.top-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.top-card__tag {
    padding: 0.25rem 0.5rem;
    border: 0.0625rem solid var(--dh-pink);
    border-radius: var(--dh-radius-pill);
    background: var(--dh-white);
    color: var(--dh-pink);
    font-size: var(--dh-fs-caption);
}

.top-card__text {
    font-size: var(--dh-fs-body);
}

.top-card--post .top-card__text {
    font-size: var(--dh-fs-small);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 法人・キャスト登録 ---------- */
.top-recruit {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 4rem 2rem;
}

.top-recruit__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.1;
    pointer-events: none;
}

.top-recruit__inner {
    position: relative;
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: var(--dh-max-width);
    padding: 0 1rem;
}

.top-recruit__col {
    display: flex;
    flex: 1 0 0;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    min-width: 0;
}

.top-recruit__divider {
    flex-shrink: 0;
    width: 0.0625rem;
    background: rgba(0, 0, 0, 0.1);
}

.top-recruit__title {
    margin: 0;
    color: var(--dh-foreground-thin);
    font-size: var(--dh-fs-h2);
    font-weight: 700;
}

.top-recruit__text {
    align-self: stretch;
    font-size: var(--dh-fs-body);
}

.top-recruit__text p + p {
    margin-top: 1.5em;
}

/* ---------- FAQ ---------- */
.top-faq {
    gap: 1rem;
    padding: 4rem 1rem;
}

.top-faq .top-section__title {
    color: var(--dh-foreground-thin);
}

.top-faq__item {
    border-radius: var(--dh-radius-md);
    background: var(--dh-white);
}

.top-faq__item summary {
    display: flex;
    align-items: center;
    padding: 1rem;
    font-size: var(--dh-fs-body);
    cursor: pointer;
    list-style: none;
}

.top-faq__item summary::-webkit-details-marker {
    display: none;
}

.top-faq__item summary img {
    transition: transform 0.15s;
}

.top-faq__item[open] summary img {
    transform: rotate(90deg);
}

.top-faq__answer {
    padding: 0 1rem 1rem 2.5rem;
    font-size: var(--dh-fs-body);
}

.top-faq__answer a {
    color: var(--dh-pink) !important;
    text-decoration: underline !important;
}

/* ---------- LINE CTA ---------- */
.top-line-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    border-radius: var(--dh-radius-md);
    background: var(--dh-pink);
    color: var(--dh-white);
    text-align: center;
}

.top-line-cta__title {
    font-size: var(--dh-fs-h1);
    font-weight: 700;
}

.top-line-cta__text {
    font-size: var(--dh-fs-body);
}

.top-line-cta__actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ---------- フッター ---------- */
.top-footer__silhouette {
    display: block;
    width: 100%;
    height: auto;
}

.top-footer__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
    margin-top: -0.0625rem;
    padding: 4rem 0;
    background: var(--dh-footer-bg);
    color: var(--dh-foreground-thin);
}

.top-footer__cols {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 4rem;
    width: 100%;
    max-width: var(--dh-max-width);
    box-sizing: border-box;
    padding: 2rem;
}

.top-footer__col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.top-footer__col h3 {
    margin: 0;
    font-size: var(--dh-fs-h3);
    font-weight: 700;
}

.top-footer__col a {
    font-size: var(--dh-fs-body);
}

.top-footer__sns {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: -2rem;
}

.top-footer__sns a {
    transition: opacity 0.15s;
}

.top-footer__sns a:hover {
    opacity: 0.7;
}

.top-footer__sns img {
    display: block;
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

.top-footer__copyright {
    font-size: var(--dh-fs-body);
}

/* ---------- レスポンシブ ---------- */
@media screen and (max-width: 61.9375rem) {
    .top-hero__deco { display: none; }
    .top-hero { padding: 5rem 1rem; }
    .top-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .top-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 47.9375rem) {
    /* スマホではカード類を1列にして、横幅いっぱいに使う */
    .top-card-grid { grid-template-columns: 1fr; }
    .top-flow { grid-template-columns: 1fr; }
    .top-header__inner { padding: 1rem; }
    .top-header__logo img { height: 1.5rem; }
    .top-header__nav { gap: 0.75rem; }
    .top-header__nav-link { display: none; }
    .top-header__logo { flex-shrink: 0; }
    .top-header__nav { min-width: 0; }
    /* ログイン中の名前が長くても画面からはみ出さない */
    .top-header__nav .dropdown { min-width: 0; }
    .top-header__nav .dropdown-toggle {
        display: block;
        max-width: 10rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .top-hero { padding: 4rem 1rem; }
    .top-hero__lead br { display: none; }
    .top-order-types { grid-template-columns: 1fr; }
    .top-order-type { min-height: 0; }
    .top-recruit { padding: 3rem 1rem; }
    .top-recruit__inner { flex-direction: column; gap: 3rem; padding: 0; }
    .top-recruit__divider { display: none; }
    .top-recruit__text br { display: none; }
    .top-line-cta { padding: 1.5rem 1rem; }
    .top-footer__cols { flex-direction: column; gap: 2rem; padding: 1rem 2rem; }
}

/* ---------- 動き (prefers-reduced-motion のときは出さない) ---------- */
@media (prefers-reduced-motion: no-preference) {
    /* ヒーローのケーキがふわふわ浮く */
    .top-hero__deco {
        animation: top-float 12s ease-in-out infinite;
    }

    .top-hero__deco--2 { animation-delay: -2s; animation-duration: 10s; }
    .top-hero__deco--3 { animation-delay: -4s; animation-duration: 14s; }
    .top-hero__deco--4 { animation-delay: -6s; animation-duration: 11s; }
    .top-hero__deco--5 { animation-delay: -8s; }
    .top-hero__deco--6 { animation-delay: -5s; animation-duration: 13s; }

    /* スクロールで表示 (クラスは JS が付けるので、JS が動かないときは最初から表示される) */
    .top-reveal {
        opacity: 0;
        transform: translateY(1.5rem);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }

    .top-reveal.is-visible {
        opacity: 1;
        transform: none;
    }

    /* 診断の結果がめくれる */
    .top-diagnosis__result.is-flipping .top-diagnosis__result-label-text {
        animation: top-flip 0.4s ease;
    }

    /* 2問答えたら結果が出てくる */
    .top-diagnosis__result-wrap.is-revealing,
    .top-diagnosis__arrow.is-revealing {
        animation: top-reveal-up 0.5s ease both;
    }

    .top-diagnosis__result-wrap.is-revealing {
        animation-delay: 0.15s;
    }

    .top-diagnosis__result.is-decided {
        animation: top-pop 0.5s ease 0.2s;
    }

    /* ボタンを押したときに少し弾む */
    .top-pill-btn:active {
        transform: scale(0.96);
    }
}

@keyframes top-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-0.375rem) rotate(-1deg); }
}

@keyframes top-flip {
    0% { transform: rotateX(0); opacity: 1; }
    50% { transform: rotateX(90deg); opacity: 0; }
    100% { transform: rotateX(0); opacity: 1; }
}

@keyframes top-reveal-up {
    from { opacity: 0; transform: translateY(1rem); }
    to { opacity: 1; transform: none; }
}

@keyframes top-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

/* ハート・紙吹雪 (JS で body 直下に作る) */
.top-burst {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    line-height: 1;
}

.top-burst--heart {
    font-size: var(--dh-fs-h3);
}

.top-burst--confetti {
    width: 0.5rem;
    height: 0.75rem;
    border-radius: 0.125rem;
    background: currentColor;
}

/* フォーカス表示はキーボード操作のときだけ、テーマ色で出す */
.top-pill-btn:focus {
    outline: none;
}

.top-pill-btn:focus-visible {
    outline: 0.125rem solid var(--dh-pink);
    outline-offset: 0.125rem;
}
