/* ============================================================
   THEO TECH — motion & polish layer
   Loaded after styles.css. All animation is gated behind
   prefers-reduced-motion: no-preference; the static design
   still looks complete without it.
   ============================================================ */

:root {
  --amber-soft: #f6e3cb;
  --sky: #3a6ea5;
  --glow: rgba(58, 110, 165, .18);
}

/* ---------- Scroll progress + header ---------- */
#progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100;
  background: linear-gradient(90deg, var(--amber), var(--sky), var(--teal));
  transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}
.site-header { transition: box-shadow .3s ease, background .3s ease; }
.site-header .nav { transition: height .3s ease; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(12,34,51,.08); }
.site-header.scrolled .nav { height: 58px; }

/* ---------- Buttons ---------- */
.btn { position: relative; overflow: hidden; }
.btn-primary { background: linear-gradient(135deg, #243a66 0%, var(--teal) 55%, var(--teal-deep) 100%); }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -80%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg); transition: left .6s ease;
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover { box-shadow: 0 12px 30px rgba(27,44,78,.36); }

/* ---------- Eyebrow accent ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: .7rem; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: linear-gradient(90deg, var(--amber), transparent); border-radius: 2px; }
.hero .eyebrow, .page-hero .eyebrow { margin-bottom: 1.1rem; }

/* ---------- Hero ---------- */
.hero, .page-hero { isolation: isolate; }
.hero::before, .page-hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 140%; z-index: -2;
  background:
    radial-gradient(520px 380px at 12% 28%, rgba(217,138,61,.20), transparent 70%),
    radial-gradient(620px 460px at 82% 18%, rgba(58,110,165,.22), transparent 70%),
    radial-gradient(520px 420px at 58% 92%, rgba(27,44,78,.12), transparent 70%);
  filter: blur(8px);
}
.hero::after, .page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(12,34,51,.14) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 35%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse 70% 70% at 70% 35%, #000 0%, transparent 72%);
  opacity: .55;
}
.hero h1 em {
  background: linear-gradient(100deg, var(--teal-deep) 10%, var(--sky) 60%, #c97a2e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  padding-right: .06em;
}
.hero-rotator { font-size: 1.05rem; color: var(--muted); margin: -.8rem 0 1.8rem; display: flex; gap: .45rem; align-items: baseline; flex-wrap: wrap; }
.hero-rotator .rot {
  display: inline-block; font-weight: 700; color: var(--teal-deep);
  border-bottom: 2px solid var(--amber); padding-bottom: 1px;
  transition: opacity .35s ease, transform .35s ease;
}
.hero-rotator .rot.out { opacity: 0; transform: translateY(8px); }

.hero-stage { position: relative; max-width: 460px; margin: 0 auto; width: 100%; }


/* ---------- Animated flow ---------- */
#flow { background: var(--paper); }
.flow { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding-top: 12px; }
.flow::before {
  content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 38px; height: 2px; z-index: 0;
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 16px);
}
.flow-pulse { position: absolute; left: 12.5%; top: 34px; width: 10px; height: 10px; border-radius: 50%; z-index: 1; background: var(--amber); box-shadow: 0 0 0 6px rgba(217,138,61,.2), 0 0 18px rgba(217,138,61,.8); }
.flow-node { position: relative; z-index: 2; text-align: center; padding: 0 8px; }
.flow-icon {
  width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center;
  background: var(--white); border: 2px solid var(--line); color: var(--teal-deep); box-shadow: var(--shadow);
  transition: border-color .3s ease, background .3s ease, color .3s ease, transform .3s ease;
}
.flow-node h3 { font-size: 1.15rem; margin-bottom: .3rem; }
.flow-node p { color: var(--muted); font-size: .92rem; margin: 0 auto; max-width: 230px; }
.flow-sample { text-align: center; color: var(--muted-2); font-size: .82rem; margin-top: 28px; }

/* ---------- Pain list: question -> check ---------- */
.pain-list li { transition: border-color .4s ease, transform .4s ease, box-shadow .4s ease; }
.pain-list li::before { transition: background .4s ease, color .4s ease, transform .4s ease; }
.pain-list.fixed li::before { content: "\2713"; background: var(--teal); color: #fff; }
.pain-list.fixed li { border-color: var(--teal-soft); box-shadow: 0 6px 18px rgba(27,44,78,.06); }

/* ---------- Spotlight cards ---------- */
.card, .demo-card, .step-card, .team-card, .about-why, .price-note { position: relative; }
.card::after, .demo-card::after, .step-card::after, .team-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%);
}
.card:hover::after, .demo-card:hover::after, .step-card:hover::after, .team-card:hover::after { opacity: 1; }
.card-icon { transition: transform .3s ease, background .3s ease; }
.card:hover .card-icon { transform: translateY(-3px) rotate(-4deg); background: var(--amber-soft); }
.step-card { transition: transform .18s ease, box-shadow .22s ease; }
.step-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.industry-card .more { display: inline-block; transition: transform .25s ease; }
.industry-card:hover .more { transform: translateX(5px); }

/* ---------- Demo thumbnails ---------- */
.demo-thumb svg { opacity: .42; }

/* ---------- Section rhythm ---------- */
#services { background: var(--paper); }
#concepts { background: linear-gradient(180deg, var(--sand) 0%, var(--paper) 100%); }
.section-head h2 { text-wrap: balance; }

