/* helyoslabs.com home. Base = a plain flowing page (no JS, reduced motion, failures).
   html.motion = the scroll choreography, switched on by js/main.js. */
:root{
  --paper:#f6f4ef; --ink:#110902; --mute:#bbbab8; --rule:#8d8d8c; --label:#6b6b6a; --rule-soft:#e9e7e3;
  --accent:oklch(0.874 0.168 91);
  --fire:oklch(0.58 0.20 28); --hvac:oklch(0.60 0.16 150); --pipes:oklch(0.55 0.17 255); --elec:oklch(0.80 0.16 90);
  --font:"Host Grotesk", system-ui, sans-serif; --display:"Schibsted Grotesk", system-ui, sans-serif;
  --gut:clamp(16px,2vw,28px); --top:92px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{background:var(--paper);color:var(--ink);font-family:var(--font);-webkit-font-smoothing:antialiased}
img,video{display:block;max-width:100%}

.top{position:sticky;top:0;z-index:10;display:flex;justify-content:space-between;align-items:center;padding:18px var(--gut);background:var(--paper)}
.wordmark{font-family:var(--display);font-weight:800;font-size:19px;letter-spacing:-.02em;color:inherit;text-decoration:none}
.btn{display:inline-flex;align-items:center;gap:10px;background:var(--ink);color:var(--paper);border-radius:999px;padding:12px 22px;font:600 14px var(--font);text-decoration:none}
.btn .dot{width:8px;height:8px;border-radius:50%;background:var(--accent)}
.btn:focus-visible,.quiet:focus-visible,.index button:focus-visible{outline:2px solid var(--ink);outline-offset:3px}

#stage{display:none}
.col,.rail{display:none}
.layer{padding:0 var(--gut);max-width:1100px;margin:0 auto}
.hero-in{padding:64px 0 24px}
.hero-in h1{font-family:var(--display);font-weight:800;font-size:clamp(44px,7vw,116px);line-height:.92;letter-spacing:-.04em;max-width:11ch}
.hero-in p{margin-top:24px;font-weight:600;font-size:clamp(17px,1.5vw,22px);line-height:1.25;max-width:30ch}
.poster{width:100%;height:auto;margin:8px 0 0}

.track{max-width:1100px;margin:0 auto;padding:0 var(--gut)}
.spacer{display:none}
.beat{padding:72px 0;border-top:1px solid var(--rule-soft)}
.kick,.num{display:block;font:600 13px var(--font);color:var(--label);margin-bottom:12px;letter-spacing:.02em}
.statement-in p{font-family:var(--display);font-weight:800;font-size:clamp(28px,3.3vw,56px);line-height:1.02;letter-spacing:-.03em;max-width:24ch}
.ch{display:flex;flex-direction:column;gap:20px}
.head h2,.close-in h2{font-family:var(--display);font-weight:800;letter-spacing:-.035em;line-height:.95}
.head h2{font-size:clamp(28px,3.6vw,62px)}
.ch video{width:100%;aspect-ratio:16/10;object-fit:cover;border-radius:14px;background:var(--rule-soft)}
.body{font-weight:600;font-size:clamp(16px,1.35vw,22px);line-height:1.25;max-width:42ch}

.counts .total{font-weight:600;font-size:clamp(16px,1.3vw,20px);line-height:1.3;max-width:46ch}
.counts .total em{display:block;font-style:normal;font-family:var(--display);font-weight:800;font-size:clamp(40px,4.4vw,72px);letter-spacing:-.03em;font-variant-numeric:tabular-nums;margin-bottom:6px}
.counts h3{font:600 12px var(--font);color:var(--label);letter-spacing:.06em;text-transform:uppercase;margin:22px 0 4px}
.counts ul{list-style:none}
.counts li{display:flex;align-items:baseline;gap:14px;border-bottom:1px solid var(--rule-soft);padding:10px 0 8px}
.counts li span{font-weight:600;font-size:17px;flex:1}
.counts li em{font-style:normal;font-family:var(--display);font-weight:800;font-size:clamp(22px,2vw,32px);letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.chip{width:10px;height:10px;flex:none;align-self:center}
.chip.pipes{background:var(--pipes)} .chip.fire{background:var(--fire)} .chip.hvac{background:var(--hvac)}
.chip.elec{background:var(--elec)} .chip.ink{background:var(--ink)}

.close-in{padding:24px 0 48px}
.close-in h2{font-size:clamp(44px,7vw,116px);line-height:.92;letter-spacing:-.04em;max-width:9ch}
.act{margin-top:32px;display:flex;flex-wrap:wrap;align-items:center;gap:20px}
.quiet{color:var(--label);font:500 14px var(--font)}

/* ── motion: the scroll choreography (html.motion, set by js/main.js) ─────────────────────────────── */
.motion-pending body{visibility:hidden}
.motion .top{position:fixed;left:0;right:0;background:none}
.motion #stage{display:block;position:fixed;top:0;right:0;width:64vw;height:100vh;z-index:0;transform-origin:50% 50%;will-change:transform,opacity}
.motion .poster{position:fixed;top:0;right:0;width:64vw;height:100vh;object-fit:contain;margin:0;z-index:0;transform-origin:50% 50%;transition:opacity .6s,visibility 0s .6s}
.motion.stage-ready .poster{opacity:0;visibility:hidden;pointer-events:none}
.motion .layer{padding:0;margin:0;max-width:none}
.motion .hero-in{position:fixed;left:var(--gut);top:110px;z-index:3;max-width:46vw;padding:0;pointer-events:none}
.motion .track{max-width:none;padding:0}
.motion .beat{padding:0;border:0}
.motion #s-hero{display:block;height:130vh}
.motion #s-drift{height:180vh}
.motion #s-capture,.motion #s-compare,.motion #s-measure,.motion #s-time{height:150vh}
.motion #s-systems{height:240vh}
.motion #s-close{height:200vh}
.motion #smooth-wrapper{position:relative;z-index:1}
.motion .statement-in{position:fixed;left:var(--gut);top:50%;transform:translateY(-50%);width:min(44vw,760px);z-index:3;opacity:0;visibility:hidden;pointer-events:none}
.motion .statement-in .w,.motion .body .w{color:var(--mute)}
.motion .close-in{position:fixed;inset:0;display:flex;flex-direction:column;justify-content:center;padding:0 var(--gut);z-index:6;opacity:0;visibility:hidden;pointer-events:none}
.motion .close-in.live{pointer-events:auto}

.motion .rail{display:block;position:fixed;left:var(--gut);bottom:28px;width:min(260px,28vw);z-index:4;opacity:0;visibility:hidden}
.index{list-style:none}
.index button{all:unset;box-sizing:border-box;width:100%;font-weight:600;font-size:15px;line-height:1;padding:10px 0 9px;color:var(--mute);
  border-bottom:1px solid var(--rule-soft);position:relative;cursor:pointer;transition:color .35s;display:flex;gap:12px}
.index button span{font-size:11px;padding-top:2px;width:18px}
.index button[aria-current="step"]{color:var(--ink)}
.index button i{position:absolute;left:0;bottom:-1px;height:1px;width:100%;background:var(--ink);transform-origin:left;transform:scaleX(0)}

.motion .col{display:flex;position:fixed;right:var(--gut);top:var(--top);bottom:28px;width:min(46vw,780px);z-index:3;pointer-events:none;flex-direction:column;justify-content:center;gap:20px}
.motion .heads{position:relative;height:clamp(104px,16vh,150px);flex:none}
.motion .heads .head{position:absolute;left:0;right:0;bottom:0}
.motion .heads .num{opacity:0;visibility:hidden}
.motion .heads h2{visibility:hidden}   /* main.js reveals each h2 once its words are split and hidden */
.motion .media{position:relative;width:100%;aspect-ratio:16/10;max-height:calc(100vh - var(--top) - 28px - 16vh - 140px);flex:none}
.motion .clips{position:absolute;inset:0;border-radius:14px;overflow:hidden;z-index:1;visibility:hidden;--r:0;
  -webkit-mask-image:linear-gradient(to top,#000 calc(var(--r) * 140% - 40%),transparent calc(var(--r) * 140%));
          mask-image:linear-gradient(to top,#000 calc(var(--r) * 140% - 40%),transparent calc(var(--r) * 140%))}
.motion .clips video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;border-radius:0;will-change:opacity,filter,transform}
.motion .cap{position:absolute;left:12px;bottom:10px;background:var(--paper);padding:4px 8px;font:500 12px var(--font);opacity:0;z-index:3;transition:opacity .4s}
.motion .media .counts{position:absolute;inset:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto 1fr;column-gap:max(3cqh,12px);padding:max(2cqh,6px) 0;opacity:0;visibility:hidden}
.motion .media{container-type:size}
.motion .media .counts .total{grid-column:1;grid-row:1/3;align-self:center;font-size:max(4.2cqh,11px);line-height:1.3;max-width:none}
.motion .media .counts .total em{font-size:max(12cqh,26px);line-height:1;margin-bottom:max(1.5cqh,4px);font-variant-numeric:normal}
.motion .media .counts h3{grid-column:2;grid-row:1;align-self:end;font-size:max(3cqh,10px);line-height:1.2;margin:0 0 max(1cqh,3px)}
.motion .media .counts ul{grid-column:2;grid-row:2;align-self:start}
.motion .media .counts li{gap:max(1.5cqh,6px);padding:max(1.2cqh,3px) 0 max(1cqh,3px)}
.motion .media .counts li span{font-size:max(4cqh,11px);line-height:1.2}
.motion .media .counts li em{font-size:max(6cqh,14px);line-height:1.1;font-variant-numeric:normal}
.motion .media .counts li .chip{width:max(2cqh,8px);height:max(2cqh,8px)}
.motion .bodies{position:relative;height:84px;flex:none}
.motion .bodies .body{position:absolute;left:0;top:0;opacity:0;visibility:hidden}

@media (max-width: 900px), (max-aspect-ratio: 4/5){
  :root{--gut:16px;--top:72px}
  .top{padding:14px var(--gut)}
  .btn{padding:10px 16px;font-size:13px}
  .motion #stage,.motion .poster{width:100vw}
  .motion .hero-in{top:auto;bottom:max(28px,env(safe-area-inset-bottom));right:var(--gut);max-width:none}
  .motion .statement-in{top:auto;bottom:32px;transform:none;right:var(--gut);width:auto}
  .motion .rail{display:none}
  .motion .col{left:var(--gut);right:var(--gut);width:auto;top:auto;bottom:max(20px,env(safe-area-inset-bottom));justify-content:flex-end;gap:14px}
  .motion .heads{height:auto;min-height:clamp(78px,11vh,120px)}
  .motion .media{max-height:none}
  .motion .clips{border-radius:10px}
  .motion .bodies{height:clamp(64px,10vh,96px)}
  .body{font-size:16px;max-width:none}
  .counts li{padding:7px 0 6px}
  .motion .close-in{justify-content:flex-end;padding-bottom:max(48px,env(safe-area-inset-bottom))}
  .act{flex-direction:column;align-items:flex-start;gap:14px;margin-top:24px}
}
