/* =========================================================================
   PossAbilities Mind — Mental Health First Aid
   Design system v2 · "Organic Biophilic + calm aurora"
   Brand: PossAbilities CIC  ·  "Live The Life You Choose"
   ========================================================================= */

/* Avenir is the brand font (renders on PossAbilities devices). Mulish is a near-identical
   free web fallback so the look holds for the public. No other typeface is used (brand rule). */
@import url('https://fonts.googleapis.com/css2?family=Mulish:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

:root {
  /* ---- Brand (PossAbilities Brand Manual 1.1) ---- */
  --brand-teal:   #5BC3C3;
  --brand-teal-d: #3FA9A9;
  --brand-purple: #40205C;
  --brand-purple-2:#5B3A7E;
  --brand-pink:   #EC008C;

  /* ---- Healing green (primary) ---- */
  --green-900: #0F3D2E;
  --green-700: #1C7A52;
  --green-600: #248A5C;
  --green-500: #34A56F;
  --green-400: #5BBE8C;
  --green-300: #8FD9B6;
  --green-100: #E3F5EC;
  --green-50:  #F1FAF5;

  /* ---- Soft aurora tints (calm, low-sat) ---- */
  --aurora-mint:   #C7EBD7;
  --aurora-teal:   #B6E4E4;
  --aurora-sage:   #DCEBD2;
  --aurora-lilac:  #E0D4F0;
  --aurora-cream:  #FBF7EF;

  /* ---- Crisis ---- */
  --crisis:    #E4572E;
  --crisis-d:  #C2451F;
  --crisis-bg: #FFF1EC;

  /* ---- Neutrals ---- */
  --ink:       #122A20;
  --body:      #38473F;
  --muted:     #61716A;
  --line:      #E5EFE9;
  --line-2:    #EDF4EF;
  --surface:   #FFFFFF;
  --bg:        #F4F9F5;
  --bg-warm:   #FAF8F2;

  /* ---- System ---- */
  --radius:    22px;
  --radius-sm: 14px;
  --radius-lg: 32px;
  --shadow-xs: 0 1px 2px rgba(16,61,46,.06);
  --shadow-sm: 0 2px 8px -2px rgba(16,61,46,.10), 0 1px 3px rgba(16,61,46,.05);
  --shadow:    0 14px 34px -14px rgba(16,61,46,.20), 0 4px 10px -4px rgba(16,61,46,.08);
  --shadow-lg: 0 40px 80px -30px rgba(16,61,46,.34), 0 12px 28px -16px rgba(16,61,46,.18);
  --shadow-glow: 0 24px 60px -18px rgba(52,165,111,.40);
  --ring:      0 0 0 4px rgba(52,165,111,.32);
  --maxw:      1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

body {
  margin: 0;
  font-family: 'Avenir Next','Avenir','Mulish',system-ui,-apple-system,Segoe UI,sans-serif;
  color: var(--body);
  background: var(--bg);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,h2,h3,h4 {
  font-family: 'Avenir Next','Avenir','Mulish',sans-serif;
  color: var(--ink); line-height: 1.08; letter-spacing: -.025em; margin: 0; font-weight: 800;
}
/* Kept as utility hooks but mapped to the brand font — Avenir only, per the brand manual.
   (.serif/.serif-i no longer use a serif typeface; they stay so existing markup needs no edits.) */
.serif { font-family: 'Avenir Next','Avenir','Mulish',sans-serif; letter-spacing: -.02em; }
.serif-i { font-family: 'Avenir Next','Avenir','Mulish',sans-serif; font-style: italic; }

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
::selection { background: var(--green-300); color: var(--green-900); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 44px); position: relative; }
.section { padding-block: clamp(64px, 10vw, 130px); position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--green-700);
  background: var(--green-100); padding: 7px 14px; border-radius: 999px;
}
.lead { font-size: clamp(1.08rem, 1.7vw, 1.3rem); color: var(--muted); max-width: 60ch; line-height: 1.6; }

/* ---------- Atmosphere: mesh + blobs + grain ---------- */
.atmos { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.atmos > * { position: absolute; }
.blob { border-radius: 50%; filter: blur(60px); opacity: .55; }
.blob-mint  { background: radial-gradient(circle, var(--aurora-mint), transparent 70%); }
.blob-teal  { background: radial-gradient(circle, var(--aurora-teal), transparent 70%); }
.blob-lilac { background: radial-gradient(circle, var(--aurora-lilac), transparent 70%); }
.blob-sage  { background: radial-gradient(circle, var(--aurora-sage), transparent 70%); }
@keyframes drift { 0%,100%{ transform: translate(0,0) scale(1); } 33%{ transform: translate(30px,-24px) scale(1.08); } 66%{ transform: translate(-22px,18px) scale(.95); } }
.blob-anim { animation: drift 18s ease-in-out infinite; }
.grain::after {
  content:""; position: absolute; inset: 0; pointer-events: none; opacity: .035; mix-blend-mode: multiply; z-index: 1;
  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='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.wrap, .section > .wrap { z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 700; cursor: pointer; position: relative;
  padding: 15px 28px; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  text-decoration: none; white-space: nowrap; letter-spacing: -.01em;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: #fff; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { text-decoration: none; box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,.7); color: var(--green-700); border-color: var(--line); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--green-300); background: #fff; text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-purple { background: var(--brand-purple); color: #fff; }
.btn-purple:hover { background: var(--brand-purple-2); text-decoration: none; transform: translateY(-2px); }
.btn-crisis { background: linear-gradient(135deg, #F06A40, var(--crisis-d)); color: #fff; box-shadow: 0 14px 30px -10px rgba(228,87,46,.6); }
.btn-crisis:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 20px 40px -10px rgba(228,87,46,.7); }
.btn-lg { padding: 18px 36px; font-size: 1.06rem; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .28s cubic-bezier(.22,1,.36,1), box-shadow .28s ease, border-color .2s ease;
  position: relative;
}
.card-hover { cursor: pointer; }
.card-hover:hover { box-shadow: var(--shadow); border-color: var(--green-300); transform: translateY(-5px); }
/* gradient hairline border accent */
.card-grad { position: relative; }
.card-grad::before {
  content:""; position:absolute; inset:0; border-radius:inherit; padding:1px;
  background: linear-gradient(135deg, var(--green-300), transparent 40%, transparent 60%, var(--brand-teal));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity:.6; pointer-events:none;
}
.glass { background: rgba(255,255,255,.72); backdrop-filter: blur(18px) saturate(1.4); border: 1px solid rgba(255,255,255,.7); box-shadow: var(--shadow); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 800; padding: 5px 12px; border-radius: 999px; letter-spacing: .01em; }
.badge-online { background: var(--green-100); color: var(--green-700); }
.badge-busy   { background: #FFF4E0; color: #9A6A12; }
.badge-off    { background: #EEF1F0; color: #6B7873; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-online { background: var(--green-500); box-shadow: 0 0 0 3px rgba(52,165,111,.25); animation: pulse-dot 2.4s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100%{ box-shadow: 0 0 0 3px rgba(52,165,111,.22); } 50%{ box-shadow: 0 0 0 6px rgba(52,165,111,.06); } }
.dot-busy { background: #E5A53B; }
.dot-off { background: #B6C0BB; }

/* ---------- Navigation ---------- */
.nav { position: sticky; top: 0; z-index: 40; transition: box-shadow .3s ease, background .3s ease; }
.nav-inner {
  display: flex; align-items: center; gap: 22px; height: 70px; margin-top: 14px;
  background: rgba(255,255,255,.7); backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.8); border-radius: 999px; padding: 0 12px 0 20px;
  box-shadow: 0 8px 30px -16px rgba(16,61,46,.28);
}
.nav.scrolled .nav-inner { box-shadow: 0 14px 40px -16px rgba(16,61,46,.34); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 900; color: var(--brand-purple); letter-spacing: -.03em; font-size: 1.12rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--green-400), var(--brand-teal)); color: #fff; flex: none;
  box-shadow: 0 6px 14px -4px rgba(52,165,111,.5); }
.nav-links { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--body); font-weight: 600; padding: 9px 15px; border-radius: 999px; font-size: .95rem; transition: all .18s ease; }
.nav-links a:hover { background: var(--green-50); color: var(--green-700); text-decoration: none; }
.nav-links a.active { color: var(--green-700); background: var(--green-100); }
.nav-cta { display: flex; gap: 9px; align-items: center; }
.nav-toggle { display: none; background: #fff; border: 1px solid var(--line); border-radius: 999px; width: 46px; height: 46px; cursor: pointer; }

.mob-cta { display: none; }
@media (max-width: 940px) {
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 92px; left: 12px; right: 12px;
    background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 14px; gap: 5px; box-shadow: var(--shadow-lg);
  }
  .nav-links.open a { width: 100%; }
  .nav-links.open .mob-cta { display: flex; justify-content: center; width: 100%; margin-top: 4px;
    padding: 14px 20px; border-radius: 999px; font-weight: 800; }
  .nav-links.open a.mob-cta-primary { background: linear-gradient(135deg,var(--green-500),var(--green-700)); color: #fff; }
  .nav-links.open .mob-cta-crisis { background: linear-gradient(135deg,#F06A40,var(--crisis-d)); color: #fff; border: none; cursor: pointer; font: inherit; font-weight: 800; }
}

/* ---------- Footer ---------- */
.footer { background: linear-gradient(160deg, #3A1D52, #271038); color: #D9CEE6; margin-top: 50px; position: relative; overflow: hidden; }
.footer a { color: #EBE3F3; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 44px; padding-block: 72px; position: relative; z-index: 1; }
.footer h4 { color: #fff; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 17px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-block: 24px; font-size: .85rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
@media (max-width: 760px){ .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; } }

/* ---------- Chips ---------- */
.chip { display:inline-flex; align-items:center; gap:7px; padding:9px 17px; border-radius:999px; background:rgba(255,255,255,.8); border:1px solid var(--line); font-weight:700; font-size:.9rem; color:var(--body); cursor:pointer; transition: all .18s ease; backdrop-filter: blur(6px); }
.chip:hover { border-color: var(--green-300); color: var(--green-700); transform: translateY(-1px); }
.chip.active { background: linear-gradient(135deg, var(--green-500), var(--green-700)); color:#fff; border-color: transparent; box-shadow: 0 8px 18px -8px rgba(52,165,111,.6); }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display:grid; place-items:center; font-weight:800; }
.avatar-ring { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--green-300); }
.avatar-stack { display: flex; }
.avatar-stack > * { margin-left: -12px; box-shadow: 0 0 0 3px #fff; }
.avatar-stack > *:first-child { margin-left: 0; }

/* ---------- Emergency floating button ---------- */
.sos {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  display: inline-flex; align-items: center; gap: 11px;
  background: linear-gradient(135deg, #F06A40, var(--crisis-d)); color: #fff; font-weight: 800;
  padding: 16px 24px; border-radius: 999px; border: none; cursor: pointer;
  box-shadow: 0 16px 38px -10px rgba(228,87,46,.7);
  transition: transform .22s ease, box-shadow .22s ease;
}
.sos:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 22px 46px -10px rgba(228,87,46,.8); }
.sos:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(228,87,46,.4); }
.sos::before { content:""; position:absolute; inset:0; border-radius:999px; border:2px solid #F06A40; animation: sos-ring 2.6s ease-out infinite; }
@keyframes sos-ring { 0%{ transform: scale(1); opacity:.6 } 100%{ transform: scale(1.6); opacity:0 } }
@media (max-width: 600px){ .sos span.sos-text { display:none; } .sos { padding: 16px; } }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(10,30,22,.5); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; animation: fade .2s ease; }
.modal { background: #fff; border-radius: var(--radius-lg); max-width: 560px; width: 100%; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .3s cubic-bezier(.22,1,.36,1); }
@keyframes fade { from{opacity:0} to{opacity:1} }
@keyframes pop { from{opacity:0; transform: translateY(16px) scale(.97)} to{opacity:1; transform:none} }

/* ---------- Breathing orb ---------- */
.breathe { width: 92px; height: 92px; border-radius: 50%; margin: 6px auto 2px; position: relative;
  background: radial-gradient(circle at 35% 30%, var(--green-300), var(--green-600));
  box-shadow: 0 0 0 0 rgba(52,165,111,.4); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%,100%{ transform: scale(.68); box-shadow: 0 0 0 0 rgba(52,165,111,.35); } 50%{ transform: scale(1); box-shadow: 0 0 40px 12px rgba(52,165,111,.18); } }

/* ---------- Chat ---------- */
.bubble { max-width: 80%; padding: 12px 16px; border-radius: 18px; font-size: .95rem; line-height: 1.5; box-shadow: var(--shadow-xs); }
.bubble-them { background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble-me { background: linear-gradient(135deg, var(--green-500), var(--green-700)); color: #fff; border-bottom-right-radius: 6px; margin-left: auto; }
.typing span { width:7px; height:7px; background: var(--green-500); border-radius:50%; display:inline-block; animation: typing 1.2s infinite; }
.typing span:nth-child(2){ animation-delay:.2s } .typing span:nth-child(3){ animation-delay:.4s }
@keyframes typing { 0%,60%,100%{ transform: translateY(0); opacity:.4 } 30%{ transform: translateY(-5px); opacity:1 } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s } .reveal.d2 { transition-delay: .16s } .reveal.d3 { transition-delay: .24s } .reveal.d4 { transition-delay: .32s }

/* ---------- Section curve divider ---------- */
.curve-top { display:block; width:100%; height:60px; margin-bottom:-1px; }

/* ---------- Utility ---------- */
.grid { display: grid; gap: clamp(18px, 2.4vw, 30px); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px){ .cols-3,.cols-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px){ .cols-2,.cols-3,.cols-4 { grid-template-columns: 1fr; } }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.muted { color: var(--muted); }
.tag-soft { background: var(--green-100); color: var(--green-700); border-radius: 999px; padding: 5px 13px; font-size:.78rem; font-weight:800; display:inline-block; letter-spacing:.01em; }
.icon { width: 24px; height: 24px; stroke-width: 1.8; }
.feature-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--green-100), #fff); color: var(--green-700); flex: none; box-shadow: inset 0 0 0 1px var(--line), 0 8px 16px -10px rgba(52,165,111,.4); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.stars { color: #F0A93B; letter-spacing: 2px; }

/* ---------- Warm, human, image-led sections ---------- */
/* Soft photo frames — swap the inner SVG for a real <img> when you have photography. */
.photo { position: relative; border-radius: var(--radius-lg); overflow: hidden; display: grid; place-items: center; aspect-ratio: 4 / 3; box-shadow: 0 18px 40px -22px rgba(16,61,46,.28); }
.photo .art { width: 60%; height: 60%; position: relative; z-index: 1; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-a   { background: linear-gradient(150deg,#FBE9DA,#E4F5EC); color: var(--green-700); }
.photo-b   { background: linear-gradient(150deg,#DDF2F2,#EAF6F0); color: var(--brand-teal-d); }
.photo-c   { background: linear-gradient(150deg,#EAE2F3,#F3ECF8); color: var(--brand-purple); }
.photo-why { background: linear-gradient(150deg,#FBE9DA,#DDF2F2); color: var(--green-700); aspect-ratio: 5 / 4; }
.photo .p-blob { position: absolute; border-radius: 50%; filter: blur(34px); opacity: .55; z-index: 0; }

.steps-warm { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 60px); }
.step-warm .photo { margin-bottom: 24px; }
.step-warm h3 { font-size: 1.3rem; margin: 0 0 8px; }
@media (max-width: 820px){ .steps-warm { grid-template-columns: 1fr; gap: 44px; max-width: 440px; margin-inline: auto; } }

.why-warm { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(38px, 5vw, 76px); align-items: center; }
.benefit-row { display: flex; gap: 17px; align-items: flex-start; padding: 20px 0; border-bottom: 1px solid var(--line); }
.benefit-row:last-of-type { border-bottom: 0; padding-bottom: 4px; }
.benefit-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; }
@media (max-width: 820px){ .why-warm { grid-template-columns: 1fr; gap: 32px; } .why-warm .photo-why { order: -1; } }

/* ---------- PWA install banner ---------- */
.install-banner { position: fixed; top: 90px; left: 16px; right: 16px; z-index: 45; max-width: 480px; margin-inline: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 13px 14px; display: none; align-items: center; gap: 13px; }
.install-banner.show { display: flex; animation: pop .3s cubic-bezier(.22,1,.36,1); }
.install-banner .ib-ic { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--green-400), var(--brand-teal)); box-shadow: 0 6px 14px -5px rgba(52,165,111,.5); }
.install-banner .ib-x { background: none; border: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; flex: none; }
.install-banner .ib-x:hover { background: var(--bg); color: var(--ink); }
@media (max-width: 600px){ .install-banner { left: 12px; right: 12px; top: 84px; } }

/* ---------- Page-level two-column grids → stack ---------- */
@media (max-width: 900px){
  .hero-grid, #talk-grid, #ben-grid, #news-grid, .stack-md { grid-template-columns: 1fr !important; }
  #talk-grid .card[style*="sticky"] { position: static !important; }
}
