/* My LOOP Coach: shared contemporary layer for the hub pages (family/*.html), loaded after each page's own <style>.
   Sticky glass header, fluid type, motion (reveals, chat replay, count-up), and phone-first layouts.
   Every animation is off under prefers-reduced-motion, and nothing is hidden unless modern.js has run (html.mx). */

:root { --ease: cubic-bezier(.2, .8, .2, 1); --glow: 0 30px 60px -30px rgba(10,106,70,.55) }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
  background-color: var(--bg, #f8fafc);
  background-image: radial-gradient(60rem 36rem at 105% -8%, rgba(123,224,74,.20), transparent 60%), radial-gradient(50rem 32rem at -12% -6%, rgba(10,106,70,.10), transparent 60%);
  background-repeat: no-repeat }
::selection { background: #d9f99d; color: #033d2b }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--loop, #7be04a) 70%, #0a6a46); outline-offset: 2px; border-radius: 8px }

/* ---------- Sticky glass header (works whether the nav sits in .container or straight in body) ---------- */
body > .container:has(> .nav), body > nav.nav { position: sticky; top: 0; z-index: 60 }
body > .container:has(> .nav)::before, body > nav.nav::before { content: ""; position: absolute; inset: 0 50%; width: 100vw; transform: translateX(-50%); z-index: -1;
  background: color-mix(in srgb, var(--bg, #f8fafc) 72%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .25s, background .25s, box-shadow .25s }
html.scrolled body > .container:has(> .nav)::before, html.scrolled body > nav.nav::before { border-bottom-color: rgba(15,23,42,.07); box-shadow: 0 10px 30px -24px rgba(15,23,42,.35) }
.nav { transition: padding .25s var(--ease) } html.scrolled .nav { padding-block: 10px }
.wordmark { white-space: nowrap; letter-spacing: -.02em }
.wordmark .m { box-shadow: 0 8px 18px -8px rgba(10,106,70,.7), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .4s var(--ease) }
.wordmark:hover .m { transform: rotate(-8deg) scale(1.06) }
.nav a { white-space: nowrap }
.nav .links a:not(.btn), .nav a.link { position: relative }
.nav .links a:not(.btn)::after, .nav a.link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 2px; background: var(--deep, #0a6a46); transform: scaleX(0); transition: transform .25s var(--ease) }
.nav .links a:not(.btn):hover::after, .nav a.link:hover::after { transform: scaleX(1) }

/* ---------- Buttons: richer, tactile ---------- */
.btn { position: relative; isolation: isolate; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s }
.btn.primary { background: linear-gradient(135deg, #0c7a50, var(--deep, #0a6a46) 55%, #075437) }
.btn.primary::after, .btn.lime::after, .btn.gold::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease) }
.btn.primary:hover::after, .btn.lime:hover::after, .btn.gold:hover::after { transform: translateX(120%) }
.btn:active { transform: translateY(0) scale(.98) }
.btn.ghost:hover { border-color: #cbd5e1; transform: translateY(-2px); box-shadow: 0 12px 26px -18px rgba(15,23,42,.45) }
.btn.lime { box-shadow: 0 16px 34px -14px rgba(123,224,74,.75) } .btn.lime:hover { transform: translateY(-2px) }

/* ---------- Type ---------- */
h1 { text-wrap: balance } h2, h3 { text-wrap: balance } p { text-wrap: pretty }
.intro h1 span, header.hero h1 span, .card h1 span {
  background: linear-gradient(100deg, #0a6a46 0%, #13a36a 35%, #0a6a46 65%, #0f8a5a 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: mx-sheen 8s ease-in-out infinite }
@keyframes mx-sheen { 0%, 100% { background-position: 0% 50% } 50% { background-position: 100% 50% } }
.eyebrow { box-shadow: 0 6px 16px -12px rgba(10,106,70,.6) }

/* ---------- Cards: lift + soft glow on hover (pointer devices only) ---------- */
@media (hover: hover) {
  .benefit, .step, .day, .plan, .get, .faq details { transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s }
  .benefit:hover, .day:hover, .get:hover { transform: translateY(-4px); border-color: #bbf7d0; box-shadow: var(--glow) }
  .plan:hover { transform: translateY(-4px); box-shadow: 0 34px 70px -40px rgba(15,23,42,.45) }
  .benefit:hover .ic, .get:hover .ic { transform: scale(1.08) rotate(-4deg) }
}
.benefit .ic, .get .ic { transition: transform .35s var(--ease); background: linear-gradient(135deg, #ecfdf3, #d9f99d) }

/* ---------- Scroll reveal (only once modern.js marks html.mx) ---------- */
html.mx [data-rv] { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms) }
html.mx [data-rv].in { opacity: 1; transform: none }

/* ---------- Hero chat: messages replay, with a typing dot ---------- */
html.mx .chat .msg.mx-wait { opacity: 0; transform: translateY(10px) scale(.98) }
.chat .msg { transition: opacity .45s var(--ease), transform .45s var(--ease) }
.mx-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: .8em 1em; background: #fff; border: 1px solid var(--line, #e2e8f0); border-radius: 16px; border-top-left-radius: 6px }
.mx-typing i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: mx-dot 1s infinite ease-in-out } .mx-typing i:nth-child(2) { animation-delay: .15s } .mx-typing i:nth-child(3) { animation-delay: .3s }
@keyframes mx-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5 } 40% { transform: translateY(-4px); opacity: 1 } }
.chat { position: relative } .chat .head .on::first-letter { animation: mx-pulse 1.8s infinite }
@keyframes mx-pulse { 50% { opacity: .35 } }
@media (min-width: 901px) { .hero .chat { transform: perspective(1400px) rotateY(-6deg) rotateX(2deg); transition: transform .6s var(--ease) } .hero .chat:hover { transform: none } }

/* ---------- Stat strip: floating glass tiles ---------- */
.strip { background: transparent; border: 0; padding: 8px 0 18px }
.strip .row { gap: 14px }
.strip .row > div { background: rgba(255,255,255,.75); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--line, #e2e8f0); border-radius: 20px; padding: 18px 10px; box-shadow: 0 20px 40px -32px rgba(15,23,42,.4) }
.strip b { background: linear-gradient(135deg, #0a6a46, #22b573); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: clamp(1.6rem, 4vw, 2.2rem); font-variant-numeric: tabular-nums }
.strip small { display: block; line-height: 1.35; font-size: .84rem }

/* ---------- Pricing ---------- */
.plan.pop { background: linear-gradient(180deg, #f0fdf4, #fff 40%); border-color: transparent; box-shadow: 0 0 0 2px var(--deep, #0a6a46), 0 34px 70px -36px rgba(10,106,70,.6) }
.plan .price { letter-spacing: -.03em } .plan .price small { font-family: var(--font-body); letter-spacing: 0; font-size: .95rem }

/* ---------- Final CTA: drifting glow ---------- */
.final .box, .end { position: relative; overflow: hidden; isolation: isolate }
.final .box::before, .end::before { content: ""; position: absolute; width: 420px; height: 420px; left: -120px; bottom: -220px; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(123,224,74,.35), transparent 65%); animation: mx-drift 12s ease-in-out infinite alternate }
@keyframes mx-drift { to { transform: translate(60vw, -120px) } }

/* ---------- FAQ: smoother ---------- */
.faq summary::-webkit-details-marker { display: none } .faq details[open] { border-color: #bbf7d0; box-shadow: 0 16px 36px -30px rgba(10,106,70,.6) }
.faq summary::after { transition: transform .25s var(--ease) } .faq details[open] summary::after { transform: rotate(180deg) }

/* ---------- Area pills ---------- */
.areas > a:not(.area) { transition: transform .2s var(--ease), border-color .2s, color .2s, box-shadow .2s } .areas > a:not(.area):hover { transform: translateY(-2px); box-shadow: 0 10px 22px -16px rgba(10,106,70,.6) }

/* ---------- Phone sticky CTA (sales page; modern.js adds it) ---------- */
.mx-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 18px;
  background: rgba(3,61,43,.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; box-shadow: 0 20px 40px -16px rgba(3,61,43,.7);
  transform: translateY(140%); transition: transform .35s var(--ease) }
.mx-bar.on { transform: none } .mx-bar small { line-height: 1.25; font-size: .76rem; color: #cfe9dc; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis } .mx-bar small b { display: block; color: #fff; font-family: var(--font-head); font-size: .9rem }
.mx-bar .btn { margin-left: auto; padding: .7em 1.1em; font-size: .92rem; flex: none }
@media (min-width: 761px) { .mx-bar { display: none } }

/* ---------- Swipe rows (phones): benefits, the 7 days, quiz "what you get" ---------- */
.mx-dots { display: none }
@media (max-width: 760px) {
  .benefits, .days, .gets { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin-inline: -16px; padding: 6px 16px 14px; scroll-padding-inline: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch }
  .benefits::-webkit-scrollbar, .days::-webkit-scrollbar, .gets::-webkit-scrollbar { display: none }
  .benefits > *, .gets > * { flex: 0 0 82%; scroll-snap-align: start; min-height: 0 }
  .days > * { flex: 0 0 62%; scroll-snap-align: start; min-height: 150px }
  .mx-dots { display: flex; justify-content: center; gap: 6px; margin-top: 4px }
  .mx-dots i { width: 7px; height: 7px; border-radius: 99px; background: #cbd5e1; transition: width .3s var(--ease), background .3s }
  .mx-dots i.on { width: 22px; background: var(--deep, #0a6a46) }
}

/* ---------- Phones: header, hero and spacing ---------- */
@media (max-width: 760px) {
  .nav { padding: 12px 0; gap: 10px }
  .wordmark { font-size: 1.04rem; gap: 7px } .wordmark .m { width: 30px; height: 30px; border-radius: 9px; font-size: .9rem }
  .nav .links { gap: 12px } .nav a.link, .nav .links a { font-size: .86rem }
  .nav .btn.small { padding: .55em .85em; font-size: .8rem; border-radius: 11px }
  .nav > span[style*="gap:20px"] { gap: 14px !important }

  body > section { padding: 52px 0 }
  h2 { font-size: clamp(1.6rem, 7.2vw, 2rem) } h2 br { display: none }
  .lead { font-size: 1.02rem !important }

  header.hero { padding: 18px 0 40px } header.hero .grid { gap: 30px }
  header.hero .grid h1 { font-size: clamp(2.3rem, 11vw, 2.9rem); letter-spacing: -.035em }
  header.hero p.lead { font-size: 1.04rem !important; margin-bottom: 20px }
  header.hero .ctas { flex-direction: column } .hero .ctas .btn { width: 100%; padding-block: 1em }
  header.hero .assure { gap: 8px; justify-content: center } .hero .assure span { background: #fff; border: 1px solid var(--line, #e2e8f0); border-radius: 999px; padding: .3em .8em; font-size: .8rem }
  .chat .body { padding: 14px } .msg { font-size: .9rem }

  .steps { gap: 0; margin-top: 26px; position: relative }
  .step { background: none; border: 0; border-radius: 0; padding: 0 0 22px 52px } .step::before { top: 0; left: 0; width: 36px; height: 36px; box-shadow: 0 0 0 6px #fff }
  .step:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; background: linear-gradient(#bbf7d0, #e2e8f0) }
  .step h3 { margin-top: 4px }
  .how p .btn, #challenge .btn, .final .btn { width: 100% }
  .how p[style*="flex"] { flex-direction: column }

  .plans { display: flex !important; flex-direction: column; gap: 22px } .plan.pop { order: -1 }
  .compare th, .compare td { padding: 10px 8px !important; font-size: .82rem !important } .compare td:first-child { font-size: .78rem !important }
  .areas > a:not(.area) { font-size: .86rem; padding: .5em .85em }
  .honest { padding: 18px } .faq details { padding: 2px 16px } .faq summary { font-size: .97rem }
  .final .box { padding: 40px 20px; border-radius: 24px }
  footer { padding-bottom: 96px }
}
@media (max-width: 380px) { .wordmark { font-size: 1rem } .nav .links a:not(.btn) { display: none } }

/* ---------- Reduced motion: everything still, everything visible ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important }
  html.mx [data-rv], html.mx .chat .msg.mx-wait { opacity: 1 !important; transform: none !important }
}
