* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #202632;
    --muted: #7a8495;
    --base: #f3f5f8;
    --panel: #f7f9fc;
    --line: rgba(32, 38, 50, 0.1);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.95), transparent 32%),
        radial-gradient(circle at 78% 74%, rgba(223, 229, 238, 0.82), transparent 36%),
        var(--base);
    color: var(--ink);
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.home-body {
    width: 100%;
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
}

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

.home {
    height: 100svh;
    min-height: 0;
    max-height: 100svh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: clamp(14px, 2.2vw, 28px);
    overflow: hidden;
}

.home-header,
.home-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--muted);
    font-size: clamp(0.78rem, 1.5vw, 0.9rem);
    font-weight: 600;
    letter-spacing: 0.08em;
}

.brand {
    color: var(--ink);
    font-size: clamp(1rem, 2vw, 1.24rem);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.contact-link,
.home-footer a {
    padding: 8px 0;
}

.contact-link:hover,
.home-footer a:hover,
.app-logo-card:hover span {
    color: var(--ink);
}

.home-stage {
    width: 100%;
    margin: 0 auto;
    display: grid;
    align-items: center;
    min-height: 0;
    overflow: hidden;
}

.logo-wall {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 2vw, 22px);
    align-items: center;
}

.logo-wall.is-physics {
    position: relative;
    display: block;
    width: min(100%, 920px);
    margin: 0 auto;
    height: var(--physics-height, 380px);
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    border: 1px solid rgba(32, 38, 50, 0.12);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.28);
}

.app-logo-card {
    position: relative;
    width: min(100%, 238px);
    aspect-ratio: 1 / 1;
    justify-self: center;
    display: grid;
    place-items: center;
    border-radius: 999px;
    transition: transform 180ms ease;
}

.logo-wall.is-physics .app-logo-card {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--physics-size, 124px);
    max-width: var(--physics-size, 124px);
    will-change: transform;
    transform: translate3d(-120%, -120%, 0);
}

.physics-word {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: 999px;
    background: #ffffff;
    color: #202632;
    font-size: clamp(0.78rem, 1.3vw, 0.94rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
    box-shadow:
        12px 16px 34px rgba(80, 94, 116, 0.12),
        -10px -12px 24px rgba(255, 255, 255, 0.78),
        inset 5px 6px 12px rgba(255, 255, 255, 0.68),
        inset -7px -8px 16px rgba(80, 94, 116, 0.07);
}

.physics-word.word-primary {
    background: #202632;
    color: #ffffff;
    box-shadow:
        12px 16px 34px rgba(32, 38, 50, 0.16),
        -10px -12px 24px rgba(255, 255, 255, 0.66),
        inset 5px 6px 12px rgba(255, 255, 255, 0.16),
        inset -7px -8px 16px rgba(0, 0, 0, 0.18);
}

.logo-wall.is-physics .physics-word {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--physics-width, auto);
    height: var(--physics-height-item, 42px);
    will-change: transform;
    transform: translate3d(-120%, -120%, 0);
}

.app-logo-card:hover {
    transform: translateY(-5px) scale(1.025);
}

