/* Workclarify — How it works. See ROADMAP.md §15
   Style from the reference video: one full-screen photo per step with a wide, light, letter-spaced title;
   moving on shrinks the photo into a card, the card row slides along and the next card grows to full screen.
   Palette (brand board): Orange #E85002 · Black #000 · Light Gray #A7A7A7 · Gray #646464 · White #F9F9F9
   · Gradient #000 → #C10801 → #F16001 → #D9C3AB. No blue. */

.hw-page {
  --orange: #E85002;
  --red: #C10801;
  --flame: #F16001;
  --sand: #D9C3AB;
  --white: #F9F9F9;
  --light: #A7A7A7;
  --gray: #646464;
  --ease: cubic-bezier(.77, 0, .18, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --display: "Oswald", "Arial Narrow", Impact, sans-serif;
  background: #000;
  color: var(--white);
  font-family: "Inter", var(--font);
  overflow: hidden;
}

/* ---------- Top bar (same as Services) ---------- */
.hw-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  padding: clamp(14px, 2.2vw, 28px) clamp(16px, 2.4vw, 36px);
  color: var(--white); font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.hw-top a { color: inherit; }
.hw-top .hs-links a[aria-current="page"]::after { transform: scaleX(1); background: var(--orange); }

/* ---------- Stage ---------- */
.hw {
  --pad: clamp(20px, 7vw, 120px);
  position: relative; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; outline: none;
  font-size: clamp(12px, calc(.4vw + .8vh), 16px);
}
.hw-bg { position: absolute; inset: 0; z-index: 0; background: #000; overflow: hidden; }
.hw-bg-img {
  position: absolute; inset: 0; transform-origin: 55% 50%;
  background-size: cover; background-repeat: no-repeat; background-position: var(--pos, 50% 50%);
  filter: saturate(.9) contrast(1.05);
}
.hw-bg-img.is-kb { animation: hw-kb 10s cubic-bezier(.2, .6, .3, 1) both; }
@keyframes hw-kb { from { transform: scale(1); } to { transform: scale(1.07); } }

/* the darkening used on the full-screen photo; the cards carry the same one (.hw-shade) so the hand-over is seamless */
.hw-veil, .hw-shade {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .5) 38%, rgba(0, 0, 0, .12) 70%, rgba(0, 0, 0, .25) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 24%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .7) 100%),
    linear-gradient(120deg, rgba(193, 8, 1, .10), rgba(241, 96, 1, .05) 50%, transparent 80%);
}
.hw-veil { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hw > .hs-grain { z-index: 4; opacity: .1; }

/* vertical label on the left edge, as in the reference */
.hw-rail {
  position: absolute; z-index: 6; left: clamp(10px, 1.6vw, 26px); top: 50%; margin: 0;
  transform: translateY(-50%) rotate(-90deg); transform-origin: center;
  font-size: .62rem; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--light); white-space: nowrap;
}

/* ---------- Transition layer: cards that shrink, slide and grow ---------- */
.hw-reel { position: absolute; inset: 0; z-index: 3; background: #000; overflow: hidden; pointer-events: none; }
.hw-strip { position: absolute; inset: 0; }
.hw-card {
  position: absolute; overflow: hidden; background: #111 center / cover no-repeat;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .9);
}
.hw-card .hw-shade { position: absolute; inset: 0; }

/* ---------- Text ---------- */
.hw-texts {
  position: absolute; z-index: 5; left: var(--pad); right: var(--pad); top: 0; bottom: 0;
  display: grid; align-content: center; pointer-events: none;
  padding: calc(2 * clamp(14px, 2.2vw, 28px) + 52px) 0 calc(clamp(18px, 4vh, 44px) + 70px);
}
.hw-slide { grid-area: 1 / 1; max-width: min(1100px, 100%); pointer-events: auto; }
.hw-slide[hidden] { display: none; }

.hw-kicker {
  margin: 0 0 1.1em; display: flex; align-items: center; gap: 1.1em;
  font-size: .78em; font-weight: 600; letter-spacing: .42em; text-transform: uppercase; color: var(--sand);
}
.hw-kicker::after { content: ""; width: clamp(40px, 6vw, 90px); height: 1px; background: linear-gradient(90deg, var(--orange), transparent); }

.hw-title {
  margin: 0; font-family: var(--display); font-weight: 300; text-transform: uppercase; color: var(--white);
  font-size: clamp(2.3rem, min(6.4vw, 11vh), 6.6rem); line-height: 1.04; letter-spacing: .1em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .35);
}
.hw-title .hw-w { display: inline-block; white-space: nowrap; }
.hw-title .hw-c { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .04em; }
.hw-title .hw-c > span { display: inline-block; will-change: transform; }
.hw-sr, .hw-title .hw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }

