/* The homepage look, loaded after home.css on main/landing and layouts.site. Light palette and hover motion.
   Rules: no grid, padding, margin, width or font-size changes here, so the layout stays home.css's.
   Hover effects live in the hover + no-preference block, so touch and reduced-motion users get the static page.
   Homepage sections are keyed by ID; every other page uses the same effects through classes on its section:
   .hue-* (colour), .m-cycle (rotate colour per tile), .m-tint-* (tile wash), .m-sweep/.m-pointer/.m-focus/.m-fill/.m-shots (hover).
   <x-site.section> sets them from props. Reference: docs/design-system/homepage-design-system.md */

:root {
  --page: #FBFBFD; --tile-2: #F1F4F6; --tile-3: #F8FAFB; --line: #E8ECEF; --line-2: #D8DEE2;
  --shadow: 0 1px 2px rgba(20,43,47,.04), 0 14px 34px -14px rgba(20,43,47,.16);
  --shadow-lg: 0 2px 6px rgba(20,43,47,.05), 0 34px 70px -24px rgba(20,43,47,.26);
  --rest: 0 1px 2px rgba(20,43,47,.03), 0 8px 24px -18px rgba(20,43,47,.14);
  --blue: #1D4ED8; --blue-s: #EAF1FF; --teal: #0F766E; --teal-s: #E3F6F3; --slate: #1B3A40; --slate-s: #E9EFF0;
  --m-body: linear-gradient(180deg, #FFF 0, #F5F8FF 14%, #FBFBFD 26%, #F2FBF9 40%, #FFFBF2 54%, #F8F5FF 68%, #FBFBFD 82%, #FFF6F5 100%);
  --m-teal-tile: linear-gradient(155deg, #F0F8F7, #E3F2F0);
  --m-rule: rgba(20,43,47,.06); --m-rule-on: #fff; --m-on-tint: rgba(255,255,255,.75); --m-on-sec: #fff; --m-sheen: rgba(255,255,255,.5);
  --sec-ink: var(--teal); --sec-soft: var(--teal-s);
}

/* Dark palette: the OS or browser asks for it, or the head script sets data-theme at night. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --rest: 0 1px 2px rgba(0,0,0,.3), 0 10px 26px -18px rgba(0,0,0,.6);
  --blue: #8AB4FF; --blue-s: rgba(96,150,255,.16); --teal: #6FD6C8; --teal-s: rgba(94,234,212,.12); --slate: #B6C9CD; --slate-s: rgba(182,201,205,.12);
  --m-body: linear-gradient(180deg, #141414 0, #111620 14%, #121212 26%, #101716 40%, #17140F 54%, #131517 68%, #121212 82%, #191313 100%);
  --m-teal-tile: linear-gradient(155deg, #1C2C2A, #172321);
  --m-rule: rgba(255,255,255,.07); --m-rule-on: #391F1E; --m-on-tint: rgba(255,255,255,.05); --m-on-sec: #121212; --m-sheen: rgba(255,255,255,.18);
} }
:root[data-theme="dark"] {
  --rest: 0 1px 2px rgba(0,0,0,.3), 0 10px 26px -18px rgba(0,0,0,.6);
  --blue: #8AB4FF; --blue-s: rgba(96,150,255,.16); --teal: #6FD6C8; --teal-s: rgba(94,234,212,.12); --slate: #B6C9CD; --slate-s: rgba(182,201,205,.12);
  --m-body: linear-gradient(180deg, #141414 0, #111620 14%, #121212 26%, #101716 40%, #17140F 54%, #131517 68%, #121212 82%, #191313 100%);
  --m-teal-tile: linear-gradient(155deg, #1C2C2A, #172321);
  --m-rule: rgba(255,255,255,.07); --m-rule-on: #391F1E; --m-on-tint: rgba(255,255,255,.05); --m-on-sec: #121212; --m-sheen: rgba(255,255,255,.18);
}

/* A hue per section: labels, rings, tints. Every ink is 4.5:1 or better on its soft. */
#what, #lead-capture, #solutions, #showcase, .hue-blue { --sec-ink: var(--blue); --sec-soft: var(--blue-s); }
#features, #mobile, #reports, #faq, .hue-slate { --sec-ink: var(--slate); --sec-soft: var(--slate-s); }
#how-it-works, #assignment, #why, .hue-teal { --sec-ink: var(--teal); --sec-soft: var(--teal-s); }
#problems, #industries, .hue-amber { --sec-ink: var(--amber-ink); --sec-soft: var(--amber-soft); }
#quotations, #trust, .hue-ok { --sec-ink: var(--ok); --sec-soft: var(--ok-soft); }
#pricing, .hue-accent { --sec-ink: var(--accent-ink); --sec-soft: var(--accent-soft); }
.m-cycle .tile:not(.dark, .red):nth-child(4n+1), .m-cycle .subs > div:nth-child(4n+1) { --sec-ink: var(--blue); --sec-soft: var(--blue-s); }
.m-cycle .tile:not(.dark, .red):nth-child(4n+2), .m-cycle .subs > div:nth-child(4n+2) { --sec-ink: var(--slate); --sec-soft: var(--slate-s); }
.m-cycle .tile:not(.dark, .red):nth-child(4n+3), .m-cycle .subs > div:nth-child(4n+3) { --sec-ink: var(--amber-ink); --sec-soft: var(--amber-soft); }
.m-cycle .tile:not(.dark, .red):nth-child(4n), .m-cycle .subs > div:nth-child(4n) { --sec-ink: var(--ok); --sec-soft: var(--ok-soft); }
#what .tile:nth-child(2), #features .tile:not(.dark, .red):nth-child(3n+2), #why .subs > div:nth-child(4n+2) { --sec-ink: var(--slate); --sec-soft: var(--slate-s); }
#what .tile:nth-child(3), #features .tile:not(.dark, .red):nth-child(3n), #why .subs > div:nth-child(4n+3) { --sec-ink: var(--amber-ink); --sec-soft: var(--amber-soft); }
#what .tile:nth-child(4), #why .subs > div:nth-child(4n) { --sec-ink: var(--ok); --sec-soft: var(--ok-soft); }
#features .tile:not(.dark, .red):nth-child(3n+1), #why .subs > div:nth-child(4n+1) { --sec-ink: var(--blue); --sec-soft: var(--blue-s); }
#industries .tile:nth-child(3n+2) { --sec-ink: var(--teal); --sec-soft: var(--teal-s); }
#industries .tile:nth-child(3n) { --sec-ink: var(--slate); --sec-soft: var(--slate-s); }
#solutions .tile:nth-child(3n+2) { --sec-ink: var(--ok); --sec-soft: var(--ok-soft); }
#solutions .tile:nth-child(3n) { --sec-ink: var(--slate); --sec-soft: var(--slate-s); }

/* Page: one soft hue drift, no hard bands. Phones stay flat because the sticky flow stage masks with solid --page. */
@media (min-width: 901px) {
  body { background: var(--m-body); }
}
.announce { background: var(--accent-soft); color: var(--text); }
.announce a { color: var(--accent-ink); }

/* Hero: no dot grid, glow or gradient text. The product screenshot is the visual. */
.hero-shot { box-shadow: 0 0 0 1px var(--line), var(--shadow-lg); }
.float-a { animation: m-drift 6s ease-in-out infinite; }
.float-b { animation: m-drift 7.5s ease-in-out -2s infinite; } /* translate, not transform: GSAP owns the transform */

/* Surfaces */
.tile, .price, .faq details { box-shadow: inset 0 0 0 1px var(--line), var(--rest); }
.tile { transition: transform .35s var(--ease), box-shadow .35s var(--ease), opacity .3s; }
.label { font-family: var(--f-sans); font-weight: 600; text-transform: none; letter-spacing: 0; } /* same size and line height, so no reflow */
.tile .label { color: var(--sec-ink); }
#what .tile, .m-tint-top .tile:not(.dark, .red) { background: linear-gradient(180deg, var(--sec-soft), var(--tile) 62%); }
#quotations .tile, #mobile .tile, #trust .tile, .m-tint-left .tile:not(.dark, .red) { background: linear-gradient(135deg, var(--sec-soft), var(--tile) 42%); }
#lead-capture .tile, #reports .tile, .m-tint-right .tile:not(.dark, .red) { background: linear-gradient(225deg, var(--sec-soft), var(--tile) 40%); }
#follow-ups { background: linear-gradient(135deg, var(--amber-soft), var(--tile) 36%); }
#features .bar i b { background: var(--sec-ink); }

/* Former dark tiles: pale teal, dark text. */
.tile.dark { --sec-ink: var(--teal); --sec-soft: var(--teal-s); --glow: color-mix(in srgb, var(--teal) 14%, transparent); background: var(--m-teal-tile); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 16%, transparent), var(--rest); }
#problems .tile.dark { --sec-ink: var(--amber-ink); }
.tile.dark p { color: var(--muted); }
.tile.dark .label { color: var(--sec-ink); }
.tile.dark p a, .tile.dark .go, .tile.dark .mini-list svg { color: var(--teal); }
.tile.dark .rule { background: var(--m-rule); }
.tile.dark .rule.on { background: var(--m-rule-on); box-shadow: 0 6px 16px -8px rgba(20,43,47,.3); }
.tile.dark .subs > div { background: var(--m-on-tint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 14%, transparent); }
.tile.dark .subs h3 { color: var(--text); }
.tile.dark .subs p { color: var(--muted); }
.tile.dark .store { background: var(--text); color: var(--page); }
.tile.dark .store.soon { background: var(--tile); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
.price.pop { background: #142B2F; } /* same in both themes, so the plan stands out in dark */
.tile.red { --sec-ink: #fff; --sec-soft: rgba(255,255,255,.15); background: linear-gradient(150deg, #D91C20, #BF1519); }

/* Flow demo: a light board, like the product. */
.stage { --ink: var(--tile); --ink-2: var(--tile-3); --on-ink: var(--muted); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-lg); }
.stage-bar b, .stage-cap b { color: var(--text); }
.stepdots i { background: var(--line-2); }
.ghost { background: var(--tile-2); }
.bcol.on { background: var(--sec-soft); }
.mover { box-shadow: 0 0 0 1px var(--line), 0 12px 26px -10px rgba(20,43,47,.3); }
.panel { box-shadow: 0 0 0 1px var(--line), 0 18px 40px -14px rgba(20,43,47,.3); }
.step .n { justify-self: start; border-radius: 3px; transition: transform .3s var(--ease), background .3s, box-shadow .3s; }
.step.is-on .n { background: var(--sec-soft); box-shadow: 0 0 0 .35rem var(--sec-soft); } /* spread, not padding: no reflow */

.faq details { transition: box-shadow .3s var(--ease); }
.faq details[open] { background: linear-gradient(180deg, var(--sec-soft), var(--tile) 70%); }
.faq details[open] p { animation: m-rise .4s var(--ease) both; }

.cta { background: linear-gradient(120deg, #D91C20, #BF1519); }
.cta::before { transition: translate .9s var(--ease); }
.paused .float { animation-play-state: paused; }

/* Scroll-linked, native only. Browsers without it show the settled state. */
@supports (animation-timeline: scroll()) {
  body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; background: linear-gradient(90deg, var(--accent), #E0431F); transform: scaleX(0); transform-origin: 0 50%; animation: m-progress linear both; animation-timeline: scroll(root); pointer-events: none; }
  @media (prefers-reduced-motion: no-preference) {
    .invoice > *, .mini-list li { animation: m-rise linear both; animation-timeline: view(); animation-range: cover 0% cover 16%; }
    :is(.invoice > *, .mini-list li):nth-child(2) { animation-range: cover 2% cover 18%; }
    :is(.invoice > *, .mini-list li):nth-child(3) { animation-range: cover 4% cover 20%; }
    :is(.invoice > *, .mini-list li):nth-child(4) { animation-range: cover 6% cover 22%; }
    :is(.invoice > *, .mini-list li):nth-child(5) { animation-range: cover 8% cover 24%; }
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  /* Every section: a soft wash fades in and the heading's accent bar draws. Absolute, so nothing reflows. */
  :is(.section, .fx-sec) { position: relative; }
  :is(.section, .fx-sec)::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 460px at 50% 0, var(--sec-soft), transparent); -webkit-mask: linear-gradient(180deg, transparent, #000 6rem, #000 calc(100% - 6rem), transparent); mask: linear-gradient(180deg, transparent, #000 6rem, #000 calc(100% - 6rem), transparent); opacity: 0; transition: opacity .5s; pointer-events: none; }
  :is(.section, .fx-sec):hover::before { opacity: .75; }
  .head h2 { position: relative; }
  .head h2::after { content: ""; position: absolute; left: 0; bottom: -.22em; width: 3.2rem; height: 3px; border-radius: 3px; background: var(--sec-ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease); }
  :is(.section, .fx-sec):hover .head h2::after { transform: scaleX(1); }

  .tile:not(.dark, .red):hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sec-ink) 32%, transparent), var(--shadow); }
  .tile.dark:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 30%, transparent), var(--shadow); }
  .tile.red:hover { box-shadow: var(--shadow-lg); }
  .tile h3 a { text-decoration-color: transparent; text-underline-offset: 3px; transition: color .25s, text-decoration-color .25s; }
  .tile:hover h3 a { color: var(--sec-ink); text-decoration-color: currentColor; }

  /* What: a coloured hairline sweeps the top edge */
  :is(#what, .m-sweep) .tile::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--sec-ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s var(--ease); }
  :is(#what, .m-sweep) .tile:hover::after { transform: scaleX(1); }

  /* Features: the border lights up under the pointer (--mx/--my from home.js) */
  :is(#features, .m-pointer) .tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), var(--sec-ink), transparent 70%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s; pointer-events: none; }
  :is(#features, .m-pointer) .tile:hover::after { opacity: 1; }

  /* Sub-cards: tint, lift, a side bar grows */
  .subs > div { position: relative; overflow: hidden; transition: transform .3s var(--ease), background .3s, box-shadow .3s; }
  .subs > div::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--sec-ink); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .35s var(--ease); }
  .subs > div:hover, .tile.dark .subs > div:hover { transform: translateY(-2px); background: var(--sec-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sec-ink) 26%, transparent); }
  .subs > div:hover::before { transform: scaleY(1); }
  .subs h3 { transition: color .25s; }
  .subs > div:hover h3, .tile.dark .subs > div:hover h3 { color: var(--sec-ink); }

  /* Screenshots: zoom inside the frame, one sheen pass (no transition at rest, so it snaps back unseen) */
  .shot { position: relative; overflow: hidden; }
  .shot img { transition: transform .7s var(--ease); }
  .tile:hover .shot img { transform: scale(1.03); }
  :is(#showcase, .m-shots) .media { position: relative; }
  :is(#showcase, .m-shots) .tile:hover .media img { transform: translateY(-4px) scale(1.04); transform-origin: 0 0; }
  .shot::after, :is(#showcase, .m-shots) .media::after, .btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, var(--m-sheen) 50%, transparent 60%); transform: translateX(-120%); pointer-events: none; }
  .tile:hover .shot::after, :is(#showcase, .m-shots) .tile:hover .media::after, .btn-primary:hover::after { transform: translateX(120%); transition: transform .9s var(--ease); }

  /* Solutions + showcase: the hovered tile comes forward, the rest ease back. !important beats GSAP's inline opacity. */
  :is(#solutions, #showcase, .m-focus) .tile:hover { transform: translateY(-5px); }
  :is(#solutions, #showcase, .m-focus) .board:hover .tile:not(:hover) { opacity: .82 !important; transform: scale(.985); }

  /* Industries: tint fills from the bottom */
  :is(#industries, .m-fill) .tile::before { background: var(--sec-soft); opacity: 1; transform: scaleY(0); transform-origin: 50% 100%; transition: transform .45s var(--ease); }
  :is(#industries, .m-fill) .tile:hover::before { transform: scaleY(1); }
  :is(#industries, .m-fill) .chip { background: linear-gradient(var(--sec-ink), var(--sec-ink)) no-repeat 0 0 / 0% 100% var(--tile-2); transition: background-size .35s var(--ease), color .2s; }
  :is(#industries, .m-fill) .chip:hover { background: linear-gradient(var(--sec-ink), var(--sec-ink)) no-repeat 0 0 / 100% 100% var(--tile-2); color: var(--m-on-sec); }

  .step:hover .n { transform: translateX(4px); }

  /* Pricing */
  .price { position: relative; }
  .price:not(.pop):hover { box-shadow: inset 0 0 0 1.5px var(--sec-ink), var(--shadow); }
  .price.pop:hover { box-shadow: var(--shadow-lg); }
  .price .amt { transform-origin: 0 100%; transition: transform .35s var(--ease); }
  .price:hover .amt { transform: scale(1.06); }
  .price.pop::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: conic-gradient(from var(--m-a), transparent 0 58%, #FF8A8C 80%, #fff 92%, transparent); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s; pointer-events: none; }
  .price.pop:hover::before { opacity: 1; animation: m-spin 4s linear infinite; }

  .faq details:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sec-ink) 32%, transparent), var(--shadow); }
  .faq summary { transition: color .2s; }
  .faq summary:hover { color: var(--sec-ink); }
  .faq details:not([open]) summary:hover svg { transform: rotate(90deg); }

  .cta:hover::before { translate: -10% 12%; }

  /* Controls */
  .btn-primary { position: relative; overflow: hidden; }
  .btn-primary:hover { box-shadow: 0 14px 28px -10px rgba(237,32,36,.6); }
  .btn-light:hover { box-shadow: inset 0 0 0 1px var(--text), var(--shadow); }
  .cta .btn-light:hover { box-shadow: var(--shadow-lg); }
  .go { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .25s; }
  .go:hover { text-decoration-color: currentColor; }
  .go svg { transition: transform .3s var(--ease); }
  .go:hover svg { transform: translateX(4px); }
  .pill { transition: transform .25s var(--ease), box-shadow .25s; }
  .pill:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow); }
}

@property --m-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes m-spin { to { --m-a: 360deg; } }
@keyframes m-drift { 50% { translate: 0 -9px; } }
@keyframes m-rise { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes m-progress { to { transform: scaleX(1); } }
