/* In Our House, motion layer v1.
   Loaded after onehouse.css on every page. onehouse-motion.js adds html.m-on, so with no script nothing here changes.
   Values come from the site (review/site-our-story.css): ink colours, row sweep, gradient bar, 2px scroll line. */
:root{ --m-settle:cubic-bezier(.16,.84,.24,1); --m-ease:cubic-bezier(.22,.61,.36,1); --m-grad:linear-gradient(90deg,#BCF0DB,#8BB4FA); }

/* 1. Screen enter: the script runs it with the Web Animations API, so the page's own CSS rise steps aside */
html.m-on [data-screen],
html.m-on [data-screen] > *,
html.m-on x-dc > div[style*="max-width:480px"] > *:not([data-glow]){ animation:none !important; }
html.m-on:not([data-mode="tv"]) x-dc [style*="--ink:1"]{ animation:none !important; }
/* TV titles keep their breath in; the colour now runs word by word */
html.m-on[data-mode="tv"] [data-anim="a"] [data-in="title"][style*="--ink:1"]{ animation:tvBreathA .86s cubic-bezier(.22,.6,.2,1) .14s both !important; }
html.m-on[data-mode="tv"] [data-anim="b"] [data-in="title"][style*="--ink:1"]{ animation:tvBreathB .86s cubic-bezier(.22,.6,.2,1) .14s both !important; }
.m-w{ display:inline-block; }
.m-w.m-l{ display:inline; } /* long words and links keep their line breaks */

/* 2. Scroll line, like the site: 2px, mint to blue, grows with the page */
.m-scroll{ position:fixed; left:0; right:0; top:0; height:2px; z-index:2147483000; pointer-events:none; background:var(--m-grad); transform:scaleX(0); transform-origin:left center; opacity:0; transition:opacity .3s; }
.m-scroll.on{ opacity:1; }
html[data-mode="tv"] .m-scroll{ display:none; }

/* 3. Taps */
html.m-on x-dc [data-opt]{ transition:border-color .3s var(--m-ease),background-color .2s,transform .35s var(--m-settle) !important; }
html.m-on x-dc [data-opt]:active{ transform:scale(.985) !important; background-color:#EEF1EC !important; }
html.m-on x-dc [data-row]:active{ background-color:#EEF1EC !important; }
/* the mint to blue wash that opens from the tap point (a layer the script places over the option) */
.m-tap{ position:fixed; z-index:2147482000; pointer-events:none; mix-blend-mode:multiply; background:linear-gradient(90deg,rgba(188,240,219,.9),rgba(139,180,250,.62)); }
/* main button: the gradient bar stays drawn for a moment after a tap */
x-dc [data-cta].m-cta-on::after{ transform:scaleX(1) !important; }

/* 4. Hovers (mouse and trackpad only) */
@media (hover:hover){
  html.m-on x-dc [data-row]{ position:relative; isolation:isolate; }
  html.m-on x-dc [data-row]::before{ content:""; position:absolute; inset:1px 0; z-index:-1; pointer-events:none; background:linear-gradient(90deg,rgba(188,240,219,.42),rgba(139,180,250,.26) 52%,rgba(139,180,250,0) 92%); opacity:0; transform:scaleX(.35); transform-origin:left center; transition:transform .85s var(--m-ease),opacity .6s; }
  html.m-on x-dc [data-row]:hover{ background:transparent !important; }
  html.m-on x-dc [data-row]:hover::before, html.m-on x-dc [data-row]:focus-visible::before{ opacity:1; transform:none; }
  html.m-on x-dc [data-row] > *{ transition:transform .85s var(--m-ease); }
  html.m-on x-dc [data-row]:hover > :nth-child(-n+2){ transform:translateX(8px); }
  html.m-on x-dc [data-opt]:hover{ border-color:#1E1E1E !important; transform:translateY(-2px); }
  /* inline links draw an ink line over their blue one */
  html.m-on x-dc a:not([data-cta]):not([data-plain]):not([style*="display"]){ text-decoration:none !important; background-image:linear-gradient(#1E1E1E,#1E1E1E),linear-gradient(#8BB4FA,#8BB4FA); background-size:0% 1.5px,100% 1.5px; background-position:0 100%,0 100%; background-repeat:no-repeat; padding-bottom:3px; transition:background-size .45s var(--m-ease) !important; }
  html.m-on x-dc a:not([data-cta]):not([data-plain]):not([style*="display"]):hover{ background-size:100% 1.5px,100% 1.5px; opacity:1 !important; }
  html.m-on x-dc button[style*="text-decoration:underline"], html.m-on x-dc a[style*="text-decoration:underline"][style*="display"]{ transition:text-decoration-color .35s var(--m-ease) !important; }
  html.m-on x-dc button[style*="text-decoration:underline"]:hover, html.m-on x-dc a[style*="text-decoration:underline"][style*="display"]:hover{ text-decoration-color:#1E1E1E !important; opacity:1 !important; }
}

/* 5. Signature: the scale fills with the gradient as a finger slides across it */
html.m-on x-dc [style*="repeat(5,1fr)"]{ touch-action:pan-y; }
html.m-on x-dc [style*="repeat(5,1fr)"] > [data-opt]{ position:relative; isolation:isolate; }
html.m-on x-dc [style*="repeat(5,1fr)"] > [data-opt]::before{ content:""; position:absolute; inset:0; z-index:-1; pointer-events:none; background:var(--mg,var(--m-grad)); transform:scaleY(0); transform-origin:50% 100%; transition:transform .18s var(--m-ease); }
html.m-wave x-dc [style*="repeat(5,1fr)"] > [data-opt]::before{ transition:transform .3s var(--m-settle) calc(var(--mk,0) * 24ms); }
/* the per number gradient and the filled state are written by the script for the scale it finds */

/* 6. Reduced motion: a 200ms fade, never nothing (the pages' own rules turn every transition off) */
@media (prefers-reduced-motion:reduce){
  html.m-on x-dc [data-row]::before{ transform:none !important; transition:opacity .2s linear !important; }
  html.m-on x-dc [data-row] > *{ transition:none !important; transform:none !important; }
  html.m-on x-dc [data-opt]{ transition:border-color .2s linear,background-color .2s linear !important; }
  html.m-on x-dc [data-opt]:hover, html.m-on x-dc [data-opt]:active{ transform:none !important; }
  html.m-on x-dc [style*="repeat(5,1fr)"] > [data-opt]::before{ transform:none !important; opacity:0; transition:opacity .2s linear !important; }
  html.m-on x-dc a:not([data-cta]):not([data-plain]):not([style*="display"]){ transition:background-size .2s linear !important; }
  .m-scroll{ transition:opacity .2s linear; }
}
