/* ============================================================
   cannalonga · shared layer
   Loaded after each page's own stylesheet. Type and color stay as each page
   defines them (DM Sans, paper, ink, acid). This layer holds what every page
   shares on top: how numbers show their evidence, and which motion stays.
   ============================================================ */

/* ---------- evidence: how each number was measured ----------
   A mono label with a dot. Filled dot: measured by a system (Metabase, Jira, Search Console).
   Ring: reported by people (a survey answer, the team's own count). */
.ev{display:inline-flex; align-items:center; gap:6px; font-family:var(--mono, ui-monospace, monospace); font-size:10.5px; font-weight:500;
  letter-spacing:.04em; line-height:1; color:var(--ink-2); white-space:nowrap;}
.ev::before{content:''; width:7px; height:7px; border-radius:50%; background:var(--ink); flex:none;}
.ev.reported::before{background:transparent; box-shadow:inset 0 0 0 1.5px var(--ink);}

/* ---------- motion: only where it explains a state ----------
   Blocks rising in and numbers counting are gone: content is there when the page is,
   for a recruiter skimming and for a crawler reading. The highlight on the headline
   still draws in; hover and focus stay. */
/* blocks come in as they reach the screen (see the layered motion below); without JS or with reduced motion they are simply there */
.reveal{opacity:1; transform:none;}
.js .article-hero .col > *,.js .hero-copy > *,.js .stats,.js .hero-d h1 .w{animation:none !important;}
.js .shot.reveal .frame > img,.js .shot.reveal .stage img,.js .shot.reveal .phone-row img{transform:none !important; transition:none !important;}
.js .meta-item:last-child .v{animation:none !important;}
/* scroll-driven decoration (heading growing, hero receding, shots drifting) is gone too */
.closing h2,.hero-d > .wrap,.card-shot{animation:none !important;}

/* ---------- small fixes the old styles left behind ---------- */
/* headings inside numbered lists and takeaways were inheriting the gray of body text */
.article-body .process li h2,.article-body .process li h3,.article-body .takeaway{color:var(--ink);}
.article-body .process li p{line-height:1.55;}

/* ---------- the highlight ----------
   One mark, exactly the hero's: same acid, same band (.38em at 78% of the line), same draw.
   In the About it marks the facts, in the testimonials the phrase each person chose to stress.
   Each one draws when it reaches the screen (index.html adds .on); with reduced motion or
   no JavaScript it is simply there. */
mark.hl,.quote strong{
  background-color:transparent; color:var(--ink); padding:0 .06em; margin:0 -.06em;
  -webkit-box-decoration-break:clone; box-decoration-break:clone;
  background-image:linear-gradient(var(--acid),var(--acid));
  background-repeat:no-repeat; background-position:0 78%; background-size:100% .38em;
}
@keyframes hl-draw{from{background-size:0% .38em;} to{background-size:100% .38em;}}
.js mark.hl,.js .quote strong{background-size:0% .38em;}
.js mark.hl.on,.js .quote strong.on{animation:hl-draw 1s cubic-bezier(.2,.7,.2,1) .45s both;}
@media (prefers-reduced-motion:reduce){
  .js mark.hl,.js .quote strong{background-size:100% .38em; animation:none !important;}
}

/* ---------- the corner arrow ----------
   Every clickable card carries the same ↗ in a circle. On hover it turns acid, everywhere:
   case cards on the home and the callouts inside the cases. */
a.card .card-media::after,a.callout::after{transition:opacity .2s ease, transform .2s ease, background-color .2s ease, color .2s ease;}
a.card:hover .card-media::after,a.callout:hover::after,
a.card:focus-visible .card-media::after,a.callout:focus-visible::after{
  opacity:1; background-color:var(--acid); color:var(--ink);
}

/* ================= audit v27: motion with a job =================
   One easing, three durations. Everything that moves sits inside no-preference;
   with reduced motion every element is simply in its final state. */
:root{--ease-out:cubic-bezier(.2,.7,.2,1); --t-micro:160ms; --t-base:280ms; --t-max:480ms;}
@keyframes v27-mk{from{background-size:0% .38em;} to{background-size:100% .38em;}}
@keyframes v27-after{from{opacity:.35; transform:translateX(4px);} to{opacity:1; transform:none;}}
@keyframes v27-read{from{transform:scaleX(0);} to{transform:scaleX(1);}}

