/* =============================================================
   MoRi — Enhanced responsive styles for mobile & tablet
   ============================================================= */

/* TABLET (768px - 920px) */
@media (max-width: 920px) and (min-width: 569px) {
    .hero {
        padding: 5rem var(--gutter) 3rem;
    }

    .hero__tag {
        margin-bottom: clamp(1rem, 3vh, 2rem);
    }

    .wordmark {
        font-size: clamp(3rem, 14vw, 8rem);
    }

    .hero__sub {
        font-size: clamp(0.95rem, 1.4vw, 1.2rem);
        max-width: 35ch;
    }

    .section-head {
        gap: 1.5rem;
    }

    .section-head h2 {
        font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    }

    .feature__title {
        font-size: clamp(1.8rem, 4vw, 3rem);
    }

    .feature__num {
        font-size: clamp(1.8rem, 4vw, 3rem);
    }

    .contact__big {
        font-size: clamp(1.8rem, 6vw, 4rem);
    }

    .reel__play {
        width: clamp(60px, 7vw, 90px);
        height: clamp(60px, 7vw, 90px);
    }
}

/* PHONE & SMALL TABLET (max 568px) */
@media (max-width: 568px) {
    /* --- Spacing resets --- */
    .hero-pin {
        height: 140vh;
    }

    .hero {
        padding: 4rem var(--gutter) 2.5rem;
        min-height: 100vh;
    }

    .hero__tag {
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }

    /* Wordmark: allow the JS morph to work on mobile too */
    .wordmark {
        font-size: clamp(2.2rem, 11vw, 4rem);
        line-height: 1;
        white-space: normal;
        word-break: break-word;
    }

    .wordmark .fixed {
        display: inline;
        color: var(--cream);
    }

    .wordmark .grow {
        display: inline-block;
        will-change: max-width, opacity;
    }

    .wordmark .gap {
        display: inline-block;
    }

    .hero__sub {
        font-size: 0.95rem;
        max-width: 28ch;
        margin-top: 1rem;
        line-height: 1.5;
    }

    .hero__scrollcue {
        bottom: 1.2rem;
        font-size: 0.6rem;
    }

    .hero__scrollcue .line {
        height: 30px;
    }

    /* --- Section spacing --- */
    .section {
        padding-block: clamp(3rem, 8vw, 5rem);
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
    }

    .section-head h2 {
        font-size: clamp(1.5rem, 3.5vw, 2.2rem);
        max-width: 100%;
    }

    .section-head .lead {
        font-size: clamp(0.9rem, 1.4vw, 1.05rem);
        max-width: 100%;
        line-height: 1.5;
    }

    /* --- Reel/Video fixes --- */
    .reel {
        aspect-ratio: 16 / 10;
        border-radius: 12px;
    }

    .reel video {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .reel img.reel__poster {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .reel__play {
        width: clamp(50px, 8vw, 70px);
        height: clamp(50px, 8vw, 70px);
        border-width: 2px;
    }

    .reel__play svg {
        width: 30%;
        height: 30%;
    }

    .reel__label {
        font-size: 0.6rem;
        letter-spacing: 0.2em;
    }

    .reel__overlay {
        gap: 1rem;
    }

    /* --- Feature cards --- */
    .feature {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: clamp(0.75rem, 2vw, 1.5rem);
        border-radius: 16px;
    }

    .feature:nth-child(even) {
        grid-template-columns: 1fr;
    }

    .feature__media {
        aspect-ratio: 3 / 2;
        max-height: 260px;
        border-radius: 12px;
    }

    .feature__body {
        order: 1 !important;
    }

    .feature__media {
        order: 0 !important;
    }

    .feature__num {
        font-size: clamp(1.6rem, 3.5vw, 2.4rem);
        margin-bottom: 0.4rem;
        opacity: 0.6;
    }

    .feature__kicker {
        font-size: 0.65rem;
        margin: 0.5rem 0 0.4rem;
        gap: 0.6em;
    }

    .feature__kicker .dot {
        width: 7px;
        height: 7px;
    }

    .feature__title {
        font-size: clamp(1.3rem, 3.2vw, 1.9rem);
        margin-bottom: 0.4rem;
    }

    .feature__desc {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
        line-height: 1.5;
    }

    .feature__meta {
        gap: 0.3rem 0.4rem;
        margin-bottom: 0.9rem;
    }

    .tag {
        font-size: 0.6rem;
        padding: 0.3em 0.65em;
    }

    .feature:hover {
        transform: none;
        background: transparent;
        box-shadow: none;
    }

    .feature:active {
        transform: translateY(-2px);
    }

    /* --- Projects grid spacing --- */
    .projects {
        gap: clamp(1.8rem, 4vw, 3.5rem);
    }

    /* --- About section --- */
    .about__grid {
        grid-template-columns: 1fr;
        gap: clamp(1.2rem, 3vw, 2.5rem);
        align-items: stretch;
    }

    .about__portrait {
        max-width: 100%;
        aspect-ratio: 3 / 4;
        border-radius: 14px;
    }

    .about__body h2 {
        font-size: clamp(1.3rem, 3.5vw, 1.8rem);
        margin-bottom: 0.8rem;
        line-height: 1.1;
    }

    .about__body h2 br {
        display: none;
    }

    .about__body p {
        font-size: 0.9rem;
        max-width: 100%;
        margin-bottom: 0.9rem;
        line-height: 1.6;
    }

    .about__body .eyebrow {
        margin-bottom: 0.5rem;
    }

    .about__disciplines {
        gap: 0.35rem;
        margin-top: 1rem;
    }

    /* --- Contact --- */
    .contact {
        text-align: center;
    }

    .contact__big {
        font-size: clamp(1.5rem, 5.5vw, 2.8rem);
        margin: 0.6rem 0 1.2rem;
        line-height: 1.2;
    }

    .contact__big a {
        display: block;
    }

    .contact__actions {
        gap: 0.7rem;
        margin-bottom: 2rem;
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.8em 1.2em;
        font-size: 0.85rem;
        min-height: 48px;
        min-width: 100%;
    }

    /* --- Nav optimizations --- */
    .nav {
        height: 64px;
        padding-inline: var(--gutter);
    }

    .nav-toggle {
        display: flex;
        width: 28px;
        height: 28px;
        gap: 4px;
        z-index: 10000;
    }

    .nav-toggle span {
        height: 2px;
    }

    .nav-links {
        position: fixed;
        inset: 0;
        top: 0;
        height: 100dvh;
        z-index: 9999;

        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;


        gap: 0;
        backdrop-filter: blur(20px);
        background: rgba(10, 22, 34, 0.98);
        transform: translateX(-100%);
        transition: transform 0.4s var(--ease-out);
        overflow-y: auto;
        padding: 2rem var(--gutter);

        /*
        transform: translateX(100%);
        transition: transform .3s ease;*/
    }

    body.nav-open .nav-links {
        transform: translateX(0);
    }

    .nav-links li {
        border-bottom: 1px solid var(--line);
        padding: 1rem 0;
    }

    .nav-links li:first-child {
        padding-top: 0;
    }

    .nav-links a {
        font-size: 1.1rem;
        color: var(--cream);
        display: block;
        padding: 0.5rem 0;
    }

    .nav-links a::after {
        display: none;
    }

    .nav-links a:hover {
        color: var(--accent);
    }

    .nav-links a {
        font-size: 1.3rem;
        color: var(--cream);
    }

    body.nav-open .nav-links {
        transform: translateY(0);
    }

    body.nav-open .nav-toggle span:nth-child(1) {
        transform: translateY(6.5px) rotate(45deg);
    }

    body.nav-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.nav-open .nav-toggle span:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    /* --- Footer --- */
    .site-footer {
        padding-block: 2rem;
    }

    .site-footer .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-socials {
        justify-content: center;
        gap: 1rem;
        order: 1;
    }

    .footer-socials a {
        font-size: 0.8rem;
    }

    .footer-meta {
        font-size: 0.75rem;
        order: 2;
    }

    .footer-meta a {
        text-decoration: underline;
    }
}

/* EXTRA SMALL PHONES (max 380px) */
@media (max-width: 380px) {
    .wordmark {
        font-size: clamp(1.8rem, 9vw, 2.8rem);
        word-break: break-word;
    }

    .hero__sub {
        font-size: 0.85rem;
        max-width: 22ch;
    }

    .section-head h2 {
        font-size: clamp(1.3rem, 3vw, 1.8rem);
    }

    .section-head .lead {
        font-size: 0.85rem;
    }

    .feature__media {
        aspect-ratio: 3 / 2.5;
        max-height: 220px;
    }

    .feature__num {
        font-size: clamp(1.4rem, 3vw, 2rem);
    }

    .feature__title {
        font-size: clamp(1.1rem, 2.8vw, 1.6rem);
    }

    .contact__big {
        font-size: clamp(1.3rem, 4.5vw, 2rem);
    }

    .btn {
        padding: 0.7em 1em;
        font-size: 0.8rem;
    }

    .tag {
        font-size: 0.55rem;
        padding: 0.25em 0.6em;
    }

    .about__body h2 {
        font-size: clamp(1.1rem, 3vw, 1.5rem);
    }

    .about__body p {
        font-size: 0.85rem;
    }

    .nav-links a {
        font-size: 1rem;
    }

    .footer-socials a,
    .footer-meta {
        font-size: 0.75rem;
    }
}

/* LANDSCAPE MODE OPTIMIZATIONS */
@media (max-width: 920px) and (max-height: 600px) and (orientation: landscape) {
    .hero-pin {
        height: 180vh;
    }

    .hero {
        padding: 2rem var(--gutter);
        min-height: auto;
    }

    .hero__tag {
        margin-bottom: 0.5rem;
    }

    .wordmark {
        font-size: clamp(1.6rem, 10vw, 3.5rem);
    }

    .hero__sub {
        margin-top: 0.5rem;
        font-size: 0.85rem;
        max-width: 30ch;
    }

    .hero__scrollcue {
        display: none;
    }

    .section {
        padding-block: clamp(2rem, 6vw, 3.5rem);
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .feature:active .feature__media img,
    .feature:active .feature__media video {
        transform: scale(1.02);
    }

    .btn {
        min-height: 48px;
        min-width: 100%;
    }

    .text-link {
        min-height: 44px;
        padding: 0.5em 0;
        display: inline-flex;
    }

    .nav-links a {
        padding: 0.8em 0;
        min-height: 44px;
    }

    .reel:hover .reel__poster {
        transform: none;
    }

    .reel:hover .reel__play {
        transform: none;
        background: rgba(10, 22, 34, 0.35);
    }

    .feature:hover .feature__media img,
    .feature:hover .feature__media video {
        transform: none;
    }

    .feature:hover {
        transform: none;
        background: transparent;
        box-shadow: none;
    }

    /* Tap states instead */
    .feature:active {
        transform: translateY(-3px);
        background: color-mix(in srgb, var(--ink-800) 45%, transparent);
    }

    .reel:active .reel__play {
        transform: scale(1.05);
        background: var(--accent);
    }

    .reel:active .reel__play svg {
        fill: var(--ink-900);
    }
}