.hw-rule {
  width: min(560px, 70%); height: 1px; margin: 1.6em 0 1.3em; transform-origin: left;
  background: linear-gradient(90deg, var(--red), var(--flame) 40%, var(--sand) 75%, rgba(217, 195, 171, 0));
}
.hw-desc { margin: 0; max-width: 36em; font-size: 1.12em; line-height: 1.65; color: rgba(249, 249, 249, .86); }

.hw-start {
  margin-top: 1.8em; display: inline-flex; align-items: center; gap: .9em; padding: .55em 1.3em .55em .55em;
  border: 1px solid rgba(249, 249, 249, .32); border-radius: 999px; background: rgba(0, 0, 0, .25);
  color: var(--white); font: 700 .76em/1 "Inter", sans-serif; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: border-color .3s, background .3s, transform .3s var(--ease-out);
}
.hw-start span {
  width: 2.3em; height: 2.3em; border-radius: 50%; background: var(--orange); position: relative; flex: none;
  transition: transform .4s var(--ease-out);
}
.hw-start span::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: .55em; height: .55em;
  border-top: 2px solid #fff; border-right: 2px solid #fff; transform: translateX(-12%) rotate(45deg);
}
.hw-start:hover, .hw-start:focus-visible { border-color: var(--orange); background: rgba(232, 80, 2, .14); transform: translateY(-2px); }
.hw-start:hover span { transform: scale(1.12); }

/* ---------- Counter + arrows (bottom centre: "I ——— IV") ---------- */
.hw-foot {
  position: absolute; z-index: 6; left: 50%; bottom: clamp(18px, 4vh, 44px); transform: translateX(-50%);
  display: flex; align-items: center; gap: clamp(12px, 1.6vw, 22px);
}
.hw-count { display: flex; align-items: center; gap: 1em; font-family: var(--display); font-weight: 300; font-size: clamp(1.05rem, 1.5vw, 1.45rem); letter-spacing: .12em; color: var(--white); }
.hw-count span { min-width: 2.2em; text-align: center; }
.hw-count span:last-child { color: var(--light); }
.hw-count i { position: relative; display: block; width: clamp(90px, 12vw, 190px); height: 1px; background: rgba(249, 249, 249, .25); overflow: hidden; }
.hw-count b { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, .25)); background: linear-gradient(90deg, var(--red), var(--flame), var(--sand)); transition: transform .9s var(--ease); }
.hw-arrow {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(249, 249, 249, .3); background: transparent; color: var(--white);
  transition: background .3s, border-color .3s, transform .3s var(--ease-out);
}
.hw-arrow svg { width: 15px; height: 15px; }
.hw-arrow:hover, .hw-arrow:focus-visible { background: var(--orange); border-color: var(--orange); transform: scale(1.08); }
.hw-arrow:disabled { opacity: .3; cursor: default; background: transparent; border-color: rgba(249, 249, 249, .3); transform: none; }

/* ---------- "All steps" ring (the reference's round button, bottom right) ---------- */
.hw-ring {
  position: absolute; z-index: 6; right: clamp(16px, 3vw, 48px); bottom: clamp(14px, 3.4vh, 38px);
  width: clamp(84px, 8vw, 116px); aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--white);
  font: 700 .62rem/1.2 "Inter", sans-serif; letter-spacing: .18em; text-transform: uppercase;
}
.hw-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hw-ring circle { fill: rgba(0, 0, 0, .2); stroke: rgba(249, 249, 249, .35); stroke-width: 1; transition: stroke .3s, fill .3s; }
.hw-ring span { position: relative; transition: transform .4s var(--ease-out); }
.hw-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--orange);
  clip-path: inset(0 0 100% 0); transition: clip-path .6s var(--ease);
}
.hw-ring:hover::after, .hw-ring:focus-visible::after { clip-path: inset(0 0 0 0); }
.hw-ring:hover circle, .hw-ring:focus-visible circle { fill: rgba(232, 80, 2, .18); }
.hw-ring:hover span { transform: scale(1.08); }

