/* 06 — Mobile polish: 360–768px tap targets, typography, spacing, drawer
   ================================================================
   NOTES (companion to NOTES.md — inlined because md write was blocked)
   ================================================================

   WIRING
   ------
   index.html lines 58-60 load style.css, ai-styles.css, apple-premium.css.
   Add AFTER those three so cascade order wins (no !important used):

       <link rel="stylesheet" href="enhancements/06-mobile.css">

   EXISTING @media RULES THIS OVERRIDES (style.css line numbers)
   -------------------------------------------------------------
   L1485  (max-width: 768px)  xray-hint hide
   L1604  (max-width: 768px)  card-metrics compact
   L2932  (max-width: 768px)  WhatsApp widget
   L2966  (max-width: 980px)  featured grid + skills 2-col
   L2983  (max-width: 768px)  hero, nav, hero-actions, projects-grid, timeline
   L3055  (max-width: 640px)  section pad, skills 1-col, skill-tag sizing
   L3732  (max-width: 768px)  testimonials, cta-primary-btn
   L3981  (max-width: 768px)  preloader sizing
   L4582  (max-width: 640px)  terminal-toggle, terminal-window 90vh
   L4690  (max-width: 768px)  large rebuild block (hero 2.4rem, drawer, filters, cards)
   L4849  (max-width: 480px)  h1 2rem, ai-project-card 1rem, terminal 360px
   L6311  (max-width: 768px)  warp HUD compaction

   KEY DELIBERATE OVERRIDES
   ------------------------
   .hero h1 @768        old: 3rem / 2.4rem    new: clamp(3rem, 11vw, 3.6rem)
   .hero h1 @480        old: 2rem             new: clamp(2.5rem, 9vw, 3rem)
   .section pad @768    old: 2.5rem 1rem      new: 4rem 1rem
   .nav-links drawer    old: slide -120%      new: full 100vh-60px + blur backdrop
   .featured-project    old: 1.25rem mixed    new: 1.5rem, h3 1.4rem
   .ai-project-card     old: 1.25rem          new: 1.5rem (1.25rem @480)
   timeline dot         old: 14px             new: 12px @768, 10px @480
   .skill-tags span     old: 0.82rem          new: 0.85rem
   .terminal-window     old: 0.78rem          new: 14px (input 16px, no iOS zoom)

   HTML HOOKS REQUIRED
   -------------------
   1. index.html L220 — hamburger button needs ARIA state:
        <button class="mobile-menu-btn" aria-label="Open navigatiemenu"
                aria-expanded="false" aria-controls="primary-nav">
      Toggle aria-expanded in script.js alongside .is-open. CSS already hooks
      .mobile-menu-btn[aria-expanded="true"] for the active tint.

   2. index.html L207 — drawer needs id:
        <div class="nav-links" id="primary-nav">

   3. Body scroll-lock when drawer open (verify current script first):
        document.body.classList.toggle('nav-open', isOpen);
      Then add: body.nav-open { overflow: hidden; }

   NOT TOUCHED
   -----------
   - Parallax disable matches [data-parallax], .parallax, .has-parallax.
     Hero video keeps playing. If JS-driven parallax exists, gate with
     window.matchMedia('(min-width: 769px)') in script.js.
   - prefers-reduced-motion already handled at style.css:4884.
   - Warp HUD kept functional, only dot/label/spacing compaction.

   MANUAL TEST CHECKLIST
   ---------------------
   - iPhone SE 375x667: hero fits, no horizontal scroll, drawer full-height
   - iPhone 14 Pro 393x852: filter chips scroll-snap smooth
   - Galaxy S20 360x800: timeline dots align with content
   - iPad Mini portrait 768x1024: still hits mobile breakpoint
   - Any button >=44x44 hit area
   - Terminal input focus: no iOS zoom
   ================================================================
*/

/* ============================================================
   <= 768px
   ============================================================ */
