/* ============================================================
   Future Hairline — the free AI hair scan.
   The site's tokens (styles.css, site.css): white, ink, the peach accent,
   Plus Jakarta Sans. One screen at a time, the height of the device: a bar
   (back, progress, close), the screen's content, and its actions at the
   bottom, where a thumb is. On a wide screen the same, centred.
   ============================================================ */

/* the site's chrome steps aside */
.fh-app,.fh-app body{height:100%;overflow:hidden}
.fh-app body::before{display:none}
.fh-app .nav,.fh-app .topband,.fh-app .gm-bar,.fh-app .footer,.fh-app .mobile-bar,.fh-app .float-bar,
.fh-app .chat-foot,.fh-app .modal-backdrop{display:none!important}

.fh{--fh-r:24px;--fh-line:rgba(21,21,21,.12);--fh-ease:cubic-bezier(.22,1,.36,1);--fh-err:#B42318;
  position:fixed;inset:0;background:#fff;color:var(--ink);font-family:var(--font-sans);
  -webkit-tap-highlight-color:transparent}
.fh [hidden]{display:none!important}
.fh-in{height:100%;max-width:1080px;margin:0 auto;display:flex;flex-direction:column;
  padding:calc(6px + env(safe-area-inset-top)) 20px calc(14px + env(safe-area-inset-bottom))}

/* ---------- the bar: back, a quiet progress line, close ---------- */
.fh-bar{flex:none;display:grid;grid-template-columns:44px 1fr 44px;align-items:center;height:56px}
.fh-ic{width:44px;height:44px;display:grid;place-items:center;border-radius:50%;border:0;padding:0;
  background:var(--bg-2);color:var(--ink);cursor:pointer;transition:background-color .2s var(--fh-ease),transform .2s var(--fh-ease)}
.fh-ic svg{width:20px;height:20px}
.fh-ic:hover{background:#EAEAE7}
.fh-ic:active{transform:scale(.94)}
.fh-back{grid-column:1}
.fh-x{grid-column:3}
.fh-prog{grid-column:2;justify-self:center;width:72px;height:4px;border-radius:2px;background:var(--fh-line);overflow:hidden}
.fh-prog i{display:block;height:100%;background:var(--ink);border-radius:2px;transform-origin:left;
  transform:scaleX(var(--p,0));transition:transform .45s var(--fh-ease)}
.fh :focus-visible{outline:2px solid var(--ink);outline-offset:3px}

/* ---------- a screen: content, then its actions ---------- */
.fh-step{display:none;flex:1;min-height:0;flex-direction:column}
.fh-step.on{display:flex}
.fh-moved .fh-step.on{animation:fhIn .34s var(--fh-ease) both}     /* moving between screens, not on load */
.fh-moved.fh-rev .fh-step.on{animation-name:fhBack}
@keyframes fhIn{from{opacity:0;transform:translateX(18px)}to{opacity:1;transform:none}}
@keyframes fhBack{from{opacity:0;transform:translateX(-18px)}to{opacity:1;transform:none}}
.fh-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;
  padding:10px 0 4px;scrollbar-width:none}
.fh-body::-webkit-scrollbar{display:none}
.fh-foot{flex:none;display:flex;flex-direction:column;gap:10px;padding-top:14px}

.fh h1{font-size:36px;line-height:1.04;font-weight:650;letter-spacing:-.04em;text-wrap:balance;margin:0}
.fh h2{font-size:28px;line-height:1.12;font-weight:650;letter-spacing:-.032em;text-wrap:balance;margin:0}
.fh h1:focus,.fh h2:focus{outline:none}
.fh-head{flex:none;margin-bottom:18px}
.fh-head p,.fh-sub{margin:8px 0 0;font-size:16px;line-height:1.45;color:var(--ink-soft);text-wrap:pretty}
.fh-fine{margin:0;font-size:13px;line-height:1.45;color:var(--ink-soft);text-align:center;text-wrap:pretty}
.fh-fine a,.fh-link{color:var(--ink);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}
.fh-link{font:inherit;background:none;border:0;padding:0;cursor:pointer}