/* ---------- Overview (light screen with the three steps as photo tiles) ---------- */
.hw-all {
  position: absolute; inset: 0; z-index: 20; background: var(--white); color: #000;
  overflow-y: auto; overscroll-behavior: contain;
}
.hw-all[hidden] { display: none; }
.hw-all-in {
  min-height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center;
  padding: calc(2 * clamp(14px, 2.2vw, 28px) + 56px) var(--pad) clamp(24px, 5vh, 60px); text-align: center; position: relative;
}
.hw-page.is-all .hw-top { color: #000; background: rgba(249, 249, 249, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hw-page.is-all .hw-top .hs-logo span:first-child { border-color: #000; }
.hw-back {
  position: absolute; left: var(--pad); top: calc(2 * clamp(14px, 2.2vw, 28px) + 60px);
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; padding: 6px 0;
  font: 700 .66rem/1 "Inter", sans-serif; letter-spacing: .2em; text-transform: uppercase; color: #000;
}
.hw-back svg { width: 14px; height: 14px; transition: transform .3s var(--ease-out); }
.hw-back:hover svg { transform: translateX(-4px); }
.hw-all-eyebrow { margin: 0 0 .9em; font-size: .72rem; font-weight: 700; letter-spacing: .36em; text-transform: uppercase; color: var(--orange); }
.hw-all-title { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .14em; font-size: clamp(1.5rem, 3vw, 2.6rem); line-height: 1.15; }
.hw-all-rule { width: min(320px, 50%); height: 1px; margin: 1.2em auto 2.2em; background: linear-gradient(90deg, transparent, var(--orange), transparent); }
.hw-tiles { list-style: none; margin: 0; padding: 0; width: min(1180px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 24px); }
.hw-tile {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; max-height: 56vh; border: 0; padding: 0; cursor: pointer;
  border-radius: 6px; overflow: hidden; color: var(--white); background: #111; text-align: left;
}
.hw-tile i { position: absolute; inset: 0; background: center / cover no-repeat; transition: transform 1.1s var(--ease-out); }
.hw-tile::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0, 0, 0, .1) 30%, rgba(0, 0, 0, .78) 100%); transition: background .4s; }
.hw-tile span { position: absolute; z-index: 2; left: 1.2em; right: 1.2em; bottom: 1.1em; display: grid; gap: .5em; }
.hw-tile small { font-size: .66rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--sand); }
.hw-tile strong { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .1em; font-size: clamp(1.05rem, 1.7vw, 1.5rem); line-height: 1.15; }
.hw-tile::after { content: ""; position: absolute; z-index: 2; left: 1.2em; top: 1.2em; width: 28px; height: 2px; background: var(--orange); transition: width .4s var(--ease-out); }
.hw-tile:hover i, .hw-tile:focus-visible i { transform: scale(1.08); }
.hw-tile:hover::after, .hw-tile:focus-visible::after { width: 56px; }
.hw-tile:hover::before { background: linear-gradient(180deg, rgba(193, 8, 1, .08) 20%, rgba(0, 0, 0, .82) 100%); }
.hw-tile:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* ---------- Smaller screens ---------- */
@media (max-width: 819px) {
  .hw-top .hs-tag { display: none; }
  .hw-top .hs-links, .hw-top .hs-contact { gap: 14px; font-size: .62rem; letter-spacing: .12em; white-space: nowrap; }
  .hw-top .hs-contact { margin-left: 14px; }
  .hw-top .hs-links a { display: inline; white-space: nowrap; }
  .hw-rail { display: none; }
}
@media (max-width: 440px) { .hw-top .hs-logo span:last-child { display: none; } }
@media (max-width: 699px) {
  .hw { --pad: 22px; }
  .hw-title { font-size: clamp(1.9rem, 9.4vw, 3rem); letter-spacing: .07em; }
  .hw-kicker { letter-spacing: .3em; }
  .hw-texts { align-content: end; padding-bottom: calc(clamp(18px, 4vh, 44px) + 78px); }
  .hw-veil { background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .15) 30%, rgba(0, 0, 0, .55) 58%, rgba(0, 0, 0, .9) 100%); }
  .hw-foot { left: 22px; transform: none; gap: 10px; }
  .hw-count { gap: .6em; }
  .hw-count span { min-width: 1.6em; }
  .hw-count i { width: 36px; }
  .hw-ring { width: 64px; right: 14px; bottom: clamp(12px, 3.4vh, 38px); font-size: .55rem; letter-spacing: .12em; }
  .hw-tiles { grid-template-columns: 1fr; }
  .hw-tile { aspect-ratio: 16 / 9; max-height: none; }
  .hw-back { position: static; align-self: flex-start; margin-bottom: 18px; }
}
@media (max-height: 560px) and (min-width: 700px) {
  .hw-title { font-size: clamp(1.8rem, 9vh, 3.4rem); }
  .hw-rule { margin: 1em 0 .8em; }
  .hw-start { margin-top: 1em; }
}

@media (prefers-reduced-motion: reduce) {
  .hw-bg-img.is-kb { animation: none; }
  .hw-start, .hw-arrow, .hw-tile i, .hw-ring span, .hw-ring::after, .hw-count b { transition: none; }
}
