/* =====================================================================
   App shell: makes RezSoulution feel like a native app on phones,
   plus a platform-wide polish layer.
   ===================================================================== */

/* ---------- Polish: everywhere ---------- */
html{-webkit-tap-highlight-color:transparent}
body::after{content:"";position:fixed;inset:0;z-index:0;pointer-events:none;opacity:.05;mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}
.btn{box-shadow:inset 0 1px 0 rgba(255,255,255,.25), 0 6px 18px rgba(30,139,255,.28), 0 1px 0 rgba(0,0,0,.4)}
.btn:active{transform:translateY(1px) scale(.98);box-shadow:inset 0 1px 0 rgba(255,255,255,.15), 0 2px 8px rgba(30,139,255,.2)}
.btn-ghost{box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
.section-title{position:relative}
.section-title::after{content:"";display:block;width:84px;height:8px;margin:12px auto 0;border-radius:4px;
  background:radial-gradient(circle,#f5f7fa 0 3px,transparent 3.5px) 0 50%/21px 8px,radial-gradient(circle,#ffc400 0 3px,transparent 3.5px) 7px 50%/21px 8px,radial-gradient(circle,#e8202a 0 3px,transparent 3.5px) 14px 50%/21px 8px}
.lc-card,.path4,.product,.path,.feature,.biz-card,.mentor-card,.grant-card,.job-card,.artist-card,.svc,.course-card,.addon,.plan-card,.story-card,.college,.track{
  transition:transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s}
@media (hover:hover){
  .lc-card:hover,.path4:hover,.biz-card:hover,.mentor-card:hover,.artist-card:hover,.addon:hover,.college:hover,.track:hover{
    transform:translateY(-4px);box-shadow:0 18px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(95,176,255,.35), 0 0 40px rgba(30,139,255,.15)}
}
/* The nation map floats in 3D */
.map-stage{perspective:1600px}
.map-stage .us-map{transform:rotateX(14deg) translateY(-6px);transform-origin:50% 60%;filter:drop-shadow(0 30px 30px rgba(0,0,0,.55)) drop-shadow(0 0 30px rgba(30,139,255,.25));transition:transform .8s cubic-bezier(.2,.8,.2,1)}
.map-stage:hover .us-map{transform:rotateX(6deg) translateY(-10px)}
@media (prefers-reduced-motion:reduce){.map-stage .us-map{transform:none}}

/* ---------- App back button and title (phones) ---------- */
.app-back,.app-title{display:none}
.tabbar{display:none}
.filter-toggle{display:none}

@media (max-width:900px){
  /* Top bar becomes an app header on inner pages */
  body:not(.page-home) .topbar .brand span{display:none}
  body:not(.page-home) .topbar .brand img{width:34px;height:34px}
  .app-back{display:grid;place-items:center;width:40px;height:40px;margin-left:-6px;border-radius:12px;border:0;background:rgba(30,139,255,.14);color:#fff;cursor:pointer;flex:none}
  .app-back svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
  .app-title{display:block;flex:1;min-width:0;margin:0 6px;font-weight:700;font-size:1.02rem;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar .brand{order:0}
  .topbar .top-search{display:none}
  .topbar{padding-top:max(8px, env(safe-area-inset-top))}

  /* Bottom tab bar */
  .tabbar{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:10px;right:10px;bottom:max(10px, env(safe-area-inset-bottom));z-index:90;
    padding:6px;border-radius:24px;background:rgba(6,16,36,.86);border:1px solid rgba(95,176,255,.25);box-shadow:0 18px 50px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
    backdrop-filter:blur(18px) saturate(1.4);-webkit-backdrop-filter:blur(18px) saturate(1.4);transition:transform .3s cubic-bezier(.2,.8,.2,1)}
  .tabbar a{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:54px;border-radius:18px;text-decoration:none;color:var(--muted);font-size:.7rem;font-weight:600;letter-spacing:.02em;transition:color .2s, background .25s}
  .tabbar .ico{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;transition:transform .3s cubic-bezier(.3,1.6,.5,1)}
  .tabbar img{width:26px;height:26px;border-radius:50%;object-fit:cover;box-shadow:0 0 0 2px currentColor}
  .tabbar a[aria-current]{color:#fff;background:linear-gradient(180deg, rgba(30,139,255,.32), rgba(30,139,255,.12))}
  .tabbar a[aria-current] .ico{transform:translateY(-2px) scale(1.1)}
  .tabbar a[aria-current]::after{content:"";position:absolute;top:4px;width:5px;height:5px;border-radius:50%;background:var(--yellow);box-shadow:0 0 8px var(--yellow)}
  .tabbar .tab-mmiw{color:#ff8a90}
  .tabbar .tab-mmiw[aria-current]{background:linear-gradient(180deg, rgba(232,32,42,.4), rgba(232,32,42,.15))}
  .tabbar a:active{transform:scale(.92)}
  body.kb .tabbar,body.menu-open .tabbar{transform:translateY(140%)}
  body{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  .to-top{bottom:calc(92px + env(safe-area-inset-bottom))}
  .quick-exit{bottom:auto}

  /* Pages slide up like an app screen */
  main{animation:screenIn .45s cubic-bezier(.16,1,.3,1)}
  @keyframes screenIn{from{opacity:0;transform:translateY(14px)}}

  /* Bigger, friendlier touch targets and press feedback */
  .btn{min-height:46px}
  .lc-card:active,.path4:active,.product:active,.path:active,.biz-card:active,.artist-card:active,.grant-card:active,.job-card:active,.mod-list a:active,.story-card:active{transform:scale(.97)}

  /* Swipeable rows instead of long stacks */
  .page-home .product-grid,.page-learn .lc-grid,.page-language .story-grid,.page-home .path-grid{display:grid;grid-auto-flow:column;grid-auto-columns:78%;grid-template-columns:none;overflow-x:auto;scroll-snap-type:x mandatory;gap:12px;padding-bottom:10px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .page-home .product-grid::-webkit-scrollbar,.page-learn .lc-grid::-webkit-scrollbar,.page-language .story-grid::-webkit-scrollbar,.page-home .path-grid::-webkit-scrollbar{display:none}
  .page-home .product-grid>*,.page-learn .lc-grid>*,.page-language .story-grid>*,.page-home .path-grid>*{scroll-snap-align:start}

  /* Announcement: one tidy line */
  .ann-bar{padding:7px 12px;font-size:.82rem}
  .ann-bar a,.ann-bar span:not(.ann-dot){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  body:has(.quick-exit) .ann-bar{padding-right:110px;justify-content:flex-start}

  /* Lesson extras are small text links, not buttons */
  .lesson-extras{gap:14px;padding-left:4px}
  .lesson-extras a,.trail .lesson-extras a{display:inline;padding:0;border:0;background:none;box-shadow:none;border-radius:0;min-height:0;font-size:.82rem;font-weight:500;color:var(--ice);text-decoration:underline;text-underline-offset:3px}

  /* Marketplace filters fold away behind a Filters button */
  .filter-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;padding:12px 16px;border-radius:14px;border:1px solid var(--line);background:rgba(11,31,63,.7);color:#fff;font:600 1rem "Saira",sans-serif;cursor:pointer}
  .filter-toggle .chev{width:14px;height:14px}
  .filter-toggle[aria-expanded="true"] .chev{transform:rotate(180deg)}
  .shop-filters.folded > :not(.filter-toggle){display:none}

  /* Footer reads like an app's "more" screen */
  .fcta{border-radius:24px}
  .fgrid{gap:22px}
}
@media (max-width:420px){.tabbar a span{font-size:.66rem}}

/* Installed as an app (added to home screen) */
@media (display-mode:standalone){
  .install-btn{display:none!important}
  .ann-bar{padding-top:max(9px, env(safe-area-inset-top))}
}
/* Mobile menu sheet: start at the top and scroll when a section is open */
@media (max-width:1240px){
  .site-nav.mega{justify-content:flex-start;overflow-y:auto;overscroll-behavior:contain;padding-top:calc(108px + env(safe-area-inset-top));padding-bottom:calc(40px + env(safe-area-inset-bottom))}
}
