/* Public home page: calm, warm and reassuring */
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Top bar (therapists sign in from here) */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  padding: 0.7rem max(16px, calc((100vw - 1080px) / 2)); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color 0.2s, box-shadow 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--border); box-shadow: 0 4px 18px rgba(30, 40, 40, 0.06); }
.tb-brand { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.tb-brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.tb-links { display: flex; gap: 1.2rem; margin-inline-start: 1rem; }
.tb-links a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.tb-links a:hover { color: var(--primary); }
.tb-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 0.8rem; }
.tb-join { color: var(--primary); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.tb-actions .btn { white-space: nowrap; }
@media (max-width: 760px) { .tb-links { display: none; } }
@media (max-width: 420px) { .tb-join { font-size: 0.8rem; } .tb-brand { font-size: 1rem; } }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; padding: 2.6rem 0 2rem; }
.eyebrow { display: inline-block; margin: 0 0 0.7rem; padding: 0.25rem 0.8rem; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-size: 0.82rem; font-weight: 700; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.45; margin: 0 0 0.8rem; }
.hero h1 span { color: var(--accent); }
.hero-lead { font-size: 1.05rem; line-height: 2.1; color: var(--muted); margin: 0 0 1.3rem; max-width: 34rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.3rem; }
.hero-cta .btn.big { padding: 0.75rem 1.6rem; font-size: 1rem; border-radius: 14px; box-shadow: 0 8px 22px rgba(47, 111, 106, 0.28); }
.hero-points { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; color: var(--muted); font-size: 0.9rem; }
.hero-points li { display: inline-flex; align-items: center; gap: 0.35rem; }
.hero-art { display: grid; justify-items: center; gap: 0.9rem; }
.hero-art > svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 40px rgba(108, 43, 217, 0.22)); }
.art-sun { animation: breathe 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.art-person { animation: float 6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* The picture's two moods: a person under a black rain cloud; after the button, happy (sun, rainbow, colour) */
.mood-on, .mood-off, .mood-sun, .mood-cloud { transition: opacity 0.9s ease, transform 1.1s ease; }
.mood-on, .mood-sun { opacity: 0; }
.mood-rainbow path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s ease 0.3s; }
.mood-rain path { animation: rain 1.1s linear infinite; }
.mood-rain path:nth-child(2) { animation-delay: 0.3s; }
.mood-rain path:nth-child(3) { animation-delay: 0.6s; }
.mood-rain path:nth-child(4) { animation-delay: 0.85s; }
.mood-tear { animation: tear 2.4s ease-in infinite; }
.mood-fly { opacity: 0; }
@keyframes rain { from { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(14px); opacity: 0; } }
@keyframes tear { 0%, 30% { transform: translateY(0); opacity: 1; } 90%, 100% { transform: translateY(12px); opacity: 0; } }
.mood-hint-text { margin: 0; color: var(--accent); font-weight: 700; font-size: 0.92rem; animation: nudge 1.6s ease-in-out infinite; }
.is-happy .mood-hint-text { visibility: hidden; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

.is-happy .mood-on, .is-happy .mood-sun { opacity: 1; }
.is-happy .mood-off { opacity: 0; }
.is-happy .mood-cloud { opacity: 0; transform: translate(170px, -40px); }
.is-happy .mood-rainbow path { stroke-dashoffset: 0; }
.is-happy .mood-fly { opacity: 1; }
.is-happy .mood-fly use { animation: rise 3.2s ease-out infinite; transform-box: fill-box; }
.is-happy .mood-fly use:nth-child(2) { animation-delay: 0.8s; }
.is-happy .mood-fly use:nth-child(3) { animation-delay: 1.6s; }
.is-happy .mood-fly use:nth-child(4) { animation-delay: 2.3s; }
@keyframes rise { 0% { opacity: 0; translate: 0 10px; } 25% { opacity: 1; } 100% { opacity: 0; translate: 0 -60px; } }

.hero-art .mood-btn { position: relative; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 1.4rem; border-radius: 99px; font-size: 0.98rem; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px rgba(255, 90, 54, 0.3); }
.mood-btn svg { width: 1.15em; height: 1.15em; fill: currentColor; }
.mood-btn::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid var(--accent); opacity: 0; animation: ring 2.2s ease-out infinite; pointer-events: none; }
.is-sent .mood-btn::after { animation: none; }
.hero-art.is-happy .mood-btn { background: var(--surface); color: var(--accent); }
@keyframes ring { 0% { opacity: 0.7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18); } }

