/* ===== A New Beginning Home Care Agency ===== */

:root{
  --purple-dark:#3f1650;
  --purple:#6f2d86;
  --purple-mid:#8a3fa3;
  --purple-light:#b57bcb;
  --purple-pale:#f5eef8;
  --ink:#241826;
  --cream:#faf8f6;
  --white:#ffffff;
  --gray:#6b6470;
  --shadow: 0 20px 50px rgba(63,22,80,.15);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Poppins", "Segoe UI", Arial, sans-serif;
  --body: "Inter", "Segoe UI", Arial, sans-serif;
}

*,*::before,*::after{ box-sizing:border-box; }
html{
  scroll-behavior:smooth;
  -webkit-text-size-adjust:100%;
  overflow-x:hidden;
  overflow-x:clip;
}
body{
  margin:0;
  font-family:var(--body);
  color:var(--ink);
  background:var(--cream);
  overflow-x:hidden;
  overflow-x:clip;
}
@media (prefers-reduced-motion:reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
ul{ list-style:none; margin:0; padding:0; }
h1,h2,h3,h4{ font-family:var(--sans); font-weight:800; margin:0 0 .5em; line-height:1.12; letter-spacing:-.015em; }
p{ line-height:1.7; color:var(--gray); }
.eyebrow{
  display:inline-block;
  font-family:var(--sans);
  font-weight:700;
  letter-spacing:.2em;
  text-transform:uppercase;
  font-size:.75rem;
  color:var(--purple-mid);
  margin-bottom:1rem;
}
.section{ padding:7rem 6vw; }
.section-narrow{ max-width:1180px; margin:0 auto; }
.section-head{ text-align:center; max-width:700px; margin:0 auto 4rem; }
.section-head h2{ font-size:clamp(2rem,4vw,3rem); text-transform:uppercase; }
.section-head p{ font-size:1.05rem; }
.bg-pale{ background:var(--purple-pale); }
.bg-dark{ background:var(--purple-dark); color:var(--white); }
.bg-dark p{ color:#ddc9e6; }
.bg-dark h2{ color:var(--white); }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  gap:.6rem;
  padding:1rem 2.2rem;
  border-radius:2px;
  font-family:var(--sans);
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:.8rem;
  border:2px solid transparent;
  cursor:pointer;
  transition:background .2s ease, color .2s ease, transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s ease;
}
.btn:active{ transform:translateY(0) scale(.985); }
.btn-primary{ background:var(--purple); color:var(--white); }
.btn-primary{ box-shadow:0 2px 10px rgba(63,22,80,.18); }
.btn-primary:hover{ background:var(--purple-dark); transform:translateY(-2px); box-shadow:0 10px 26px rgba(63,22,80,.30); }
.btn-outline{ border-color:var(--white); color:var(--white); }
.btn-outline:hover{ background:var(--white); color:var(--purple-dark); }
.btn-outline-dark{ border-color:var(--purple); color:var(--purple); }
.btn-outline-dark:hover{ background:var(--purple); color:var(--white); }

/* ---------- Top bar ---------- */
.topbar{
  background:var(--purple-dark);
  color:#e9d9ef;
  font-size:.8rem;
  padding:.55rem 6vw;
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:.5rem;
}
.topbar a{ color:#e9d9ef; }
.topbar span{ margin-right:1.6rem; }
.topbar svg{ width:13px; height:13px; margin-right:.4rem; vertical-align:-2px; }

/* ---------- Nav ---------- */
.site-header{
  position:sticky; top:0; z-index:200;
  background:var(--white);
  box-shadow:0 2px 18px rgba(0,0,0,.06);
}
.nav-wrap{
  display:flex; align-items:center; justify-content:space-between;
  padding:.7rem 6vw;
  max-width:1440px; margin:0 auto;
}
.brand{ display:flex; align-items:center; gap:.75rem; }
.brand img{ height:64px; width:auto; }
.brand-text{ font-family:var(--sans); line-height:1.1; }
.brand-text strong{ display:block; font-size:1rem; color:var(--purple-dark); letter-spacing:.03em; }
.brand-text small{ font-size:.65rem; letter-spacing:.15em; color:var(--gray); text-transform:uppercase; }

.nav-links{ display:flex; gap:1.6rem; }
.nav-links a{
  font-family:var(--sans); font-weight:600; font-size:.78rem;
  letter-spacing:.06em; text-transform:uppercase; color:var(--ink);
  position:relative; padding:.3rem 0; white-space:nowrap;
}
.nav-links a::after{
  content:""; position:absolute; left:0; bottom:0; height:2px; width:0;
  background:var(--purple); transition:.25s ease;
}
.nav-links a:hover::after, .nav-links a.active::after{ width:100%; }
.nav-links a.active{ color:var(--purple); }


.nav-cta{ display:flex; align-items:center; gap:1rem; }
.nav-cta .btn{ padding:.8rem 1.5rem; white-space:nowrap; }
.nav-call{ display:none; }
.nav-call svg{ width:15px; height:15px; }

/* 44px tap targets; bars are centred so the X crosses dead-centre */
.hamburger, .menu-close{
  position:relative; flex:none;
  width:44px; height:44px; padding:0;
  background:transparent; border:0; border-radius:50%; cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:background-color .25s ease;
}
.hamburger{ display:none; margin-right:-6px; }
@media (hover:hover){ .hamburger:hover{ background:var(--purple-pale); } }
.hamburger span, .menu-close span{
  position:absolute; left:11px; top:21px; width:22px; height:2px;
  background:var(--purple-dark); border-radius:2px;
}
.hamburger span:nth-child(1){ transform:translateY(-7px); }
.hamburger span:nth-child(3){ transform:translateY(7px); }

/* Sits where the hamburger was, on the purple overlay */
.menu-close{ position:absolute; top:1.1rem; right:calc(5vw - 6px); }
@media (hover:hover){ .menu-close:hover{ background:rgba(255,255,255,.12); } }
.menu-close span{ background:var(--white); }
.menu-close span:nth-child(1){ transform:rotate(45deg); }
.menu-close span:nth-child(2){ transform:rotate(-45deg); }
.mobile-menu :focus-visible{ outline-color:#fff; }

.mobile-menu{
  position:fixed; inset:0; background:var(--purple-dark);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:1.6rem; transform:translateY(-100%); z-index:300;
  /* hidden when closed so its links can't be tabbed to off-screen */
  visibility:hidden; transition:transform .4s ease, visibility 0s .4s;
}
.mobile-menu.open{ transform:translateY(0); visibility:visible; transition:transform .4s ease; }
.mobile-menu a{
  font-family:var(--sans); font-size:1.6rem; font-weight:700; color:var(--white);
  text-transform:uppercase; letter-spacing:.06em;
}
.mobile-menu a:hover{ color:var(--purple-light); }

/* ---------- Hero ---------- */
.hero{
  position:relative;
  min-height:92vh;
  min-height:92dvh;
  display:flex; align-items:center; justify-content:center;
  text-align:center;
  color:var(--white);
  background-size:cover; background-position:center;
  overflow:hidden;
}
.hero::before{
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(125% 95% at 50% 52%, rgba(20,8,26,.26) 0%, rgba(20,8,26,.72) 100%),
    linear-gradient(180deg, rgba(63,22,80,.52) 0%, rgba(63,22,80,.30) 45%, rgba(20,8,26,.82) 100%);
}
.hero-inner{ position:relative; z-index:2; max-width:900px; padding:0 5vw; animation:heroIn .9s ease-out both; }
@keyframes heroIn{ from{ opacity:0; transform:translateY(30px); } to{ opacity:1; transform:none; } }
.hero-inner .eyebrow{ color:var(--purple-light); }
.hero-inner h1{
  font-size:clamp(2.4rem,6vw,4.6rem);
  text-transform:uppercase;
  letter-spacing:.01em;
  margin-bottom:1rem;
}
.hero-inner p{ color:#e9d9ef; font-size:1.15rem; max-width:620px; margin:0 auto 2.2rem; }
.hero-btns{ display:flex; gap:1rem; justify-content:center; flex-wrap:wrap; }
.scroll-cue{
  position:absolute; bottom:2rem; left:50%; transform:translateX(-50%);
  z-index:2; color:var(--white); opacity:.8;
  animation:bob 2s infinite;
  font-size:1.6rem;
}
@keyframes bob{ 0%,100%{ transform:translate(-50%,0);} 50%{ transform:translate(-50%,10px);} }

.hero-sm{ min-height:52vh; min-height:52dvh; }
.hero-sm h1{ font-size:clamp(2rem,5vw,3.2rem); }

/* ---------- Cards ---------- */
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:2.2rem; }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:3rem; align-items:center; }
.card{
  background:var(--white);
  padding:2.6rem 2.2rem;
  border-top:4px solid var(--purple);
  border-radius:0 0 14px 14px;
  box-shadow:0 10px 30px rgba(63,22,80,.10);
  transition:transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease;
}
.card:hover{ transform:translateY(-6px); box-shadow:0 24px 54px rgba(63,22,80,.18); }
.card .icon{
  width:56px; height:56px; margin-bottom:1.4rem;
  color:var(--purple);
}
.card h3{ font-size:1.2rem; text-transform:uppercase; letter-spacing:.03em; }

.pill-list li{
  display:flex; gap:.8rem; align-items:flex-start; margin-bottom:1rem; color:var(--gray);
}
.pill-list li svg{ flex:none; width:20px; height:20px; margin-top:.2rem; color:var(--purple); }

/* ---------- Stat strip ---------- */
.stat-strip{
  display:grid; grid-template-columns:repeat(4,1fr);
  background:linear-gradient(135deg,var(--purple-dark) 0%,var(--purple) 55%,var(--purple-mid) 100%);
  color:var(--white);
  text-align:center;
}
.stat-strip div{ padding:3rem 1rem; border-right:1px solid rgba(255,255,255,.15); }
.stat-strip div:last-child{ border-right:none; }
.stat-strip strong{ display:block; font-family:var(--sans); font-size:2.4rem; font-weight:800; }
.stat-strip span{ font-size:.78rem; letter-spacing:.1em; text-transform:uppercase; opacity:.85; }

/* ---------- CTA banner ---------- */
.cta-banner{
  background:linear-gradient(120deg,var(--purple-dark),var(--purple));
  color:var(--white); text-align:center; padding:5rem 6vw;
}
.cta-banner h2{ color:var(--white); font-size:clamp(1.8rem,4vw,2.6rem); text-transform:uppercase; }
.cta-banner p{ color:#e9d9ef; max-width:560px; margin:0 auto 2rem; }

/* ---------- Gallery ---------- */
.gallery-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:1.2rem; }
.gallery-grid figure{ margin:0; overflow:hidden; position:relative; border-radius:2px; }
.gallery-grid img{ width:100%; height:100%; object-fit:cover; aspect-ratio:4/3; transition:transform .5s ease; }
.gallery-grid figure:hover img{ transform:scale(1.08); }

/* ---------- Masonry gallery + lightbox ---------- */
.masonry{ column-count:3; column-gap:1.2rem; }
.masonry figure{
  margin:0 0 1.2rem; break-inside:avoid; overflow:hidden; cursor:zoom-in;
  border-radius:2px; box-shadow:0 10px 30px rgba(63,22,80,.12);
}
.masonry img{ width:100%; transition:transform .5s ease, filter .5s ease; }
.masonry figure:hover img{ transform:scale(1.05); filter:brightness(1.05); }

.lightbox{
  position:fixed; inset:0; z-index:500; background:rgba(20,8,26,.94);
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none; transition:opacity .3s ease;
}
.lightbox.open{ opacity:1; pointer-events:auto; }
.lightbox img{ max-width:90vw; max-height:88vh; box-shadow:0 30px 80px rgba(0,0,0,.6); border-radius:2px; }
.lightbox button{
  position:absolute; background:none; border:none; color:var(--white); cursor:pointer;
  font-size:3rem; line-height:1; padding:1rem; opacity:.75; transition:.2s;
}
.lightbox button:hover{ opacity:1; }
.lb-close{ top:1rem; right:1.5rem; }
.lb-prev{ left:1rem; top:50%; transform:translateY(-50%); }
.lb-next{ right:1rem; top:50%; transform:translateY(-50%); }
@media (max-width:980px){ .masonry{ column-count:2; } }
@media (max-width:560px){ .masonry{ column-count:1; } .lightbox button{ font-size:2.2rem; } }

/* ---------- Team ---------- */
.team-photo{ position:relative; }
.team-photo img{ box-shadow:var(--shadow); width:100%; aspect-ratio:3/2; object-fit:cover; }
.badge-quote{
  position:absolute; bottom:-1.6rem; right:-1.6rem;
  background:var(--purple); color:var(--white);
  padding:1.4rem 1.8rem; max-width:230px;
  font-family:var(--serif); font-style:italic; font-size:1rem;
  box-shadow:var(--shadow);
}

/* ---------- Forms ---------- */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:1.2rem; }
.form-grid .full{ grid-column:1 / -1; }
input,textarea,select{
  width:100%; padding:.95rem 1.1rem; font-family:var(--body); font-size:.95rem;
  border:1px solid #ddd2e2; background:var(--white); color:var(--ink);
  border-radius:2px;
}
input:focus,textarea:focus,select:focus{ outline:none; border-color:var(--purple); }
label{ font-size:.8rem; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--purple-dark); display:block; margin-bottom:.4rem; }

