/* ============================================================= */
/*  /how-it-works — page-local styles only.                       */
/*                                                                */
/*  Every selector is scoped to .hiw (or its own .hiw-* / .auth-* */
/*  classes inside it), so no other page can change. The header,  */
/*  footer, type reset and colours come from styles.css as-is.    */
/*                                                                */
/*  MOTION. Two kinds, never mixed on one property:               */
/*    transform  — the one-time entrance ([data-enter] → .is-in)  */
/*    translate  — scroll parallax, written by how-it-works.js    */
/*  Both are compositor-only. Without JS (html.no-js) or with     */
/*  reduced motion, everything is simply shown in place.          */
/* ============================================================= */

.hiw {
  --hiw-blue: #1288F5;            /* ClickSling app blue (auth + wizard buttons) */
  --hiw-blue-hover: #0F78D9;
  --hiw-shadow: 0 2px 6px rgba(16, 24, 40, .05), 0 34px 80px -28px rgba(16, 24, 40, .28);
  --hiw-shadow-lift: 0 4px 12px rgba(16, 24, 40, .08), 0 48px 110px -30px rgba(16, 24, 40, .38);
  --hiw-ease: cubic-bezier(.2, .7, .2, 1);
  position: relative;
  background: var(--paper);
  overflow-x: clip;               /* entrance offsets never cause sideways scroll; clip keeps sticky working */
}

/* ---- Header logo: the same rule every sub-page carries inline. ---- */
.site-header .site-logo { display: inline-flex; align-items: center; }
.site-header .site-logo img { height: 30px; width: auto; display: block; }

/* ---- Layout -------------------------------------------------- */

.hiw-col {
  position: relative;
  width: 84%;
  max-width: 1400px;
  margin-inline: auto;
}

.hiw-scene {
  position: relative;
  z-index: 1;                     /* content above the journey line */
  padding-block: clamp(6rem, 13vw, 12rem);
}

.hiw-scene--register {
  padding-top: clamp(8.5rem, 14vw, 12rem);   /* clear the fixed header */
}

.hiw-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 7rem);
}

/* ---- Type ---------------------------------------------------- */

.hiw-eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--hiw-blue);
  margin-bottom: 1.4rem;
}

.hiw-h {
  font-size: clamp(2.6rem, 6.2vw, 5.8rem);
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ink);
}

.hiw-sub {
  margin-top: 1.25rem;
  max-width: 30ch;
  font-size: clamp(1.15rem, 1.7vw, 1.6rem);
  line-height: 1.4;
  color: var(--muted);
}

.hiw-copy--end { margin-left: auto; text-align: right; max-width: 54rem; }
.hiw-copy--end .hiw-sub { margin-left: auto; }
.hiw-scene--creative .hiw-copy { max-width: 54rem; }
.hiw-scene--creative .hiw-sub { max-width: 34ch; }

/* Visually hidden, still read aloud. */
.hiw-sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Product windows ----------------------------------------- */

.hiw-window {
  background: #fff;
  border: 1px solid rgba(10, 10, 10, .07);
  border-radius: 14px;
  box-shadow: var(--hiw-shadow);
  overflow: hidden;
}
.hiw-window img { width: 100%; height: auto; }

/* ---- Journey line -------------------------------------------- */

