/*
  Elite Home Care — shared stylesheet for every page.
  Design: Mockup A "warm community", with Mockup C's motion (approved combined home page, 2026-10-01).
  No inline styles anywhere on the site (CSP style-src 'self').
  Motion rules:
    - Every animation and transition sits behind prefers-reduced-motion; under "reduce" everything is still and visible.
    - Scroll-driven motion (animation-timeline) is inside @supports and the no-preference guard.
      Browsers without it (e.g. Firefox) get the IntersectionObserver reveal from site.js instead.
    - Cross-document view transitions are a progressive enhancement, off under reduced motion.
*/
:root {
  --navy:#233A75; --blue:#22619D; --azure:#1E82C4; --crim:#BD2025; --deep:#8E2221;
  --paper:#FFFFFF; --ink:#3D4759; --muted:#6B7486; --line:#DCDFE6; --tint:#F1F5FB; --tintr:#FDF2F2;
  --serif: Georgia, "DejaVu Serif", "Liberation Serif", serif;
  --sans: "Helvetica Neue", Arial, "Liberation Sans", "DejaVu Sans", sans-serif;
}
* { box-sizing: border-box; }
body { margin:0; font-family:var(--sans); color:var(--ink); background:var(--paper); font-size:17px; line-height:1.6; overflow-x:hidden; }
img { max-width:100%; height:auto; display:block; }
a { color:var(--blue); }
:focus-visible { outline:3px solid var(--crim); outline-offset:3px; border-radius:4px; }
.referral :focus-visible, footer.site :focus-visible { outline-color:#FFD166; }
.referral .ref-card :focus-visible { outline-color:var(--crim); } /* white card inside the navy band: back to crimson (0,3,0 beats 0,2,0) */
[id] { scroll-margin-top:90px; } /* in-page anchor targets clear the sticky header */
.wrap { width:100%; max-width:1180px; margin:0 auto; padding:0 20px; }
.skip { position:absolute; left:-9999px; top:0; background:var(--navy); color:#fff; padding:10px 16px; z-index:100; }
.skip:focus { left:12px; top:12px; }
.draft-bar { background:var(--deep); color:#fff; text-align:center; font-size:14px; padding:6px 12px; }
.ph { background:#FFF7D6; color:#5A4500; border:1px dashed #A07C00; padding:0 6px; border-radius:3px; font-size:.9em; font-style:normal; font-weight:600; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* header and shared nav */
header.site { background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:50; }
.hbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; padding-top:10px; padding-bottom:10px; }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--navy); }
.brand img { width:62px; }
.brand span { font-family:var(--serif); font-size:22px; font-weight:700; line-height:1.1; }
.brand small { display:block; font-family:var(--sans); font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--deep); font-weight:700; }
.menu-btn { background:var(--navy); color:#fff; border:0; border-radius:8px; padding:10px 14px; font-size:15px; font-weight:600; cursor:pointer; }
nav.main ul { list-style:none; margin:0; padding:0; }
nav.main { display:none; width:100%; }
nav.main.open { display:block; }
.no-js nav.main { display:block; }
.no-js .menu-btn { display:none; }
nav.main a { display:block; padding:12px 4px; text-decoration:none; color:var(--navy); font-weight:600; border-top:1px solid var(--line); }
nav.main a[aria-current="page"] { color:var(--crim); text-decoration:underline; text-decoration-thickness:3px; text-underline-offset:6px; }
@media (min-width:980px) {
  .menu-btn { display:none; }
  nav.main { display:block; width:auto; }
  nav.main ul { display:flex; gap:4px; }
  nav.main a { border:0; padding:8px 12px; border-radius:20px; font-size:15px; }
  nav.main a:hover { background:var(--tint); }
  .hbar { flex-wrap:nowrap; }
}

/* home hero — A's warm red-to-white wash, with C's drift/float/entrance motion */
.hero { position:relative; overflow:hidden; background:var(--tintr); padding:36px 0 44px; }
.hero-bg { position:absolute; top:0; left:0; width:200%; height:100%; pointer-events:none;
  background:linear-gradient(110deg, var(--tintr) 0%, #fff 25%, var(--tint) 50%, #fff 75%, var(--tintr) 100%); }
.orb { position:absolute; border-radius:50%; pointer-events:none; }
.orb.one { width:420px; height:420px; right:-140px; top:-140px; background:rgba(35,58,117,.06); }
.orb.two { width:260px; height:260px; left:-100px; bottom:-130px; background:rgba(189,32,37,.08); }
.hero-grid { position:relative; z-index:1; display:grid; gap:28px; }
.eyebrow { font-size:13px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--deep); margin:0 0 8px; }
.hero h1, .page-hero h1 { font-family:var(--serif); color:var(--navy); font-size:clamp(32px,6vw,54px); line-height:1.1; margin:0 0 14px; }
.hero h1 em { color:var(--crim); font-style:italic; }
.lead { font-size:19px; margin:0 0 22px; max-width:36em; }
.creds { list-style:none; margin:20px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:8px; }
.creds li { background:#fff; border:1px solid var(--line); border-radius:20px; padding:4px 12px; font-size:14px; font-weight:700; color:var(--navy); }
.btns { display:flex; flex-wrap:wrap; gap:12px; }
.btn { display:inline-block; padding:14px 22px; border-radius:40px; font-weight:700; text-decoration:none; font-size:16px; }
.btn.primary { background:var(--crim); color:#fff; }
.btn.primary:hover { background:var(--deep); }
.btn.ghost { border:2px solid var(--navy); color:var(--navy); background:#fff; }
.btn.ghost:hover { background:var(--tint); }
@media (min-width:900px) {
  .hero { padding:64px 0 72px; }
  .hero-grid { grid-template-columns:1.1fr .9fr; align-items:center; gap:48px; }
}

/* inner-page header band (same palette as the home hero, no looping motion) */
.page-hero { background:linear-gradient(110deg, var(--tintr) 0%, #fff 45%, var(--tint) 100%); padding:40px 0 36px; border-bottom:1px solid var(--line); }
.page-hero h1 { font-size:clamp(30px,5vw,46px); }
.page-hero .lead { margin-bottom:0; }
.page-hero .btns { margin-top:22px; }

/* photo slots: real <picture>/<img> markup with a local placeholder image and a visible label.
   aspect-ratio + width/height attributes reserve the space, so swapping in real photos causes no layout shift. */
.photo-slot { position:relative; margin:0; overflow:hidden; border:2px dashed #9AA6BB; border-radius:18px; background:#EEF2F8; }
.photo-slot picture, .photo-slot img { display:block; width:100%; height:100%; }
.photo-slot img { object-fit:cover; aspect-ratio:var(--ratio, 4 / 3); }
.photo-slot figcaption { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; text-align:center; padding:20px; color:#4A5568; font-weight:600; }
.photo-slot.r-hero { --ratio: 4 / 5; border-radius:50% 50% 18px 18px / 30% 30% 18px 18px; }
.photo-slot.r-card { --ratio: 16 / 9; border-radius:0; border-width:0 0 2px 0; font-size:14px; }
.photo-slot.r-wide { --ratio: 4 / 3; }
.photo-slot.has-photo { border-color:transparent; background:none; }

/* scroll reveal fallback (IntersectionObserver): only armed when site.js has added .motion to <html> */
.motion .reveal { opacity:0; transform:translateY(28px); }
.motion .reveal.in { opacity:1; transform:none; }

/* sections */
section { padding:52px 0; }
h2 { font-family:var(--serif); color:var(--navy); font-size:clamp(28px,4.4vw,40px); line-height:1.15; margin:0 0 12px; }
.script { font-family:var(--serif); font-style:italic; color:var(--crim); font-size:22px; margin:0 0 6px; }
.intro { max-width:44em; margin:0 0 28px; }
.tinted { background:var(--tint); }
.tinted-r { background:var(--tintr); }

.svc-grid { display:grid; gap:18px; }
@media (min-width:700px) { .svc-grid { grid-template-columns:1fr 1fr; } }
@media (min-width:1100px) { .svc-grid { grid-template-columns:repeat(3,1fr); } }
.svc { background:#fff; border:1px solid var(--line); border-radius:16px; overflow:hidden; display:flex; flex-direction:column; }
.svc h3, .svc h2 { margin:0; padding:16px 20px 4px; color:var(--navy); font-size:20px; font-family:var(--sans); line-height:1.3; }
.svc p { margin:0; padding:6px 20px 20px; }

.focus { background:var(--tint); border-radius:16px; padding:24px; margin-top:28px; }
.focus h3, .focus h2 { margin:0 0 12px; color:var(--navy); font-family:var(--serif); font-size:24px; }
.chips { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:10px; }
.chips li { background:#fff; border:1px solid var(--line); border-radius:24px; padding:8px 16px; font-weight:700; color:var(--navy); }
.chips a { color:var(--navy); }

.referral { background:var(--navy); color:#fff; }
.referral h2 { color:#fff; }
.referral .script { color:#F4C9CA; }
.referral p { color:#E6ECF7; }
.referral a:not(.btn) { color:#fff; }
.ref-grid { display:grid; gap:24px; }
@media (min-width:900px) { .ref-grid { grid-template-columns:1.2fr .8fr; align-items:start; } }
.ref-card { background:#fff; color:var(--ink); border-radius:16px; padding:24px; }
.ref-card dl { margin:0 0 6px; }
.ref-card dt { font-size:13px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--deep); }
.ref-card dd { margin:2px 0 14px; font-size:26px; font-weight:700; color:var(--navy); }
.referral .ref-card dd a { color:var(--navy); text-decoration:none; } /* 0,2,2 beats .referral a:not(.btn) 0,2,1 */
.referral .ref-card dd a:hover { text-decoration:underline; }
.ref-card dd small { display:block; font-size:15px; font-weight:600; color:var(--ink); }
.ref-card dd.small { font-size:16px; }

/* "How a referral works": hand-drawn inline SVG icons + a connecting line (no library, no external assets) */
.steps { position:relative; margin:8px 0 0; view-timeline-name:--steps; }
.steps-list { list-style:none; margin:0; padding:0; display:grid; gap:28px; }
.steps li { position:relative; z-index:1; display:grid; grid-template-columns:84px 1fr; gap:16px; align-items:start; }
.steps .num { display:block; font-size:13px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--deep); }
.steps h3 { margin:2px 0 6px; color:var(--navy); font-size:20px; line-height:1.3; }
.steps p { margin:0; }
.step-ic { width:84px; height:84px; display:block; background:#fff; border-radius:50%; }
.step-ic .ring { fill:#fff; stroke:var(--navy); stroke-width:3; }
.step-ic .draw { fill:none; stroke:var(--crim); stroke-width:3.5; stroke-linecap:round; stroke-linejoin:round; }
.steps-line { position:absolute; z-index:0; pointer-events:none; }
.steps-line line { stroke:var(--azure); stroke-width:4; stroke-linecap:butt; stroke-dasharray:100; stroke-dashoffset:0; }
.steps-line.h { display:none; }
.steps-line.v { left:40px; top:42px; width:4px; height:calc(100% - 84px); }
@media (min-width:900px) {
  .steps-list { grid-template-columns:repeat(3,1fr); gap:24px; }
  .steps li { grid-template-columns:1fr; justify-items:start; }
  .steps-line.v { display:none; }
  .steps-line.h { display:block; left:42px; top:40px; width:calc(66.667% + 16px); height:4px; }
}

.about-grid, .careers-grid, .contact-grid, .two-col { display:grid; gap:28px; }
@media (min-width:900px) {
  .about-grid { grid-template-columns:.9fr 1.1fr; align-items:center; }
  .careers-grid { grid-template-columns:1.1fr .9fr; align-items:center; }
  .contact-grid, .two-col { grid-template-columns:1fr 1fr; }
}
.about { background:var(--tint); }
.quote { font-family:var(--serif); font-size:22px; color:var(--navy); border-left:4px solid var(--crim); padding-left:16px; margin:18px 0; }
.careers { background:var(--tintr); }
.card { background:#fff; border:1px solid var(--line); border-radius:16px; padding:24px; }
.card h2 { font-size:clamp(24px,3.4vw,30px); }

.contact dl, .facts { margin:0; }
.contact dt, .facts dt { font-weight:700; color:var(--navy); margin-top:12px; }
.contact dd, .facts dd { margin:0; }
.contact .call-card { border:1px solid var(--line); } /* phone card in the contact block; .contact dt/dd (later, same specificity) would otherwise override .ref-card */
.contact .call-card dt { margin-top:0; color:var(--deep); }
.contact .call-card dd { margin:2px 0 14px; }
.contact .call-card dd a { color:var(--navy); text-decoration:none; }
.contact .call-card dd a:hover { text-decoration:underline; }

/* legal documents */
.doc { max-width:820px; }
.doc h2 { font-size:clamp(22px,3vw,28px); margin:1.8em 0 .4em; padding-bottom:.2em; border-bottom:2px solid #e2e8f2; }
.doc h3 { font-size:1.05rem; color:var(--navy); margin:1.4em 0 .3em; }
.doc ul { padding-left:1.3em; }
.doc li { margin-bottom:.35em; }
.doc .meta { color:var(--muted); }
.doc .npp-lead { font-weight:700; font-size:1.05rem; border-left:4px solid var(--crim); padding:.2em 0 .2em 14px; margin:1em 0 1.6em; }
.doc .boxes { display:grid; gap:14px; }
.doc .box { background:var(--tint); border:1px solid #e2e8f2; border-radius:12px; padding:14px 18px; }
.doc .box h3 { margin-top:0; }
.doc .ex { color:var(--muted); font-style:italic; }
.doc .contact-box { background:var(--tint); border:1px solid #e2e8f2; border-radius:12px; padding:18px 20px; margin:.8em 0; }
.doc .contact-box p { margin:.2em 0; }
.draft-box { margin:28px 0; padding:16px 18px; border:2px dashed var(--crim); border-radius:10px; background:#fff; color:var(--ink); font-size:.95rem; }
.draft-box.top { margin-top:0; background:#FFF7D6; border-color:#A07C00; color:#5A4500; }
.draft-box p { margin:.3em 0; }
.doc .tagline { margin:1.4em 0; }
.doc .tagline h3 { margin-bottom:.2em; }
.doc .tagline .tl-en { font-weight:400; color:var(--muted); font-size:.9em; }
.doc .tagline p { margin:0; }
/* Phone and fax numbers never break across lines. */
a[href^="tel:"], .nowrap { white-space:nowrap; }
/* Language-assistance notices: system fonts per script (nothing is downloaded). */
.doc .tagline:lang(ar), .doc .tagline:lang(fa) { font-family:"Segoe UI", "Geeza Pro", "Noto Sans Arabic", "Noto Naskh Arabic", "DejaVu Sans", sans-serif; }
.doc .tagline:lang(ur) { font-family:"Segoe UI", "Geeza Pro", "Noto Naskh Arabic", "Noto Sans Arabic", "FreeSerif", serif; }
.doc .tagline:lang(my) { font-family:"Myanmar Text", "Myanmar Sangam MN", "Noto Sans Myanmar", "Padauk", sans-serif; }
.doc .tagline:lang(lo) { font-family:"Leelawadee UI", "Lao Sangam MN", "Noto Sans Lao", "DejaVu Sans", sans-serif; }
.doc .tagline:lang(th) { font-family:"Leelawadee UI", "Thonburi", "Noto Sans Thai", "Loma", "FreeSerif", sans-serif; }
.doc .tagline:lang(ko) { font-family:"Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "WenQuanYi Zen Hei", sans-serif; }
.doc .tagline:lang(zh-Hans) { font-family:"Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "WenQuanYi Zen Hei", sans-serif; }
.doc .tagline:lang(zh-Hant) { font-family:"Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "WenQuanYi Zen Hei", sans-serif; }
.doc-foot { margin-top:40px; padding-top:14px; border-top:1px solid #e2e8f2; font-size:.88rem; color:var(--muted); }

/* footer */
footer.site { background:var(--navy); color:#DDE5F3; padding:36px 0 28px; font-size:15px; }
footer.site a { color:#fff; }
.foot-grid { display:grid; gap:20px; }
@media (min-width:800px) { .foot-grid { grid-template-columns:1.1fr 1.2fr .8fr; } }
footer.site ul { list-style:none; padding:0; margin:0; }
footer.site li { margin:4px 0; }
.foot-h { color:#fff; font-size:18px; font-family:var(--sans); margin:0 0 8px; }
.foot-logo { background:#fff; border-radius:12px; padding:8px; width:84px; box-sizing:content-box; }
footer.site dl { margin:0; }
footer.site dt { font-weight:700; color:#fff; margin-top:8px; }
footer.site dd { margin:0; }
.legal { border-top:1px solid rgba(255,255,255,.2); margin-top:24px; padding-top:16px; font-size:14px; }

/* ---------- MOTION: only when the visitor has not asked for reduced motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior:smooth; }

  /* home hero loops (C) */
  .hero-bg { animation:drift 18s ease-in-out infinite alternate; will-change:transform; }
  .orb.one { animation:float 12s ease-in-out infinite alternate; }
  .orb.two { animation:float 15s ease-in-out infinite alternate-reverse; }
  .bob { animation:bob 6s ease-in-out infinite alternate; }
  .hero.paused .hero-bg, .hero.paused .orb, .hero.paused .bob { animation-play-state:paused; }
  @keyframes drift { from { transform:translateX(0); } to { transform:translateX(-50%); } }
  @keyframes float { from { transform:translate(0,0) scale(1); } to { transform:translate(-30px,24px) scale(1.06); } }
  @keyframes bob { from { transform:translateY(0); } to { transform:translateY(-12px); } }

  /* staggered entrance (C) */
  .enter { animation:rise .8s cubic-bezier(.2,.7,.2,1) both; }
  .enter.d1 { animation-delay:.1s; } .enter.d2 { animation-delay:.25s; } .enter.d3 { animation-delay:.4s; } .enter.d4 { animation-delay:.55s; }
  @keyframes rise { from { opacity:0; transform:translateY(22px); } to { opacity:1; transform:none; } }

  /* IntersectionObserver reveal (fallback path, works in every browser with JS) */
  .motion .reveal { transition:opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
  .motion .reveal.d1 { transition-delay:.08s; } .motion .reveal.d2 { transition-delay:.16s; } .motion .reveal.d3 { transition-delay:.24s; }

  /* referral graphic, fallback path: icons and connecting line draw when the list is revealed */
  .motion .steps .draw { stroke-dasharray:1; stroke-dashoffset:1; transition:stroke-dashoffset 1.1s ease .3s; }
  .motion .steps li:nth-child(2) .draw { transition-delay:.6s; }
  .motion .steps li:nth-child(3) .draw { transition-delay:.9s; }
  .motion .steps .steps-line line { stroke-dashoffset:100; transition:stroke-dashoffset 1.6s ease .2s; }
  .motion .steps.in .draw, .motion .steps.in .steps-line line { stroke-dashoffset:0; }

  /* scroll-driven enhancement (Chrome 115+, Safari 26+): hero photo drifts with scroll; line draws as the steps scroll through */
  @supports (animation-timeline: view()) {
    .hero-drift { animation:hero-drift linear both; animation-timeline:view(); animation-range:exit 0% exit 100%; }
    @keyframes hero-drift { from { transform:translateY(0); } to { transform:translateY(70px); } }
    .motion .steps .steps-line line { transition:none; animation:line-draw linear both; animation-timeline:--steps; animation-range:entry 30% cover 55%; }
    @keyframes line-draw { from { stroke-dashoffset:100; } to { stroke-dashoffset:0; } }
  }

  /* cross-document view transitions (Chrome 126+, Safari 18.2+; others just navigate normally) */
  @view-transition { navigation:auto; }
  header.site { view-transition-name:site-header; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration:.25s; }
}

/* ---------- REDUCED MOTION: fully still, everything visible (belt and braces) ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  *, *::before, *::after { animation:none !important; transition:none !important; }
  .hero-bg, .hero-drift { transform:none !important; }
  .enter, .reveal, .motion .reveal { opacity:1 !important; transform:none !important; }
  .steps .draw, .steps-line line { stroke-dashoffset:0 !important; }
}
