/* ==========================================================================
   Stellar Qatar — Mobile App Shell
   Loaded after style.css. Adds: light/dark theme, mobile top app bar,
   bottom tab bar, swipe-in side drawer, search overlay, slide-in contact
   drawer, read-aloud, and general "installed app" polish for small screens.
   Desktop (>=992px) is left visually as-is; the classic navbar still runs
   there. Everything below is scoped to mobile/tablet unless noted.
   ========================================================================== */

:root{
  --as-radius:16px;
  --as-radius-sm:10px;
  --as-surface:#ffffff;
  --as-surface-2:#f7f4ec;
  --as-text:#14161a;
  --as-muted:#68707a;
  --as-border:rgba(20,22,26,.09);
  --as-shadow:0 10px 30px rgba(20,22,26,.10);
  --as-accent:#ffc700;
  --as-accent-ink:#14161a;
  --as-bottom-h:64px;
  --as-top-h:58px;
  --as-safe-b:env(safe-area-inset-bottom,0px);
  --as-safe-t:env(safe-area-inset-top,0px);
}

html[data-theme="dark"]{
  --as-surface:#15171c;
  --as-surface-2:#1b1e24;
  --as-text:#f2f3f5;
  --as-muted:#9aa1ab;
  --as-border:rgba(255,255,255,.10);
  --as-shadow:0 10px 30px rgba(0,0,0,.45);
  color-scheme:dark;
}

