/* JustCreative — Swiss minimal. Tokens per PLAN.md §4.2. Hand-written, no framework. */

/* ---- Fonts (self-hosted, §5.4). Termina: as delivered, no subset (EULA). ---- */
@font-face{
  font-family:"Termina";
  src:url("/assets/fonts/termina-demi.woff2") format("woff2");
  font-weight:600; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Space Grotesk";
  src:url("/assets/fonts/space-grotesk-400.woff2") format("woff2");
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:"Space Grotesk";
  src:url("/assets/fonts/space-grotesk-500.woff2") format("woff2");
  font-weight:500; font-style:normal; font-display:swap;
}
/* Tuned wide fallback so the Termina swap shifts nothing (§5.4b). */
@font-face{
  font-family:"Termina-fallback";
  src:local("Arial");
  size-adjust:118%; ascent-override:78%; descent-override:22%; line-gap-override:0%;
}
/* Same treatment for the body face — most of the page is Space Grotesk (§5.4b). */
@font-face{
  font-family:"SpaceGrotesk-fallback";
  src:local("Arial");
  size-adjust:105%; ascent-override:93.7%; descent-override:27.8%; line-gap-override:0%;
}

/* ---- Tokens ---- */
:root{
  --color-primary:#18181B;        --color-on-primary:#FFFFFF;
  --color-secondary:#3F3F46;      --color-on-secondary:#FFFFFF;
  --color-accent:#2563EB;         --color-on-accent:#FFFFFF;
  --color-background:#FAFAFA;     --color-foreground:#09090B;
  --color-card:#FFFFFF;           --color-card-foreground:#09090B;
  --color-muted:#E8ECF0;          --color-muted-foreground:#475569;
  --color-border:#E4E4E7;         --color-border-strong:#18181B;
  --color-ring:#18181B;

  --space-1:.5rem; --space-2:1rem; --space-3:1.5rem; --space-4:2rem;
  --space-6:3rem;  --space-8:4rem; --space-12:6rem;

  --ease:cubic-bezier(.16,1,.3,1);
  --dur-fast:200ms; --dur-slow:600ms;

  --display:"Termina","Termina-fallback",Arial,sans-serif;
  --ui:"Space Grotesk","SpaceGrotesk-fallback",system-ui,-apple-system,sans-serif;

  --w-max:1920px;   /* full-bleed to 1920, capped + centered beyond */
  --r-pill:999px;          /* references run pills, not sharp corners */
  --r-tile:14px;
}

/* ---- Base ---- */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; overflow-x:clip; }
body{
  margin:0; background:var(--color-background); color:var(--color-foreground);
  overflow-x:clip;   /* belt-and-braces: animated stages can never cause sideways scroll */
  font-family:var(--ui); font-size:1rem; line-height:1.6; font-weight:400;
}
img,video{ max-width:100%; height:auto; display:block; }
/* The hidden attribute always wins — a display rule on a class must not undo it
   (bit us twice: the consent banner and the More-quotes button). */
[hidden]{ display:none !important; }
a{ color:inherit; text-decoration-thickness:1px; text-underline-offset:3px; }
a:hover{ color:var(--color-accent); transition:color var(--dur-fast) var(--ease); }
:focus-visible{ outline:2px solid var(--color-ring); outline-offset:2px; }
::selection{ background:var(--color-primary); color:var(--color-on-primary); }

.wrap{ max-width:var(--w-max); margin-inline:auto;
  /* 24px on phones → 120px at 1920, linear via 6.25vw (120/1920). */
  padding-inline:clamp(1.5rem, 6.25vw, 7.5rem); }
section{ padding-block:clamp(4rem,10vw,9rem); scroll-margin-top:5rem; }

/* Skip link (§7.1) */
.skip{
  position:absolute; left:-999px; top:0; z-index:100;
  background:var(--color-primary); color:var(--color-on-primary);
  padding:var(--space-1) var(--space-2);
}
.skip:focus{ left:0; }

/* ---- Type scale ---- */
.h-xl{
  font-family:var(--display); font-weight:600;
  font-size:clamp(2.6rem,7.2vw,6.5rem); line-height:1.02;
  letter-spacing:-.02em; margin:0 0 var(--space-4); text-wrap:balance;
}
.h-l{
  font-family:var(--display); font-weight:600;
  font-size:clamp(2.2rem,4.2vw,3.4rem); line-height:1.06; letter-spacing:-.01em;
  margin:0 0 var(--space-4); text-wrap:balance;
}
.h-m{ font-family:var(--display); font-weight:600; font-size:1.05rem; line-height:1.3; margin:0 0 var(--space-1); }
.kicker{
  font-size:.75rem; font-weight:500; letter-spacing:.22em; text-transform:uppercase;
  color:var(--color-muted-foreground); margin:0 0 var(--space-3);
}
.lead{ font-size:1.125rem; max-width:38rem; color:var(--color-secondary); }
.muted{ color:var(--color-muted-foreground); }

