/* ============================================================================
   Mobile layer. Loaded last on every page, so it gets the final say.

   Two jobs:

   1. The home page. Under 768px the WebGL sequence is switched off entirely
      (home-scene.js bails out before it boots) and the `#mobile-home` landing
      below takes over — three plain, scrollable sections.
   2. Everything else. The captured markup was built desktop-first and pins
      several headings to fixed sizes; Turkish words are longer than the
      English ones they replaced, so those headings are re-clamped here. The
      header's hamburger menu is styled here too — the markup had the button
      but never had a menu to open.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   Mobile home landing — hidden by default, only ever shown under 768px.
   -------------------------------------------------------------------------- */

#mobile-home { display: none; }

@media (max-width: 767px) {

  /* The 3D page takes over the viewport and kills native scrolling. None of
     that applies here, so hand the page back to the browser. */
  html:has(body.home-3d),
  body.home-3d {
    overflow: auto !important;
    height: auto !important;
    overscroll-behavior: auto;
  }

  /* Every piece of the WebGL experience, gone. */
  body.home-3d #intro-overlay,
  body.home-3d #canvas-container,
  body.home-3d #scroll-hint,
  body.home-3d #zone-nav,
  body.home-3d #overlay-container { display: none !important; }

  #mobile-home { display: block; }

  .m-section { padding: 56px 22px 64px; }
  .m-section--hero { padding-top: 132px; background: var(--brand-blue); }
  .m-section--services { background: var(--brand-cream); }
  .m-section--close { background: var(--brand-blue-dark); }

  .m-kicker {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 19px;
    margin-bottom: 10px;
  }
  .m-title {
    font-family: 'Archivo Black', sans-serif;
    text-transform: uppercase;
    font-size: clamp(30px, 9vw, 42px);
    line-height: 0.98;
    margin-bottom: 16px;
    overflow-wrap: break-word;
  }
  .m-lead { font-size: 17px; line-height: 1.65; }

  .m-section--hero .m-kicker,
  .m-section--hero .m-title,
  .m-section--hero .m-lead { color: var(--brand-cream); }
  .m-section--hero .m-lead { color: var(--brand-blue-pale); }

  .m-section--services .m-kicker { color: var(--brand-red); }
  .m-section--services .m-title { color: var(--brand-blue); }

  .m-section--close .m-kicker { color: var(--brand-blue-light); }
  .m-section--close .m-title { color: var(--brand-cream); }
  .m-section--close .m-lead { color: var(--brand-blue-light); }

  .m-logo {
    display: block;
    width: 190px;
    max-width: 62%;
    height: auto;
    margin-bottom: 26px;
  }

  /* Buttons */
  .m-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
  .m-btn {
    display: inline-block;
    padding: 13px 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-shadow: none;
  }
  .m-btn--solid { background: var(--brand-red); color: var(--brand-cream); }
  .m-btn--ghost {
    background: transparent;
    color: var(--brand-cream);
    box-shadow: inset 0 0 0 2px var(--brand-blue-light);
  }
  .m-btn--light { background: var(--brand-blue); color: var(--brand-cream); }

  /* Services list */
  .m-list { margin-top: 28px; border-top: 1px solid rgba(46, 62, 82, 0.15); }
  .m-item {
    padding: 18px 0;
    border-bottom: 1px solid rgba(46, 62, 82, 0.15);
  }
  /* override.css forces every h3 to italic Playfair with !important, so this
     has to shout back to stay a sans-serif label. */
  .m-item h3 {
    font-family: 'Space Grotesk', sans-serif !important;
    font-style: normal !important;
    font-weight: 700;
    font-size: 19px;
    line-height: 1.25;
    color: var(--brand-blue-dark);
    margin-bottom: 5px;
  }
  .m-item p { font-size: 15px; line-height: 1.5; color: var(--brand-grey); }

  /* Post links */
  .m-posts { margin-top: 26px; border-top: 1px solid rgba(146, 163, 190, 0.3); }
  .m-post {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid rgba(146, 163, 190, 0.3);
  }
  .m-post span {
    display: block;
    font-size: 13px;
    color: var(--brand-blue-light);
    margin-top: 6px;
  }
  .m-post strong {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
    color: var(--brand-cream);
  }

  .m-rule {
    height: 1px;
    background: rgba(146, 163, 190, 0.3);
    margin: 44px 0 40px;
  }

  .m-foot {
    padding: 26px 22px 34px;
    background: var(--brand-blue-dark);
    color: var(--brand-blue-light);
    font-size: 12px;
    text-align: center;
  }
  .m-foot a { color: var(--brand-blue-light); opacity: 0.75; margin: 0 8px; }

  /* -------------------------------------------------------------------------
     Header + hamburger menu.

     The captured markup ships the button and a nav list that is `hidden` up to
     the md breakpoint, but the list was positioned for the desktop layout. On
     mobile it is pulled out of the absolute placement and dropped underneath
     the logo as a full-width panel.
     ------------------------------------------------------------------------ */

  /* The desktop layout centres the nav by absolutely positioning it inside a
     shrink-to-fit chain of wrappers. Rather than fight that chain for a
     containing block, the whole chain goes full width on mobile and the menu
     simply flows underneath the logo. The header is `fixed`, so a taller
     header just overlays the page — which is what a dropdown should do. */
  /* Note: this build of Tailwind implements `-translate-x-1/2` with the
     `translate` property, not `transform`, so both have to be cleared. */
  header > div,
  header > div > div,
  header nav {
    width: 100% !important;
    position: static !important;
    left: auto !important;
    transform: none !important;
    translate: none !important;
    min-width: 0 !important;
  }
  header nav ul {
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    transform: none !important;
    translate: none !important;
    background: var(--brand-blue-dark);
    box-shadow: 0 12px 30px rgba(46, 62, 82, 0.35);
  }
  header nav ul li { width: 100%; }
  header nav ul li a {
    width: 100%;
    justify-content: center;
    font-size: 20px;
  }
  /* The link for the page you are already on is deliberately italic and
     normal-case (`max-md:!normal-case` in the markup) — that is the "you are
     here" state, so it is left alone. */
  header nav ul li a span { padding: 16px 18px; }
  /* The home item is an icon; give it the same row height as the words. */
  header nav ul li a svg { width: 22px; height: 22px; }

  /* 32px is under every touch-target guideline. */
  header button {
    width: 44px !important;
    height: 44px !important;
    padding: 10px !important;
  }

  /* -------------------------------------------------------------------------
     Inner pages: headings were pinned to desktop sizes and overflow once the
     copy is Turkish. Scoped to `main` so the header is untouched.
     ------------------------------------------------------------------------ */

  main h1, main h2, main h3, main p { overflow-wrap: break-word; }

  main h1.text-6xl,
  main h2.text-6xl,
  main h1.text-7xl {
    font-size: clamp(30px, 9vw, 44px) !important;
    line-height: 0.95 !important;
  }
  main h1.text-5xl,
  main h2.text-5xl {
    font-size: clamp(26px, 7.6vw, 36px) !important;
    line-height: 1 !important;
  }
  main h2.text-4xl { font-size: clamp(22px, 6.4vw, 30px) !important; }

  /* The accordion rows on the services page. */
  main .grid.md\:grid-cols-12 { gap: 8px; }

  /* Contact card breathes better edge to edge on a phone. */
  main .rounded-2xl { border-radius: 1.25rem; }
}