html[data-theme="dark"] body{background:#0c0d10;color:#cdd1d6}
html[data-theme="dark"] .bg-bone{background:#14161a}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4{color:#f5f6f8}
html[data-theme="dark"] .icon-box,html[data-theme="dark"] .content-card,html[data-theme="dark"] .product-card:not(.featured),html[data-theme="dark"] .journey-card,html[data-theme="dark"] .faq-card,html[data-theme="dark"] .resource-card,html[data-theme="dark"] .service-panel,html[data-theme="dark"] .stat,html[data-theme="dark"] .article-gate-card{background:#15171c;border-color:rgba(255,255,255,.08);color:#c8ccd2}
html[data-theme="dark"] .section-intro p,html[data-theme="dark"] .lead-copy,html[data-theme="dark"] p{color:#aab0b8}
html[data-theme="dark"] .contact-side p,html[data-theme="dark"] .footer-main p{color:#aab0b8}
html[data-theme="dark"] .outcome-panel .eyebrow,html[data-theme="dark"] .outcome-panel p{color:var(--ink)}
html[data-theme="dark"] .outcome-panel .check-list li,html[data-theme="dark"] .outcome-panel strong,html[data-theme="dark"] .outcome-panel h3{color:var(--ink)}
html[data-theme="dark"] .outcome-panel .check-list li:before{color:var(--green)}
html[data-theme="dark"] .form-control,html[data-theme="dark"] .form-select{background:#15171c;border-color:rgba(255,255,255,.14);color:#eef0f3}
html[data-theme="dark"] .form-control::placeholder{color:#6b7178}
html[data-theme="dark"] .dropdown-menu{background:#15171c;box-shadow:0 18px 48px rgba(0,0,0,.5)}
html[data-theme="dark"] .dropdown-item{color:#c8ccd2}
html[data-theme="dark"] .dropdown-item:hover{background:#1b1e24;color:var(--gold)}
html[data-theme="dark"] .article-answer,html[data-theme="dark"] .source-note,html[data-theme="dark"] .next-step,html[data-theme="dark"] .soft-band,html[data-theme="dark"] .service-layers-section{background:#14161a;border-color:rgba(255,255,255,.08)}
html[data-theme="dark"] .article-body,html[data-theme="dark"] .check-list li{color:#c1c6cc}
html[data-theme="dark"] .badge-soft{background:#1b1e24;color:#c1c6cc}
html[data-theme="dark"] .resource-tag,html[data-theme="dark"] .resource-arrow{color:var(--gold)}
html[data-theme="dark"] .breadcrumb-lite{color:#8b92a0}

/* Elements that hard-code color:var(--ink) for a light-card context still
   render dark-on-dark once their card/section background flips in dark
   mode. Re-point them to a light color so text doesn't disappear. */
html[data-theme="dark"] .btn-outline-ink{border-color:#e7e9ec;color:#e7e9ec}
html[data-theme="dark"] .btn-outline-ink:hover{background:#e7e9ec;color:#0c0d10}
html[data-theme="dark"] .bg-ink .icon-box h3,html[data-theme="dark"] .bg-ink .icon-box p{color:#e7e9ec}
html[data-theme="dark"] .service-panel-list a{color:#e7e9ec}
html[data-theme="dark"] .service-panel-list a:hover{color:var(--gold)}
html[data-theme="dark"] .stat strong{color:#f5f6f8}
html[data-theme="dark"] .next-step{color:#e7e9ec}
html[data-theme="dark"] .next-step strong,html[data-theme="dark"] .next-step p{color:#e7e9ec}
html[data-theme="dark"] .next-step a{color:var(--gold)}
html[data-theme="dark"] .resource-card h2 a{color:#f5f6f8}
html[data-theme="dark"] .resource-card h2 a:hover{color:var(--gold)}
html[data-theme="dark"] .resource-link{color:#e7e9ec;border-color:rgba(255,255,255,.1)}
html[data-theme="dark"] .resource-link:hover{color:var(--gold)}
html[data-theme="dark"] .source-note a{color:var(--gold)}
html[data-theme="dark"] .faq .accordion-button{background:#15171c;color:#eef0f3}
html[data-theme="dark"] .faq .accordion-body{color:#aab0b8}
html[data-theme="dark"] .faq .accordion-item{border-color:rgba(255,255,255,.1)}
html[data-theme="dark"] .service-panel-head i{background:#20242c;color:#e7e9ec}

*{-webkit-tap-highlight-color:transparent}
button{touch-action:manipulation}

/* ---------- Top app bar (mobile/tablet only) ---------- */
.app-topbar{display:none}
@media(max-width:991.98px){
  .navbar{display:none!important}
  .app-topbar{
    display:flex;align-items:center;gap:.6rem;
    position:sticky;top:0;z-index:1200;
    height:calc(var(--as-top-h) + var(--as-safe-t));
    padding:var(--as-safe-t) .85rem 0;
    background:var(--as-surface);border-bottom:1px solid var(--as-border);
    backdrop-filter:saturate(180%) blur(14px);
  }
  .app-topbar-brand{display:flex;align-items:center;margin-right:auto}
  .app-topbar-brand img{height:26px}
  html[data-theme="dark"] .app-topbar-brand img{filter:invert(1) brightness(1.6)}
  .app-topbar-actions{display:flex;align-items:center;gap:.25rem}
  body{padding-bottom:calc(var(--as-bottom-h) + var(--as-safe-b))}
  .whatsapp{bottom:calc(var(--as-bottom-h) + var(--as-safe-b) + 14px)}
  .consent-banner{bottom:calc(var(--as-bottom-h) + var(--as-safe-b) + 1rem)}
}

.app-icon-btn{
  width:40px;height:40px;border-radius:50%;border:0;background:transparent;
  color:var(--as-text);display:grid;place-items:center;font-size:1.05rem;
  transition:background .15s ease;
}
.app-icon-btn:active{background:var(--as-border)}

/* ---------- Bottom tab bar ---------- */
.app-bottom-nav{display:none}
@media(max-width:991.98px){
  .app-bottom-nav{
    display:grid;grid-template-columns:repeat(5,1fr);
    position:fixed;left:0;right:0;bottom:0;z-index:1150;
    height:calc(var(--as-bottom-h) + var(--as-safe-b));
    padding-bottom:var(--as-safe-b);
    background:var(--as-surface);border-top:1px solid var(--as-border);
    box-shadow:0 -8px 24px rgba(20,22,26,.08);
  }
  .app-bottom-nav a,.app-bottom-nav button{
    all:unset;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
    height:var(--as-bottom-h);color:var(--as-muted);font-size:.68rem;font-weight:700;text-align:center;cursor:pointer;
  }
  .app-bottom-nav i{font-size:1.15rem}
  .app-bottom-nav a.is-active,.app-bottom-nav button.is-active{color:var(--as-accent-ink)}
  html[data-theme="dark"] .app-bottom-nav a.is-active,html[data-theme="dark"] .app-bottom-nav button.is-active{color:var(--gold)}
  .app-bottom-nav a.is-active i,.app-bottom-nav button.is-active i{
    background:var(--as-accent);color:var(--as-accent-ink);width:34px;height:22px;border-radius:11px;display:grid;place-items:center;font-size:.85rem;
  }
}

/* ---------- Shared scrim ---------- */
.app-shell-scrim{
  position:fixed;inset:0;background:rgba(10,11,13,.55);z-index:1250;
  opacity:0;pointer-events:none;transition:opacity .28s ease;
}
.app-shell-scrim.is-active{opacity:1;pointer-events:auto}

/* ---------- Side drawer ---------- */
.app-drawer{
  position:fixed;top:0;bottom:0;left:0;width:86%;max-width:340px;z-index:1300;
  background:var(--ink);color:#fff;display:flex;flex-direction:column;
  transform:translateX(-104%);transition:transform .3s cubic-bezier(.2,.9,.25,1);
  padding-top:var(--as-safe-t);overflow-y:auto;box-shadow:24px 0 60px rgba(0,0,0,.35);
}
.app-drawer.is-open{transform:translateX(0)}
.app-drawer-head{display:flex;align-items:center;justify-content:space-between;padding:1.1rem 1.1rem .8rem}
.app-drawer-head img{height:30px}
.app-drawer-head h2{color:#fff;font-size:1.2rem;margin:0}
.app-drawer .app-icon-btn{color:#fff}
.app-drawer-nav{list-style:none;margin:0;padding:.3rem 0 1rem}
.app-drawer-nav>li>a{display:flex;align-items:center;gap:.75rem;padding:.85rem 1.2rem;color:#fff;text-decoration:none;font-weight:700;font-size:1.02rem;border-bottom:1px solid rgba(255,255,255,.06)}
.app-drawer-nav>li>a i{width:20px;color:var(--gold)}
.app-drawer-nav>li>a:active,.app-drawer-nav>li>a.is-active{color:var(--gold)}
.app-drawer-group{padding:.9rem 1.2rem;border-bottom:1px solid rgba(255,255,255,.06)}
.app-drawer-group-label{display:block;text-transform:uppercase;letter-spacing:.1em;font-size:.7rem;font-weight:800;color:var(--gold);margin-bottom:.55rem}
.app-drawer-group a{display:block;padding:.5rem 0;color:#d9dce1;text-decoration:none;font-weight:500}
.app-drawer-group a:active{color:var(--gold)}
.app-drawer-toggles{padding:.4rem 1.2rem;border-bottom:1px solid rgba(255,255,255,.06)}
.app-toggle-row{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;width:100%;padding:.85rem 0;color:#e8eaed;font-weight:600;cursor:pointer}
.app-toggle-row span:first-child{display:flex;align-items:center;gap:.65rem}
.app-toggle-row i{color:var(--gold)}
.app-switch{width:42px;height:24px;border-radius:12px;background:rgba(255,255,255,.18);position:relative;transition:background .2s ease;flex:none}
.app-switch:before{content:'';position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .2s ease}
html[data-theme="dark"] .app-switch{background:var(--gold)}
html[data-theme="dark"] .app-switch:before{transform:translateX(18px)}
.app-drawer-contact{padding:1.2rem;color:#9aa1ab;font-size:.92rem;margin-top:auto}
.app-drawer-contact a{display:block;color:#fff;text-decoration:none;margin-top:.5rem;font-weight:600}
.app-drawer-contact a:active{color:var(--gold)}

/* ---------- Search overlay ---------- */
.app-search-overlay{
  position:fixed;inset:0;z-index:1400;background:var(--ink);color:#fff;
  display:flex;flex-direction:column;transform:translateY(-100%);transition:transform .28s ease;
  padding-top:var(--as-safe-t);
}
.app-search-overlay.is-open{transform:translateY(0)}
.app-search-head{display:flex;align-items:center;gap:.6rem;padding:1rem 1rem .8rem;border-bottom:1px solid rgba(255,255,255,.08)}
.app-search-input-wrap{flex:1;display:flex;align-items:center;gap:.6rem;background:rgba(255,255,255,.08);border-radius:12px;padding:.7rem 1rem}
.app-search-input-wrap i{color:#9aa1ab}
.app-search-input-wrap input{all:unset;flex:1;color:#fff;font-size:1rem}
.app-search-input-wrap input::placeholder{color:#8890a0}
.app-search-overlay .app-icon-btn{color:#fff}
.app-search-results{flex:1;overflow-y:auto;padding:.5rem 1rem 2rem}
.app-search-hint{color:#8890a0;padding:1.2rem .2rem;font-size:.92rem}
.app-search-result{display:block;padding:1rem .3rem;border-bottom:1px solid rgba(255,255,255,.08);text-decoration:none;color:#fff}
.app-search-result .asr-tag{display:block;color:var(--gold);font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;margin-bottom:.3rem}
.app-search-result .asr-title{display:block;font-weight:700;font-size:1.05rem;margin-bottom:.25rem}
.app-search-result .asr-desc{display:block;color:#b6bac2;font-size:.88rem;line-height:1.4}
.app-search-empty{color:#8890a0;padding:1.2rem .2rem}

/* ---------- Contact slide-in drawer ---------- */
.app-contact-drawer{
  position:fixed;top:0;bottom:0;right:0;width:92%;max-width:420px;z-index:1300;
  background:var(--as-surface);color:var(--as-text);display:flex;flex-direction:column;
  transform:translateX(104%);transition:transform .3s cubic-bezier(.2,.9,.25,1);
  padding-top:var(--as-safe-t);overflow-y:auto;box-shadow:-24px 0 60px rgba(0,0,0,.25);
}
.app-contact-drawer.is-open{transform:translateX(0)}
.app-contact-drawer .app-drawer-head h2{color:var(--as-text)}
.app-contact-drawer .app-icon-btn{color:var(--as-text)}
.app-contact-intro{padding:0 1.2rem;color:var(--as-muted);margin-bottom:1rem}
.app-contact-form{padding:0 1.2rem;display:grid;gap:.7rem}
.app-contact-alt{padding:1.4rem 1.2rem 2rem;border-top:1px solid var(--as-border);margin-top:1.4rem;display:grid;gap:.15rem}
.app-contact-alt a{display:flex;align-items:center;gap:.6rem;padding:.6rem 0;color:var(--as-text);text-decoration:none;font-weight:600}
.app-contact-alt a i{color:var(--gold2);width:18px}

body.app-shell-locked{overflow:hidden}

/* ---------- Read-aloud highlight ---------- */
.app-reading{outline:2px solid var(--gold);outline-offset:4px;border-radius:4px}

/* ---------- Small app-like polish on mobile ---------- */
@media(max-width:991.98px){
  .btn{border-radius:12px}
  .icon-box,.content-card,.product-card,.journey-card,.faq-card,.resource-card,.service-panel,.stat{border-radius:var(--as-radius)}
  .form-control,.form-select{border-radius:var(--as-radius-sm)}
  .hero{padding-top:2.6rem}
}

/* ==========================================================================
   Mobile-first typography rescale
   Desktop copy (display-title, hero h1, card headings, body copy) is sized
   for wide measure and vw-based clamps that bottom out too large on a
   360-430px screen. Re-tune the whole type scale for phones specifically,
   independent of the desktop clamp() values.
   ========================================================================== */
@media(max-width:767.98px){
  .container{padding-left:1.15rem;padding-right:1.15rem}

  .eyebrow{font-size:.7rem;letter-spacing:.09em}
  .hero .eyebrow{font-size:.68rem}

  .hero{padding:2.4rem 0 2.2rem}
  .hero h1{font-size:2.05rem;line-height:1.12;letter-spacing:-.03em;max-width:100%;text-wrap:balance}
  .hero .lead{font-size:1rem;line-height:1.6;max-width:100%}
  .hero-mini{padding:2rem 0 1.9rem}
  .hero-mini h1{font-size:1.9rem;line-height:1.14}

  h2{letter-spacing:-.02em}
  .display-title{font-size:1.7rem!important;line-height:1.2!important;letter-spacing:-.025em!important}
  .section-intro{max-width:100%}
  .section-intro p{font-size:.98rem;line-height:1.6}
  .lead-copy{font-size:1rem;line-height:1.6}
  p{font-size:.98rem}

  .section{padding:2.6rem 0!important}
  .section-sm{padding:2rem 0}

  .problem-box{padding:1.5rem}
  .problem-box h3{font-size:1.15rem}
  .check-list li{padding:.6rem 0 .6rem 1.75rem;font-size:.95rem}

  .icon-box,.content-card,.product-card,.journey-card,.faq-card,.resource-card,.service-panel{padding:1.4rem!important}
  .product-card h2{font-size:1.5rem!important;line-height:1.16}
  .product-card p{font-size:.95rem}
  .icon-box h3,.content-card h3{font-size:1.1rem}
  .icon-box p,.content-card p{font-size:.93rem}
  .icon-box i,.mini-icon{width:44px;height:44px;font-size:1.05rem;margin-bottom:1rem}
  .product-label{font-size:.72rem}

  .quote-panel{font-size:1.18rem;line-height:1.4;padding-left:1.1rem;border-left-width:4px}
  .outcome-panel{padding:1.6rem}
  .outcome-panel h2{font-size:1.55rem}
  .next-step{padding:1.4rem}
  .number-step{gap:.9rem}
  .number-step .num{font-size:1.4rem;min-width:40px}
  .number-step h3{font-size:1.08rem}

  .article-answer{padding:1.15rem 1.25rem;font-size:1rem}
  .article-section h2{font-size:1.4rem;line-height:1.22}
  .article-body{font-size:.98rem}
  .resource-card h2{font-size:1.18rem}
}

/* ==========================================================================
   Swipeable card carousels
   Stacks of near-identical cards (pricing/stage tiers, feature icon grids,
   resource cards) read as a long wall of text on a phone. On mobile turn
   the row that holds them into a horizontal, snap-scrolling strip — same
   swipe language as the rest of the app shell — with a peek of the next
   card so it reads as "swipe for more", not "keep scrolling forever".
   ========================================================================== */
@media(max-width:767.98px){
  .row:has(.product-card),
  .row:has(.icon-box),
  .row:has(.resource-card),
  .row:has(.service-panel),
  .row:has(.journey-card){
    flex-wrap:nowrap;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding-bottom:.35rem;
    margin-left:-1.15rem;margin-right:-1.15rem;
    padding-left:1.15rem;padding-right:1.15rem;
  }
  .row:has(.product-card)::-webkit-scrollbar,
  .row:has(.icon-box)::-webkit-scrollbar,
  .row:has(.resource-card)::-webkit-scrollbar,
  .row:has(.service-panel)::-webkit-scrollbar,
  .row:has(.journey-card)::-webkit-scrollbar{display:none}

  .row:has(.product-card) > [class*="col-"],
  .row:has(.icon-box) > [class*="col-"],
  .row:has(.resource-card) > [class*="col-"],
  .row:has(.service-panel) > [class*="col-"],
  .row:has(.journey-card) > [class*="col-"]{
    flex:0 0 82%;max-width:82%;scroll-snap-align:start;
  }
  .row:has(.icon-box) > [class*="col-"]{flex-basis:72%;max-width:72%}

  .app-carousel-hint{display:flex;align-items:center;gap:.4rem;color:var(--as-muted);font-size:.78rem;font-weight:700;margin:-.25rem 0 1rem}
  .app-carousel-hint i{color:var(--gold2)}
}
