/* Lightit mobile UX layer — loads after bundle + footer */

@media (max-width: 768px) {
  :root {
    --container-pad: 18px;
    --header-h: 60px;
    --logo-h: 38px;
    --touch: 48px;
  }

  html,
  body.lightit-page {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overscroll-behavior-y: contain;
  }

  /* Header: logo left, lang + menu clustered right (no floating center gap) */
  .li-nav {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 6px;
    width: 100%;
    min-height: var(--header-h);
    padding-inline: max(10px, var(--safe-left, 0px)) max(6px, var(--safe-right, 0px));
  }

  .li-logo {
    grid-column: 1;
    grid-row: 1;
    margin: 0 !important;
    justify-self: start;
    z-index: 201;
  }

  .li-logo img {
    height: var(--logo-h);
    width: auto;
    max-width: min(148px, 42vw);
  }

  .li-lang-toggle {
    grid-column: 2;
    grid-row: 1;
    margin: 0 !important;
    z-index: 201;
    gap: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(6, 6, 8, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 0 2px;
  }

  .li-lang-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    font-size: 12px;
  }

  .li-menu-toggle {
    grid-column: 3;
    grid-row: 1;
    margin: 0 !important;
    z-index: 201;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    gap: 5px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(6, 6, 8, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
  }

  .li-menu-toggle span {
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  }

  .li-menu-toggle[aria-expanded="true"] {
    background: rgba(6, 6, 8, 0.9);
    border-color: rgba(255, 255, 255, 0.32);
  }

  .li-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(3.5px) rotate(45deg);
  }

  .li-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  /*
   * Solid header on mobile — no backdrop-filter.
   * backdrop-filter on .li-header traps position:fixed menu links/overlay
   * inside the 56px header box (links then sit on top of the logo).
   */
  .li-header,
  .li-header.scrolled {
    background: rgba(6, 6, 8, 0.96) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  /*
   * Bundle minifies calc(+) without spaces → invalid CSS → top:auto.
   * Result: nav links use static position and collide with the logo.
   * Spaces around + / - are required in calc().
   */
  .li-nav-links {
    top: calc(var(--header-h) + var(--safe-top, 0px) + 16px) !important;
    bottom: auto !important;
    left: max(20px, var(--safe-left, 0px)) !important;
    right: max(20px, var(--safe-right, 0px)) !important;
    max-height: calc(100dvh - var(--header-h) - var(--safe-top, 0px) - 120px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 202 !important;
    /* Kill bundle entrance translate — it left links sitting inside the header/logo */
    transform: none !important;
  }

  .li-nav-cta {
    top: auto !important;
    bottom: max(24px, var(--safe-bottom, 0px)) !important;
    left: max(20px, var(--safe-left, 0px)) !important;
    right: max(20px, var(--safe-right, 0px)) !important;
    z-index: 202 !important;
    transform: none !important;
  }

  .li-nav.open::before {
    z-index: 198 !important;
    background: rgba(6, 6, 8, 0.98) !important;
  }

  body.menu-open .li-header {
    background: rgba(6, 6, 8, 0.98) !important;
  }

  /* Hero: brand + lead + CTAs — one composition */
  .li-hero--banner {
    /* Slightly shorter than the screen so the next section peeks in */
    min-height: 88vh;
    min-height: 88svh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }

  .li-hero-banner-stage {
    padding-top: calc(var(--header-h) + var(--safe-top, 0px) + 8px) !important;
    padding-bottom: 8px !important;
    flex: 1 1 auto;
    align-items: center !important;
  }

  .li-hero-banner img {
    width: min(100%, 92%) !important;
    max-width: 100%;
    max-height: min(24vh, 148px);
    object-fit: contain;
  }

  .li-hero--banner .li-hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(6, 6, 8, 0.5) 0%,
      rgba(6, 6, 8, 0.22) 36%,
      rgba(6, 6, 8, 0.62) 70%,
      rgba(6, 6, 8, 0.9) 100%
    ) !important;
  }

  .li-hero-inner {
    padding-bottom: 4px;
    padding-inline: 2px;
  }

  .li-hero .li-lead,
  .li-hero-inner .li-lead {
    font-size: 14.5px !important;
    line-height: 1.55 !important;
    margin-bottom: 18px !important;
    max-width: 34em;
    text-shadow: 0 1px 16px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9);
  }

  .li-hero-cta {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    width: 100%;
    margin-top: 0 !important;
  }

  .li-hero-cta .li-btn--primary {
    width: 100%;
    min-height: 52px;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
  }

  .li-hero-cta .li-btn--secondary {
    width: fit-content;
    min-height: 44px;
    align-self: flex-start;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 10px 2px !important;
  }

  /* Contact FAB — keep above header (201); under cookie (950) */
  .li-contact-chips {
    bottom: max(18px, calc(12px + env(safe-area-inset-bottom, 0px))) !important;
    right: max(14px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    z-index: 900;
  }

  .li-contact-chip {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 18px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    border-radius: 999px;
    background: #fff;
    color: #060608;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
  }

  /* Compare: leftover dual-slider affordances (single composite has no handle) */
  

  

  

  .li-compare-label {
    top: 12px;
    padding: 6px 10px;
    font-size: 10px;
  }

  .li-compare-label--live {
    left: 12px;
  }

  .li-compare-label--design {
    right: 12px;
  }

  /* Services */
  .li-service-panel {
    min-height: min(72vh, 520px);
  }

  .li-service-panel-inner {
    padding: 28px 0 36px;
    padding-left: 18px !important;
    max-width: 100%;
  }

  .li-service-panel h2 {
    font-size: clamp(2rem, 10vw, 2.75rem) !important;
    margin-bottom: 8px;
  }

  .li-service-link {
    margin-top: 1.25rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 0;
  }

  /* Process — hover titles on mobile */
  .li-process-title {
    min-height: 44px;
    padding: 8px 0;
  }

  .li-process-bodies {
    min-height: 5.5em;
  }

  .li-team-member {
    padding: 20px 4px 20px 0;
  }

  .li-team-index {
    font-size: 11px;
  }

  /* Work / team spacing owned by premium.css --section-y */

  .li-faq-item summary {
    min-height: var(--touch);
    padding: 14px 0;
    gap: 12px;
    font-size: 1rem;
  }

  .li-faq-item p {
    font-size: 14.5px;
    line-height: 1.55;
    padding-bottom: 16px;
  }

  /* Forms */
  .li-form input,
  .li-form textarea,
  .li-form select {
    font-size: 16px !important;
    min-height: 48px;
  }

  .li-form button[type="submit"],
  .li-form .li-btn {
    width: 100%;
    min-height: 52px;
    border-radius: 999px;
  }

  /* Contact FAB clearance — reinforced in premium.css */

  /* Footer meta — unified close */
  .li-footer-legal-inline a {
    min-height: 44px;
    font-size: 12px;
  }

  .li-footer .li-footer-social {
    gap: 2px;
  }

  .li-footer .li-social {
    width: 48px;
    height: 48px;
    min-height: 48px;
  }

  /* Cookie bar */
  .li-cookie {
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .li-cookie-actions .li-btn {
    min-height: 44px;
  }

  /* Menu open: settle chrome */
  /* contact-chip dense hide */
  .li-contact-chips.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.menu-open .li-contact-chips,
  body.menu-open .scroll-progress {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .li-nav.open .li-nav-links a {
    min-height: 48px;
    font-size: clamp(1.45rem, 6.5vw, 2rem);
    padding: 12px 0;
  }

  .li-nav.open .li-nav-cta {
    min-height: 54px;
    border-radius: 999px;
  }

  /* Keep logo + controls above the overlay panel */
  body.menu-open .li-logo,
  body.menu-open .li-lang-toggle,
  body.menu-open .li-menu-toggle {
    z-index: 203 !important;
  }
}

@media (max-width: 480px) {
  :root {
    --container-pad: 16px;
    --header-h: 56px;
    --logo-h: 34px;
  }

  .li-hero-banner img {
    max-height: min(20vh, 120px);
  }

  .li-hero .li-lead,
  .li-hero-inner .li-lead {
    font-size: 14px !important;
  }

  .li-stats::before {
    margin-bottom: 28px;
  }

  .li-stats-grid {
    gap: 12px 8px !important;
  }

  .li-stat:not(:last-child)::after {
    display: none;
  }

  .li-team-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 359px) {
  .li-team-grid {
    grid-template-columns: 1fr !important;
  }

  .li-logo img {
    max-width: 120px;
  }
}

/* Prefer fewer layout jumps on phones */
@media (max-width: 768px) {
  .li-clients,
  .li-compare,
  .li-services,
  .li-process,
  .li-reel,
  .li-work,
  .li-team,
  .li-faq {
    content-visibility: visible;
    contain-intrinsic-size: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .li-header,
  .li-contact-chip,
  .li-nav.open::before,
  .li-reel-item-img,
  .li-reel-item-video,
  .li-reel-item-play {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Mobile pack (2026-09-30): tap targets, text size, cookie vs menu ── */
@media (max-width: 768px) {
  body.menu-open .li-cookie {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body .li-seo-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  body .li-seo-related a,
  body .li-seo-related-current,
  body .li-footer .li-contact-email,
  body .li-footer .li-contact-phone {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  body .li-footer .li-contact-channels { gap: 4px; }

  body .li-logo {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  body .li-reel-ig-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  body .li-cookie-policy {
    display: inline-block;
    font-size: 12px;
    padding: 14px 10px;
    margin: -14px -10px;
  }
}

/* ===== Mobile audit round 5 (2026-10-01) ===== */

/* (a) Compact cookie banner, <=768px (~115px tall, 44px controls) */
@media (max-width: 768px) {
  .li-cookie { padding: 8px 8px max(8px, env(safe-area-inset-bottom, 0px)); }
  .li-cookie-inner {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: center;
    gap: 0 8px;
    padding: 8px 12px 6px;
  }
  .li-cookie-copy,
  .li-cookie-actions { display: contents; }
  .li-cookie-title {               /* still the aria-labelledby target */
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .li-cookie-body {
    grid-column: 1 / -1; margin: 0 0 2px;
    font-size: 13px; line-height: 1.4;
    display: block; overflow: visible; -webkit-line-clamp: unset;
  }
  body .li-cookie-policy {
    grid-row: 2; grid-column: 1;
    display: inline-flex; align-items: center; min-height: 44px;
    margin: 0; padding: 0 8px 0 0; font-size: 12px; white-space: nowrap;
  }
  #cookie-decline { grid-row: 2; grid-column: 2; }
  #cookie-accept  { grid-row: 2; grid-column: 3; }
  .li-cookie-actions .li-btn { width: 100%; min-height: 44px; padding: 8px 10px; }
  /* careers hero: reserve room for the shorter banner (was 208/228px) */
  body.li-cookie-open.lightit-careers-page .li-careers-hero {
    padding-bottom: calc(clamp(36px, 6vh, 56px) + 124px + env(safe-area-inset-bottom, 0px));
  }
}

/* short phones (height <= 700px): keep all menu rows + CONTACT visible, Contact must not cover FAQ */
@media (max-width: 768px) and (max-height: 700px) {
  .li-nav.open .li-nav-links a { min-height: 44px; padding: 8px 0; font-size: clamp(1.25rem, 5.6vw, 1.6rem); }
}

/* (b) Remaining tap targets >=44px, <=768px (padding + equal negative margin = no layout shift) */
@media (max-width: 768px) {
  
  body .li-footer-brand-link { padding: 10px 0; margin: -10px 0; }
  /* underline was a border-bottom -> text-decoration so padding does not push the line down */
  body.lightit-careers-page .li-careers-jump {
    display: inline-block; padding: 12px 0; margin: -12px 0; border-bottom: 0;
    text-decoration: underline; text-decoration-color: rgba(255,255,255,.35);
    text-decoration-thickness: 1px; text-underline-offset: .3em;
  }
  body.lightit-careers-page .li-careers-jump:hover,
  body.lightit-careers-page .li-careers-jump:focus-visible { text-decoration-color: rgba(255,255,255,.75); }
  /* careers: fallback hello@lightit.co link (was 18px tall) */
  body.lightit-careers-page .li-careers-apply .li-apply-alt a { display: inline-block; padding: 13px 0; margin: -13px 0; }
}

/* (c) Type floor 12px (cookie text 13px), <=768px. Replaces the buggy max(12px,1em) rule (1em resolved to 17px) */
@media (max-width: 768px) {
  body .li-compare-label { font-size: 12px; letter-spacing: 0.1em; }
  body .li-stat-lbl      { font-size: 12px; letter-spacing: 0.08em; }
  body .li-section-label { font-size: 12px; letter-spacing: 0.16em; }
  body .li-work-kicker   { font-size: 12px; letter-spacing: 0.12em; } /* parent of .li-work-year / .li-work-type */
  body .li-client-name   { font-size: clamp(12px, 3.2vw, 14px); }
  body .li-service-num,
  body .li-process-title .li-process-num,
  body .li-team-index,
  body .li-form label small,
  body .li-contact-chip  { font-size: 12px; }
}

/* (d) Tablet nav 769-1100px: nowrap, tight spacing, logo can no longer shrink (fixes logo 0-19px + "Design / Live" wrapping) */
@media (min-width: 769px) and (max-width: 1100px) {
  .li-nav { gap: 12px; }
  .li-nav-links { gap: 14px; }
  .li-nav-links a { white-space: nowrap; letter-spacing: 0.06em; }
  .li-nav-cta { padding: 10px 16px; margin-right: 16px; }
  .li-lang-toggle { margin-right: 0; }
  .li-logo { flex: 0 0 auto; margin-left: 16px; }
}
@media (min-width: 769px) and (max-width: 1023px) {
  .li-logo img { height: 40px; }
}

/* (d2) Narrow tablet 769-810px: Contact button must fit the viewport (was 11px EN / 32px TR past the edge); logo gap 16px */
@media (min-width: 769px) and (max-width: 810px) {
  .li-nav-links { gap: 9px; }
  .li-nav-links a { letter-spacing: 0.04em; }
  .li-nav-cta { padding: 10px 12px; margin-right: 12px; }
  .li-logo { margin-right: 4px; }
}
