/* Habytet POS blocks: hero, device frames, gallery, pan.
   Shared by the homepage (/: the hero), the POS page (/pos/) and the product pages. Everything reads as a
   static page first; motion only applies under html.js-motion. */

.ph{
  --ph-paper:var(--paper,#FBFAFD);
  --ph-tint:#F1F0F6;
  --ph-ink:var(--ink,#14173A);
  --ph-ink-2:var(--ink-2,#4B4E6B);
  --ph-ink-3:var(--ink-3,#8A8CA3);
  --ph-cobalt:var(--cobalt,#5B5BD6);
  --ph-ease:cubic-bezier(.33,1,.68,1);
  --ph-display:"Bricolage Grotesque","Helvetica Neue",Arial,sans-serif;
  --ph-text:"Geist",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --ph-gut:clamp(16px,4vw,48px);
  --ph-max:1068px;
  --ph-wide:1440px;
  font-family:var(--ph-text);color:var(--ph-ink);font-weight:400;
}
.ph *,.ph *::before,.ph *::after{box-sizing:border-box}
.ph img{max-width:100%;display:block}
:where(.ph) :where(h1,h2,h3,p,figure){margin:0}

/* ── buttons ── */
.ph-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.45em;
  min-height:48px;padding:0 1.5em;border-radius:999px;border:0;
  background:var(--ph-ink);color:#fff;text-decoration:none;
  font:500 1.0625rem/1 var(--ph-text);letter-spacing:-.005em;white-space:nowrap;
  transition:background-color .25s ease,color .25s ease,transform .25s var(--ph-ease);
}
.ph-btn:hover{background:var(--ph-cobalt)}
.ph-btn:active{transform:scale(.97)}
.ph-btn--light{background:#fff;color:var(--ph-ink)}
.ph-btn--light:hover{background:#ECE8FB;color:var(--ph-ink)}
.ph-link{
  display:inline-flex;align-items:center;gap:.3em;min-height:44px;
  color:var(--ph-cobalt);text-decoration:none;font:500 1.0625rem/1 var(--ph-text);
}
.ph-link::after{content:"";width:.45em;height:.45em;border:solid currentColor;border-width:1.6px 1.6px 0 0;transform:rotate(45deg);margin-left:.1em;transition:transform .25s var(--ph-ease)}
.ph-link:hover::after{transform:translateX(3px) rotate(45deg)}
.ph-link--light{color:#fff}

/* ── device frames: CSS bezel, real screen images inside ── */
.ph-tablet,.ph-phone{container-type:inline-size;width:100%}
.ph-tablet__body,.ph-phone__body{
  position:relative;background:linear-gradient(160deg,#2a2b30,#0b0c0f 60%);
  box-shadow:
    0 0 0 .22cqw #c4c7cd,
    0 0 0 .42cqw #6a6d74,
    0 4cqw 7cqw -3cqw rgba(15,17,40,.5),
    0 1.2cqw 2.4cqw rgba(15,17,40,.16);
}
.ph-tablet__body{padding:2.5cqw;border-radius:5cqw}
.ph-phone__body{padding:3.4cqw;border-radius:15cqw}
.ph-screen{position:relative;overflow:hidden;background:#fff;isolation:isolate}
.ph-tablet .ph-screen{aspect-ratio:1522/1200;border-radius:2.6cqw}
.ph-phone .ph-screen{aspect-ratio:400/876;border-radius:11.5cqw;background:#F4F4F6}
.ph-screen img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0}
.ph-screen img.is-on{opacity:1}
.ph-phone__island{position:absolute;z-index:2;left:50%;top:5.2cqw;width:27cqw;height:7.6cqw;border-radius:99px;background:#050506;transform:translateX(-50%)}

/* ── dots (the highlights gallery) ── */
.ph-controls{display:flex;align-items:center;justify-content:center;gap:10px}
.ph-dots{
  display:flex;align-items:center;gap:18px;height:48px;padding:0 18px;border-radius:999px;
  background:rgba(236,236,240,.72);-webkit-backdrop-filter:blur(16px) saturate(160%);backdrop-filter:blur(16px) saturate(160%);
}
.ph-dot{
  position:relative;width:8px;height:8px;padding:0;border:0;border-radius:99px;cursor:pointer;overflow:hidden;
  background:rgba(20,23,58,.32);transition:width .5s var(--ph-ease),background-color .3s ease;
}
.ph-dot::before{content:"";position:absolute;inset:-14px -4px}
.ph-dot.is-active{width:48px;background:rgba(20,23,58,.22)}
.ph-dot.is-active::after{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--ph-ink);transform-origin:0 50%;transform:scaleX(var(--p,0))}
.ph-controls[hidden]{display:none}

/* ═══ HERO: "Order up." ═══ */
.ph-hero{
  position:relative;height:100vh;height:100svh;min-height:600px;overflow:hidden;
  display:flex;flex-direction:column;background:#F8F9F9;color:var(--ph-ink);
}
.ph-hero__copy{
  position:relative;z-index:2;width:100%;max-width:var(--ph-max);margin:0 auto;text-align:center;
  padding:calc(env(safe-area-inset-top,0px) + clamp(96px,13vh,124px)) var(--ph-gut) 0;
}
/* "Order up." is set like the launch post: San Francisco on Apple devices, Inter elsewhere */
.ph-orderup{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","Inter","Helvetica Neue",Arial,sans-serif;font-weight:700;letter-spacing:-.045em;line-height:1;color:#1d1d1f}
.ph-hero__title{font-size:clamp(3.25rem,min(9.5vw,15vh),8.25rem);text-wrap:balance}
.ph-hero__lockup{width:clamp(200px,24vw,340px);height:auto;margin:clamp(.9rem,2vw,1.5rem) auto 0}
.ph-hero__sub{margin:clamp(.9rem,1.8vw,1.25rem) auto 0;max-width:30rem;font-size:clamp(1.0625rem,1.5vw,1.3rem);line-height:1.45;color:var(--ph-ink-2)}
.ph-hero__cta{margin-top:clamp(1.25rem,2.4vw,1.75rem);display:flex;gap:.75rem;justify-content:center;flex-wrap:wrap}
/* the launch photo runs to the bottom edge of the hero on a matching light ground */
.ph-hero__media{position:relative;flex:1 1 auto;min-height:0;margin-top:clamp(.5rem,2vh,1.25rem)}
.ph-hero__media img{
  position:absolute;top:0;left:0;right:0;margin:0 auto;width:auto;height:128%;max-width:none;object-fit:contain;
  -webkit-mask-image:linear-gradient(to right,transparent,#000 10%,#000 90%,transparent),linear-gradient(to bottom,transparent,#000 7%);
  -webkit-mask-composite:source-in;
          mask-image:linear-gradient(to right,transparent,#000 10%,#000 90%,transparent),linear-gradient(to bottom,transparent,#000 7%);
          mask-composite:intersect;
}
@media (max-width:760px){
  .ph-hero__media img{width:116%;left:-8%;right:auto;height:auto}
  .ph-hero__sub{font-size:1.0625rem}
  .ph-dots{height:44px;padding:0 16px}
}

/* ── step labels (phones, scroll scenes only) ── */
.ph-steps{display:none;grid-area:steps;justify-content:center;gap:8px}
.ph-steps button{
  min-height:36px;padding:0 16px;border:0;border-radius:99px;cursor:pointer;
  font:500 .9375rem/1 var(--ph-text);color:var(--ph-ink-2);background:rgba(20,23,58,.06);
  transition:background-color .3s ease,color .3s ease;
}
.ph-steps button.is-on{background:var(--ph-ink);color:#fff}
.ph-pan .ph-steps button{color:rgba(255,255,255,.7);background:rgba(255,255,255,.1)}
.ph-pan .ph-steps button.is-on{color:var(--ph-ink);background:#fff}
.ph-pan__captions{display:none}

/* ═══ PHONE SCROLL SCENES ═══
   One tablet stays put (CSS sticky inside a 300svh section) while the picture,
   the screen and the caption step kitchen → counter → store with the scroll.
   No pinning and nothing that touches touch events: the page always scrolls. */
@media (max-width:760px){
  .ph-pan.is-scrolly{height:300vh;height:300svh}
  .ph-pan.is-scrolly .ph-pan__stage{
    position:sticky;top:0;height:100vh;height:100svh;min-height:0;overflow:hidden;
    display:grid;grid-template-columns:minmax(0,1fr);align-content:center;gap:12px;
    padding:calc(env(safe-area-inset-top,0px) + 72px) var(--ph-gut) 16px;
  }
  .is-scrolly .ph-steps{display:flex}
  .is-scrolly .ph-pan__strip figure{opacity:0;transition:opacity .6s ease}
  .is-scrolly .ph-pan__strip figure.is-on{opacity:1}
  .is-scrolly .ph-screen img{transition:opacity .45s ease}

  /* POS page pan */
  .ph-pan.is-scrolly .ph-pan__stage{grid-template-areas:"head" "panel" "steps" "captions";align-items:start}
  .ph-pan.is-scrolly .ph-pan__head{grid-area:head;padding:0}
  .ph-pan.is-scrolly .ph-pan__head h2{font-size:1.75rem}
  .ph-pan.is-scrolly .pp-pan__sub{display:none}
  .ph-pan.is-scrolly .ph-pan__strip{grid-area:panel;order:0;position:relative;display:block;width:100%;height:clamp(280px,52svh,520px);border-radius:22px;overflow:hidden}
  .ph-pan.is-scrolly .ph-pan__strip figure{position:absolute;inset:0;aspect-ratio:auto;border-radius:0}
  .ph-pan.is-scrolly .ph-pan__device{grid-area:panel;align-self:center;justify-self:center;width:90%}
  .ph-pan.is-scrolly .ph-pan__captions{display:grid;grid-area:captions;list-style:none;margin:0;padding:0}
  .ph-pan.is-scrolly .ph-pan__captions > li{grid-area:1/1;opacity:0;transition:opacity .45s ease}
  .ph-pan.is-scrolly .ph-pan__captions > li.is-on{opacity:1}
  .ph-pan__captions h3{font:600 1.0625rem/1.25 var(--ph-text)}
  .ph-pan__captions p{margin-top:.3rem;color:rgba(255,255,255,.78);font-size:.95rem;line-height:1.5}
}

/* ═══ HIGHLIGHTS GALLERY ═══ */
.ph-gallery{position:relative}
.ph-gallery__track{
  --side:calc((100% - min(100% - 2 * var(--ph-gut), 1068px)) / 2);
  position:relative;display:flex;gap:clamp(12px,1.6vw,24px);padding:0 var(--side) 4px;scroll-padding:0 var(--side);
  overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none;cursor:grab;
}
.ph-gallery__track::-webkit-scrollbar{display:none}
.ph-gallery__track.is-dragging{scroll-snap-type:none;cursor:grabbing;-webkit-user-select:none;user-select:none}
.ph-card{
  position:relative;flex:0 0 min(100% - 2 * var(--ph-gut),1068px);height:clamp(460px,64vh,640px);
  border-radius:28px;overflow:hidden;background:#fff;display:flex;flex-direction:column;
  transition:opacity .6s ease;scroll-snap-align:center;scroll-snap-stop:always;
}
.ph-gallery.is-ready .ph-card:not(.is-active){opacity:.45}
.ph-card__copy{position:relative;z-index:2;padding:clamp(24px,3.4vw,44px) clamp(24px,3.4vw,48px) 0;max-width:34rem}
.ph-card__copy h3{font:600 clamp(1.25rem,2vw,1.6rem)/1.2 var(--ph-display);letter-spacing:-.02em}
.ph-card__copy p{margin-top:.4rem;color:var(--ph-ink-2);font-size:clamp(1rem,1.3vw,1.125rem);line-height:1.45}
.ph-card__media{position:relative;flex:1;min-height:0;display:flex;align-items:flex-end;justify-content:center;padding:0 clamp(16px,4vw,48px)}
.ph-card__media .ph-tablet{width:min(78%,640px);transform:translateY(18%)}
.ph-card__media .ph-phone{width:min(46%,270px);transform:translateY(16%)}
.ph-card--ink{background:var(--ph-ink);color:#fff}
.ph-card--ink .ph-card__copy p{color:rgba(255,255,255,.75)}
.ph-card--lilac{background:#ECE8FB}
.ph-card--sky{background:#E3ECFB}
.ph-card--sage{background:#E1F3EA}
.ph-card--peach{background:#FDEBE1}
.ph-gallery__controls{margin-top:28px}
/* wider screens: the words to the left, the screen large on the right, running off the edge */
@media (min-width:761px){
  .ph-card{flex-direction:row;height:clamp(480px,70vh,660px)}
  .ph-card__copy{flex:0 0 31%;max-width:none;padding:clamp(32px,3.8vw,52px) 0 0 clamp(32px,3.8vw,52px)}
  .ph-card__copy h3{font-size:clamp(1.5rem,2.3vw,2rem);letter-spacing:-.025em}
  .ph-card__copy p{margin-top:.6rem}
  .ph-card__media{min-width:0;align-items:flex-start;justify-content:flex-start;padding:clamp(40px,4.4vw,60px) 0 0 clamp(16px,2.4vw,32px)}
  .ph-card__media .ph-tablet{flex:none;width:108%;transform:none}
  .ph-card--phone .ph-card__media{justify-content:center;padding-left:0}
  .ph-card__media .ph-phone{flex:none;width:min(58%,310px);transform:none}
}

/* ═══ PAN: the thirds, full width, tablet held in the middle ═══ */
.ph-pan{position:relative;background:#101118;color:#fff}
.ph-pan__stage{position:relative;height:100vh;height:100svh;min-height:560px;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:20px;padding:calc(env(safe-area-inset-top,0px) + clamp(88px,11vh,112px)) var(--ph-gut) clamp(20px,4vh,40px)}
.ph-pan__strip{position:absolute;top:0;left:0;height:100%;width:300%;display:flex}
.ph-pan__strip figure{position:relative;flex:1 1 0;margin:0;overflow:hidden}
.ph-pan__strip img{width:100%;height:100%;object-fit:cover}
.ph-pan__strip::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(10,11,20,.6),rgba(10,11,20,.25) 40%,rgba(10,11,20,.55))}
.ph-pan__strip figure + figure img{-webkit-mask-image:linear-gradient(to right,transparent,#000 6%);mask-image:linear-gradient(to right,transparent,#000 6%);margin-left:-6%;width:106%;max-width:none}
.ph-pan__head{position:relative;z-index:3;text-align:center}
.ph-pan__head h2{font:700 clamp(2.25rem,5vw,4.5rem)/1 var(--ph-display);letter-spacing:-.04em}
.ph-pan__device{position:relative;z-index:3;flex:none;width:min(56vw,calc((100svh - 330px) * 1.2),800px)}
.ph-pan__labels{position:relative;z-index:3;display:flex;justify-content:center;gap:clamp(8px,2vw,20px);list-style:none;margin:0;padding:0}
.ph-pan__labels li{padding:10px 18px;border-radius:99px;font:500 1rem/1.2 var(--ph-text);color:rgba(255,255,255,.6);background:rgba(255,255,255,.08);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);transition:color .4s ease,background-color .4s ease}
.ph-pan__labels li.is-on{color:var(--ph-ink);background:#fff}
@media (max-width:760px){
  .ph-pan__stage{height:auto;min-height:0;overflow:visible;padding:72px var(--ph-gut);gap:24px;align-items:stretch}
  .ph-pan__strip{order:3}
  .ph-pan__strip figure{flex:none}
  .ph-pan__strip{position:relative;width:100%;height:auto;flex-direction:column;gap:12px}
  .ph-pan__strip::after{display:none}
  .ph-pan__strip figure{aspect-ratio:4/3;border-radius:22px}
  .ph-pan__strip figure + figure img{-webkit-mask-image:none;mask-image:none;margin:0;width:100%}
  .ph-pan__head{position:relative;top:0;padding:0 0 24px}
  .ph-pan__device{width:100%}
  .ph-pan__labels{display:none}
}

/* ═══ first-load landing ═══
   The words rise, then the device travels up from below and stops exactly where it
   sits (transform only). An inline script adds .is-arriving before first paint;
   pos.js adds .is-rising, then .is-landing once the picture has decoded, then
   .is-landed. Without motion none of these apply and the device is simply there. */
@keyframes ph-rise{from{opacity:0;transform:translateY(60px)}to{opacity:1;transform:none}}
@keyframes ph-land{
  0%{opacity:0;transform:translate3d(0,50vh,0) scale(.96)}
  33%{opacity:1}
  100%{opacity:1;transform:none}
}
.js-motion [data-ph-land].is-arriving:not(.is-landed) [data-ph-device],
.js-motion .ph-hero.is-arriving:not(.is-landed):not(.is-rising) [data-ph-in]{opacity:0}
.js-motion .ph-hero.is-rising:not(.is-landed) [data-ph-in]{animation:ph-rise .9s var(--ph-ease) both;animation-delay:calc(var(--i,0) * .11s)}
.js-motion [data-ph-land].is-landing [data-ph-device]{animation:ph-land 1.1s cubic-bezier(.22,1,.36,1) .3s both}

/* ═══ fade-up on entry ═══ */
.js-motion [data-ph-rise]{opacity:0;transform:translateY(40px)}
.js-motion [data-ph-rise].is-in{opacity:1;transform:none;transition:opacity 1s var(--ph-ease),transform 1s var(--ph-ease);transition-delay:calc(var(--i,0) * .1s)}

@media (prefers-reduced-motion:reduce){
  .ph *{transition:none!important;animation:none!important}
}
