/* ===================================================================
   SeniorCareApps.com — App Store
   Layout & style modeled on the go-alis.com/app-store reference.
   =================================================================== */

:root {
  --ink:        #1b1c24;   /* dark header / footer            */
  --ink-2:      #101119;   /* darker band                     */
  --orange:     #f26a21;   /* primary accent (CTA, highlights)*/
  --orange-dk:  #d8560f;
  --blue:       #35a9db;   /* filter pills / secondary accent */
  --blue-dk:    #2b8fbb;
  --bg:         #f4f5f7;   /* page background                 */
  --card:       #ffffff;
  --line:       #e6e8ec;
  --text:       #2a2b33;
  --muted:      #6b7280;
  --shadow:     0 1px 2px rgba(16,17,25,.06), 0 6px 18px rgba(16,17,25,.06);
  --radius:     14px;
  --wrap:       1200px;
}

*,*::before,*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3 { font-family: "Poppins", "Inter", system-ui, sans-serif; line-height: 1.2; margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / nav ------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  color: #fff;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand .brand-txt { font-family: "Poppins", sans-serif; font-size: 18px; letter-spacing: .2px; color: #fff; }
.brand .brand-txt b { color: var(--orange); font-weight: 700; }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  color: #e7e8ee; text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 6px 0; transition: color .15s;
}
.site-nav a:hover { color: #fff; }
.site-nav a.is-current { color: #fff; }

.btn {
  display: inline-block; font-weight: 600; font-size: 14px; line-height: 1;
  padding: 12px 20px; border-radius: 6px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dk); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-outline:hover { border-color: #fff; }

.nav-toggle {
  display: none; background: none; border: 0; color: #fff; cursor: pointer;
  padding: 8px; margin: -8px -8px -8px 4px;
}
.nav-toggle svg { width: 26px; height: 26px; }

/* ---------- Title band -------------------------------------------- */
.title-band {
  background: var(--ink-2);
  color: #fff;
  text-align: center;
  padding: 42px 0 40px;
}
.title-band h1 { font-size: clamp(28px, 4.5vw, 44px); font-weight: 700; }
.title-band h1 b { color: var(--orange); font-weight: 700; }

/* ---------- Intro card -------------------------------------------- */
.intro {
  max-width: 760px; margin: -26px auto 34px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 30px 32px; text-align: center;
  position: relative; z-index: 2;
}
.intro h2 { font-size: 22px; margin-bottom: 8px; }
.intro p { color: var(--muted); margin: 0 auto 18px; max-width: 620px; }
.intro .intro-cta { font-weight: 600; color: var(--blue-dk); text-decoration: none; font-size: 15px; }
.intro .intro-cta:hover { text-decoration: underline; }

/* ---------- Filter bar -------------------------------------------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 0 auto 30px; max-width: 980px;
}
.filter-pill {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.filter-pill:hover { border-color: var(--blue); color: var(--blue-dk); }
.filter-pill.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- App grid (flip cards) --------------------------------- */
.app-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  margin-bottom: 20px;
}
.app-card {
  perspective: 1200px;
  min-height: 210px;
  outline: none;
}
.app-card.is-hidden { display: none; }

.flip {
  position: relative; width: 100%; height: 100%; min-height: 210px;
  transition: transform .6s cubic-bezier(.4,.15,.15,1);
  transform-style: preserve-3d;
}
.app-card:hover .flip,
.app-card:focus-within .flip,
.app-card.is-flipped .flip { transform: rotateY(180deg); }

.face {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 22px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}

/* front */
.face.front .logo {
  width: 66px; height: 66px; border-radius: 16px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Poppins", sans-serif; font-weight: 700; font-size: 24px; color: #fff;
  background: linear-gradient(135deg, var(--c1, #35a9db), var(--c2, #2b8fbb));
  box-shadow: 0 6px 16px rgba(16,17,25,.12);
}
.face.front h3 { font-size: 18px; margin-bottom: 6px; color: var(--ink); }
.face.front .cat { font-size: 12px; font-weight: 600; letter-spacing: .3px; color: var(--muted); text-transform: uppercase; }
.face.front .flip-hint { margin-top: 14px; font-size: 12px; color: var(--blue-dk); font-weight: 600; opacity: .85; }

/* back */
.face.back {
  transform: rotateY(180deg);
  background: var(--ink);
  border-color: var(--ink);
  color: #eef0f4;
}
.face.back h3 { font-size: 16px; color: #fff; margin-bottom: 8px; font-family:"Poppins",sans-serif; }
.face.back p { font-size: 14px; color: #c9ccd6; margin: 0 0 18px; }
.btn-more {
  display: inline-block; background: var(--orange); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 13px; padding: 10px 18px; border-radius: 6px;
  transition: background .15s;
}
.btn-more:hover { background: var(--orange-dk); }

.no-results { text-align: center; color: var(--muted); padding: 30px 0 10px; display: none; }
.no-results.show { display: block; }

/* count line */
.count-line { text-align: center; color: var(--muted); font-size: 14px; margin: 6px 0 46px; }

/* ---------- CTA band ---------------------------------------------- */
.cta-band {
  background: var(--orange); color: #fff; text-align: center;
  padding: 46px 0;
}
.cta-band h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 10px; }
.cta-band p { margin: 0 auto 22px; max-width: 560px; color: #fff8f3; }
.cta-band .btn-white { background: #fff; color: var(--orange-dk); }
.cta-band .btn-white:hover { background: #fdece2; }

/* ---------- Footer ------------------------------------------------ */
.site-footer { background: var(--ink); color: #b9bcc6; padding: 46px 0 30px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 40px 60px; justify-content: space-between; }
.footer-brand { max-width: 300px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { font-size: 14px; color: #9a9dab; }
.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h4 { font-family: "Poppins", sans-serif; color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 12px; }
.footer-col a { display: block; color: #b9bcc6; text-decoration: none; font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); margin-top: 34px; padding-top: 20px;
  font-size: 13px; color: #8b8e9b; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
}

/* ---------- Profile (stub) pages ---------------------------------- */
.profile { padding: 50px 0 40px; }
.profile .back-link { display: inline-block; color: var(--blue-dk); text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 24px; }
.profile .back-link:hover { text-decoration: underline; }
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 8px; }
.profile-head .logo {
  width: 78px; height: 78px; border-radius: 18px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: "Poppins", sans-serif; font-weight: 700; font-size: 28px; color: #fff;
  background: linear-gradient(135deg, var(--c1, #35a9db), var(--c2, #2b8fbb));
}
.profile-head h1 { font-size: 30px; color: var(--ink); }
.profile-head .cat { font-size: 12px; font-weight: 600; letter-spacing: .3px; color: var(--muted); text-transform: uppercase; }
.profile .lede { font-size: 18px; color: var(--text); max-width: 720px; margin: 18px 0 26px; }
.profile .stub-note {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: 10px; padding: 18px 22px; color: var(--muted); max-width: 720px;
}

/* ---------- Responsive -------------------------------------------- */
@media (max-width: 900px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .site-nav {
    position: absolute; top: 64px; left: 0; right: 0; background: var(--ink);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 18px;
    display: none; border-top: 1px solid rgba(255,255,255,.1);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
  .site-nav .btn { text-align: center; margin-top: 10px; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 520px) {
  .app-grid { grid-template-columns: 1fr; }
  .intro { padding: 24px 20px; }
  .footer-cols { gap: 30px; }
}

/* Devices without hover: disable hover-flip so tap-flip (JS) governs */
@media (hover: none) {
  .app-card:hover .flip { transform: none; }
  .app-card.is-flipped .flip { transform: rotateY(180deg); }
}
