/* =============================================
   DCASEL — Mobile Optimization Layer
   Updated for Liquid Glass floating nav
   Breakpoints: 320px | 480px | 768px
   ============================================= */

/* ─── BASE MOBILE RESETS ─── */
@media (max-width: 767px) {

  :root {
    --px: 20px;
    --sy: 60px;
    --nav-h: 72px;
  }

  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  body {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
  }

  #cursor, #cursor-follower {
    display: none !important;
  }

  /* Better touch targets — but NOT for nav (would break glass pill layout) */
  button:not(.ham):not(.w-arr):not(.r-arr):not(.srv-arr) {
    min-height: 44px;
  }

  /* Prevent overflow — but NOT nav (glass pill must overflow freely for dropdown) */
  section, footer {
    overflow-x: hidden;
  }

  /* ─── FLOATING GLASS NAV — MOBILE ─── */

  /* Shell: tighter margins, stays centered */
  .nav-shell {
    top: 10px !important;
    width: calc(100% - 24px);
    left: 50%;
    transform: translateX(-50%);
    overflow: visible;
  }

  .nav-shell.scrolled {
    top: 6px !important;
  }

  /* Pill: shorter height on mobile */
  nav {
    height: 50px;
    padding: 0 6px 0 16px;
    border-radius: 100px;
    overflow: visible; /* keep dropdown accessible */
  }

  /* Glass layers must clip to pill shape individually */
  .glass-filter,
  .glass-overlay,
  .glass-specular {
    border-radius: 100px;
  }

  /* Logo — smaller on mobile */
  .logo-svg {
    height: 22px;
  }

  /* Ham button — glass pill, proper tap target */
  .ham {
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    gap: 5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100px;
    /* Remove any inherited min-height from button rule */
    min-height: unset !important;
  }

  .ham span {
    width: 17px;
    height: 1.5px;
  }

  /* Nav CTA — hidden on mobile (burger takes over) */
  .nav-cta {
    display: none !important;
  }

  /* Nav links — hidden on mobile */
  .nav-links {
    display: none !important;
  }

  /* ─── HERO SECTION ─── */
  #hero {
    min-height: 0svh;
    padding: 0 var(--px);
    padding-top: var(--nav-h);
  }

  .hero-body {
    grid-template-columns: 1fr;
    padding-top: 20px;
    padding-bottom: 40px;
    align-items: flex-end;
    gap: 0;
  }

  .hero-left {
    width: 100%;
  }

  .hero-eyebrow {
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }

  .hero-badge {
    font-size: 0.6rem;
    padding: 0.4rem 0.85rem;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }

  .hero-est { font-size: 0.6rem; }

  .hero-hl {
    font-size: clamp(44px, 12vw, 72px);
    line-height: 0.88;
    letter-spacing: -0.02em;
  }

  .hero-body [style*="padding-left:6vw"],
  .hero-body [style*="padding-left:clamp"] {
    padding-left: 0 !important;
  }

  .hero-hr { margin: 22px 0 0; }

  .hero-foot {
    padding: 20px 0;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .hero-desc {
    font-size: 0.9rem;
    line-height: 1.72;
    font-weight: 500;
    color: var(--muted);
    max-width: 100%;
  }

  .hero-right {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    width: 100%;
  }

  .hero-stats { gap: 24px; }
  .hs-n { font-size: 1.4rem; }
  .hs-l { font-size: 0.55rem; letter-spacing: 0.06em; }

  .hero-geo, #geoCanvas { display: none !important; }

  /* ─── MARQUEE STRIP ─── */
  .mq-strip { padding: 14px 0; }
  .mq-item {
    font-size: clamp(1.15rem, 4vw, 1.6rem);
    padding: 0 18px;
  }

  /* ─── SERVICES ─── */
  #services { padding: var(--sy) var(--px); }

  .srv-head {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
  }

  .srv-title {
    font-size: clamp(30px, 8vw, 48px);
    line-height: 0.92;
  }

  .srv-intro {
    font-size: 0.9rem;
    line-height: 1.75;
  }

  .srv-row-head {
    grid-template-columns: 32px 1fr 40px;
    gap: 12px;
    padding: 20px 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .srv-num { font-size: 0.58rem; padding-top: 4px; }
  .srv-name { font-size: clamp(18px, 5vw, 28px); }

  .srv-tags {
    display: flex !important;
    opacity: 1 !important;
    transform: none !important;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
  }

  .srv-tag { font-size: 0.5rem; padding: 0.18rem 0.55rem; }
  .srv-arr { width: 38px; height: 38px; flex-shrink: 0; min-height: unset !important; }

  .srv-panel-inner { padding: 0 0 32px; }

  .srv-panel-inner .panel-top {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 28px;
  }

  .panel-about h4 {
    font-size: clamp(20px, 5vw, 28px);
    line-height: 1.05;
    margin-bottom: 12px;
  }

  .panel-about p { font-size: 0.88rem; line-height: 1.82; }
  .panel-deliverables { padding: 20px 18px; }
  .panel-deliverables li { font-size: 0.85rem; padding: 8px 0; }
  .panel-cases-grid { grid-template-columns: 1fr; gap: 12px; }

  .panel-start {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-top: 28px;
    padding-top: 28px;
  }

  .srv-strip { padding: 24px var(--px); }
  .srv-chip {
    font-size: 0.6rem;
    padding: 0.38rem 0.9rem;
    min-height: 36px;
    display: flex;
    align-items: center;
  }

  /* ─── WORK CAROUSEL ─── */
  #work { padding-bottom: var(--sy); }

  .work-hd {
    padding: var(--sy) var(--px) 36px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .work-title {
    font-size: clamp(34px, 9vw, 60px);
    line-height: 0.92;
  }

  .work-carousel { padding: 32px var(--px) 0; }

  .cs-card {
    width: calc(100vw - var(--px) * 2);
    aspect-ratio: 4/5;
    max-height: 78vh;
  }

  .cs-desc { max-height: 90px !important; opacity: 1 !important; }
  .cs-info { padding: 20px 16px 16px; }
  .cs-name { font-size: clamp(22px, 6vw, 32px); }
  .cs-cat { font-size: 0.56rem; margin-bottom: 6px; }
  .cs-link {
    font-size: 0.6rem;
    color: rgba(244, 241, 236, 0.75) !important;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .work-ctrl {
    padding: 0 var(--px);
    margin-top: 20px;
    flex-wrap: nowrap;
    gap: 12px;
  }

  .w-arr { width: 46px; height: 46px; min-width: 46px; min-height: unset !important; }
  .w-arr svg { width: 14px; height: 14px; }

  .work-more { padding-top: 40px; }
  .work-more a {
    font-size: clamp(0.95rem, 3vw, 1.3rem);
    padding: 0.95rem 2rem;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }

  /* ─── CLIENTS ─── */
  #clients { padding: var(--sy) 0; }

  .clients-head {
    padding: 0 var(--px);
    margin-bottom: 32px;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .clients-title { font-size: clamp(26px, 7vw, 44px); line-height: 0.92; }
  .clients-sub { font-size: 0.88rem; line-height: 1.65; max-width: 100%; }
  .logo-item { width: 140px; height: 64px; padding: 0 18px; }
  .logo-text { font-size: 0.95rem; }

  /* ─── NUMBERS ─── */
  .numbers-grid { grid-template-columns: 1fr 1fr; }
  .num-item { padding: clamp(24px, 4vw, 40px) clamp(16px, 3vw, 28px); }
  .num-val { font-size: clamp(44px, 10vw, 72px); line-height: 0.9; }
  .num-label { font-size: 0.68rem; margin-top: 10px; }

  /* ─── PROCESS ─── */
  #process { padding: var(--sy) var(--px); }

  .proc-hd {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
  }

  .proc-title { font-size: clamp(32px, 8.5vw, 60px); line-height: 0.92; }
  .proc-note { font-size: 0.88rem; line-height: 1.75; max-width: 100%; }

  .proc-step {
    grid-template-columns: 48px 1fr;
    gap: 0;
    padding: 26px 0;
  }

  .proc-step:hover { padding-left: 0 !important; }
  .proc-left { padding-right: 8px; }
  .proc-n { font-size: clamp(1.6rem, 4vw, 2.5rem); }
  .proc-body { padding-left: 12px; }
  .proc-step-title { font-size: clamp(18px, 4.5vw, 26px); margin-bottom: 10px; }
  .proc-step-desc { font-size: 0.88rem; line-height: 1.8; max-width: 100%; }
  .proc-chips { display: flex !important; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
  .proc-chip { font-size: 0.5rem; padding: 0.2rem 0.6rem; }

  /* ─── WHY ─── */
  #why { padding: var(--sy) var(--px); }
  .why-inner { grid-template-columns: 1fr; gap: 40px; }
  .why-title { font-size: clamp(30px, 8vw, 52px); line-height: 0.92; margin-bottom: 14px; }
  .why-sub { font-size: 0.9rem; line-height: 1.75; max-width: 100%; }
  .why-stats { grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
  .why-stat-n { font-size: clamp(1.8rem, 5vw, 2.5rem); }
  .why-stat-l { font-size: 0.56rem; letter-spacing: 0.12em; }
  .why-row { padding: 20px 0; }
  .why-row:hover { padding-left: 0 !important; }
  .why-rt { font-size: clamp(18px, 4.5vw, 26px); }
  .why-rn { font-size: 0.56rem; }
  .why-rb { font-size: 0.88rem; line-height: 1.78; max-width: 100%; margin-top: 8px; }
  .why-stick { position: static !important; top: auto !important; }

  /* ─── REVIEWS ─── */
  #reviews { padding: var(--sy) var(--px) 48px; }

  .rev-hd {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
    align-items: flex-start;
  }

  .rev-title { font-size: clamp(30px, 8vw, 52px); line-height: 0.92; }
  .rev-stars-block { text-align: left; }

  .rev-card {
    width: calc(100vw - var(--px) * 2) !important;
    padding: 24px 20px;
  }

  .rev-text { font-size: clamp(0.92rem, 2.5vw, 1.05rem); line-height: 1.68; }
  .rev-star { font-size: 0.82rem; margin-bottom: 14px; }
  .rev-name { font-size: 0.82rem; }
  .rev-role { font-size: 0.64rem; }

  .rev-ctrl {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
  }

  .r-arr { width: 46px; height: 46px; min-width: 46px; min-height: unset !important; }

  .rev-write-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-top: 32px;
    padding-top: 28px;
  }

  .rev-write-txt { font-size: 0.9rem; line-height: 1.7; max-width: 100%; }

  .rfm-form-grid { grid-template-columns: 1fr; gap: 16px; }
  .rfm-input, .rfm-textarea, .rfm-select {
    font-size: 1rem;
    padding: 0.92rem 1rem;
  }
  .rfm-textarea { min-height: 130px; }
  .rfm-submit-row { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* ─── ABOUT ─── */
  #about { padding: var(--sy) var(--px); }
  .about-g { grid-template-columns: 1fr; gap: 40px; }
  .about-title { font-size: clamp(30px, 8vw, 52px); line-height: 0.92; margin-bottom: 20px; }
  .about-body p { font-size: 0.9rem; line-height: 1.82; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .about-sb { padding: 20px 16px; }
  .about-sn { font-size: clamp(1.8rem, 5vw, 2.8rem); margin-bottom: 4px; }
  .about-sl { font-size: 0.56rem; letter-spacing: 0.1em; }
  .about-q { margin: 24px 0; padding: 20px 18px; }
  .about-q p { font-size: 1rem; line-height: 1.55; }
  .about-founder { padding: 16px; gap: 12px; }
  .about-fn { font-size: 0.82rem; }
  .about-fr { font-size: 0.64rem; }

  /* ─── CTA ─── */
  #cta { padding: 72px var(--px) var(--sy); }
  .cta-title { font-size: clamp(32px, 8.5vw, 64px); line-height: 0.92; margin-bottom: 16px; }
  .cta-sub { font-size: 0.9rem; line-height: 1.78; max-width: 100%; margin: 0 0 28px; }

  .cta-btns {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .cta-btns .btn-p,
  .cta-btns .btn-o,
  .cta-btns .btn-ember {
    width: 100%;
    justify-content: center;
    padding: 0.95rem 1.5rem;
    min-height: 52px;
    font-size: 0.72rem;
  }

  /* ─── BUTTONS ─── */
  .btn-p, .btn-o, .btn-ember {
    min-height: 48px;
    font-size: 0.7rem;
    padding: 0.82rem 1.35rem;
  }

  /* ─── FOOTER ─── */
  footer { padding: 56px var(--px) 32px; }

  .ft-g {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
  }

  .ft-logo { font-size: 1.35rem; }
  .ft-desc { font-size: 0.8rem; line-height: 1.72; max-width: 100%; }
  .ft-col h4 { font-size: 0.56rem; letter-spacing: 0.16em; margin-bottom: 14px; }
  .ft-col a { font-size: 0.8rem; padding: 4px 0; min-height: 36px; display: flex; align-items: center; }
  .ft-col ul { gap: 0; }
  .ft-soc { width: 38px; height: 38px; }
  .ft-copy, .ft-made { font-size: 0.7rem; }
  .ft-bot { flex-direction: column; gap: 6px; text-align: center; margin-top: 36px; padding-top: 20px; }

  /* ─── CS OVERLAY ─── */
  .cso-bar { height: 56px; padding: 0 16px; }
  .cso-back { font-size: 0.62rem; gap: 8px; min-height: unset; }
  .cso-logo { font-size: 1.15rem; }
  .cso-start { font-size: 0.6rem; padding: 0.35rem 0.8rem; min-height: 36px; display: flex; align-items: center; }
  .cso-hero-img { height: clamp(260px, 55vw, 360px); }
  .cso-h1 { font-size: clamp(32px, 8vw, 56px); line-height: 0.9; margin-bottom: 14px; }
  .cso-body { padding: 40px var(--px); }
  .cso-intro { grid-template-columns: 1fr; gap: 32px; margin-bottom: 40px; }
  .cso-lead { font-size: clamp(18px, 4.5vw, 26px); line-height: 1.35; }
  .cso-metrics { grid-template-columns: 1fr 1fr; margin-bottom: 40px; }
  .cso-metric { padding: 24px 18px; }
  .cso-metric-n { font-size: clamp(1.8rem, 5vw, 2.6rem); }
  .cso-2col { grid-template-columns: 1fr; gap: 12px; }
  .cso-quote { padding: 24px 18px; }
  .cso-quote p { font-size: clamp(1rem, 3.5vw, 1.25rem); line-height: 1.55; }
  .cso-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cso-gal-item.wide { grid-column: span 1; }
  .cso-end { padding: 40px 0; }
  .cso-end h3 { font-size: clamp(26px, 6.5vw, 44px); }
  .cso-end-btns { flex-direction: column; align-items: center; gap: 10px; }

  /* ─── LIGHTBOX ─── */
  .gal-lb-prev { left: 12px; }
  .gal-lb-next { right: 12px; }
  .gal-lb-prev, .gal-lb-next { width: 42px; height: 42px; }
  #galImg { max-width: 94vw; max-height: 80vh; }

  /* ─── SECTION TAGS ─── */
  .sec-tag { font-size: 0.6rem; letter-spacing: 0.16em; }

  /* ─── PAGE HERO (inner pages) ─── */
  .pg-hero {
    min-height: 80svh;
    padding: calc(var(--nav-h) + 24px) var(--px) var(--sy);
    justify-content: flex-end;
  }

  .pg-h1 { font-size: clamp(48px, 12vw, 88px); line-height: 0.88; letter-spacing: -0.02em; }
  .pg-hero-desc { font-size: 0.9rem; line-height: 1.75; max-width: 100%; }
  .pg-hero-num { font-size: clamp(80px, 22vw, 150px); right: var(--px); bottom: calc(var(--sy) + 20px); }
  .pg-hero-foot { flex-direction: column; gap: 16px; padding-top: 20px; }
  .pg-hero-tags { gap: 5px; }
  .pg-htag { font-size: 0.54rem; padding: 0.28rem 0.75rem; min-height: 30px; display: flex; align-items: center; }

  /* ─── INTRO SPLIT ─── */
  .intro-split { padding: var(--sy) var(--px); gap: 32px; }
  .intro-lead { font-size: clamp(20px, 5.5vw, 30px); line-height: 1.3; }
  .intro-body { font-size: 0.9rem; line-height: 1.85; }

  /* ─── APPROACH STEPS ─── */
  .approach { padding: var(--sy) var(--px); }
  .approach-title { font-size: clamp(30px, 8vw, 52px); line-height: 0.92; }
  .step { grid-template-columns: 50px 1fr; padding: 26px 0; }
  .step:hover { padding-left: 0 !important; }
  .step-body { padding-left: 12px; }
  .step-n { font-size: clamp(1.6rem, 4vw, 2.4rem); }
  .step-title { font-size: clamp(18px, 4.5vw, 26px); margin-bottom: 8px; }
  .step-desc { font-size: 0.88rem; line-height: 1.8; max-width: 100%; }
  .step-tags { display: flex !important; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
  .step-tag { font-size: 0.5rem; padding: 0.2rem 0.6rem; }

  /* ─── DELIVERABLES ─── */
  .deliverables { padding: var(--sy) var(--px); }
  .del-grid { gap: 36px; }
  .del-title { font-size: clamp(26px, 7vw, 44px); line-height: 0.92; }
  .del-sub { font-size: 0.9rem; line-height: 1.8; }
  .del-item { padding: 16px 0; gap: 12px; }
  .del-item:hover { padding-left: 0 !important; }
  .del-name { font-size: clamp(16px, 4vw, 22px); }
  .del-icon { width: 36px; height: 36px; flex-shrink: 0; }

  /* ─── CASES GRID ─── */
  .cases { padding: var(--sy) var(--px); }
  .cases-hd { flex-direction: column; gap: 12px; align-items: flex-start; margin-bottom: 32px; }
  .cases-title { font-size: clamp(32px, 8.5vw, 56px); line-height: 0.92; }
  .cases-grid { grid-template-columns: 1fr; gap: 16px; }
  .cs-card.wide { grid-column: span 1; }

  /* ─── CTA BAND ─── */
  .cta-band { padding: 64px var(--px); }
  .cta-band-title { font-size: clamp(30px, 7.5vw, 56px); line-height: 0.92; margin-bottom: 14px; }
  .cta-band-sub { font-size: 0.9rem; max-width: 100%; margin-bottom: 28px; }
  .cta-band-bg { font-size: clamp(60px, 18vw, 120px); }

  /* ─── WHY PANEL (inside service pages) ─── */
  .why-panel { padding: var(--sy) var(--px); }
  .why-grid { grid-template-columns: 1fr; gap: 40px; }
  .why-sticky { position: static !important; }
  .why-nums { grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
  .why-num-n { font-size: clamp(1.8rem, 5vw, 2.5rem); }
  .why-num-l { font-size: 0.56rem; letter-spacing: 0.1em; }

  /* ─── NOISE / GRAIN ─── */
  .noise { opacity: 0.012; }
  .hero-grain { opacity: 0.016; }
}

/* ─── SMALL PHONES (320–480px) ─── */
@media (max-width: 480px) {
  :root {
    --px: 16px;
    --sy: 52px;
    --nav-h: 68px;
  }

  .nav-shell {
    width: calc(100% - 16px);
    top: 8px !important;
  }

  nav { height: 46px; padding: 0 5px 0 14px; }

  .logo-svg { height: 20px; }
  .ham { width: 36px; height: 36px; }
  .ham span { width: 16px; }

  .hero-hl { font-size: clamp(38px, 11vw, 58px); }

  .ft-g { grid-template-columns: 1fr; gap: 28px; }
  .num-val { font-size: clamp(38px, 9.5vw, 58px); }
  .why-stats { grid-template-columns: 1fr 1fr; }
  .cso-metrics { grid-template-columns: 1fr; }
  .cs-card { aspect-ratio: 3/4; }


  .pg-h1 { font-size: clamp(40px, 11vw, 68px); }
  .work-title { font-size: clamp(28px, 8.5vw, 48px); }
  .srv-name { font-size: clamp(16px, 4.5vw, 24px); }
  .proc-step { grid-template-columns: 44px 1fr; }
  .why-rt { font-size: clamp(17px, 4.2vw, 24px); }
  .rev-card { padding: 20px 16px; }
  .rev-text { font-size: 0.9rem; }
  .cta-title { font-size: clamp(28px, 8vw, 52px); }
  .mq-item { font-size: clamp(1rem, 3.5vw, 1.3rem); padding: 0 14px; }
}

/* ─── TABLET (481–767px) ─── */
@media (min-width: 481px) and (max-width: 767px) {
  :root {
    --px: 24px;
    --sy: 68px;
  }

  .hero-hl { font-size: clamp(52px, 10vw, 72px); }

  .cs-card {
    width: calc((100vw - var(--px) * 2 - 14px) / 2);
    aspect-ratio: 3/4;
    max-height: none;
  }

  .cases-grid { grid-template-columns: 1fr 1fr; }
  .rev-card { width: calc((100vw - var(--px) * 2 - 14px) / 2) !important; }
  .panel-cases-grid { grid-template-columns: 1fr 1fr; }
  .cso-metrics { grid-template-columns: repeat(3, 1fr); }
  .rfm-form-grid { grid-template-columns: 1fr 1fr; }
  .rfm-field.full { grid-column: 1 / -1; }
  .about-stats { grid-template-columns: 1fr 1fr; }
}

/* ─── TOUCH DEVICE ─── */
@media (hover: none) and (pointer: coarse) {
  .srv-row-head::before { display: none; }

  .srv-tags { opacity: 1 !important; transform: none !important; }
  .cs-desc { max-height: 90px !important; opacity: 1 !important; }

  .ft-col a,

  .del-item:hover,
  .why-row:hover,
  .step:hover,
  .proc-step:hover { padding-left: 0; }

  .btn-p:active, .btn-o:active, .btn-ember:active, .mob-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
  }

  .w-arr:active, .r-arr:active {
    background: var(--ember);
    border-color: var(--ember);
  }

  .w-arr:active svg, .r-arr:active svg { stroke: var(--bone); }
}