/* ---------- Footer ---------- */
footer{ background:var(--ink); color:#cbb9d2; padding:5rem 6vw 2rem; }
.footer-grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1.2fr; gap:2.5rem; max-width:1280px; margin:0 auto; }
.footer-grid h4{ color:var(--white); font-size:.85rem; letter-spacing:.1em; text-transform:uppercase; margin-bottom:1.2rem; }
.footer-grid a{ display:block; margin-bottom:.6rem; font-size:.9rem; color:#cbb9d2; }
.footer-grid a:hover{ color:var(--white); }
.footer-logo{ height:96px; margin-bottom:1rem; }
.footer-bottom{
  max-width:1280px; margin:3rem auto 0; padding-top:1.6rem;
  border-top:1px solid rgba(255,255,255,.1);
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:1rem;
  font-size:.8rem; color:#8a7a91;
}
.social-row{ display:flex; gap:.8rem; }
.social-row a{
  width:36px; height:36px; border-radius:50%; border:1px solid rgba(255,255,255,.25);
  display:flex; align-items:center; justify-content:center;
}
.social-row a:hover{ background:var(--purple); border-color:var(--purple); }

:where(a,button,input,select,textarea,summary,.hamburger):focus-visible{
  outline:3px solid var(--purple-mid);
  outline-offset:3px;
  border-radius:3px;
}
.hero :focus-visible, .cta-banner :focus-visible, footer :focus-visible{ outline-color:#fff; }

/* ---------- Utility ---------- */
.text-center{ text-align:center; }
.mt-lg{ margin-top:3rem; }

/* ---------- Responsive ---------- */
@media (max-width:1400px){ .brand-text{ display:none; } }

@media (max-width:1120px){
  .nav-links, .nav-cta .btn:not(.nav-call){ display:none; }
  .hamburger{ display:block; }
  .nav-cta{ gap:.75rem; }
  .nav-call{ display:inline-flex; padding:.7rem 1.1rem; font-size:.72rem; gap:.4rem; }
}

@media (max-width:980px){
  .grid-3{ grid-template-columns:1fr; }
  .grid-2{ grid-template-columns:1fr; gap:2.5rem; }
  .stat-strip{ grid-template-columns:repeat(2,1fr); }
  .stat-strip div{ border-bottom:1px solid rgba(255,255,255,.15); }
  .footer-grid{ grid-template-columns:1fr 1fr; }
  .gallery-grid{ grid-template-columns:1fr 1fr; }
  .form-grid{ grid-template-columns:1fr; }
  .topbar{ justify-content:center; text-align:center; }

  /* AOS slides horizontally by 100px, which pushed the page wider than the
     screen and let it scroll sideways. Fade upward on small screens instead. */
  [data-aos="fade-right"]:not(.aos-animate),
  [data-aos="fade-left"]:not(.aos-animate){
    transform:translate3d(0,40px,0) !important;
  }

  .section{ padding:5rem 6vw; }
  .section-head{ margin-bottom:2.8rem; }
  .mt-lg{ margin-top:2rem; }
}

/* Tablet / large phone */
@media (max-width:900px){
  /* 16px stops iOS Safari zooming in when a field is focused */
  input,textarea,select{ font-size:16px; }
  .card{ padding:2.1rem 1.6rem; }
  .card .icon{ width:46px; height:46px; margin-bottom:1rem; }
  .brand img{ height:52px; }
  .nav-wrap{ padding:.55rem 5vw; }
  .hero{ min-height:80vh; min-height:80dvh; }
  .hero-sm{ min-height:38vh; min-height:38dvh; }
  .cta-banner{ padding:4rem 6vw; }
  footer{ padding:3.5rem 6vw 2rem; }
}

/* Phones */
@media (max-width:640px){
  .topbar{ font-size:.72rem; padding:.45rem 5vw; gap:.15rem; line-height:1.6; }
  .topbar span{ margin-right:.9rem; }
  .topbar > div:last-child > span:last-child{ margin-right:0; }
  /* Address lives in the footer and on the Contact page; the phone matters more here */
  .topbar > div:first-child{ display:none; }

  .section{ padding:3.75rem 6vw; }
  .section-head{ margin-bottom:2.2rem; }
  .section-head p{ font-size:.98rem; }
  .gallery-grid{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr; gap:2rem; }
  .footer-bottom{ justify-content:center; text-align:center; margin-top:2rem; }
  .badge-quote{ position:static; margin-top:1.25rem; max-width:none; font-size:.95rem; padding:1.1rem 1.3rem; }
  .team-photo img{ aspect-ratio:4/3; }

  .hero-inner p{ font-size:1.02rem; }
  .hero-btns{ flex-direction:column; align-items:stretch; gap:.75rem; }
  .hero-btns .btn{ justify-content:center; width:100%; }
  .scroll-cue{ display:none; }

  .stat-strip div{ padding:2rem .75rem; }
  .stat-strip strong{ font-size:1.9rem; }
  .stat-strip span{ font-size:.68rem; }

  /* Comfortable tap targets */
  .footer-grid a{ margin-bottom:.85rem; }
  .social-row a{ width:44px; height:44px; }
  .btn{ padding:.95rem 1.6rem; }

  .mobile-menu a{ font-size:1.35rem; }
}

@media (max-width:430px){
  /* Long email would wrap the bar onto a third line */
  .topbar > div:last-child > span:last-child{ display:none; }
  .card{ padding:1.9rem 1.35rem; }
  .brand img{ height:46px; }
  .nav-call{ padding:.65rem .9rem; letter-spacing:.05em; }
}

/* Slide-out menu: never trap content off-screen */
.mobile-menu{ overflow-y:auto; padding:5.5rem 1.5rem 3rem; -webkit-overflow-scrolling:touch; }
@media (max-height:620px){
  .mobile-menu{ justify-content:flex-start; gap:1.1rem; }
  .mobile-menu a{ font-size:1.2rem; }
}

/* Lightbox controls sized for thumbs, clear of the photo */
@media (max-width:700px){
  .lightbox img{ max-width:94vw; max-height:70dvh; }
  .lightbox button{
    width:52px; height:52px; padding:0; font-size:2rem;
    display:flex; align-items:center; justify-content:center;
    background:rgba(255,255,255,.15); border-radius:50%; opacity:1;
  }
  .lb-close{ top:1rem; right:1rem; }
  .lb-prev{ left:50%; margin-left:-64px; top:auto; bottom:1.75rem; transform:none; }
  .lb-next{ left:50%; margin-left:12px; right:auto; top:auto; bottom:1.75rem; transform:none; }
}
