/*
 * mobile.css — Rahim Dad Azimi Portfolio
 * Completely separate from style.css / @layer system.
 * No @layer used here → these rules beat all layered styles.
 * !important used deliberately to defeat JS inline styles & layer cascade.
 * Load this AFTER style.css.
 */

/* ═══════════════════════════════════════════
   SHARED BASE — applies to all mobile widths
   ≤ 900px
═══════════════════════════════════════════ */
@media screen and (max-width: 900px) {

  /* ── Global overflow fix ── */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* ── Disable custom cursor (touch devices don't need it) ── */
  body         { cursor: auto !important; }
  #cur,
  #cur-ring    { display: none !important; }
  a, button    { cursor: pointer !important; }

  /* ── SPLASH: make content immediately visible.
        The CSS animation has opacity:0 as start state; on many
        mobile browsers the fill-mode never resolves correctly.
        On mobile we skip the animation entirely and show instantly. ── */
  #splash {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9000 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1.2rem !important;
    background: #07070a !important;
  }
  .sp-logo {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    font-family: 'Cormorant Garamond', serif !important;
    font-size: clamp(1.6rem, 6vw, 2.4rem) !important;
    font-weight: 300 !important;
    color: #F2EDE3 !important;
    letter-spacing: .12em !important;
  }
  .sp-logo em { color: #C8A96B !important; font-style: italic !important; }
  .sp-bar {
    width: 100px !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, #C8A96B, transparent) !important;
    animation: none !important;
  }
  .sp-sub {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    font-size: .58rem !important;
    letter-spacing: .28em !important;
    text-transform: uppercase !important;
    color: #6A6660 !important;
  }

  /* ── SIDEBAR: off-canvas drawer, hidden until .open ── */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: min(280px, 80vw) !important;
    height: 100vh !important;
    transform: translateX(-110%) !important;
    transition: transform .3s ease !important;
    z-index: 800 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    background: rgba(13,13,17,.97) !important;
    backdrop-filter: blur(20px) !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 12px 0 60px rgba(0,0,0,.75) !important;
  }

  /* ── HAMBURGER: always on screen ── */
  .mob-btn {
    display: flex !important;
    position: fixed !important;
    top: .7rem !important;
    left: .7rem !important;
    z-index: 900 !important;
    cursor: pointer !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    background: rgba(13,13,17,.92) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* ── MAIN: full width, top padding for hamburger ── */
  .wrap {
    display: block !important;
    width: 100% !important;
  }
  .main {
    margin-left: 0 !important;
    padding: 4.5rem 1.1rem 3rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    flex: none !important;
  }

  /* ── SECTIONS: clip absolute children, reasonable padding ── */
  section {
    padding: 2.5rem 0 !important;
    overflow: hidden !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
  }
  section:last-child { border-bottom: none !important; }

  /* ── SECTION BG NUMBERS: hidden — they extend past viewport ── */
  .sec-num { display: none !important; }

  /* ── TYPOGRAPHY ── */
  .hero-hl {
    font-size: clamp(1.55rem, 7.5vw, 2.3rem) !important;
    line-height: 1.1 !important;
    margin-bottom: 1.75rem !important;
    word-break: break-word !important;
  }
  .sec-h {
    font-size: clamp(1.45rem, 6.5vw, 2rem) !important;
    word-break: break-word !important;
  }
  .sec-rule { margin: .6rem 0 1.5rem !important; }

  /* ── BENTO: bio full width, certs in 2 cols ── */
  .bento {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1px !important;
    margin-bottom: 2rem !important;
  }
  .bn-bio  { grid-column: 1 / 3 !important; grid-row: 1 / 2 !important; padding: 1.2rem !important; }
  .bn-cert { grid-column: 1 / 2 !important; grid-row: 2 / 3 !important; }
  .bn-goog { grid-column: 2 / 3 !important; grid-row: 2 / 3 !important; }
  .bn-meta { grid-column: 1 / 2 !important; grid-row: 3 / 4 !important; }
  .bn-bcs  { grid-column: 2 / 3 !important; grid-row: 3 / 4 !important; }
  .bn-bio p { font-size: .82rem !important; line-height: 1.75 !important; }
  .bn-mt    { font-size: .7rem !important; white-space: normal !important; }
  .bn-ms    { font-size: .6rem !important; }
  .bn { padding: 1rem .9rem !important; }
  .bn-bio.bn { padding: 1.2rem !important; }

  /* ── SERVICES ── */
  .svc-row { padding: 1rem 1.1rem !important; gap: .85rem !important; flex-wrap: nowrap !important; }
  .svc-info h3 { font-size: .95rem !important; }
  .svc-info p  { font-size: .72rem !important; line-height: 1.6 !important; }

  /* ── PORTFOLIO: single column ── */
  .pf-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
  .pc-thumb { aspect-ratio: 16 / 9 !important; }

  /* ── PORTFOLIO MOCKUP: no 3D perspective (causes paint overflow) ── */
  .pcm-wrap {
    transform: none !important;
    width: 80% !important;
    max-width: 200px !important;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,.5)) !important;
  }
  /* neutralise JS inline tilt transforms */
  .pc { transform: none !important; }
  .pc:hover { transform: translateY(-4px) !important; transition: transform .3s ease !important; }

  /* ── TESTIMONIALS ── */
  .tc {
    width: calc(88% - .5rem) !important;
    flex-shrink: 0 !important;
    padding: 1.2rem !important;
  }
  .tc-text { font-size: .76rem !important; }
  .tc-scroll { -webkit-overflow-scrolling: touch !important; }

  /* ── PRICING: single column ── */
  .pr-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1px !important;
  }
  .process-steps {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1px !important;
  }
  .pr { padding: 1.5rem 1.25rem !important; }
  .pr-price { font-size: 2.4rem !important; }
  .pr.featured {
    border-left: none !important;
    border-right: none !important;
  }
  .ps { padding: 1.2rem !important; }

  /* ── CONTACT: single column ── */
  .cc-grid  { grid-template-columns: 1fr !important; }
  .form-row { grid-template-columns: 1fr !important; }
  .cc { padding: .85rem 1rem !important; }
  .cc-val { font-size: .72rem !important; word-break: break-all !important; }

  /* ── FORM ── */
  .fg input,
  .fg textarea { font-size: .82rem !important; }
  .fg textarea  { height: 120px !important; }
  .btn-send { width: 100% !important; justify-content: center !important; }
}


