/* ================================
   ACCESSIBILITY & MOBILE FIXES
   Loaded last on every page. Desktop layouts are untouched: layout rules
   only apply below 1024px / 768px / 600px, and the global rules (skip link,
   focus ring, screen-reader text, reduced motion) don't change how the
   pages look for mouse users.
   "#top" is the <body> id on every page; it raises specificity above the
   page-specific stylesheets (.wayo-page …, .ucsos-page …) without !important.
================================ */

/* ---------- Global ---------- */

/* Text that's read by screen readers but not shown */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    background: none !important;
}

/* Skip link: hidden until a keyboard user tabs to it */
.skip-link {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: 10px 18px;
    border-radius: 999px;
    background: #000;
    color: #EBF6FF;
    font-family: "JetBrains Mono", monospace;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

/* One clear, consistent focus ring for keyboard users (mouse clicks don't show it) */
#top a:focus-visible,
#top button:focus-visible,
#top [tabindex]:focus-visible,
#top summary:focus-visible,
#top video:focus-visible {
    outline: 2px solid #CA380C;
    outline-offset: 3px;
}

#top main:focus {
    outline: none;
}

/* Bigger tap area for small text links, with no visual change */
#top .nav-links a {
    display: inline-block;
    padding-top: 8px;
    padding-bottom: 8px;
    margin-top: -8px;
    margin-bottom: -8px;
}

/* "Back to home page" keeps its own flex layout; only the tap area grows */
#top .back-home a {
    padding-top: 8px;
    padding-bottom: 8px;
    margin-top: -8px;
    margin-bottom: -8px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ---------- Tablet and below ---------- */
@media (max-width: 1024px) {
    /* Contact block: stack heading and links (project pages were keeping
       two columns, which pushed the links off-screen on phones) */
    #top .contact-content {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    #top .contact-right {
        justify-self: start;
    }
}

/* ---------- Phones ---------- */
@media (max-width: 768px) {
    /* Two-column "label | text" sections collapse to one column */
    #top .responsibilities-container,
    #top .challenges-container,
    #top .goals-container,
    #top .about-project-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Remove the 60px side indents that squeeze body text on phones */
    #top .about-project-right p,
    #top .responsibilities-right p,
    #top .challenges-right p,
    #top .goals-right p,
    #top .UX-right p,
    #top .UX-right ul,
    #top .UX-research-right p,
    #top .UF-right p,
    #top .final-design-text p {
        padding-left: 0;
        padding-right: 0;
    }

    /* Contact heading and links sized to fit a phone screen */
    #top .contact-left h3 {
        font-size: clamp(36px, 10.5vw, 56px);
        line-height: 1.05;
    }
    #top .contact-links a {
        font-size: 28px;
    }

    /* Status pill text stays readable */
    #top .status-pill {
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    /* Header: name on its own line, nav and CV button on the next,
       instead of squeezing all three into one row */
    #top .header-inner,
    #top .container-header {
        flex-wrap: wrap;
        row-gap: 14px;
        column-gap: 16px;
    }
    #top .logo {
        flex: 1 1 100%;
    }
    #top .logo a {
        font-size: 20px;
        white-space: nowrap;
    }
    #top .nav {
        flex: 1 1 100%;
        justify-content: space-between;
        gap: 20px;
    }
    #top .nav-links {
        gap: 24px;
    }
    #top .nav-links a {
        font-size: 16px;
    }
    #top .cv-button {
        font-size: 16px;
        padding: 10px 20px;
        white-space: nowrap;
    }

    /* Homepage name: scale with the screen so "SAHAIDACHNA" fits */
    #top .hero-line {
        font-size: clamp(34px, 11.5vw, 54px);
    }
}
