/* TACIT motion 1.0.0: the CSS the scripted behaviours need. Everything is keyed to data attributes; no class names.
   Layout, type and colour stay in Webflow. Rules inside :where() carry no specificity, so any Webflow class overrides them.
   The DOM contract is in HOOKS.md. */

/* 1. Live drawings. The script adds a <canvas> that fills the hook element; the element gets its size in Webflow. */
:where([data-lines], [data-step], [data-plot]) { position: relative; display: block; }
[data-lines] > canvas, [data-step] > canvas, [data-plot] > canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }

/* 2. Headline words light up as the band mouths them. */
[data-word] { transition: opacity .25s cubic-bezier(.2, .7, .2, 1); }
[data-speaking="true"] [data-word] { opacity: .45; }
[data-speaking="true"] [data-word="on"] { opacity: 1; }

/* 3. Films. The film lies over the still and is only shown once it is really playing. */
:where([data-film]) { position: relative; overflow: hidden; }
:where([data-film] video[data-film-video]) { object-fit: cover; z-index: 1; }
[data-film] video[data-film-video] { position: absolute; left: 0; top: 0; width: 100%; height: 100%; visibility: hidden; }
[data-film][data-film-state="playing"] video[data-film-video],
[data-film][data-film-state="paused"] video[data-film-video] { visibility: visible; }

/* 4. Nav glass. The bar itself turns clear; a stack of masked backdrop blurs and a colour veil sit behind it and fade out below it. */
:where([data-tacit-nav]) { position: relative; }
[data-tacit-nav][data-nav-glass="true"] { background: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border-bottom-color: transparent !important; isolation: isolate; transition: color .45s; }
[data-tacit-glass] { position: absolute; left: 0; right: 0; top: 0; height: 150%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .35s; }
[data-nav-stuck="true"] > [data-tacit-glass] { opacity: 1; }
[data-tacit-glass] > * { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
[data-tacit-glass] > span { transition: background-color .5s; }

/* 5. Page load reveal, from html[data-tacit-ready="false"] (set by the head snippet) to "true" (set by the script). */
[data-reveal="rise"], [data-reveal="rise-late"] { transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform 1.1s cubic-bezier(.2, .7, .2, 1); }
[data-reveal="rise-late"] { transition-delay: .35s; }
html[data-tacit-ready="false"] [data-reveal="rise"],
html[data-tacit-ready="false"] [data-reveal="rise-late"] { opacity: 0; transform: translateY(16px); }
[data-reveal="open"] { clip-path: inset(0 round var(--tacit-reveal-r, 0px)); transition: clip-path 1.5s cubic-bezier(.2, .7, .2, 1); }
html[data-tacit-ready="false"] [data-reveal="open"] { clip-path: inset(9% 7% 9% 7% round 40px); }
[data-reveal="settle"] { transition: transform 2s cubic-bezier(.2, .7, .2, 1); }
html[data-tacit-ready="false"] [data-reveal="settle"] { transform: scale(1.09); }

/* 6. Product images: the base render with the lit render stacked on top of it. */
:where([data-lit], [data-gallery-layer="shot"]) { position: relative; }
[data-lit] [data-finish-img], [data-gallery-layer="shot"] [data-finish-img] { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
/* Homepage stage: the mark lights when data-lit turns "true" */
[data-lit] [data-finish-img="glow"] { opacity: 0; transition: opacity .9s cubic-bezier(.2, .7, .2, 1); }
[data-lit="true"] [data-finish-img="glow"] { opacity: 1; }
/* Product page side view: the mark lights, breathes once and rests, on a loop */
@keyframes tacit-breathe { 0%, 14% { opacity: 0; } 40% { opacity: 1; } 52% { opacity: .72; } 64% { opacity: 1; } 92%, 100% { opacity: 0; } }
[data-gallery] [data-finish-img="glow"] { opacity: 0; transition: opacity .7s cubic-bezier(.2, .7, .2, 1); }
[data-gallery][data-view="side"] [data-finish-img="glow"] { animation: tacit-breathe 6.4s ease-in-out infinite; }

/* 7. Product gallery: views crossfade off data-view on the root. */
[data-gallery-layer="shot"] { transition: opacity .35s cubic-bezier(.2, .7, .2, 1); }
[data-gallery-layer="trio"] { opacity: 0; pointer-events: none; transition: opacity .35s cubic-bezier(.2, .7, .2, 1); }
[data-gallery-layer="life"] { opacity: 0; pointer-events: none; transition: opacity .4s cubic-bezier(.2, .7, .2, 1); }
[data-gallery][data-view="trio"] [data-gallery-layer="trio"],
[data-gallery][data-view^="life"] [data-gallery-layer="life"] { opacity: 1; }
[data-gallery][data-view="trio"] [data-gallery-layer="shot"],
[data-gallery][data-view^="life"] [data-gallery-layer="shot"] { opacity: 0; }
/* wide layout: the lifestyle photo runs under the card instead of sitting in the panel */
html[data-tacit-wide="true"] [data-gallery-layer="life"] { display: none; }
:where([data-backdrop]) { z-index: 0; }
[data-backdrop] { position: fixed; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .5s cubic-bezier(.2, .7, .2, 1); }
[data-backdrop] > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
html[data-tacit-wide="true"][data-tacit-life="on"] [data-backdrop] { opacity: 1; }

/* 8. Accordion: the wrapper the height animation runs on. */
[data-accordion-body] { overflow: hidden; }

/* 9. Dock: slides up from the bottom edge on the narrow layout; it does not exist on the wide one. */
[data-dock] { transform: translateY(110%); transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
[data-dock="on"] { transform: none; }
html[data-tacit-wide="true"] [data-dock] { display: none; }

/* Reduced motion: every state change above happens at once, and the lit mark holds instead of breathing.
   (The canvases, the films and the accordion check the same preference in the script.) */
@media (prefers-reduced-motion: reduce) {
  [data-word], [data-reveal], [data-tacit-nav], [data-tacit-glass], [data-tacit-glass] > span, [data-finish-img],
  [data-gallery-layer], [data-backdrop], [data-dock] { transition-duration: .01ms !important; }
  [data-gallery][data-view="side"] [data-finish-img="glow"] { animation: none; opacity: 1; }
}