/* ═══════════════════════════════════════════
   SMALL PHONES  ≤ 480px
═══════════════════════════════════════════ */
@media screen and (max-width: 480px) {

  .main { padding: 4rem .85rem 3rem !important; }

  /* headline scaling */
  .hero-hl { font-size: clamp(1.35rem, 8.5vw, 1.75rem) !important; }
  .sec-h   { font-size: clamp(1.25rem, 8vw, 1.6rem) !important; }

  /* bento: fully single column */
  .bento { grid-template-columns: 1fr !important; }
  .bn-bio,
  .bn-cert,
  .bn-goog,
  .bn-meta,
  .bn-bcs {
    grid-column: 1 / 2 !important;
    grid-row: auto !important;
  }
  .bn-bio p { font-size: .79rem !important; }

  /* services: hide decorative elements to save space */
  .svc-n     { display: none !important; }
  .svc-arrow { display: none !important; }
  .svc-info h3 { font-size: .9rem !important; }
  .svc-info p  { font-size: .7rem !important; }

  /* testimonials */
  .tc { width: calc(93% - .5rem) !important; padding: 1rem !important; }
  .tc-q    { font-size: 1.9rem !important; }
  .tc-text { font-size: .73rem !important; }
  .tc-name { font-size: .7rem !important; }
  .tc-role { font-size: .59rem !important; }

  /* pricing */
  .pr      { padding: 1.2rem 1rem !important; }
  .pr-price { font-size: 2.1rem !important; }
  .pr-f    { font-size: .7rem !important; }
  .pr-btn  { font-size: .64rem !important; }

  /* contact */
  .cc-ico      { width: 28px !important; height: 28px !important; }
  .cc-ico svg  { width: 12px !important; height: 12px !important; }
  .cc-lbl      { font-size: .52rem !important; }
  .cc-val      { font-size: .69rem !important; }

  /* mockup smaller */
  .pcm-wrap { max-width: 170px !important; width: 76% !important; }

  /* marquee */
  .m-pill { font-size: .63rem !important; padding: .27rem .7rem !important; }
}


/* ═══════════════════════════════════════════
   VERY SMALL  ≤ 360px
═══════════════════════════════════════════ */
@media screen and (max-width: 360px) {
  .main    { padding: 3.75rem .65rem 2.5rem !important; }
  .hero-hl { font-size: 1.28rem !important; }
  .sec-h   { font-size: 1.22rem !important; }
  .bn-bio p { font-size: .76rem !important; }
  .svc-info h3 { font-size: .85rem !important; }
  .pr-price { font-size: 1.9rem !important; }
  .tc-text  { font-size: .7rem !important; }
  .cc-val   { font-size: .65rem !important; }
}