@media (prefers-reduced-motion:no-preference){
  /* 1. the hero highlight draws once, left to right */
  /* layered: first the highlight draws, then, after a beat, the results change one by one */
  .js .hero-d h1 .mk{animation:v27-mk 1s var(--ease-out) 350ms both !important;}
  /* 2. before stays, the arrow and the after value arrive: the change, not a count */
  /* v50: the marker under "the wrong screen" draws first (0.35s → 1.35s), then the results arrive left to right
     (top to bottom on phones): Detector, Genial, LIAM. Counted among the results only, so the "Results" label
     added before them on phones and tablets can't shift the order again. */
  .js .hero-d .after-in{display:inline-block; animation:v27-after 600ms var(--ease-out) 1500ms both;}
  .js .hero-d a.stat:nth-of-type(2) .after-in{animation-delay:1750ms;}
  .js .hero-d a.stat:nth-of-type(3) .after-in{animation-delay:2000ms;}
  /* then, as the page scrolls, each block comes in once: a short rise and fade */
  .js .reveal{opacity:0; transform:translateY(24px); transition:opacity 800ms var(--ease-out), transform 800ms var(--ease-out);}
  .js .reveal.in{opacity:1; transform:none;}
  /* 3. cards: the shot pans up, the arrow steps out, the source line comes forward */
  a.card .card-shot{transition:transform 600ms var(--ease-out);}
  a.card:hover .card-shot,a.card:focus-visible .card-shot{transform:translateY(-3%);}
  /* 4. the old top-edge reading bar stays off; a better place for it is still to be found */
  body::before{display:none !important;}
  /* 6. page to page: the card picture becomes the case picture */
  ::view-transition-group(*){animation-duration:var(--t-base); animation-timing-function:var(--ease-out);}
}
@media (prefers-reduced-motion:reduce){
  *{view-transition-name:none !important;}
  .js .hero-d .after-in{animation:none !important;}
}
@media (hover:hover) and (min-width:821px){
  a.card .card-met .ev{opacity:.7; transition:opacity var(--t-base) var(--ease-out);}
  a.card:hover .card-met .ev,a.card:focus-visible .card-met .ev{opacity:1;}
}

/* ================= audit v27: visual bugs ================= */
/* Pick & Pack: the corner arrow sits on the monitor, so it gets a solid ground */
a.card .card-media.coral::after{opacity:1; background:var(--paper);}
/* on touch screens the corner arrow is a hover hint with nothing to hover; it also slid under the back-to-top button */
@media (max-width:820px){ a.card .card-media::after{display:none;} }
/* nothing may push the page wider than the screen */
html,body{overflow-x:clip;}
.card-media{contain:paint;}
/* Compass on a phone: the wide boards scroll sideways on purpose; say so */
@media (max-width:820px){
  .shot.wide{position:relative;}
  .shot.wide::before{content:'scroll \2192'; position:absolute; top:10px; right:calc(var(--pad, 20px) + 10px); z-index:2;
    font-family:var(--mono, ui-monospace, monospace); font-size:11px; letter-spacing:.04em; color:var(--ink);
    background:var(--paper); border:1px solid var(--line); border-radius:100px; padding:4px 9px; pointer-events:none;}
  html[lang="pt-BR"] .shot.wide::before{content:'role \2192';}
}
/* the old reveal zoomed card pictures to 107% until they entered, and Matri kept a 106% scale meant for
   the drift that is gone: both pushed the picture 2px past a 375px screen */
.js .card.reveal .card-shot{transform:none;}
.card-media.ink .card-shot{scale:1 !important;}
@media (prefers-reduced-motion:no-preference){
  .js a.card.reveal:hover .card-shot,.js a.card.reveal:focus-visible .card-shot{transform:translateY(-3%);}
  .js a.card.reveal:hover .card-media.coral .card-shot{transform:none;}
}
/* case index: the section's rule lands just under the nav, so the heading is right there to read */
.stage-label{scroll-margin-top:96px;}

