/* ============================================================
   motion.css — big-screen scaling, section rhythm, motion.
   Loads after site.css / components.css / home.css.
   ============================================================ */

/* ---------- 1. Fluid scale ---------- */
html { font-size: clamp(16px, calc(12px + 0.3125vw), 20px); }
:root { --maxw: 76rem; --tint: #e8fbf8; --tint-deep: #d5f5ef; }

.home-hero .bl-hero__graphic svg,
.page-hero__graphic svg { height: clamp(460px, 34vw, 820px); }
@media (min-width: 1600px) {
  .home-hero, .page-hero--graphic { padding-block: clamp(4.5rem, 6vw, 7rem) clamp(3rem, 4vw, 5rem); }
}

/* ---------- 2. Section rhythm: tighter, and visibly different ---------- */
.hm { padding-block: clamp(2.4rem, 4.2vw, 3.75rem); position: relative; }
.hm__head { margin-bottom: clamp(1.25rem, 2.8vw, 2rem); }
.svc-block { padding-block: clamp(2rem, 4vw, 3.25rem); }
.home-logos { padding-block: 0 clamp(1.5rem, 3vw, 2.25rem); }
.home-hero { padding-block: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 3vw, 2.5rem); }

/* mist sections get a hairline + short accent rule so the boundary is explicit */
.hm--mist { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hm--mist::after {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 72px; height: 4px; background: var(--teal); border-radius: 0 0 4px 4px;
}

/* teal tint section */
.hm--tint { background: linear-gradient(180deg, var(--tint) 0%, #f3fdfb 100%); border-top: 1px solid var(--tint-deep); }
.hm--tint .hm-card { background: #fff; }

/* deep navy statement section (Why Planfocus) */
.hm--navy {
  background:
    radial-gradient(900px 420px at 92% -10%, rgba(41,222,199,.22), transparent 60%),
    radial-gradient(600px 360px at 0% 110%, rgba(255,102,101,.16), transparent 62%),
    linear-gradient(160deg, #142933 0%, #1b3644 55%, #244554 100%);
  background-color: #1b3644; color: #e6eef0;
}
.hm--navy h2, .hm--navy h3 { color: #fff; }
.hm--navy .serif-i { color: var(--teal-soft); }
.hm--navy .hm__sub { color: #c9dbe0; }
.hm--navy .eyebrow { color: #d6f7f0; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.hm--navy .hm-card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); box-shadow: none; color: #e6eef0; backdrop-filter: blur(2px); }
.hm--navy .hm-card:hover { background: rgba(255,255,255,.1); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.hm--navy .hm-card p { color: #c9dbe0; }
.hm--navy .hm-card__stat { color: var(--teal); }
.hm--navy .hm-quote { background: rgba(255,255,255,.06); color: #fff; border-left-color: var(--coral); }
.hm--navy .hm-quote cite { color: #9fc4cc; }

/* ambient glows in outer margins on wide screens (light sections only) */
@media (min-width: 1500px) {
  .hm:not(.hm--navy), .svc-block { overflow: hidden; }
  .hm:not(.hm--navy)::before, .svc-block::before {
    content: ""; position: absolute; inset: auto auto -20% -12%; width: 42vw; height: 42vw;
    border-radius: 50%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(41,222,199,.10), transparent 70%);
  }
  .hm--mist::before, .svc-block.section--alt::before {
    inset: -25% -14% auto auto;
    background: radial-gradient(closest-side, rgba(255,102,101,.08), transparent 70%);
  }
  .hm > .container, .svc-block > .container { position: relative; z-index: 1; }
}

/* ---------- 3. Motion ---------- */

/* Staggered reveal */
[data-reveal] .hm-card, [data-reveal] .card, [data-reveal] .feat-card {
  opacity: 0; transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1);
}
[data-reveal].is-revealed .hm-card, [data-reveal].is-revealed .card, [data-reveal].is-revealed .feat-card { opacity: 1; transform: none; }
[data-reveal].is-revealed .hm-grid > :nth-child(1), [data-reveal].is-revealed .svc-cards > :nth-child(1), [data-reveal].is-revealed .feat-grid > :nth-child(1) { transition-delay: .05s; }
[data-reveal].is-revealed .hm-grid > :nth-child(2), [data-reveal].is-revealed .svc-cards > :nth-child(2), [data-reveal].is-revealed .feat-grid > :nth-child(2) { transition-delay: .15s; }
[data-reveal].is-revealed .hm-grid > :nth-child(3), [data-reveal].is-revealed .feat-grid > :nth-child(3) { transition-delay: .25s; }
[data-reveal].is-revealed .hm-grid > :nth-child(4), [data-reveal].is-revealed .feat-grid > :nth-child(4) { transition-delay: .35s; }
[data-reveal].is-revealed .feat-grid > :nth-child(5) { transition-delay: .45s; }
[data-reveal].is-revealed .feat-grid > :nth-child(6) { transition-delay: .55s; }

/* Hero graphic: float (on the svg) + mouse parallax (on the wrapper, set by JS) */
@keyframes pf-float {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(calc(-50% - 14px)) translateX(-6px); }
}
.home-hero .bl-hero__graphic svg, .page-hero__graphic svg { animation: pf-float 9s ease-in-out infinite; }
.bl-hero__graphic { transition: transform .35s cubic-bezier(.2,.7,.3,1); will-change: transform; }

/* Sparks */
.spark-field { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.home-hero, #contact { position: relative; }
.home-hero > .bl-hero__text, .home-hero > .bl-hero__graphic, #contact > .container { position: relative; z-index: 1; }
.spark { position: absolute; bottom: -40px; font-size: 12px; line-height: 1; color: var(--teal); opacity: 0; animation: pf-drift linear infinite; will-change: transform, opacity; }
.spark.is-coral { color: var(--coral); }
@keyframes pf-drift {
  0%   { transform: translateY(0) rotate(0deg) scale(var(--s, 1)); opacity: 0; }
  10%  { opacity: var(--o, .5); }
  85%  { opacity: var(--o, .5); }
  100% { transform: translateY(-110vh) rotate(160deg) scale(var(--s, 1)); opacity: 0; }
}

.btn--teal { transition: transform .2s, box-shadow .2s, background .2s; }
.btn--teal:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(41,222,199,.35); }

/* ---------- 4. Lifecycle track (Produce -> Understand -> Present) ---------- */
.life-track { position: relative; max-width: 900px; margin: 0 auto clamp(1.25rem, 3vw, 2rem); padding: .5rem 0; }
.life-track svg { display: block; width: 100%; height: 64px; overflow: visible; }
.life-track .lt-path { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; transition: stroke-dashoffset 1.6s cubic-bezier(.2,.7,.3,1); }
.life-track .lt-dot { fill: #fff; stroke: var(--teal); stroke-width: 3; opacity: 0; transform: scale(.4); transform-origin: center; transform-box: fill-box; transition: opacity .4s, transform .4s cubic-bezier(.2,.9,.3,1.4); }
.life-track .lt-dot.is-coral { stroke: var(--coral); }
.life-track .lt-label { font: 700 .72rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; fill: var(--teal-deep); opacity: 0; transition: opacity .5s; }
.is-revealed .life-track .lt-path { stroke-dashoffset: 0; }
.is-revealed .life-track .lt-dot, .is-revealed .life-track .lt-label { opacity: 1; transform: scale(1); }
.is-revealed .life-track .lt-dot:nth-of-type(1), .is-revealed .life-track .lt-label:nth-of-type(1) { transition-delay: .2s; }
.is-revealed .life-track .lt-dot:nth-of-type(2), .is-revealed .life-track .lt-label:nth-of-type(2) { transition-delay: .9s; }
.is-revealed .life-track .lt-dot:nth-of-type(3), .is-revealed .life-track .lt-label:nth-of-type(3) { transition-delay: 1.6s; }
@media (max-width: 900px) { .life-track { display: none; } }

/* ---------- 5. Animated product tiles ---------- */
.tile { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--mist); border: 1px solid var(--line); margin: .25rem 0 1rem; }
.tile * { box-sizing: border-box; }

/* Blueprint: a template assembling itself, row by row, then a tick */
.tile--bp .doc { position: absolute; inset: 12% 18%; background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(36,69,84,.12); padding: 10% 9%; display: flex; flex-direction: column; gap: 7%; }
.tile--bp .row { height: 9%; border-radius: 3px; background: var(--mist-deep); transform: translateX(-110%); opacity: 0; animation: pf-rowin 6s ease-out infinite; }
.tile--bp .row.is-title { width: 55%; background: var(--navy); }
.tile--bp .row:nth-child(2) { width: 92%; animation-delay: .4s; }
.tile--bp .row:nth-child(3) { width: 80%; animation-delay: .8s; }
.tile--bp .row:nth-child(4) { width: 88%; animation-delay: 1.2s; background: var(--teal-soft); }
.tile--bp .row:nth-child(5) { width: 60%; animation-delay: 1.6s; }
.tile--bp .tick { position: absolute; right: 8%; bottom: 10%; width: 15%; aspect-ratio: 1; border-radius: 50%; background: var(--teal); color: var(--navy-deep); display: grid; place-items: center; font-weight: 800; font-size: clamp(12px, 1.1vw, 18px); opacity: 0; animation: pf-pop 6s ease-out infinite; animation-delay: 2.2s; }
@keyframes pf-rowin { 0% { transform: translateX(-110%); opacity: 0; } 12% { transform: none; opacity: 1; } 80% { transform: none; opacity: 1; } 92%, 100% { transform: translateX(-110%); opacity: 0; } }
@keyframes pf-pop { 0% { opacity: 0; transform: scale(.4); } 8% { opacity: 1; transform: scale(1.15); } 12% { transform: scale(1); } 78% { opacity: 1; } 90%, 100% { opacity: 0; transform: scale(.4); } }

/* Coremetryx: a live dashboard tile, bars growing + a KPI */
.tile--cx { background: #fff; }
.tile--cx .kpi { position: absolute; left: 8%; top: 9%; font: 700 .62rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile--cx .kpi b { display: block; font: 500 clamp(18px, 1.6vw, 26px)/1 var(--font-head); color: var(--navy-deep); letter-spacing: 0; text-transform: none; margin-top: .25rem; }
.tile--cx .kpi i { font-style: normal; color: #5c7a12; font-size: .7rem; margin-left: .4rem; }
.tile--cx .bars { position: absolute; left: 8%; right: 8%; bottom: 12%; height: 48%; display: flex; align-items: flex-end; gap: 4%; }
.tile--cx .bar { flex: 1; background: linear-gradient(180deg, #a4d233, #7fb31a); border-radius: 3px 3px 0 0; transform-origin: bottom; transform: scaleY(0); animation: pf-grow 7s cubic-bezier(.2,.7,.3,1) infinite; }
.tile--cx .bar:nth-child(2) { animation-delay: .15s; background: linear-gradient(180deg, var(--teal), var(--teal-deep)); }
.tile--cx .bar:nth-child(3) { animation-delay: .3s; }
.tile--cx .bar:nth-child(4) { animation-delay: .45s; background: linear-gradient(180deg, var(--teal), var(--teal-deep)); }
.tile--cx .bar:nth-child(5) { animation-delay: .6s; }
.tile--cx .bar:nth-child(6) { animation-delay: .75s; background: linear-gradient(180deg, var(--teal), var(--teal-deep)); }
.tile--cx .bar:nth-child(7) { animation-delay: .9s; }
.tile--cx .grid { position: absolute; left: 8%; right: 8%; bottom: 12%; height: 48%; background: repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 25%); opacity: .7; }
@keyframes pf-grow { 0% { transform: scaleY(0); } 14% { transform: scaleY(1); } 84% { transform: scaleY(1); } 94%, 100% { transform: scaleY(0); } }

/* AdviceStudio: dense document crossfading into a branded slide */
.tile--as .layer { position: absolute; inset: 12% 16%; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(36,69,84,.12); }
.tile--as .docx { padding: 9% 8%; display: flex; flex-direction: column; gap: 5%; animation: pf-doc 8s ease-in-out infinite; }
.tile--as .docx span { height: 6%; background: var(--mist-deep); border-radius: 2px; }
.tile--as .docx span:nth-child(odd) { width: 100%; } .tile--as .docx span:nth-child(even) { width: 84%; } .tile--as .docx span:nth-child(3n) { width: 92%; }
.tile--as .docx::after { content: "60 pages"; position: absolute; right: 8%; bottom: 7%; font: 600 .6rem/1 var(--font-body); color: var(--muted); }
.tile--as .slide { opacity: 0; transform: scale(.96); animation: pf-slide 8s ease-in-out infinite; overflow: hidden; }
.tile--as .slide .bar { height: 18%; background: var(--navy); display: flex; align-items: center; padding: 0 8%; gap: 6%; }
.tile--as .slide .bar i { width: 10%; height: 42%; background: var(--teal); border-radius: 3px; }
.tile--as .slide .bar b { height: 28%; flex: 1; background: rgba(255,255,255,.35); border-radius: 3px; }
.tile--as .slide .chart { position: absolute; left: 8%; right: 8%; bottom: 12%; height: 46%; display: flex; align-items: flex-end; gap: 5%; }
.tile--as .slide .chart i { flex: 1; border-radius: 3px 3px 0 0; background: var(--teal-soft); }
.tile--as .slide .chart i:nth-child(2) { background: var(--teal); } .tile--as .slide .chart i:nth-child(4) { background: var(--coral); }
.tile--as .slide .title { position: absolute; left: 8%; top: 26%; width: 48%; height: 7%; background: var(--navy); border-radius: 2px; opacity: .85; }
@keyframes pf-doc   { 0%, 38% { opacity: 1; transform: none; } 48%, 88% { opacity: 0; transform: scale(1.04); } 98%, 100% { opacity: 1; transform: none; } }
@keyframes pf-slide { 0%, 40% { opacity: 0; transform: scale(.96); } 50%, 86% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: scale(.96); } }

/* ---------- 6a. Contact form as a card ---------- */
.hm-connect .contact-form {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: clamp(1.4rem, 3.5vw, 2.4rem);
  margin-top: clamp(1.25rem, 3vw, 2rem);
}
.hm-connect .contact-form__row { margin-bottom: 1rem; }
.hm-connect .contact-form label { font-weight: 600; color: var(--navy-deep); }
.hm-connect .contact-form input, .hm-connect .contact-form textarea { background: var(--mist); border: 1px solid var(--line); border-radius: 10px; }
.hm-connect .contact-form input:focus, .hm-connect .contact-form textarea:focus { background: #fff; border-color: var(--teal); outline: 2px solid rgba(41,222,199,.35); outline-offset: 0; }
.hm-connect .contact-form__submit { width: 100%; background: var(--teal); color: var(--navy-deep); font-weight: 700; padding: .95rem 1.5rem; border-radius: 10px; }
.hm-connect .contact-form__submit:hover { background: var(--teal-soft); }

/* ---------- 6. Health Check quiz ---------- */
.hc-quiz { max-width: 640px; margin: 0 auto clamp(1.5rem, 3vw, 2.25rem); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: clamp(1.25rem, 3vw, 2rem); text-align: center; }
.hc-quiz__progress { display: flex; justify-content: center; gap: .4rem; margin-bottom: 1rem; }
.hc-quiz__progress i { width: 28px; height: 4px; border-radius: 2px; background: var(--mist-deep); transition: background .3s; }
.hc-quiz__progress i.is-on { background: var(--teal); }
.hc-quiz__q { font-family: var(--font-head); font-size: clamp(1.2rem, 2.2vw, 1.5rem); color: var(--navy-deep); margin: 0 0 1.1rem; min-height: 2.6em; }
.hc-quiz__btns { display: flex; gap: .7rem; justify-content: center; }
.hc-quiz__btns button { font: 600 1rem var(--font-body); padding: .75rem 1.6rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.hc-quiz__btns button:hover { transform: translateY(-2px); border-color: var(--teal); }
.hc-quiz__btns button.is-yes { background: var(--teal); border-color: var(--teal); color: var(--navy-deep); }
.hc-quiz__result { display: none; }
.hc-quiz.is-done .hc-quiz__q, .hc-quiz.is-done .hc-quiz__btns { display: none; }
.hc-quiz.is-done .hc-quiz__result { display: block; }
.hc-quiz__result .score { font: 500 clamp(2rem, 4vw, 2.8rem)/1 var(--font-head); color: var(--teal-deep); margin-bottom: .4rem; }
.hc-quiz__result p { color: var(--navy-soft); margin: 0 0 1rem; }
.hc-quiz__step { animation: pf-qin .35s cubic-bezier(.2,.7,.3,1); }
@keyframes pf-qin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .home-hero .bl-hero__graphic svg, .page-hero__graphic svg, .tile *, .hc-quiz__step { animation: none !important; }
  .bl-hero__graphic { transition: none; }
  .spark { display: none; }
  [data-reveal] .hm-card, [data-reveal] .card, [data-reveal] .feat-card { opacity: 1; transform: none; transition: none; }
  .life-track .lt-path { stroke-dashoffset: 0; transition: none; }
  .life-track .lt-dot, .life-track .lt-label { opacity: 1; transform: none; transition: none; }
  .tile--bp .row, .tile--cx .bar { transform: none; opacity: 1; }
  .tile--as .docx { opacity: 0; } .tile--as .slide { opacity: 1; transform: none; }
}
