/*==================================================
    HIIRAGI HITSUGI Official Website
    responsive.css
    Version : 1.1.0
==================================================*/

.hamburger {
    display: none;
}

@media (max-width: 1100px) {
    header { padding-inline: 36px; }
    nav { gap: 26px; }
    .hero-content h1 { font-size: clamp(64px, 11vw, 120px); }
    .about-layout { grid-template-columns: 1fr; gap: 54px; }
    .about-details { max-width: 760px; padding-top: 0; margin-left: auto; }
    .capabilities-heading { grid-template-columns: 1fr; }
    .capabilities-heading > p { max-width: 560px; padding-bottom: 0; }

    .works-heading-row {
        grid-template-columns: minmax(0, 1fr) minmax(260px, .6fr);
    }

    #works .work-card-featured { grid-column: 1 / -1; grid-row: auto; }
    #works .work-card:not(.work-card-featured) { grid-column: span 6; }
    .work-card-featured .work-visual { min-height: 52vw; max-height: 620px; }
}

@media (max-width: 768px) {
    /* スマホではスクロール追従レイヤーを停止して描画負荷を抑える */
    .section-atmosphere { display: none; }

    header { height: 72px; padding-inline: 22px; }

    header nav {
        position: fixed;
        inset: 72px 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 26px 22px 32px;
        background: rgba(5, 8, 22, .94);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(18px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translate3d(0, -14px, 0);
        transition: opacity .3s ease, transform .3s ease, visibility .3s;
    }

    header nav a {
        width: min(100%, 420px);
        padding: 18px;
        text-align: center;
        letter-spacing: 3px;
        border-bottom: 1px solid rgba(255, 255, 255, .07);
    }

    header nav a:last-child { border-bottom: 0; }

    header.is-menu-open nav {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate3d(0, 0, 0);
    }

    .hamburger {
        position: relative;
        display: flex;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;
        color: inherit;
        cursor: pointer;
    }

    .hamburger span {
        display: block;
        width: 24px;
        height: 1px;
        background: currentColor;
        transform-origin: center;
        transition: transform .3s ease, opacity .2s ease;
    }

    .hamburger:focus-visible {
        outline: 2px solid var(--cyan2);
        outline-offset: 2px;
    }

    .is-menu-open .hamburger span:first-child {
        transform: translate3d(0, 7px, 0) rotate(45deg);
    }

    .is-menu-open .hamburger span:nth-child(2) { opacity: 0; }

    .is-menu-open .hamburger span:last-child {
        transform: translate3d(0, -7px, 0) rotate(-45deg);
    }

    #hero { min-height: 660px; height: 100svh; }
    .hero-content { width: min(100% - 28px, 620px); }
    .hero-sub { margin-bottom: 20px; font-size: 11px; letter-spacing: 6px; }
    .hero-content h1 { font-size: clamp(48px, 15vw, 86px); line-height: .92; letter-spacing: 2px; }
    .hero-text { margin-top: 25px; font-size: 17px; }
    .hero-buttons { flex-direction: column; gap: 12px; margin-top: 34px; }
    #explore, .secondary-button { width: min(280px, 84vw); min-width: 0; padding: 15px 24px; }
    .hero-social { left: 22px; bottom: 26px; }
    .scroll-indicator { right: 18px; left: auto; bottom: 25px; transform: none; }
    .scroll-indicator span { height: 48px; }
    section { padding-inline: 22px; }

    .about-principles dd { flex-direction: column; gap: 5px; }
    .capabilities-grid { grid-template-columns: 1fr; }
    .capabilities-grid .skill-card { min-height: 300px; }

    .works-heading-row { grid-template-columns: 1fr; gap: 24px; }
    .works-intro { padding-bottom: 0; }
    .works-filter { margin-top: 38px; }
    #works .works-grid { grid-template-columns: 1fr; gap: 18px; }
    #works .work-card,
    #works .work-card-featured,
    #works .work-card:not(.work-card-featured) { grid-column: 1; grid-row: auto; }
    .work-card-featured .work-visual,
    .work-visual { min-height: 54vw; }
    .work-body { padding: 24px; }
    .work-pointer-glow { display: none; }
}

@media (max-width: 420px) {
    .logo { font-size: 14px; letter-spacing: 3px; }
    .hero-content h1 { font-size: clamp(43px, 15.5vw, 65px); }
    .hero-sub { letter-spacing: 4px; }
    .hero-text { font-size: 15px; }
    .hero-social { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-glow,
    .scroll-indicator span { animation: none !important; }
    header nav,
    .hamburger span { transition: none; }
}


/*==================================================
    VTuber Hero Responsive / Version 3.4.0
==================================================*/
@media (max-width: 768px) {
    .hero-content {
        padding-top: 36px;
    }

    .hero-social {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        margin-top: 20px;
        gap: 8px;
    }

    .hero-social a {
        min-width: 80px;
        min-height: 36px;
        padding: 8px 14px;
        font-size: 10px;
    }
}

@media (max-width: 420px) {
    .hero-social {
        display: flex;
        width: min(100%, 310px);
    }

    .hero-social a {
        flex: 1 1 82px;
    }

    #contact h2 {
        font-size: clamp(34px, 10vw, 48px);
        letter-spacing: 2px;
    }

    #contact p {
        font-size: 16px;
    }
}


