/* =========================================================
   Pia.Dev — phone & tablet layout
   Loaded after Tailwind. Desktop is untouched: everything
   here lives inside max-width media queries, except the
   mobile menu which is hidden on desktop.
   ========================================================= */

/* ---------- Mobile menu (hidden on desktop) ---------- */
.m-burger { display: none; }
.m-mobilemenu { display: none; }

@media (max-width: 767px) {
    .m-burger {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 42px;
        height: 42px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, .16);
        background: rgba(255, 255, 255, .03);
        cursor: pointer;
        transition: border-color .2s, background-color .2s;
    }
    .m-burger:hover, .m-burger:focus-visible { border-color: #56C196; outline: none; }
    .m-burger span {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: #e5e7eb;
        transition: transform .35s cubic-bezier(.16, 1, .3, 1), opacity .2s;
    }
    .m-burger.is-open { border-color: #E325D0; }
    .m-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .m-burger.is-open span:nth-child(2) { opacity: 0; }
    .m-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .m-mobilemenu {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 6px 16px 20px;
        background-color: #0b0b0b;
        z-index: 60;
        border-bottom: 1px solid rgba(86, 193, 150, .3);
        box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .9);
        font-family: 'Inconsolata', monospace;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity .25s, transform .3s cubic-bezier(.16, 1, .3, 1);
    }
    .m-mobilemenu[hidden] { display: none; }
    .m-mobilemenu.is-open { opacity: 1; transform: none; }
    .m-mobilemenu > a {
        display: block;
        padding: 14px 4px;
        font-size: 1.15rem;
        color: #d1d5db;
        border-bottom: 1px dashed rgba(255, 255, 255, .08);
        transition: color .2s, padding-left .3s cubic-bezier(.16, 1, .3, 1);
    }
    .m-mobilemenu > a:hover, .m-mobilemenu > a:focus-visible { color: #fff; padding-left: 12px; outline: none; }
    .m-mobilemenu > a.is-active { color: #56C196; }
    .m-mobilemenu__social { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; }
    .m-mobilemenu__social a {
        padding: 8px 14px;
        border-radius: 999px;
        border: 1px solid rgba(102, 166, 214, .45);
        color: #66A6D6;
        font-size: .95rem;
    }
}

/* Social icons move into the menu on phones so the top bar isn't crowded */
@media (max-width: 639px) {
    .m-nav-social { display: none !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 639px) {
    /* Headings scale with the screen instead of running off it */
    main .text-7xl, main .text-6xl { font-size: clamp(2.3rem, 11.5vw, 3.75rem); line-height: 1.08; }
    main .text-5xl { font-size: clamp(1.75rem, 8vw, 3rem); line-height: 1.12; }
    main .text-4xl { font-size: clamp(1.6rem, 7vw, 2.25rem); line-height: 1.15; }
    main .text-3xl { font-size: clamp(1.4rem, 6vw, 1.875rem); }
    main h1, main h2, main h3 { overflow-wrap: anywhere; }

    /* Heading + button rows ("PROJECTS  View All Projects →") stack */
    .m-stack-row { flex-direction: column; align-items: flex-start; gap: 1rem; }

    /* Footer: logo above contact details, links wrap cleanly */
    .m-foot-top { flex-direction: column; gap: 1.25rem; }
    .m-foot-contact { text-align: left; }
    .m-foot-links { flex-wrap: wrap; gap: .6rem 1.4rem; }
    .m-foot-links > * { margin: 0 !important; white-space: nowrap; }
    footer .justify-between.items-center { justify-content: flex-start; }

    /* Long words / emails never force sideways scrolling */
    main, footer { overflow-wrap: anywhere; }
}

/* ---------- Education timeline (About): one column on phones/tablets ---------- */
@media (max-width: 767px) {
    .m-timeline > .absolute { left: 9px !important; }
    .m-timeline .space-y-16 > .relative { display: block; padding-left: 34px; }
    .m-timeline .space-y-16 > .relative > .w-1\/2 { width: 100%; padding: 0; text-align: left; }
    .m-timeline .space-y-16 > .relative > .w-1\/2:empty { display: none; }
    .m-timeline .space-y-16 > .relative > .absolute { left: 9px !important; top: 28px; }
    .m-timeline .space-y-16 > :not([hidden]) ~ :not([hidden]) { margin-top: 2rem !important; }
}