/* ---- Header ---- */
.top{ background:var(--color-background); }
.top .wrap{ display:flex; align-items:center; justify-content:space-between; height:4rem; }
.brand{ display:flex; align-items:center; gap:var(--space-1); text-decoration:none; }
.brand img{ height:1.3rem; width:auto; filter:brightness(0); }
.top nav{ display:flex; gap:var(--space-3); align-items:center; margin-left:auto; }
.top nav a{ text-decoration:none; font-weight:500; font-size:.95rem; padding:.4rem 0; }
.findme-label{ font-weight:600; margin-right:var(--space-1); }
.nav-ico{ display:none; width:1.5rem; height:1.5rem; }
@media (max-width:767px){
  .nav-txt{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .nav-ico{ display:block; }
  .top nav a{ padding:.5rem; }   /* 44px-ish touch targets for icon links */
}

/* ---- Hero ---- */
.hero{ padding-block:clamp(5rem,12vw,10rem) clamp(3rem,7vw,6rem); }
.hero .lead{ margin-block:var(--space-4); font-size:clamp(1.05rem,1.6vw,1.35rem); max-width:69rem; }  /* sized for a two-line lead at desktop */
.stats{ display:flex; gap:clamp(2rem,6vw,5rem); margin-top:clamp(2.5rem,6vw,4.5rem); flex-wrap:wrap; }
.stat b{ display:block; font-family:var(--display); font-weight:600; font-size:clamp(1.8rem,3.4vw,2.8rem); line-height:1.1; }
.stat span{ font-size:.8rem; letter-spacing:.14em; text-transform:uppercase; color:var(--color-muted-foreground); }

.btn{
  display:inline-flex; align-items:center; gap:.6rem;
  background:var(--color-primary); color:var(--color-on-primary);
  font-family:var(--ui); font-weight:500; font-size:1.05rem;
  padding:1rem 2rem; border:1px solid var(--color-border-strong); border-radius:var(--r-pill);
  text-decoration:none; cursor:pointer;
  transition:background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
             transform var(--dur-fast) var(--ease);
  min-height:44px;
}
.btn:hover{ background:var(--color-accent); border-color:var(--color-accent); color:var(--color-on-accent); }
.btn:active{ transform:scale(.98); }

/* ---- Client wall ---- */
.clients{ padding-block:var(--space-6); }
.clients p{ margin:0 0 var(--space-4); }
/* ---- Client wall: reference-style static grid — 5 across, two rows, air ---- */
.clients{ padding-block:clamp(2rem,4.5vw,4rem) clamp(4rem,9vw,8rem); }
.clients .kicker{ text-align:center; margin-bottom:clamp(2.5rem,6vw,4.5rem); }
.logo-grid{
  display:grid; grid-template-columns:repeat(2,1fr);
  gap:clamp(4rem,10vw,9rem) var(--space-6);   /* row gap ~1.5x — logos need air between rows */
  align-items:center; justify-items:center;
}
@media (min-width:640px){ .logo-grid{ grid-template-columns:repeat(3,1fr); } }
@media (min-width:1024px){ .logo-grid{ grid-template-columns:repeat(5,1fr); } }
.logo-grid img{
  /* --ls = per-logo scale from clients.scale_desktop, editable in the CMS */
  height:calc(clamp(3.8rem,5.2vw,5rem) * var(--ls, 1)); width:auto; max-width:16rem; object-fit:contain;
  filter:brightness(0); opacity:.9;   /* uniform dark marks, all logos */
}

/* ---- Work grid (§3.7, corrected): two DIFFERENT projects per row —
   small square beside large landscape, emphasis alternating. Captions per item. ---- */
.work-row{
  display:grid; gap:clamp(1.2rem,2.6vw,2.5rem);
  margin-block:clamp(3.5rem,8vw,7rem);
  align-items:start;
}
.work-row:last-of-type{ margin-bottom:0; }
@media (max-width:767px){
  .work-row{ gap:3.5rem; margin-block:3.5rem; }   /* stacked projects need real separation */
}
@media (min-width:768px){
  /* 35% / 65% split. Large 16/10 at 65% → height ≈ 1.16× the 35% square. */
  .work-row{ grid-template-columns:35fr 65fr; }        /* small | LARGE */
  .work-row.flip{ grid-template-columns:65fr 35fr; }   /* LARGE | small */
  .work-row.single{ grid-template-columns:1fr; }
  /* Full-width tile keeps the same rendered height as a 65% tile (0.65W·10/16). */
  .work-row.single .tile{ aspect-ratio:16/6.5; }
}
.witem .tile{ border-radius:var(--r-tile); background:var(--color-muted); position:relative; overflow:hidden; }
.w-lg .tile{ aspect-ratio:16/10; }    /* was 16/12.5, height -20% */
.w-sm .tile{ aspect-ratio:1/0.8; }    /* was square, height -20% */
@media (max-width:767px){ .w-sm .tile{ aspect-ratio:16/11; } }  /* stacked: everyone wide */
.tile img:not(.tile-endlogo):not(.fw-cap):not(.tlt-card img),.tile video{ width:100%; height:100%; object-fit:cover;
  transition:transform .8s var(--ease); display:block; }
a.tile-link:hover .tile img:not(.tile-endlogo):not(.fw-cap), a.tile-link:hover .tile video{ transform:scale(1.03); }
.tile .ph{
  position:absolute; inset:0; display:grid; place-items:center;
  color:var(--color-muted-foreground); font-size:.8rem; letter-spacing:.14em; text-transform:uppercase;
}
.p-meta{ display:flex; gap:var(--space-2); align-items:flex-start;
  justify-content:space-between; margin-top:var(--space-2); }
.p-head{ display:flex; flex-direction:column; gap:.35rem; }
.p-meta .h-m{ margin:0; font-size:clamp(1.15rem,1.9vw,1.5rem); }
.p-meta .disc{ font-size:.72rem; letter-spacing:.18em; text-transform:uppercase;
  color:var(--color-muted-foreground); }
.p-ext{ width:2.8rem; height:2.8rem; flex-shrink:0; margin-top:.1rem;
  color:var(--color-foreground); }
.p-sum{ margin:.35rem 0 0; color:var(--color-secondary); font-size:1rem; max-width:36rem; }
.p-sum a{ color:inherit; text-decoration:underline; text-underline-offset:3px; }
.p-sum a:hover{ color:var(--color-accent); }
a.tile-link{ display:block; text-decoration:none; color:inherit; }
a.tile-link:focus-visible{ outline:2px solid var(--color-ring); outline-offset:4px; border-radius:var(--r-tile); }

/* ---- Quotes: oversized pull-quotes, light ground ---- */
.quote-grid{ display:grid; gap:clamp(2.5rem,6vw,4.5rem); max-width:56rem; }
blockquote{ margin:0; }
blockquote p{
  font-family:var(--display); font-weight:600;
  font-size:clamp(1.1rem,1.9vw,1.5rem); line-height:1.35; letter-spacing:-.01em; margin:0;
}
blockquote footer{ margin-top:var(--space-2); font-size:.78rem; letter-spacing:.18em;
  text-transform:uppercase; color:var(--color-muted-foreground); }

/* ---- Expertise ---- */
.exp{ display:grid; gap:0; }
@media (min-width:768px){
  .exp{ grid-template-columns:repeat(2,1fr); gap:0 var(--space-6); align-items:start; }
  .exp li:nth-last-child(-n+2){ border-bottom:none; }   /* last row (both columns) clean */
}
@media (max-width:767px){ .exp li:last-child{ border-bottom:none; } }
.exp li{
  list-style:none; border-bottom:1px solid var(--color-border); padding-block:var(--space-6);
  font-family:var(--display); font-weight:600; font-size:clamp(1.05rem,1.8vw,1.5rem);
  display:flex; flex-direction:column; justify-content:center;
}
.exp-btn{
  all:unset; cursor:pointer; display:flex; align-items:center; justify-content:space-between;
  gap:var(--space-2); width:100%;
  font:inherit; color:inherit;
}
.exp-btn:focus-visible{ outline:2px solid var(--color-ring); outline-offset:4px; }
/* Floating tooltip: dark card above the row. Hover, keyboard focus, or tap —
   never hover-only (touch uses the + button). Esc dismisses (JS). */
.exp-item{ position:relative; }
.exp-tip{
  position:absolute; left:0; bottom:calc(100% - var(--space-4));
  max-width:30rem; z-index:6;
  background:var(--color-primary); color:var(--color-on-primary);
  font-family:var(--ui); font-weight:400; font-size:.95rem; line-height:1.5;
  padding:.7rem 1rem; border-radius:10px;
  opacity:0; transform:translateY(8px); pointer-events:none;
  transition:opacity .3s var(--ease), transform .3s var(--ease);
}
.exp-tip::after{
  content:""; position:absolute; top:100%; left:1.4rem;
  border:7px solid transparent; border-top-color:var(--color-primary);
}
.exp-item:hover .exp-tip,
.exp-item:focus-within .exp-tip,
.exp-item.open .exp-tip{ opacity:1; transform:none; }
.exp{ margin:0; padding:0; }

/* ---- About ---- */
.about-grid{ display:grid; gap:var(--space-6); align-items:start; }
@media (min-width:768px){ .about-grid{ grid-template-columns:auto 1fr; } }
.about-grid img{ width:9rem; height:9rem; object-fit:cover; }

/* ---- Contact ---- */
.contact .lead{ margin-bottom:var(--space-4); }

/* ---- Footer ---- */
footer.site{
  padding-top:clamp(4rem,9vw,8rem); overflow:hidden;
}
.f-ask{
  font-family:var(--display); font-weight:600;
  font-size:clamp(1.6rem,3.6vw,3rem); line-height:1.15; margin:0;
  color:var(--color-foreground);
}
.f-mail{ margin:.1em 0 0; }
.f-mail a{
  font-family:var(--display); font-weight:600;
  font-size:clamp(1.6rem,3.6vw,3rem); line-height:1.15;
  color:var(--color-foreground);
  text-decoration:underline; text-decoration-thickness:3px; text-underline-offset:.14em;
}
.f-mail a:hover{ color:var(--color-accent); }
.f-mail{ margin-bottom:clamp(5rem,12vw,10rem); }
/* Giant clipped wordmark — top 60% of the glyphs, cut by the page edge. */
.f-mark{ height:.58em; overflow:hidden;
  font-family:var(--display); font-weight:600;
  font-size:clamp(4rem,15.5vw,18rem); line-height:1;
  color:var(--color-foreground); white-space:nowrap; text-align:center;
}
.f-mark span{ display:block; }

.err404{ padding-block:var(--space-12); }

/* Motion: MOTION_POLICY='always' (§7.4) — scroll effects arrive Phase 4.
   Interactive transitions above are 200ms and always on. */

/* ---- Contact form (§7.5, §8.5) ---- */
.cform{ max-width:34rem; }
.cform label{ font-weight:500; margin-top:var(--space-2); }
.cform input,.cform textarea{
  font:inherit; padding:.7rem .8rem; width:100%;
  border:1px solid var(--color-border-strong); background:var(--color-card); color:inherit;
}
.cform [aria-invalid="true"]{ border-color:var(--color-destructive); border-width:2px; }
.ferr{ color:var(--color-destructive); font-size:.9rem; margin:.2rem 0 0; font-weight:500; }
.fnote{ font-size:.85rem; }
.hp{ position:absolute; left:-9999px; top:auto; }
.bad ul{ margin:.4rem 0 0; padding-left:1.2rem; }
.bad a{ color:inherit; font-weight:500; }
.prose{ max-width:44rem; }
.prose .h-m{ margin-top:var(--space-4); }

/* ---- Motion (§5.7, §7.4) — html gets data-motion from site.js ---- */
html[data-motion] .rv{ opacity:0; transform:translateY(16px); }
html[data-motion="full"] .rv{
  transition:opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
html .rv.is-in, html[data-motion="off"] .rv{ opacity:1; transform:none; transition-delay:0s; }
@media (max-width:767px){ html[data-motion] .rv{ transform:translateY(10px); } }
@media print{ .rv{ opacity:1 !important; transform:none !important; } }

/* ---- Animation set (§5.7): entrance, settle, wordmark, micro ---- */

/* 1 · Hero line rise on load. Clip wrapper so lines emerge from their own baseline. */
/* Descender room inside the reveal mask: the 1.02 line-height box clips a g/y at
   large sizes, so the mask gets .14em below the baseline and takes it back with a
   negative margin — rhythm unchanged. translateY(110%) still hides the line fully. */
.hl-clip{ display:block; overflow:hidden; padding-bottom:.14em; margin-bottom:-.14em; }
.hl-line{ display:block; }
html[data-motion="full"] .hl-line{
  transform:translateY(118%);   /* clears the mask incl. its .14em descender room */
  animation:hl-rise .9s var(--ease) forwards;
  animation-delay:calc(var(--i) * 90ms);
}
@keyframes hl-rise{ to{ transform:none; } }
html[data-motion="full"] .hl-fade{
  opacity:0; transform:translateY(14px);
  animation:hl-in .8s var(--ease) forwards;
  animation-delay:calc(200ms + var(--i) * 90ms);
}
@keyframes hl-in{ to{ opacity:1; transform:none; } }

/* 2 · Media scale-settle on reveal: zoom-out 1.05→1 riding the .rv transition. */
html[data-motion="full"] .witem.rv .tile img:not(.tile-endlogo):not(.fw-cap),
html[data-motion="full"] .witem.rv .tile video{
  transform:scale(1.05);
  transition:transform 1.1s var(--ease);
}
html .witem.rv.is-in .tile img:not(.tile-endlogo):not(.fw-cap),
html .witem.rv.is-in .tile video{ transform:scale(1); }
/* hover zoom still wins after settle */
html[data-motion="full"] a.tile-link:hover .tile img:not(.tile-endlogo):not(.fw-cap),
html[data-motion="full"] a.tile-link:hover .tile video{ transform:scale(1.03); }

/* 3 · Footer wordmark rises out of the page edge. */
html[data-motion="full"] .f-mark span{
  transform:translateY(60%);
  transition:transform 1.2s var(--ease);
}
html .f-mark.is-in span{ transform:none; }

/* 4 · External arrow nudge on tile-row hover. */
.p-ext{ transition:transform .45s var(--ease), color .45s var(--ease); }
.p-meta .h-m{ transition:color .45s var(--ease); }
.witem:hover .p-ext{ transform:translate(3px,-3px); color:var(--color-accent); }
.witem:hover .p-meta .h-m{ color:var(--color-accent); }

/* ---- Reveal upgrades: masked tiles, logo cascade ---- */

/* Portfolio: each item reveals via mask wipe, caption follows. Container never hides. */
html[data-motion] .witem.rv{ opacity:1; transform:none; }
/* Mask wipe: plain inset() clip-path — interpolates in Chrome/Safari/Firefox.
   (The earlier `round` term is what Chrome refuses to animate.) Corners stay
   rounded via the tile's own border-radius + overflow:hidden. */
html[data-motion="full"] .witem.rv .tile{
  clip-path:inset(100% 0 0 0);
  transition:clip-path 1s var(--ease);
}
html[data-motion="full"] .witem.rv.is-in .tile{ clip-path:inset(0 0 0 0); }
html[data-motion="full"] .witem.rv .p-meta,
html[data-motion="full"] .witem.rv .p-sum{
  opacity:0; transform:translateY(12px);
  transition:opacity .7s var(--ease) .25s, transform .7s var(--ease) .25s;
}
html .witem.rv.is-in .p-meta, html .witem.rv.is-in .p-sum,
html[data-motion="off"] .witem .p-meta, html[data-motion="off"] .witem .p-sum{
  opacity:1; transform:none;
}

/* Logos: cascade in, settling at their resting .9 */
html[data-motion="full"] .logo-grid img{
  opacity:0; transform:translateY(12px);
  transition:opacity .7s var(--ease), transform .7s var(--ease);
}
html .logo-grid img.is-in,
html[data-motion="off"] .logo-grid img{ opacity:.9; transform:none; }

/* Video end-logo: white client mark fades in over the closing seconds. */
.tile img.tile-endlogo{
  position:absolute; inset:0; margin:auto; width:36%; height:auto; z-index:2; object-fit:contain;
  filter:brightness(0) invert(1); opacity:0; pointer-events:none;
  transition:opacity 2.2s ease-in-out;
}
.tile.endlogo-on img.tile-endlogo{ opacity:1; }

/* CTA arrow: the projects' stroke-rounded arrow, horizontal, revealed left-to-right. */
.btn-arrow{ gap:0; }   /* label truly centered until the arrow exists */
.btn-arrow .arr{
  display:inline-flex; align-items:center; overflow:hidden;
  width:0; height:1.2em; margin-left:0;
  transition:width .45s var(--ease), margin-left .45s var(--ease);
}
.btn-arrow .arr svg{ width:1.2em; height:1.2em; flex-shrink:0; }
.btn-arrow:hover .arr, .btn-arrow:focus-visible .arr{ width:1.2em; margin-left:.6rem; }

/* Quotes: extras hidden behind the button. Mobile collapses them smoothly
   (max-height + fade); desktop shows all three, so .q-off barely applies there. */
@media (max-width:767px){
  .quote-grid{ display:block; }
  .quote-grid blockquote{ margin-bottom:clamp(2.5rem,6vw,4.5rem); }
  .quote-grid blockquote.q-off{
    max-height:0; opacity:0; margin-bottom:0; overflow:hidden;
    transform:translateY(12px);
  }
  .quote-grid blockquote.q-reveal{
    transition:max-height .7s var(--ease), opacity .6s var(--ease) .15s,
               margin-bottom .7s var(--ease), transform .6s var(--ease) .15s;
    max-height:30rem; opacity:1; transform:none;
  }
}
@media (min-width:768px){ .q-off{ display:none; } }
.q-more-wrap{ margin:clamp(2rem,5vw,3.5rem) 0 0; }

/* ---- Futuwise phone walkthrough ----
   Timeline: 4 screens × 7s = 28s loop. Per screen: scroll the capture 5s,
   rest .9s, slide .6s to the next. Track slides; captures scroll. */
.witem .tile.phone-stage{
  background:#FEF2F2;
  display:grid; place-items:end center; overflow:hidden;
  container-type:size;
}
.fw-phone{
  /* Oversized and bottom-cropped: ~3/4 of the device shows, lower edge cut by the tile. */
  --glass-h: 130cqh;   /* +20% */
  margin-bottom:-52cqh;
  --glass-w: calc(var(--glass-h) / 2.05);
  width:calc(var(--glass-w) + 16px);
  padding:8px; background:#111; border-radius:38px;
  box-shadow:0 24px 60px rgba(130,50,179,.25);   /* default: Futuwise purple */
}
.fw-glass{
  position:relative; width:var(--glass-w); height:var(--glass-h);
  border-radius:30px; overflow:hidden; background:#fff;
}
.fw-notch{
  position:absolute; top:8px; left:50%; transform:translateX(-50%);
  width:34%; height:14px; border-radius:999px; background:#111;
}
.fw-track{
  display:flex; height:100%;
  animation:fw-track 56s cubic-bezier(.6,0,.2,1) infinite;
  animation-play-state:paused;
}
.fw-scr{ flex:0 0 100%; height:100%; overflow:hidden; }
.fw-cap{ width:100% !important; height:auto !important; object-fit:unset !important; display:block;
  animation-duration:56s; animation-timing-function:cubic-bezier(.45,0,.3,1);
  animation-iteration-count:infinite; animation-play-state:paused;
}
.fw-cap-0{ animation-name:fw-scroll-0; }
.fw-cap-1{ animation-name:fw-scroll-1; }
.fw-cap-2{ animation-name:fw-scroll-2; }
.fw-cap-3{ animation-name:fw-scroll-3; }

/* Run only when in view, with motion on. */
html[data-motion="full"] .phone-stage.anim-on .fw-track,
html[data-motion="full"] .phone-stage.anim-on .fw-cap,
html[data-motion="full"] .phone-stage.anim-on .fw-tap{ animation-play-state:running; }

/* Track positions: dwell 0-21.4%, slide by 25% steps (.6s ≈ 2.1%). */
@keyframes fw-track{
  0%, 22.9%   { transform:translateX(0); }
  25%, 47.9%  { transform:translateX(-100%); }
  50%, 72.9%  { transform:translateX(-200%); }
  75%, 97.9%  { transform:translateX(-300%); }
  100%        { transform:translateX(-300%); }
}
/* Each capture: scroll the WHOLE page down, hold at the bottom, scroll back to
   the top, then the next screen slides in. Full travel = -100% + glass height. */
@keyframes fw-scroll-0{
  0%, 1.8%{ transform:translateY(0); }
  12.0%, 13.2%{ transform:translateY(var(--travel, 0px)); }
  20.8%, 100%{ transform:translateY(0); }
}
@keyframes fw-scroll-1{
  0%, 26.8%{ transform:translateY(0); }
  37.0%, 38.2%{ transform:translateY(var(--travel, 0px)); }
  45.8%, 100%{ transform:translateY(0); }
}
@keyframes fw-scroll-2{
  0%, 51.8%{ transform:translateY(0); }
  62.0%, 63.2%{ transform:translateY(var(--travel, 0px)); }
  70.8%, 100%{ transform:translateY(0); }
}
@keyframes fw-scroll-3{
  0%, 76.8%{ transform:translateY(0); }
  87.0%, 88.2%{ transform:translateY(var(--travel, 0px)); }
  95.8%, 100%{ transform:translateY(0); }
}

/* Tap indicator: a fingertip ripple just before each navigation slide. */
.fw-tap{
  position:absolute; left:64%; top:72%; width:16px; height:16px; z-index:3;
  border-radius:50%; background:rgba(255,255,255,.85); opacity:0;
  animation:fw-tap 56s linear infinite; animation-play-state:paused;
  pointer-events:none;
}
.fw-tap::after{
  content:""; position:absolute; inset:-6px; border-radius:50%;
  border:2px solid rgba(255,255,255,.7);
}
@keyframes fw-tap{
  0%, 20.9% { opacity:0; transform:scale(.4); }
  21.6%     { opacity:.95; transform:scale(1); }
  22.6%, 25% { opacity:0; transform:scale(1.5); }
  45.9% { opacity:0; transform:scale(.4); }
  46.6% { opacity:.95; transform:scale(1); }
  47.6%, 50% { opacity:0; transform:scale(1.5); }
  70.9% { opacity:0; transform:scale(.4); }
  71.6% { opacity:.95; transform:scale(1); }
  72.6%, 75% { opacity:0; transform:scale(1.5); }
  95.9% { opacity:0; transform:scale(.4); }
  96.6% { opacity:.95; transform:scale(1); }
  97.6%, 100% { opacity:0; transform:scale(1.5); }
}

/* ---- Just Let's Play morphing device ----
   Frame dimensions per stage; transitions morph between them (jitter-style).
   Content layers crossfade; controller stage wiggles (tilt game). */
.witem .tile.jlp-stage{
  background:#262250;                       /* JLP deep indigo */
  display:grid; place-items:center; overflow:hidden;
  container-type:size;
}
.jlp-device{
  position:relative; background:#111; border-radius:18px; padding:6px;
  box-shadow:0 24px 60px rgba(0,0,0,.45);
  transition:width 1s var(--ease), height 1s var(--ease),
             border-radius 1s var(--ease), transform 1s var(--ease);
}
.jlp-screen{ position:relative; width:100%; height:100%; border-radius:12px;
  overflow:hidden; background:#262250; }
.jlp-c{ position:absolute; inset:0; width:100% !important; height:100% !important;
  object-fit:cover; opacity:0; transition:opacity .55s var(--ease); }

/* Stage geometry — width/height locked to each asset's aspect so nothing crops:
   host 1400×736, join 640×1391, controller 1400×644, gameplay 1440×752. */
.jlp-device.s-host { width:156cqh; height:82cqh; }   /* same footprint as gameplay */
/* Join: landscape box under a -90° wrapper = upright vertical phone (art pre-rotated CW).
   Controller: flat landscape box, wrapper back to 0°, landscape art. */
.jlp-device.s-join { width:88cqh;   height:40.5cqh; border-radius:26px; }
.jlp-device.s-ctrl { width:95.6cqh; height:44cqh;   border-radius:26px; }
.jlp-device.s-play { width:157cqh;   height:82cqh; border-radius:14px; }

/* Content per stage */
.s-host .jlp-host, .s-join.j1 .jlp-join1, .s-join.j2 .jlp-join2,
.s-ctrl .jlp-ctrl, .s-play .jlp-play{ opacity:1; }

/* Controller wiggle lives on the wrapper as a TRANSITION (JS flips --tilt), so
   entering and leaving the stage always eases — keyframes snapped mid-cycle. */
.jlp-outer{
  transform:rotate(calc(var(--rot, 0deg) + var(--tilt, 0deg)));
  transition:transform 1.1s var(--ease);
}
.jlp-outer.tilting{ transition:transform .8s ease-in-out; }  /* fast continuous pendulum */

/* Sticky CTA: bottom-center after the hero, gone at the footer. Duplicate of the
   hero CTA (aria-hidden + tabindex -1 — keyboard users already have the real one). */
.sticky-cta{
  position:fixed; left:50%; bottom:1.5rem; z-index:40;
  transform:translateX(-50%) translateY(140%);
  opacity:0; pointer-events:none;
  box-shadow:0 10px 30px rgba(9,9,11,.25);
  transition:transform .5s var(--ease), opacity .5s var(--ease);
}
.sticky-cta.on{ transform:translateX(-50%); opacity:1; pointer-events:auto; }

/* ---- Toetusfond gallery wall: three horizontal bands. Top/bottom drift
   left-to-right, middle right-to-left. Middle band fully in frame; outer bands
   cut ~60% by the tile edges. Tracks doubled for a seamless wrap. ---- */
.witem .tile.tlt-stage{
  background:#ED1C24;                       /* Toetusfond red */
  overflow:hidden; padding:0; position:relative;
  container-type:size;                      /* cq units measure the TILE, not the viewport */
}
/* Absolutely centered overlay — the oversized wall can never stretch the tile. */
.tlt-rows{
  position:absolute; left:0; right:0; top:50%; transform:translateY(-50%);
  height:121.5cqw;
  display:flex; flex-direction:column; gap:4.5cqw;
}
/* Middle band = 60% of tile height (tile is 16/10 → 62.5cqw tall; 37.5 = 60%).
   Outers same card size, cropped to ~9.5cqw slivers by the window. */
.tlt-row{ height:37.5cqw; flex:0 0 auto; }
.tlt-track{
  display:flex; gap:4.5cqw; height:100%; width:max-content;
}
/* Middle stream: one-time shift so a card's center = tile center at every rest.
   Card 60cqw + landing grid congruent per jump → stays centered after each step. */
.tlt-row:nth-child(2) .tlt-track{ margin-left:calc((100cqw - 60cqw) / 2 - 64.5cqw); }  /* one card earlier — left edge filled, rest still centered */
/* Outer bands: the seam between cards sits at tile center — brick stagger vs the middle. */
.tlt-row:nth-child(odd) .tlt-track{ margin-left:calc(50cqw - 2.25cqw - 60cqw); }
.tlt-card{
  aspect-ratio:16/10; height:100%; border-radius:10px; flex:0 0 auto;
  background:rgba(255,255,255,.92); overflow:hidden;
}
.tlt-card img{ width:100% !important; height:100% !important; object-fit:cover; display:block; }
html[data-motion="full"] .tlt-stage.anim-on .tlt-ltr{ animation:tlt-ltr 9s infinite; }
html[data-motion="full"] .tlt-stage.anim-on .tlt-rtl{ animation:tlt-rtl 9s infinite; }
/* Stepped travel: sit ~1.7s, then a springy one-card jump (overshoot bezier). */
@keyframes tlt-ltr{
  0.0%, 19.0%{ transform:translateX(-50.0%); animation-timing-function:cubic-bezier(.34,1.56,.64,1); }
  25.0%{ transform:translateX(-37.5%); }
  25.0%, 44.0%{ transform:translateX(-37.5%); animation-timing-function:cubic-bezier(.34,1.56,.64,1); }
  50.0%{ transform:translateX(-25.0%); }
  50.0%, 69.0%{ transform:translateX(-25.0%); animation-timing-function:cubic-bezier(.34,1.56,.64,1); }
  75.0%{ transform:translateX(-12.5%); }
  75.0%, 94.0%{ transform:translateX(-12.5%); animation-timing-function:cubic-bezier(.34,1.56,.64,1); }
  100%{ transform:translateX(0.0%); }
}
@keyframes tlt-rtl{
  0.0%, 19.0%{ transform:translateX(0.0%); animation-timing-function:cubic-bezier(.34,1.56,.64,1); }
  25.0%{ transform:translateX(-12.5%); }
  25.0%, 44.0%{ transform:translateX(-12.5%); animation-timing-function:cubic-bezier(.34,1.56,.64,1); }
  50.0%{ transform:translateX(-25.0%); }
  50.0%, 69.0%{ transform:translateX(-25.0%); animation-timing-function:cubic-bezier(.34,1.56,.64,1); }
  75.0%{ transform:translateX(-37.5%); }
  75.0%, 94.0%{ transform:translateX(-37.5%); animation-timing-function:cubic-bezier(.34,1.56,.64,1); }
  100%{ transform:translateX(-50.0%); }
}


/* Grounds per phone stage */
.witem .tile.phone-stage.fw-ground{ background:#FEF2F2; }   /* Futuwise soft pink */
.witem .tile.phone-stage.ecu-ground{ background:#F3F7FC; }  /* EJL pale blue (user hex) */
.ecu-ground .fw-phone{ box-shadow:0 24px 60px rgba(64,135,227,.18); }  /* EJL blue shadow */

/* ECU support mark: above the phone, pinned to the corner. */
.witem .tile.ecu-stage{ position:relative; }
.tile img.ecu-support{
  position:absolute; right:0; bottom:0; z-index:4;
  height:40% !important; width:auto !important; object-fit:contain;
}

/* 3-screen phone cycle (42s): thirds instead of quarters. */
.fw-n3 .fw-track{ animation-name:fw-track3; animation-duration:42s; }
.fw-n3 .fw-cap{ animation-duration:42s; }
.fw-n3 .fw-cap-0{ animation-name:fw3-scroll-0; }
.fw-n3 .fw-cap-1{ animation-name:fw3-scroll-1; }
.fw-n3 .fw-cap-2{ animation-name:fw3-scroll-2; }
@keyframes fw-track3{
  0%, 30.5%   { transform:translateX(0); }
  33.3%, 63.8%{ transform:translateX(-100%); }
  66.7%, 97.1%{ transform:translateX(-200%); }
  100%        { transform:translateX(-200%); }
}
@keyframes fw3-scroll-0{
  0%, 2.4%    { transform:translateY(0); }
  16.0%, 17.6%{ transform:translateY(var(--travel, 0px)); }
  27.7%, 100% { transform:translateY(0); }
}
@keyframes fw3-scroll-1{
  0%, 35.7%   { transform:translateY(0); }
  49.3%, 50.9%{ transform:translateY(var(--travel, 0px)); }
  61.0%, 100% { transform:translateY(0); }
}
@keyframes fw3-scroll-2{
  0%, 69.0%   { transform:translateY(0); }
  82.6%, 84.2%{ transform:translateY(var(--travel, 0px)); }
  94.3%, 100% { transform:translateY(0); }
}

@media (max-width:767px){
  .p-ext{ width:1.8rem; height:1.8rem; }   /* last in file — beats the base rule */
  .top nav.findme{ display:none; }         /* socials live in the footer on mobile */
  /* Expertise: descriptions inline under the label — no tooltips on touch. */
  .exp li{ padding-block:var(--space-3); }   /* half the desktop rhythm */
  .exp-tip{
    position:static; opacity:1; transform:none; pointer-events:auto;
    background:none; color:var(--color-muted-foreground);
    padding:.5rem 0 0; border-radius:0; max-width:none;
  }
  .exp-tip::after{ display:none; }
  .exp-btn{ cursor:default; }
}

/* ---- Mobile logo marquee: 3 rows, outer left→right, middle right→left ---- */
.logo-marquee{ display:none; }
@media (max-width:767px){
  .logo-grid{ display:none; }
  .logo-marquee{
    --lm-h:3.94rem;               /* the one logo-size knob for the mobile wall */
    display:flex; flex-direction:column; gap:3rem;
    overflow:hidden; position:relative;
  }

  /* Pen-model marquee: inline <use> logos, two groups per row (min-width:100%),
     each group slides its own width. -webkit-prefixed mask like the reference. */
  .lm-row{
    display:flex; overflow:hidden; gap:3rem;
    -webkit-mask-image:linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
    mask-image:linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  }
  .lm-group{
    flex-shrink:0; display:flex; align-items:center; justify-content:space-around;
    gap:3rem; min-width:100%;
  }
  html[data-motion="full"] .lm-group{
    -webkit-animation:lm-scroll 45s linear infinite;
    animation:lm-scroll 45s linear infinite;
  }
  html[data-motion="full"] .lm-reverse .lm-group{ animation-direction:reverse; animation-delay:-6s; }
  .lm-logo{ flex-shrink:0; color:#09090B; }
}
@keyframes lm-ltr{ from{ transform:translateX(-50%); } to{ transform:translateX(0); } }
@keyframes lm-rtl{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }

@-webkit-keyframes lm-scroll{ from{ transform:translateX(0); } to{ transform:translateX(calc(-100% - 3rem)); } }
@keyframes lm-scroll{ from{ transform:translateX(0); } to{ transform:translateX(calc(-100% - 3rem)); } }

/* Language toggle: dark-border pill, top right. */
.lang-btn{
  margin-left:var(--space-3); flex-shrink:0;
  font-size:.78rem; font-weight:600; letter-spacing:.12em;
  border:1px solid var(--color-border-strong); border-radius:var(--r-pill);
  padding:.45rem .9rem; text-decoration:none; color:var(--color-foreground);
  transition:background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.lang-btn:hover{ background:var(--color-primary); color:var(--color-on-primary); }

/* Footer socials: mobile-only row under the email (header socials hide there). */
.f-social{ display:none; }
@media (max-width:767px){
  .f-social{
    display:flex; gap:var(--space-2); align-items:baseline; flex-wrap:wrap; font-weight:500;
  }
  .f-social a{ text-decoration:underline; text-underline-offset:3px; }
  .f-mail{ margin-bottom:1.5rem; }
  .f-social{ margin-bottom:clamp(5rem,12vw,10rem); }
}


/* ---- Legal row in footer + consent banner (§16.4) ---- */
.f-legal{ margin:.4rem 0 clamp(3rem,7vw,5rem); display:flex; gap:1.4rem; align-items:baseline; }
.f-legal a, .f-cookies{
  font-size:.85rem; color:var(--color-muted-foreground); text-decoration:underline;
  text-underline-offset:3px; background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
}
.f-legal a:hover, .f-cookies:hover{ color:var(--color-foreground); }

#consent{
  position:fixed; z-index:90000; left:0; right:0; bottom:0; padding:16px;
  display:flex; justify-content:flex-start; pointer-events:none;
}
.c-box{
  pointer-events:auto; max-width:26rem; background:#fff; color:var(--color-foreground);
  border:1px solid var(--color-border); border-radius:16px; padding:1.4rem 1.5rem;
  box-shadow:0 18px 60px rgba(16,16,19,.18); font-size:.92rem; line-height:1.5;
}
.c-h{ font-family:var(--display); font-weight:600; font-size:1.05rem; margin:0 0 .5rem; }
.c-b{ margin:0 0 1rem; color:var(--color-muted-foreground); }
.c-purposes{ display:grid; gap:.6rem; margin:0 0 1rem; }
.c-purposes label{ display:flex; gap:.6rem; align-items:flex-start; cursor:pointer; }
.c-purposes input{ margin-top:.25rem; width:1.05rem; height:1.05rem; accent-color:var(--color-accent); }
.c-actions{ display:flex; flex-wrap:wrap; gap:.6rem 1rem; align-items:center; }
.c-btn{
  font:600 .88rem/1 var(--body, inherit); font-family:inherit; cursor:pointer;
  border-radius:99px; padding:.72rem 1.15rem; border:1.5px solid var(--color-foreground);
  background:#fff; color:var(--color-foreground); min-height:44px;
}
.c-btn:hover{ background:var(--color-secondary, #f3f3f3); }
.c-primary{ background:var(--color-foreground); color:#fff; }
.c-primary:hover{ background:#000; }
.c-link{
  background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
  font-size:.85rem; color:var(--color-muted-foreground); text-decoration:underline; text-underline-offset:3px;
}
.c-link:hover{ color:var(--color-foreground); }
.c-btn:focus-visible, .c-link:focus-visible, .c-purposes input:focus-visible{
  outline:2px solid var(--color-accent); outline-offset:3px;
}
@media (max-width:480px){ #consent{ padding:10px; } .c-box{ max-width:none; width:100%; } }
#consent[hidden], .c-purposes[hidden], #c-save[hidden]{ display:none; }

/* Destructive tokens (§4.2) — error text and admin danger actions */
:root{ --color-destructive:#DC2626; --color-on-destructive:#FFFFFF; }
/* Legal row links meet the 24px minimum target (§7.3) */
.f-legal a, .f-cookies, .c-link{ padding:.3rem 0; display:inline-block; }
.quote-grid footer a{ color:inherit; text-decoration:underline; text-underline-offset:3px; text-decoration-thickness:1px; }