@media (prefers-reduced-motion: reduce) {
  .art-sun, .art-person, .mood-rain path, .mood-tear, .mood-btn::after, .mood-hint-text, .is-happy .mood-fly use { animation: none; }
  .mood-on, .mood-off, .mood-sun, .mood-cloud, .mood-rainbow path { transition: none; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 1.4rem; gap: 1rem; text-align: center; }
  .hero-art { order: -1; max-width: 320px; margin: 0 auto; }
  .hero-lead { margin-inline: auto; }
  .hero-cta, .hero-points { justify-content: center; }
}

/* Sections */
.section { padding: 2.2rem 0; }
.section h2 { font-size: 1.4rem; margin: 0 0 0.4rem; text-align: center; }
.section-lead { text-align: center; color: var(--muted); max-width: 40rem; margin: 0 auto 1.2rem; line-height: 2; }
.home-search { max-width: 560px; margin: 0 auto 0.8rem; }
.home-search input { min-height: 48px; border-radius: 14px; box-shadow: var(--shadow); font-size: 0.95rem; }
#therapists .dir-cats { justify-content: center; flex-wrap: wrap; overflow: visible; }
.home-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin-top: 1rem; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.2rem; box-shadow: var(--shadow); }
.step h3 { margin: 0.5rem 0 0.3rem; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); line-height: 2; font-size: 0.92rem; }
.step-n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.safety { background: linear-gradient(180deg, transparent, var(--primary-soft) 30%, transparent); border-radius: 28px; }
.safety-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin-top: 1rem; }
.safe { background: var(--surface); border-radius: 16px; padding: 1rem; border: 1px solid var(--border); }
.safe-icon { font-size: 1.5rem; }
.safe h3 { margin: 0.4rem 0 0.25rem; font-size: 0.98rem; }
.safe p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.9; }
@media (max-width: 900px) { .safety-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .safety-grid { grid-template-columns: 1fr; } }
.calm-quote { text-align: center; font-size: 1.1rem; color: var(--primary); margin: 1.6rem 0 0; font-weight: 600; }

.crisis { padding-top: 0.6rem; }
.crisis p { margin: 0; background: var(--warn-soft); color: var(--text); border-radius: 14px; padding: 0.8rem 1rem; line-height: 2; font-size: 0.9rem; text-align: center; }

.home-footer { max-width: 1080px; margin: 1rem auto 0; padding: 1.4rem 16px 2rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; border-top: 1px solid var(--border); }
.home-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.home-footer nav a { color: var(--muted); text-decoration: none; font-size: 0.88rem; }
.home-footer nav a:hover { color: var(--primary); }
.hero-cta .btn { width: auto; flex: none; }

/* Warm, living background: soft cream with gentle glows of peach, sage and lilac */
.home { --warm-bg: var(--bg); }
.home .topbar { background: color-mix(in srgb, var(--warm-bg) 78%, transparent); }
.home .step, .home .safe, .home .dir-card { background: color-mix(in srgb, var(--surface) 88%, transparent); }
.home .safety { background: var(--mint-soft); }

/* "Not recorded": a camera with a slash through it */
.ico-nocam { width: 1.35em; height: 1.35em; vertical-align: -0.2em; color: var(--muted); }
.safe-icon .ico-nocam { width: 1.6rem; height: 1.6rem; color: var(--primary); }

.tb-brand .logo { width: 30px; height: 30px; }
.home .topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