/* ============================================================
   Animations (motion allowed only)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @keyframes drift1 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(40px,24px,0) scale(1.08); } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes spinr { to { transform: rotate(-360deg); } }
  @keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
  @keyframes pingdot { 0% { box-shadow: 0 0 0 0 rgba(27,44,78,.45); } 100% { box-shadow: 0 0 0 10px rgba(27,44,78,0); } }
  @keyframes wordIn { from { opacity: 0; transform: translateY(.45em); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  @keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }
  @keyframes tick { to { transform: translateX(-50%); } }
  @keyframes flowMove { 0% { left: 12.5%; opacity: 0; } 6% { opacity: 1; } 94% { opacity: 1; } 100% { left: calc(87.5% - 10px); opacity: 0; } }
  @keyframes nodeOn {
    0%, 3% { border-color: var(--line); background: var(--white); color: var(--teal-deep); transform: none; }
    8%, 22% { border-color: var(--teal); background: var(--teal); color: #fff; transform: scale(1.12); }
    30%, 100% { border-color: var(--line); background: var(--white); color: var(--teal-deep); transform: none; }
  }
  @keyframes slip { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
  @keyframes waveY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
  @keyframes houseFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
  @keyframes sheen { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

  .hero::before, .page-hero::before { animation: drift1 18s ease-in-out infinite; will-change: transform; }

  .js .hero .eyebrow, .js .hero-sub, .js .hero-rotator, .js .hero-cta, .js .hero-note { opacity: 0; animation: fadeUp .8s ease forwards; }
  .js .hero .eyebrow { animation-delay: .05s; }
  .js .hero-sub { animation-delay: .75s; }
  .js .hero-rotator { animation-delay: .9s; }
  .js .hero-cta { animation-delay: 1.05s; }
  .js .hero-note { animation-delay: 1.25s; }
  .hero h1 .w { display: inline-block; opacity: 0; animation: wordIn .8s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(.2s + var(--i) * .07s); }

  .js .hero-stage { opacity: 0; animation: fadeUp 1s ease .35s forwards; }
          
          

  .flow.live .flow-pulse { animation: flowMove 8s ease-in-out infinite; }
  .flow.live .flow-icon { animation: nodeOn 8s ease-in-out infinite; }
  .flow.live .flow-node:nth-child(3) .flow-icon { animation-delay: 2s; }
  .flow.live .flow-node:nth-child(4) .flow-icon { animation-delay: 4s; }
  .flow.live .flow-node:nth-child(5) .flow-icon { animation-delay: 6s; }

  .pain-list.fixed li { transition-delay: calc(var(--i) * .12s); }
  .pain-list.fixed li::before { transition-delay: calc(var(--i) * .12s); }

  .demo-thumb.marina svg rect { animation: slip 3.6s ease-in-out infinite; }
  .demo-thumb.marina svg rect:nth-child(2n) { animation-delay: .6s; }
  .demo-thumb.marina svg rect:nth-child(3n) { animation-delay: 1.4s; }
  .demo-thumb.marina svg rect:nth-child(5n) { animation-delay: 2.1s; }
  .demo-thumb.pool svg path { animation: waveY 4.5s ease-in-out infinite; }
  .demo-thumb.pool svg path + path { animation-duration: 3.6s; animation-direction: reverse; }
  .demo-thumb.home svg g, .demo-thumb.houseiq svg g, .demo-thumb.simplyclean svg g { animation: houseFloat 5s ease-in-out infinite; }

  .reveal { transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-stage { max-width: 420px; }
  .flow::before, .flow-pulse { display: none; }
}
@media (max-width: 520px) {
  }

/* gradient text must be applied to the split-word spans inside <em> */
.hero h1 em .w {
  background: linear-gradient(100deg, var(--teal-deep) 10%, var(--sky) 60%, #c97a2e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  padding-right: .06em;
}

/* Hero layout (clean: logo + text, no decorative waves) */
.hero { padding: 96px 0 88px; }
.hero-stage .hero-logo { max-width: 100%; filter: drop-shadow(0 22px 30px rgba(12,34,51,.16)); }
@media (prefers-reduced-motion: no-preference) {
  .hero-stage .hero-logo { animation: bob 7s ease-in-out infinite; }
}
@media (max-width: 900px) { .hero { padding: 56px 0 64px; } }

/* images with width/height attributes must scale proportionally */
.hero-logo, .brand-mark { height: auto; }
.brand-mark { width: 34px; }
.hero-stage .hero-logo { width: 100%; max-width: 440px; margin: 0 auto; }

/* ---------- Mobile alignment ---------- */
@media (max-width: 900px) {
  .eyebrow { display: block; }
  .eyebrow::before { display: none; }
  .hero-visual { max-width: none; width: 100%; }
  .hero-stage .hero-logo { max-width: 300px; margin: -24px auto -28px; }
  .hero-rotator { margin: 0 0 1.4rem; }
  .section-head { margin-bottom: 2rem; }
  .pain-close { flex-direction: column; align-items: flex-start; gap: .8rem; }
  .pain-close p { font-size: 1.3rem; }
  .demo-actions { flex-wrap: wrap; }
  .demo-callout { padding: 22px; }
  .flow-node { text-align: left; display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; align-items: start; padding: 0; }
  .flow-node .flow-icon { margin: 0; grid-row: 1 / span 2; }
  .flow-node p { margin: 0; max-width: none; }
  .flow-node h3 { margin-bottom: .2rem; }
}

@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; gap: 26px; padding-top: 0; }
  .btn { line-height: 1.25; text-align: center; justify-content: center; }
  .price-note .btn, .pain-close .btn, .demo-callout .btn { width: 100%; }
  .container { padding: 0 20px; }
}

/* contain the decorative glow so it never causes sideways scrolling */
.page-hero, .hero { overflow: hidden; }
html, body { overflow-x: clip; }