/* buttons: the site's pills, full width and a comfortable height */
.fh .btn{justify-content:center;min-height:54px;font-size:16px;font-weight:600;letter-spacing:-.005em;
  text-transform:none;transition:background-color .2s var(--fh-ease),transform .2s var(--fh-ease),opacity .2s}
.fh .btn:active{transform:scale(.98)}
.fh .btn[disabled]{opacity:.4;cursor:not-allowed;transform:none}
.fh .btn-gold{padding:10px 10px 10px 22px}
.fh .btn-gold::after{width:28px;height:28px;background-size:13px}
.fh .btn-ghost{padding:10px 22px;background:#fff;border:1px solid var(--fh-line)}
.fh-acts{display:flex;gap:10px}
.fh-acts .btn{flex:1 1 0;min-width:0;padding:10px 14px}
.fh-acts .btn-gold::after{display:none}      /* two side by side: the words carry it */

/* ---------- start ---------- */
.fh-start .fh-sub{margin-top:12px}
.fh-proof{flex:1;min-height:180px;display:flex;flex-direction:column;gap:10px;margin:22px 0 0}
.fh-proof .ba2{flex:1;min-height:0;aspect-ratio:auto;border-radius:var(--fh-r)}
.fh-proof figcaption{flex:none;font-size:13px;color:var(--ink-soft);text-align:center}
.fh .ba2-lab{top:14px;padding:6px 12px;font-size:13px;font-weight:600;color:var(--ink);background:rgba(255,255,255,.9);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.fh .ba2-lab.b{left:14px}
.fh .ba2-lab.a{right:14px}
.fh .ba2-knob{width:48px;height:48px;margin:-24px 0 0 -24px}
.fh .ba2-knob svg{width:22px;height:22px}
.fh .ba2-range:focus-visible ~ .ba2-knob{outline:2px solid #fff;outline-offset:3px}

/* ---------- photos: the stage is always the 2:3 the photo is saved at ---------- */
.fh-photos .fh-body{overflow:hidden}
.fh-photos .fh-head{margin-bottom:14px}
.fh-photos .fh-head p{min-height:2.9em}
.fh-stagebox{flex:1;min-height:200px;container-type:size;display:grid;place-items:center}
.fh-stage{position:relative;width:min(100cqw,66.667cqh);height:min(100cqh,150cqw);border-radius:var(--fh-r);
  overflow:hidden;background:var(--bg-2);isolation:isolate}
.fh-stage video,.fh-stage #fhView{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#111}
.fh-stage video.mirror{transform:scaleX(-1)}
.fh-guide{position:absolute;inset:7% 9% 3%;z-index:1;color:rgba(255,255,255,.78);pointer-events:none;
  filter:drop-shadow(0 1px 6px rgba(0,0,0,.45))}
.fh-guide svg,.fh-empty svg{width:100%;height:100%;display:block}
.fh-empty{position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:18px;padding:24px;text-align:center}
.fh-empty span{width:42%;max-width:150px;aspect-ratio:3/4;color:#B9B9BD}
.fh-empty p{margin:0;max-width:26ch;font-size:15px;line-height:1.45;color:var(--ink-soft)}
.fh-timer{position:absolute;top:12px;left:12px;z-index:2;display:flex;align-items:center;gap:6px;height:36px;
  padding:0 12px 0 9px;border:0;border-radius:999px;font:inherit;font-size:13px;font-weight:600;color:#fff;
  background:rgba(20,20,20,.5);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);cursor:pointer}
.fh-timer svg{width:18px;height:18px}
.fh-timer[aria-pressed="true"]{background:rgba(255,255,255,.92);color:var(--ink)}
.fh-count{position:absolute;inset:0;z-index:3;display:grid;place-items:center;font-size:120px;font-weight:600;
  letter-spacing:-.04em;color:#fff;text-shadow:0 4px 30px rgba(0,0,0,.5)}
.fh-warn{position:absolute;left:12px;right:12px;bottom:12px;z-index:2;margin:0;padding:10px 14px;border-radius:14px;
  font-size:13.5px;line-height:1.35;text-align:center;color:var(--ink);background:rgba(255,255,255,.92);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}

.fh-shots{flex:none;display:flex;justify-content:center;gap:14px;margin-top:14px}
.fh-shot{display:flex;flex-direction:column;align-items:center;gap:6px;padding:0;border:0;background:none;
  font:inherit;color:var(--ink-soft);cursor:pointer}
.fh-thumb{position:relative;width:48px;height:48px;border-radius:14px;overflow:hidden;display:grid;place-items:center;
  background:var(--bg-2);color:#A9A9AE;box-shadow:0 0 0 1px var(--fh-line);transition:box-shadow .2s var(--fh-ease)}
.fh-thumb svg{width:70%;height:70%}
.fh-thumb img{width:100%;height:100%;object-fit:cover}
.fh-shot[data-shot="2"]:not(.done) .fh-thumb{background:#fff;box-shadow:none;outline:1.5px dashed #B9B9BD;outline-offset:-1.5px}
.fh-shot.cur .fh-thumb{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--ink)}
.fh-shot.cur{color:var(--ink)}
.fh-shot-l{font-size:12.5px;font-weight:600}
.fh-shot.done .fh-thumb::after{content:"";position:absolute;right:3px;bottom:3px;width:16px;height:16px;border-radius:50%;
  background:var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.2 8.3l2.4 2.3 5-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat}

/* the camera's own row: library, shutter, flip */
.fh-cam{align-items:center;justify-content:space-between;max-width:320px;width:100%;margin:0 auto;min-height:76px}
.fh-cam .fh-ic{width:52px;height:52px}
.fh-cam .fh-ic svg{width:24px;height:24px}
.fh-snap{width:76px;height:76px;border-radius:50%;padding:0;border:4px solid var(--ink);background:var(--ink);
  box-shadow:inset 0 0 0 3px #fff;cursor:pointer;transition:transform .15s var(--fh-ease),opacity .2s}
.fh-snap:active{transform:scale(.92)}
.fh-snap[disabled]{opacity:.35;cursor:default}
.fh-camfoot .fh-acts:not(.fh-cam){min-height:76px;align-items:center}

/* ---------- questions: segmented controls ---------- */
.fh-seg{border:0;margin:0 0 26px;padding:0;min-width:0}
.fh-seg legend{padding:0;margin-bottom:10px;font-size:16px;font-weight:600;letter-spacing:-.01em}
.fh-seg-row{display:flex;gap:4px;padding:4px;border-radius:16px;background:var(--bg-2)}
.fh-seg label{flex:1 1 0;min-width:0;position:relative;cursor:pointer}
.fh-seg input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}
.fh-seg span{display:flex;align-items:center;justify-content:center;min-height:46px;padding:6px 8px;border-radius:12px;
  font-size:15px;font-weight:600;line-height:1.2;text-align:center;color:var(--ink-soft);
  transition:background-color .2s var(--fh-ease),color .2s var(--fh-ease),box-shadow .2s var(--fh-ease)}
.fh-seg input:checked+span{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(21,21,21,.12),0 0 0 .5px rgba(21,21,21,.06)}
.fh-seg input:focus-visible+span{outline:2px solid var(--ink);outline-offset:1px}
.fh-seg label:hover input:not(:checked)+span{color:var(--ink)}

/* ---------- details ---------- */
.fh-field{display:flex;flex-direction:column;gap:6px;margin-bottom:2px}
.fh-field>span{font-size:14px;font-weight:600}
.fh-field input{width:100%;height:52px;padding:0 16px;font:inherit;font-size:17px;color:var(--ink);background:#fff;
  border:1px solid rgba(21,21,21,.16);border-radius:14px;transition:border-color .2s var(--fh-ease),box-shadow .2s var(--fh-ease)}
.fh-field input:focus{outline:none;border-color:var(--ink);box-shadow:0 0 0 3px rgba(21,21,21,.08)}
.fh [aria-invalid="true"]{border-color:var(--fh-err)}
.fh-e{display:block;min-height:18px;font-size:13px;line-height:18px;color:var(--fh-err)}
.fh-hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
.fh-check{display:flex;gap:12px;align-items:flex-start;margin-top:8px;font-size:14px;line-height:1.45;color:var(--ink-soft);cursor:pointer}
.fh-check input{flex:none;width:22px;height:22px;margin:0;accent-color:var(--ink);cursor:pointer}
.fh-check input[aria-invalid="true"]{outline:2px solid var(--fh-err);outline-offset:1px}
.fh-check+.fh-e{padding-left:34px;margin-bottom:6px}
.fh-details .fh-fine{text-align:left}

/* ---------- working: their own photo, being read ---------- */
.fh-work .fh-body{align-items:center;justify-content:center;text-align:center}
.fh-scanpic{position:relative;flex:none;margin:0 0 30px;width:min(220px,52vw);aspect-ratio:2/3;border-radius:var(--fh-r);
  overflow:hidden;background:var(--bg-2);box-shadow:0 24px 50px -28px rgba(21,21,21,.45)}
.fh-scanpic img{width:100%;height:100%;object-fit:cover}
.fh-scanpic i{position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,0) 30%,rgba(255,255,255,.38) 50%,rgba(255,255,255,0) 70%)
  0 0/100% 300% no-repeat;animation:fhSheen 2.8s var(--fh-ease) infinite}
@keyframes fhSheen{from{background-position:0 100%}to{background-position:0 0}}
.fh-line{margin:10px 0 0;min-height:24px;font-size:16px;color:var(--ink-soft)}
.fh-bar2{width:180px;height:4px;margin:18px 0 22px;border-radius:2px;background:var(--fh-line);overflow:hidden}
.fh-bar2 i{display:block;height:100%;background:var(--ink);transform:scaleX(0);transform-origin:left;transition:transform .6s linear}
.fh-work .fh-fine{max-width:32ch}
.fh-fail p{margin:12px 0 0;font-size:16px;line-height:1.5;color:var(--ink-soft);max-width:40ch}
.fh-fail .fh-fine{margin-top:14px}

/* ---------- result ---------- */
.fh-result .fh-plan{display:contents}
.fh-result .fh-body{gap:0}
.fh-result h2{order:1}
.fh-mailed{order:2;display:flex;align-items:center;gap:8px;margin:8px 0 0;font-size:15px;font-weight:600;color:var(--ink);
  overflow-wrap:anywhere}
.fh-mailed svg{flex:none;width:20px;height:20px;padding:3px;border-radius:50%;background:var(--accent);color:var(--ink)}
.fh-pic{order:3;flex:none;margin-top:18px}
.fh-cmp{position:relative;margin:0 auto;height:min(52vh,560px);aspect-ratio:2/3;max-width:100%;border-radius:var(--fh-r);
  overflow:hidden;background:var(--bg-2)}
.fh-cmp .ba2{position:absolute;inset:0;aspect-ratio:auto;border-radius:0}
.fh-cmp>img{width:100%;height:100%;object-fit:cover}
.fh-pic .fh-fine{margin-top:10px}
.fh-facts{order:4;margin:20px 0 0}
.fh-facts div{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:13px 0;border-top:1px solid var(--fh-line)}
.fh-facts div:last-child{border-bottom:1px solid var(--fh-line)}
.fh-facts dt{flex:none;font-size:15px;color:var(--ink-soft)}
.fh-facts dd{margin:0;font-size:16px;font-weight:600;text-align:right}
.fh-facts small{display:block;margin-top:3px;font-size:12.5px;font-weight:400;color:var(--ink-soft)}
.fh-advice{order:5;margin:16px 0 0;padding:14px 16px;border-radius:16px;background:var(--bg-2);font-size:14.5px;line-height:1.5;color:var(--ink)}
.fh-advice .fh-link{margin-left:2px}
.fh-result .fh-foot .btn-ghost{min-height:44px;border:0;background:none;padding:6px 16px}
.fh-result .fh-foot .btn-ghost:hover{background:var(--bg-2)}
.fh-result .fh-foot .btn-ghost::before{content:"";width:18px;height:18px;flex:none;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E") center/contain no-repeat}

/* ---------- small phones: give the photo the room ---------- */
@media(max-height:700px){
  .fh h1{font-size:30px}
  .fh h2{font-size:24px}
  .fh-head{margin-bottom:12px}
  .fh-photos .fh-head p{min-height:0}
  .fh-scanpic{width:min(170px,44vw);margin-bottom:20px}
  .fh-seg{margin-bottom:18px}
  .fh-details .fh-head p{display:none}             /* the consent says the same, right below */
  .fh-field input{height:46px}
  .fh-e{min-height:16px;line-height:16px;font-size:12.5px}
  .fh-check{margin-top:4px;font-size:13px}
  .fh-details .fh-fine{font-size:12px}
  .fh-check+.fh-e{margin-bottom:2px}
}

/* ---------- a wide screen: the same screens, centred; start and result side by side ---------- */
@media(min-width:900px){
  .fh-in{padding:18px 40px 32px}
  .fh-step{width:100%;max-width:520px;margin:0 auto;justify-content:center}
  .fh-step .fh-body{flex:0 1 auto}
  .fh-photos .fh-body{flex:1 1 auto}
  .fh-photos{justify-content:flex-start}
  .fh-foot{padding-top:22px}
  .fh-acts .btn,.fh-foot>.btn{flex:none;min-width:200px}
  .fh-foot>.btn{align-self:stretch}
  .fh h2{font-size:32px}

  .fh-start,.fh-result{max-width:none;display:none;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    column-gap:56px;align-content:center}
  .fh-start.on,.fh-result.on{display:grid}
  .fh-start .fh-body,.fh-result .fh-body{display:contents}
  .fh-start .fh-say{grid-column:1;grid-row:1;align-self:end}
  .fh-start h1{font-size:54px}
  .fh-start .fh-sub{font-size:18px;max-width:36ch}
  .fh-proof{grid-column:2;grid-row:1 / 3;margin:0;height:min(68vh,600px)}
  .fh-start .fh-foot{grid-column:1;grid-row:2;align-self:start;align-items:flex-start;padding-top:30px}
  .fh-start .fh-foot .btn{align-self:flex-start}
  .fh-start .fh-fine{text-align:left}

  .fh-result{grid-template-rows:1fr auto auto 1fr;align-content:stretch}    /* the plan sits level with the picture */
  .fh-result .fh-plan{display:block;grid-column:2;grid-row:2}
  .fh-pic{grid-column:1;grid-row:1 / 5;margin:0;align-self:center}
  .fh-cmp{height:min(66vh,600px)}
  .fh-result .fh-foot{grid-column:2;grid-row:3;padding-top:24px}
  .fh-result .fh-foot .btn-ghost{align-self:flex-start}
}

/* motion: a crossfade at most */
@media (prefers-reduced-motion:reduce){
  .fh-moved .fh-step.on,.fh-moved.fh-rev .fh-step.on{animation:fhFade .15s linear both}
  @keyframes fhFade{from{opacity:0}to{opacity:1}}
  .fh-scanpic i{animation:none;opacity:0}
  .fh *{transition-duration:.01s!important}
}