/*==================================================
    Mobile Character Framing / Version 3.6.0
==================================================*/
@media (max-width: 768px) {
    /* Hero: reserve the upper area for the character and keep the face in frame. */
    #hero {
        align-items: stretch;
        background: #050816;
    }

    .hero-background {
        background: #050816;
    }

    .hero-background img {
        display: block;
        width: 100%;
        height: 70%;
        object-fit: cover;
        object-position: 36% 48%;
        transform: scale(1.025);
        transform-origin: center top;
    }

    .hero-overlay {
        background:
            linear-gradient(180deg, rgba(2, 5, 15, .18) 0%, rgba(3, 7, 18, .2) 31%, rgba(5, 8, 22, .88) 66%, #050816 86%),
            linear-gradient(90deg, rgba(3, 7, 18, .28), transparent 60%);
    }

    .hero-gradient {
        background: radial-gradient(circle at 36% 24%, rgba(0, 207, 255, .18), transparent 45%);
    }

    .hero-content {
        min-height: 100%;
        justify-content: flex-end;
        box-sizing: border-box;
        padding: clamp(205px, 31svh, 280px) 0 54px;
    }

    .hero-sub {
        margin-bottom: 14px;
    }

    .hero-content h1 {
        font-size: clamp(42px, 13.5vw, 70px);
    }

    .hero-text {
        margin-top: 18px;
    }

    .hero-buttons {
        margin-top: 24px;
    }

    .hero-social {
        margin-top: 16px;
    }

    .scroll-indicator {
        display: none;
    }

    /* Portrait sections: show the upper character area instead of centering the full canvas. */
    #about .section-visual-image,
    #skills .section-visual-image {
        max-width: none;
        height: 86%;
        object-fit: contain;
        object-position: center top;
        opacity: .72;
    }

    #about .section-visual-image {
        width: 118vw;
        inset: 3% -13vw auto auto;
    }

    #skills .section-visual-image {
        width: 122vw;
        inset: 2% auto auto -9vw;
        object-position: 64% top;
    }

    #about .section-visual-backdrop {
        object-position: 50% 14%;
    }

    #skills .section-visual-backdrop {
        object-position: 64% 12%;
    }

    /* Landscape content art: the face is on the left side of the source image. */
    #works .section-visual-image,
    #works .section-visual-backdrop {
        object-position: 24% 50%;
    }

    #works .section-visual-image {
        transform-origin: 24% 50%;
    }

    /* Featured card uses hero.webp; keep its face visible too. */
    #works .work-card-featured .work-visual img {
        object-position: 36% 48%;
    }

    .contact-form-grid {
        grid-template-columns: 1fr;
    }

    .contact-field-wide {
        grid-column: auto;
    }

    .contact-form {
        margin-top: 38px;
        border-radius: 22px;
    }
}

@media (max-width: 420px) {
    #hero {
        min-height: 720px;
        height: max(100svh, 720px);
    }

    .hero-background img {
        height: 66%;
        object-position: 35% 48%;
    }

    .hero-content {
        padding-top: 220px;
        padding-bottom: 34px;
    }

    .hero-content h1 {
        font-size: clamp(40px, 12.8vw, 56px);
        line-height: .94;
    }

    .hero-buttons {
        gap: 9px;
    }

    #explore,
    .secondary-button {
        min-height: 46px;
        padding-block: 12px;
    }

    #about .section-visual-image {
        width: 126vw;
        inset-inline-end: -17vw;
    }

    #skills .section-visual-image {
        width: 128vw;
        inset-inline-start: -13vw;
    }

    .contact-form {
        padding: 24px 17px;
    }

    .contact-field > span small {
        display: block;
        margin: 4px 0 0;
    }

    .contact-submit {
        width: 100%;
        min-width: 0;
    }
}

/*==================================================
    Expanded Navigation Breakpoint / Version 4.0.0
    Six navigation items switch to the menu before they crowd the logo.
==================================================*/
@media (min-width: 769px) and (max-width: 980px) {
    header { height: 72px; padding-inline: 28px; }

    header nav {
        position: fixed;
        inset: 72px 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 26px 22px 32px;
        background: rgba(5, 8, 22, .96);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(18px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translate3d(0, -14px, 0);
        transition: opacity .3s ease, transform .3s ease, visibility .3s;
    }

    header nav a {
        width: min(100%, 460px);
        padding: 17px;
        text-align: center;
        letter-spacing: 3px;
        border-bottom: 1px solid rgba(255, 255, 255, .07);
    }

    header nav a:last-child { border-bottom: 0; }

    header.is-menu-open nav {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate3d(0, 0, 0);
    }

    .hamburger {
        position: relative;
        display: flex;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;
        color: inherit;
        cursor: pointer;
    }

    .hamburger span {
        display: block;
        width: 24px;
        height: 1px;
        background: currentColor;
        transform-origin: center;
        transition: transform .3s ease, opacity .2s ease;
    }

    .is-menu-open .hamburger span:first-child { transform: translate3d(0, 7px, 0) rotate(45deg); }
    .is-menu-open .hamburger span:nth-child(2) { opacity: 0; }
    .is-menu-open .hamburger span:last-child { transform: translate3d(0, -7px, 0) rotate(-45deg); }
}