@media (max-width: 768px) {

    /* ---------- Global rhythm ---------- */
    html { -webkit-text-size-adjust: 100%; }
    body { overflow-x: hidden; }

    .section {
        padding: 4rem 1rem;
    }

    .section-header {
        margin-bottom: 2.25rem;
    }

    /* ---------- Hero ---------- */
    .hero {
        padding: 5rem 1rem 3rem;
        min-height: auto;
    }

    .hero h1 {
        font-size: clamp(3rem, 11vw, 3.6rem);
        line-height: 1.05;
        letter-spacing: -0.02em;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.55;
        padding: 0 0.25rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 0.85rem;
        align-items: stretch;
        max-width: 100%;
    }

    .hero-stat-divider {
        display: none;
    }

    .hero-stat {
        text-align: center;
    }

    /* ---------- Navbar + drawer ---------- */
    .navbar { height: 60px; }
    .nav-container { padding: 0 1rem; }

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        height: calc(100vh - 60px);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.25rem;
        padding: 1.5rem 1.25rem 2rem;
        background: rgba(7, 17, 31, 0.82);
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-110%);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
    }

    body.light-theme .nav-links {
        background: rgba(255, 255, 255, 0.86);
    }

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

    .nav-links a {
        display: flex;
        align-items: center;
        min-height: 56px;
        padding: 0 1rem;
        font-size: 1.05rem;
        border-radius: 12px;
        border-bottom: 1px solid var(--border-color);
    }

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

    .nav-links .btn-primary {
        margin-top: 0.75rem;
        justify-content: center;
        border-bottom: 0;
    }

    .mobile-menu-btn[aria-expanded="true"] {
        background: rgba(var(--accent-rgb), 0.12);
    }

    /* ---------- Hero CTAs ---------- */
    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    /* ---------- Featured projects ---------- */
    .featured-projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .featured-project {
        padding: 1.5rem;
        border-radius: 18px;
    }

    .featured-content h3 {
        font-size: 1.4rem;
        line-height: 1.2;
    }

    .featured-content p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* ---------- Project filter chips (horizontal scroll-snap) ---------- */
    .project-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 1rem;
        padding: 0 1rem 0.75rem;
        margin: 0 -1rem 1.5rem;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .project-filters::-webkit-scrollbar { display: none; }

    .filter-btn {
        flex: 0 0 auto;
        scroll-snap-align: start;
        min-height: 44px;
        padding: 0.55rem 1.1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* ---------- AI project cards ---------- */
    .ai-projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
        perspective: none;
    }

    .ai-project-card {
        width: 100%;
        padding: 1.5rem;
        min-height: 0;
        border-radius: 20px;
        transform: none;
    }

    .ai-project-card:hover { transform: none; }

    .ai-project-card h3 {
        font-size: 1.2rem;
        min-height: 0;
    }

    .ai-project-card p {
        font-size: 0.92rem;
        line-height: 1.55;
    }

    .ai-project-card .project-tags span {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .show-more-btn {
        min-height: 48px;
        padding: 0.75rem 1.5rem;
    }

    /* ---------- Experience timeline ---------- */
    .timeline {
        padding-left: 1.5rem;
        border-left-width: 2px;
    }

    .timeline-item {
        margin-bottom: 2.25rem;
    }

    .timeline-item::before {
        left: -1.85rem;
        width: 12px;
        height: 12px;
        border-width: 2px;
        top: 0.55rem;
    }

    .timeline-date {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .timeline-content {
        padding: 1rem 0 0;
    }

    .role-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .role-header h3 {
        font-size: 1.15rem;
        line-height: 1.3;
    }

    /* ---------- Skills ---------- */
    .skills-container,
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .skill-category {
        padding: 1.25rem;
    }

    .skill-tags {
        gap: 0.4rem;
    }

    .skill-tags span {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        min-height: 36px;
    }

    /* ---------- Education ---------- */
    .education-grid,
    .education-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .education-card,
    .education-item {
        width: 100%;
        padding: 1.25rem;
    }

    /* ---------- Certifications ---------- */
    .certifications-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cert-item {
        padding: 1.75rem 1.25rem;
    }

    /* ---------- Contact + terminal ---------- */
    #contact.section {
        padding: 4rem 1rem;
    }

    .contact-card {
        width: 100%;
        padding: 1.25rem 1rem;
        border-radius: 18px;
    }

    .terminal-window {
        width: 100%;
        padding: 1rem;
        font-size: 14px;
        height: min(420px, 60vh);
    }

    .terminal-input {
        font-size: 16px;
    }

    .terminal-input-row {
        min-height: 44px;
    }

    .terminal-chip {
        min-height: 36px;
        padding: 0.4rem 0.7rem;
        font-size: 0.72rem;
    }

    /* ---------- Contact modal form ---------- */
    .ai-form input,
    .ai-form textarea {
        font-size: 16px;
        min-height: 48px;
        padding: 0.75rem 1rem;
    }

    .ai-form textarea { min-height: 120px; }

    .submit-btn {
        min-height: 52px;
        width: 100%;
        justify-content: center;
    }

    /* ---------- Footer ---------- */
    footer,
    .portfolio-footer {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        padding: 2rem 1rem;
        text-align: center;
    }

    /* ---------- Tap targets baseline ---------- */
    .btn-primary,
    .btn-secondary,
    .cta-primary-btn,
    .secondary-link,
    .filter-btn,
    .cv-download-btn,
    .theme-toggle-btn,
    .show-more-btn,
    .nav-links a,
    .submit-btn {
        min-height: 44px;
    }

    a, button { touch-action: manipulation; }

    /* ---------- Disable heavy effects on mobile ---------- */
    .ai-project-card,
    .featured-project {
        transform: none;
        backdrop-filter: blur(20px) saturate(160%);
        -webkit-backdrop-filter: blur(20px) saturate(160%);
    }

    [data-parallax],
    .parallax,
    .has-parallax {
        transform: none;
        background-attachment: scroll;
    }

    /* ---------- Warp HUD compaction ---------- */
    .warp-stop-dot { width: 8px; height: 8px; }
    .warp-stop.is-active .warp-stop-dot { width: 12px; height: 12px; }
    .warp-stop-label { font-size: 0.5rem; letter-spacing: 0.08em; }
    .warp-route { gap: 0.4rem; }
}