.app-logo-surface {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    padding: clamp(6px, 1.2vw, 12px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: #f7f9fc;
    box-shadow:
        18px 24px 48px rgba(80, 94, 116, 0.15),
        -14px -16px 30px rgba(255, 255, 255, 0.86),
        inset 8px 10px 18px rgba(255, 255, 255, 0.78),
        inset -12px -14px 24px rgba(80, 94, 116, 0.09);
    transition: box-shadow 180ms ease, background 180ms ease;
}

.app-logo-card:hover .app-logo-surface {
    background: #ffffff;
    box-shadow:
        22px 30px 60px rgba(80, 94, 116, 0.18),
        -16px -18px 34px rgba(255, 255, 255, 0.9),
        inset 9px 11px 19px rgba(255, 255, 255, 0.82),
        inset -13px -16px 28px rgba(80, 94, 116, 0.11);
}

.app-logo-card.gohan .app-logo-surface {
    background: #ff8a1f;
    box-shadow:
        18px 24px 48px rgba(183, 76, 18, 0.24),
        -14px -16px 30px rgba(255, 255, 255, 0.68),
        inset 8px 10px 18px rgba(255, 255, 255, 0.32),
        inset -12px -14px 24px rgba(97, 42, 10, 0.18);
}

.app-logo-card.uolog .app-logo-surface {
    background: #2a6f97;
    box-shadow:
        18px 24px 48px rgba(18, 80, 116, 0.26),
        -14px -16px 30px rgba(255, 255, 255, 0.7),
        inset 8px 10px 18px rgba(255, 255, 255, 0.36),
        inset -12px -14px 24px rgba(4, 39, 62, 0.2);
}

.logo-wall.is-physics .app-logo-surface {
    transform: rotate(calc(var(--body-angle, 0rad) * -1));
}

.app-logo-card img {
    position: relative;
    z-index: 1;
    width: 84%;
    height: 84%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 12px 18px rgba(42, 53, 77, 0.13));
}

.app-logo-card.emofleets img {
    width: 74%;
    height: 74%;
}

.app-logo-card.gohan img {
    width: 96%;
    height: 96%;
}

.app-logo-card.zutsuuyohou img {
    width: 88%;
    height: 88%;
}

.app-logo-card.uolog img {
    width: 88%;
    height: 88%;
    filter: drop-shadow(0 12px 18px rgba(3, 27, 43, 0.24));
}

.app-logo-card.kitayo img {
    width: 88%;
    height: 88%;
}

.app-logo-card > span:not(.app-logo-surface) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.home-footer {
    align-self: end;
}

.home-footer span {
    white-space: nowrap;
}

.shuffle-button {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(82px, calc(env(safe-area-inset-bottom) + 82px));
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 999px;
    background: #202632;
    color: #ffffff;
    font: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow:
        12px 16px 34px rgba(32, 38, 50, 0.2),
        inset 5px 6px 12px rgba(255, 255, 255, 0.18),
        inset -7px -8px 16px rgba(0, 0, 0, 0.22);
    z-index: 10;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.shuffle-button:hover {
    transform: translateY(-2px) rotate(12deg);
    box-shadow:
        14px 18px 38px rgba(32, 38, 50, 0.24),
        inset 5px 6px 12px rgba(255, 255, 255, 0.2),
        inset -7px -8px 16px rgba(0, 0, 0, 0.24);
}

.shuffle-button:active {
    transform: translateY(1px) scale(0.96);
}

@media (max-width: 900px) {
    .home-stage {
        align-content: center;
    }

    .app-logo-card {
        width: min(100%, 188px);
    }
}

@media (max-width: 620px) {
    .home {
        padding: 16px;
    }

    .home-header,
    .home-footer {
        letter-spacing: 0.04em;
    }

    .logo-wall {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .app-logo-card {
        width: 100%;
        padding: 5px;
    }

    .shuffle-button {
        width: 48px;
        height: 48px;
        font-size: 1.34rem;
    }

    .logo-wall.is-physics {
        min-height: 0;
    }

    .logo-wall.is-physics .app-logo-card {
        width: var(--physics-size, 88px);
    }

    .physics-word {
        min-height: 34px;
        padding: 0 12px;
        font-size: 0.72rem;
    }

    .app-logo-card img,
    .app-logo-card.zutsuuyohou img,
    .app-logo-card.uolog img,
    .app-logo-card.kitayo img {
        width: 86%;
        height: 86%;
    }

    .app-logo-card.emofleets img {
        width: 74%;
        height: 74%;
    }

    .app-logo-card.gohan img {
        width: 94%;
        height: 94%;
    }

}

@media (prefers-reduced-motion: reduce) {
    .app-logo-card {
        transition: none;
    }

    .app-logo-card:hover {
        transform: none;
    }
}