.hiw-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}
.hiw-line__path {
  fill: none;
  stroke: var(--orange);          /* the brand orange from styles.css :root */
  stroke-opacity: .34;
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* =============================================================== */
/*  SCENE 1 — the registration page, recreated as plain elements.   */
/*  Sizes, colours and copy are the app's own (src/app/auth-ui.css  */
/*  and src/app/register/page.tsx).                                 */
/* =============================================================== */

.hiw-reg { position: relative; }

.hiw-reg__window {
  display: grid;                  /* both steps share one cell: the window never resizes */
  padding: clamp(1.6rem, 3.2vw, 2.75rem);
  border-radius: 18px;
  font-family: Arial, Helvetica, sans-serif;
  color: #0A0A0A;
  line-height: 1.35;
}

.hiw-reg__panel {
  grid-area: 1 / 1;
  transition: opacity .45s ease, transform .55s var(--hiw-ease);
}
.hiw-reg__panel:not(.is-shown) {
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}

.hiw-reg .auth-title { font-size: clamp(26px, 2.6vw, 33px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.hiw-reg .auth-sub { margin-top: 9px; font-size: 15px; color: #8a9099; }
.hiw-reg .auth-sub strong { color: #0A0A0A; }
.hiw-reg .auth-sub--gap { margin-top: 12px; }
.hiw-reg .auth-sub--small { margin-top: 8px; font-size: 13.5px; line-height: 1.45; }
.hiw-reg .auth-formbody { margin-top: 24px; }
.hiw-reg .auth-formbody--code { margin-top: 18px; }
.hiw-reg .auth-row2 { display: flex; gap: 12px; }
.hiw-reg .auth-row2 .auth-fld { flex: 1; min-width: 0; }
.hiw-reg .auth-fld { margin-bottom: 14px; }
.hiw-reg .auth-lbl { font-size: 12.5px; font-weight: 700; color: #4b5158; margin-bottom: 6px; }
.hiw-reg .auth-opt { font-weight: 400; color: #aeb2b7; }
.hiw-reg .auth-pwtop { display: flex; justify-content: space-between; align-items: baseline; }
.hiw-reg .auth-show { font-size: 12px; color: #8a9099; text-decoration: underline; }
.hiw-reg .auth-hint { margin-top: 6px; font-size: 12.5px; color: #aeb2b7; }
.hiw-reg .auth-legal { margin: 2px 0 12px; font-size: 12px; color: #8a9099; line-height: 1.5; }

.hiw-reg .auth-inp {
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid #d9dce0;
  border-radius: 11px;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.hiw-reg .auth-inp:empty::before { content: attr(data-placeholder); color: #9aa0a6; }
.hiw-reg .auth-inp.is-focus { border-color: var(--hiw-blue); box-shadow: 0 0 0 3px rgba(18, 136, 245, .12); }
.hiw-reg .auth-inp.is-focus::after {
  content: "";
  width: 1.5px;
  height: 19px;
  margin-left: 1px;
  background: #0A0A0A;
  animation: hiw-caret 1s steps(1) infinite;
}
.hiw-reg .auth-inp:empty.is-focus::before { content: none; }
.hiw-reg .auth-inp--pw { letter-spacing: .12em; }
.hiw-reg .auth-inp--code { justify-content: center; font-size: 20px; letter-spacing: .3em; padding-left: calc(14px + .3em); }

.hiw-reg .auth-submit {
  margin-top: 8px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--hiw-blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  transition: transform .14s ease, filter .14s ease, opacity .2s ease;
}
.hiw-reg .auth-submit.is-press { transform: scale(.975); filter: brightness(.9); }
.hiw-reg .auth-submit.is-busy { opacity: .6; }

.hiw-reg .auth-alt { margin-top: 18px; text-align: center; font-size: 14px; color: #8a9099; }
.hiw-reg .auth-alt b { color: #0A0A0A; text-decoration: underline; }
.hiw-reg .auth-alt--small { margin-top: 8px; font-size: 13px; }
.hiw-reg .auth-alt--small:first-of-type { margin-top: 18px; }

.hiw-reg .auth-envelope {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  border: 1px solid #e2e5e9;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.hiw-reg__panel--code { text-align: left; align-self: center; }

/* The verification email, arriving over the window's corner. */
.hiw-mail {
  position: absolute;
  top: -1.75rem;
  right: -2.25rem;
  width: min(330px, 78%);
  padding: .95rem 1.1rem 1rem;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(10, 10, 10, .08);
  border-radius: 16px;
  box-shadow: var(--hiw-shadow-lift);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(-14px) scale(.97);
  transition: opacity .5s ease, transform .6s var(--hiw-ease);
  pointer-events: none;
}
.hiw-mail.is-in { opacity: 1; transform: none; }
.hiw-mail__from { display: flex; align-items: center; gap: .45rem; font-size: 12px; font-weight: 700; color: #4b5158; }
.hiw-mail__dot { width: 8px; height: 8px; border-radius: 99px; background: var(--hiw-blue); }
.hiw-mail__now { margin-left: auto; font-weight: 400; color: #9aa0a6; }
.hiw-mail__subject { margin-top: .35rem; font-size: 14px; font-weight: 700; color: #0A0A0A; }
.hiw-mail__body { margin-top: .15rem; font-size: 13px; color: #5c636d; }

@keyframes hiw-caret { 50% { opacity: 0; } }

/* =============================================================== */
/*  SCENE 2 — the wizard. The section is tall; its stage is sticky; */
/*  scrolling through it cross-fades the real screens in order.     */
/*  Normal scrolling throughout: nothing is hijacked.               */
/* =============================================================== */

.hiw-scene--wizard { padding-block: 0; }
html.js .hiw-scene--wizard { height: calc(100vh + var(--hiw-frames, 8) * 32vh); }

.hiw-wizard__sticky {
  padding-block: clamp(6rem, 12vw, 9rem);
}
html.js .hiw-wizard__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding-block: 0;
  display: flex;
  align-items: center;
  padding-top: 4.5rem;            /* the fixed header */
}

.hiw-wizard__inner { width: 84%; }

.hiw-copy--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(1.25rem, 2.6vw, 2.25rem);
}
.hiw-scene--wizard .hiw-h { font-size: clamp(2.2rem, 4.4vw, 4.4rem); }
.hiw-scene--wizard .hiw-sub { margin-top: .7rem; }

.hiw-steps {
  list-style: none;
  display: grid;
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;           /* reads down, then across: 01 … 03, then 04 … 07 */
  gap: .3rem 1.6rem;
  font-size: .9rem;
  color: #9aa0a6;
  white-space: nowrap;
}
.hiw-steps li { transition: color .3s ease; }
.hiw-steps span { display: inline-block; min-width: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hiw-steps li.is-active { color: var(--ink); }
.hiw-steps li.is-active span { color: var(--hiw-blue); }

.hiw-frames {
  position: relative;
  margin-inline: auto;
  /* As wide as the column allows, but always short enough to fit the
     viewport beneath the headline: no frame is ever cut off. */
  width: min(100%, calc((100svh - 15.5rem) * 1.38));
  aspect-ratio: 1600 / 1160;
}
.hiw-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity, translate;
}
.hiw-frame.is-shown { opacity: 1; }
.hiw-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* =============================================================== */
/*  SCENES 3 & 4 — layered compositions.                            */
/* =============================================================== */

.hiw-layers {
  position: relative;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}
.hiw-layer { position: relative; }

/* Dossier: the report behind, the researcher video in front. */
.hiw-layers--dossier { padding-bottom: 9%; }
.hiw-layers--dossier .hiw-layer--back { width: 68%; }
.hiw-layers--dossier .hiw-layer--front {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 46%;
  z-index: 2;
}
.hiw-video {
  aspect-ratio: 2880 / 2160;
  border-radius: 20px;
  overflow: hidden;
  background: #eef1f5;
  box-shadow: var(--hiw-shadow-lift);
}
.hiw-video video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }  /* the poster (Dossier screen) shows its top; the 4:3 video fills exactly */

/* Creative Department: the campaign, then the ad stepping forward. */
.hiw-layers--creative { padding-bottom: 6%; }
.hiw-layers--creative .hiw-layer--back { width: 74%; }
.hiw-layers--creative .hiw-layer--ad {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 40%;
  z-index: 2;
}
.hiw-layer--ad img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: var(--hiw-shadow-lift);
}

/* =============================================================== */
/*  SCENE 5 — the entire agency. Free-floating vignettes: no boxes, */
/*  no borders, whole images (never cropped). The artwork sits on   */
/*  near-white, so multiply blends any edge into the page and lets   */
/*  neighbours overlap gently without a white rectangle showing.     */
/* =============================================================== */

.hiw-vignettes {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 2vw, 2rem);
  align-items: start;
}
.hiw-vig { margin: 0; mix-blend-mode: multiply; }
.hiw-vig img { display: block; width: 100%; height: auto; }

.hiw-vig--printer  { grid-column: 1 / 8;  grid-row: 1; }
.hiw-vig--pop      { grid-column: 7 / 13; grid-row: 1; margin-top: 18%; }
.hiw-vig--branding { grid-column: 2 / 6;  grid-row: 2; margin-top: -4%; }
.hiw-vig--merch    { grid-column: 8 / 12; grid-row: 2; margin-top: -10%; }

/* Neighbours arrive a beat apart. */
html.js .hiw .hiw-vig--pop[data-enter],
html.js .hiw .hiw-vig--merch[data-enter] { transition-delay: .15s; }

.hiw-copy--center { margin: clamp(3rem, 6vw, 5.5rem) auto 0; text-align: center; max-width: none; }
.hiw-h--finale { font-size: clamp(2.6rem, 4.6vw, 5rem); }   /* two lines on desktop, as written */

/* ---- Closing call to action --------------------------------- */

.hiw-cta {
  position: relative;
  z-index: 1;
  padding-block: clamp(2rem, 4vw, 4rem) clamp(7rem, 12vw, 11rem);
}
.hiw-cta__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hiw-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.75rem;
  padding: 1.1rem 2.6rem;
  border-radius: 999px;
  background: var(--hiw-blue);
  color: #fff;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 18px 40px -14px rgba(18, 136, 245, .55);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.hiw-cta__btn:hover { background: var(--hiw-blue-hover); transform: translateY(-1px); box-shadow: 0 22px 46px -14px rgba(18, 136, 245, .6); }
.hiw-cta__btn:focus-visible { outline: 3px solid var(--hiw-blue); outline-offset: 4px; }
.hiw-cta__note { margin-top: 1rem; font-size: 1rem; color: var(--muted); }

/* =============================================================== */
/*  Entrances — once, on arrival. JS adds .is-in.                   */
/* =============================================================== */

html.js .hiw [data-enter] {
  opacity: 0;
  transition: opacity .9s ease, transform 1.15s var(--hiw-ease);
}
html.js .hiw [data-enter="up"]     { transform: translateY(56px); }
html.js .hiw [data-enter="left"]   { transform: translateX(-56px); }
html.js .hiw [data-enter="right"]  { transform: translateX(56px); }
html.js .hiw [data-enter="emerge"] {
  /* The ad starts inside the interface — smaller, further back — and
     steps forward to its place in front of it. */
  transform: translate(-28%, -14%) scale(.82);
  transition-delay: .5s;
  transition-duration: 1s, 1.4s;
}
html.js .hiw [data-enter].is-in { opacity: 1; transform: none; }

/* Parallax targets: let the compositor know. */
html.js .hiw [data-speed] { will-change: translate; }

/* =============================================================== */
/*  Tablet                                                          */
/* =============================================================== */

@media (max-width: 1100px) {
  .hiw-split { grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 3rem; }
  .hiw-mail { right: -1rem; }
  .hiw-steps { grid-template-rows: none; grid-auto-flow: row; }
}

/* Tablet portrait: the registration scene stacks — copy, then the page. */
@media (max-width: 960px) {
  .hiw-split { grid-template-columns: minmax(0, 1fr); gap: 3.25rem; }
  .hiw-reg { max-width: 560px; }
}

/* =============================================================== */
/*  Mobile — its own composition: one column, story order kept,     */
/*  smaller movements (the script also halves parallax here).       */
/* =============================================================== */

@media (max-width: 760px) {
  .hiw-col, .hiw-wizard__inner { width: auto; margin-inline: 16px; }
  .hiw-scene { padding-block: 5rem; }
  .hiw-scene--register { padding-top: 7.5rem; }

  .hiw-split { grid-template-columns: minmax(0, 1fr); gap: 2.75rem; }
  .hiw-h { font-size: clamp(2.35rem, 11vw, 3.4rem); }
  .hiw-sub { font-size: 1.15rem; }

  .hiw-reg__window { padding: 1.4rem 1.15rem; border-radius: 16px; }
  .hiw-mail { top: -1.5rem; right: -.25rem; width: 82%; }

  /* Wizard: headline, then one line naming the current step. */
  html.js .hiw-scene--wizard { height: calc(100vh + var(--hiw-frames, 8) * 26vh); }
  html.js .hiw-wizard__sticky { padding-top: 4rem; }
  .hiw-copy--row { display: block; }
  .hiw-scene--wizard .hiw-h { font-size: clamp(2rem, 9vw, 2.8rem); }
  .hiw-steps { display: block; margin-top: 1rem; font-size: .95rem; }
  html.js .hiw-steps li:not(.is-active) { display: none; }
  .hiw-frames { width: 100%; }
  .hiw-window { border-radius: 10px; }

  .hiw-copy--end { text-align: left; margin-left: 0; }
  .hiw-copy--end .hiw-sub { margin-left: 0; }

  .hiw-layers--dossier { padding-bottom: 34%; }
  .hiw-layers--dossier .hiw-layer--back { width: 100%; }
  .hiw-layers--dossier .hiw-layer--front { width: 68%; right: -4px; }
  .hiw-video { border-radius: 14px; }

  .hiw-layers--creative { padding-bottom: 42%; }
  .hiw-layers--creative .hiw-layer--back { width: 100%; }
  .hiw-layers--creative .hiw-layer--ad { width: 66%; right: -4px; }

  /* Scene 5: one column, alternating sides, nothing overlapping. */
  .hiw-vignettes { display: block; }
  .hiw-vig { width: 86%; margin: 0 0 1.75rem; }
  .hiw-vig--pop, .hiw-vig--merch { margin-left: auto; }
  .hiw-vig--branding, .hiw-vig--merch { width: 76%; }
  .hiw-h--finale { font-size: clamp(2.2rem, 9.5vw, 3.2rem); }

  html.js .hiw [data-enter="left"]  { transform: translateX(-28px); }
  html.js .hiw [data-enter="right"] { transform: translateX(28px); }
  html.js .hiw [data-enter="up"]    { transform: translateY(36px); }
}

/* =============================================================== */
/*  Reduced motion: no entrances, no parallax, no typing. The       */
/*  wizard still advances with scroll, by cross-fade only.          */
/* =============================================================== */

@media (prefers-reduced-motion: reduce) {
  html.js .hiw [data-enter] { opacity: 1; transform: none; transition: none; }
  .hiw-reg__panel, .hiw-mail, .hiw-steps li, .hiw-cta__btn { transition: none; }
  .hiw-reg .auth-inp.is-focus::after { animation: none; }
}