/* ============================================================
   <= 480px
   ============================================================ */
@media (max-width: 480px) {

    .section {
        padding: 3rem 1rem;
    }

    .hero {
        padding: 4.5rem 1rem 2.5rem;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 9vw, 3rem);
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .featured-project {
        padding: 1.25rem;
    }

    .featured-content h3 {
        font-size: 1.3rem;
    }

    .ai-project-card {
        padding: 1.25rem;
    }

    .ai-project-card h3 {
        font-size: 1.1rem;
    }

    .timeline {
        padding-left: 1.25rem;
    }

    .timeline-item::before {
        left: -1.6rem;
        width: 10px;
        height: 10px;
    }

    .skill-tags span {
        font-size: 0.8rem;
        padding: 0.45rem 0.65rem;
    }

    .terminal-window {
        height: min(360px, 55vh);
        padding: 0.85rem;
        font-size: 13.5px;
    }

    .terminal-chip {
        font-size: 0.68rem;
        padding: 0.35rem 0.55rem;
    }

    .filter-btn {
        padding: 0.5rem 0.95rem;
        font-size: 0.8rem;
    }

    .cert-item {
        padding: 1.5rem 1rem;
    }

    .warp-stage {
        width: 92vw;
        padding: 0.75rem 1rem;
    }

    .warp-big {
        font-size: clamp(24px, 7.5vw, 36px);
    }
}