/* Matri: light phone screens run to the edge of a dark picture and met the light page; a gray hairline keeps the card's shape */
.card-media.ink .card-shot{scale:1.04;}   /* past the file's own rounded corners */
.card-media.ink::after{content:''; position:absolute; inset:0; z-index:1; border:1px solid #cbc7bc; border-radius:inherit; pointer-events:none;}
/* printing never waits for a block to scroll in */
@media print{ .reveal,.js .reveal{opacity:1 !important; transform:none !important;} }

/* ---------- case and AI pages: small print like the home ----------
   DM Sans, sentence case, no numbers. Numbers stay only where order is real (steps, pins on a screen). */
:is(.article-hero,.article-body) :is(.kicker,.updated,.meta-item .k,.tldr .k,.tldr dt,.index .k,.decision-row .dk,.receipts b,.compare .k,.ai-card .k,.award,.cat),
.flow figcaption{font-family:inherit; font-size:13.5px; font-weight:500; letter-spacing:-.005em; text-transform:none;}
.article-body .index li a::before{content:none;}
.article-body .decision-head .dn{display:none;}
.article-body .stage-label b{display:none;}
.article-body .stage-label span{font-size:15px; font-weight:500; letter-spacing:-.01em; text-transform:none; line-height:1.4;}
.article-body .stage-label.same span{display:none;}   /* the heading right below already says it */
@media (max-width:1099px){ .article-body .case-intro > .index{width:100%;} }   /* auto margins in a flex column shrank it to its text */
/* the marker in running text: always there on these pages, and it draws when its block comes in */
.js .article-body mark.hl{background-size:100% .38em;}
@media (prefers-reduced-motion:no-preference){ .js .article-body .reveal.in mark.hl{animation:hl-draw 1s cubic-bezier(.2,.7,.2,1) .45s both;} }

/* ================= v44 craft: micro-interactions =================
   Fast and functional: 150–250ms on one easing, nothing that moves without a reason. */
:root{--ease-out:cubic-bezier(.2,0,0,1);}

/* case index: the section being read gets an ink underline, not only the weight (acid disappears on paper) */
.index li a{transition:color .2s var(--ease-out), text-decoration-color .2s var(--ease-out);
  text-decoration-line:underline; text-decoration-color:transparent; text-decoration-thickness:2px; text-underline-offset:5px;}
.index li a.active{text-decoration-color:var(--ink);}

/* home cards: the picture settles a little closer, the corner arrow slides 4px toward where it goes */
@media (prefers-reduced-motion:no-preference){
  .card-shot{transition:transform .25s var(--ease-out) !important;}
  .js a.card.reveal:hover .card-shot,.js a.card.reveal:focus-visible .card-shot,
  .js a.card.reveal:hover .card-media.coral .card-shot,.js a.card.reveal:focus-visible .card-media.coral .card-shot{transform:scale(1.015) !important;}
  a.card .card-media::after{transition:opacity .2s var(--ease-out), transform .2s var(--ease-out), background-color .2s var(--ease-out), color .2s var(--ease-out) !important;}
  a.card:hover .card-media::after,a.card:focus-visible .card-media::after{transform:translate(4px,-4px) !important;}
}

/* copy feedback: the email button flips to ink with an acid label for 1.8s */
.copy-btn{transition:background-color .2s var(--ease-out), color .2s var(--ease-out);}
.copy-btn.done,.copy-btn.done:hover{background:var(--ink); color:var(--acid);}

/* anything copyable (colophon hex values and tokens) */
.copyable{cursor:copy; border-radius:4px; outline-offset:2px; position:relative; transition:background-color .2s var(--ease-out), color .2s var(--ease-out);}
.copyable:hover{background:rgba(20,20,15,.06);}
.copyable:focus-visible{outline:2px solid var(--ink);}
.copyable.copied{background:var(--acid); color:var(--ink);}
.copyable.copied::after{content:attr(data-copied-label); position:absolute; left:50%; bottom:calc(100% + 6px); transform:translateX(-50%); white-space:nowrap;
  font:700 11px/1 'DM Sans',sans-serif; letter-spacing:0; text-transform:none; background:var(--ink); color:var(--acid); padding:6px 8px; border-radius:6px; pointer-events:none;}

/* product demos recorded as video (MP4/WebM): framed like the rest of the case, with a quiet play/pause */
.demo{position:relative; margin:0; border:1px solid rgba(20,20,15,.08); border-radius:14px; overflow:hidden; background:var(--paper-2);}
.demo video{display:block; width:100%; height:auto;}
.demo-toggle{position:absolute; right:12px; bottom:12px; width:36px; height:36px; border:0; border-radius:50%; background:rgba(20,20,15,.72); color:var(--paper);
  display:flex; align-items:center; justify-content:center; cursor:pointer; opacity:0; transition:opacity .2s var(--ease-out);}
.demo:hover .demo-toggle,.demo-toggle:focus-visible,.demo-toggle[data-state="paused"]{opacity:1;}
.demo-toggle::before{content:''; width:10px; height:12px; border-left:3px solid currentColor; border-right:3px solid currentColor; box-sizing:border-box;}
.demo-toggle[data-state="paused"]::before{width:0; height:0; border:0; border-left:11px solid currentColor; border-top:7px solid transparent; border-bottom:7px solid transparent; margin-left:3px;}
@media (hover:none){ .demo-toggle{opacity:1;} }

/* ================= v45: the case cover arrives =================
   On the home the device moves under the cursor; opening the case, it rises into place.
   The light settles behind it a beat earlier, then the device lifts from below. Runs once per page load. */
/* Some engines (Safari, and Chrome while a layer animates) stop clipping a scaled child to the parent's
   rounded corners: the light, scaled from a point on the right, leaked past the left corners and squared them.
   The clip-path draws the same 18px round on its own, and isolation keeps the animated layers inside it. */
.hero-banner{isolation:isolate; clip-path:inset(0 round 18px); -webkit-clip-path:inset(0 round 18px);}
@keyframes hb-rise{from{opacity:0; transform:translateY(56px) scale(.965);} to{opacity:1; transform:none;}}
@keyframes hb-light{from{opacity:.35; transform:scale(1.06);} to{opacity:1; transform:none;}}
@keyframes hb-copy{from{opacity:0; transform:translateY(14px);} to{opacity:1; transform:none;}}
@media (prefers-reduced-motion:no-preference){
  .hero-banner .hb-shot img{animation:hb-rise .95s cubic-bezier(.16,1,.3,1) .22s both; will-change:transform,opacity;}
  .hero-banner::before{animation:hb-light 1.3s cubic-bezier(.16,1,.3,1) both; transform-origin:70% 60%;}
  .hero-banner .hb-text > *{animation:hb-copy .6s cubic-bezier(.16,1,.3,1) both;}
  .hero-banner .hb-text > :nth-child(2){animation-delay:.06s;}
  .hero-banner .hb-text > :nth-child(3){animation-delay:.12s;}
  .hero-banner .hb-text > :nth-child(n+4){animation-delay:.18s;}
}
