/* Workclarify — Services page. See ROADMAP.md §14
   Style from the reference video: the active service fills the screen as a photo; the other five wait
   as photo cards on the right; picking a card grows it into the background and the text rises in.
   Palette (brand board): Orange #E85002 · Black #000 · Light Gray #A7A7A7 · Gray #646464 · Dark Gray #333
   · White #F9F9F9 · Gradient #000 → #C10801 → #F16001 → #D9C3AB */

.sx-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;            /* one screen, no scrolling */
}

/* ---------- Top bar (same as the home slider's) ---------- */
.sx-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;
}
.sx-top a { color: inherit; }
.sx-top .hs-links a[aria-current="page"]::after { transform: scaleX(1); background: var(--orange); }

/* ---------- Stage ---------- */
.sx {
  --cw: min(clamp(128px, 12.2vw, 232px), 24vh);   /* card width: also limited by screen height */
  --pad: clamp(16px, 4vw, 64px);
  position: relative; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate;
  font-size: clamp(12px, calc(.42vw + .9vh), 16px);   /* js/services.js trims this if a screen is too short */
  outline: none;
}
.sx-bg { position: absolute; inset: 0; z-index: 0; background: #0b0503; overflow: hidden; }
.sx-bg-img, .sx-grow {
  background-size: cover; background-repeat: no-repeat; background-position: var(--pos, 50% 50%);
  filter: saturate(.92) contrast(1.04);
}
.sx-bg-img { position: absolute; inset: 0; transform-origin: 60% 50%; }
.sx-bg-img.is-kb { animation: sx-kb 9s cubic-bezier(.2, .6, .3, 1) both; }
/* slow push-in, starting at 1 so the grown card hands over without a jump */
@keyframes sx-kb { from { transform: scale(1); } to { transform: scale(1.08); } }

/* the card that grows into the background */
.sx-grow { position: absolute; z-index: 1; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9); }

.sx-veil {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .86) 0%, rgba(0, 0, 0, .62) 30%, rgba(0, 0, 0, .14) 62%, rgba(0, 0, 0, .3) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .78) 100%),
    linear-gradient(120deg, rgba(193, 8, 1, .10), rgba(241, 96, 1, .06) 50%, transparent 80%);
}
.sx > .hs-grain { z-index: 3; opacity: .1; }

/* ---------- Layout: text left, cards + controls right ---------- */
.sx-layout {
  position: relative; z-index: 4; height: 100%;
  display: grid; grid-template-columns: minmax(0, 41%) minmax(0, 1fr); column-gap: clamp(20px, 3vw, 56px);
  /* top: never less than the fixed top bar (its padding x2 + 40 px logo) plus a little air */
  padding: max(calc(2 * clamp(14px, 2.2vw, 28px) + 52px), 11vh) 0 clamp(12px, 3vh, 36px) var(--pad);
}
.sx-texts { align-self: safe center; min-width: 0; display: flex; flex-direction: column; gap: 1.1em; }
.sx-h1 { margin: 0 0 .6em; font-size: .7em; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--sand); }
.sx-h1 span { color: var(--light); letter-spacing: .14em; font-weight: 500; }
.sx-text { display: flex; flex-direction: column; gap: 1.05em; }
.sx-text[hidden] { display: none; }
.sx-kicker { display: flex; align-items: center; gap: .8em; margin: 0; font-size: .86em; font-weight: 500; color: #E8E2DC; letter-spacing: .02em; }
.sx-kicker i { width: 28px; height: 3px; border-radius: 2px; background: var(--orange); }
.sx-title {
  margin: 0; font-family: var(--display); font-weight: 600; text-transform: uppercase; color: #fff;
  font-size: clamp(2.6em, 4.9vw, 6em); line-height: .98; letter-spacing: .005em;
}
.sx-title--long { font-size: clamp(2.1em, 3.6vw, 4.4em); }
.sx-l { display: block; overflow: hidden; padding-bottom: .04em; }     /* mask for the rising lines */
.sx-l > span { display: inline-block; transform-origin: left bottom; transition: transform .5s var(--ease-out), color .4s ease; }
.sx-desc { margin: 0; max-width: 48ch; font-size: .96em; line-height: 1.6; color: rgba(249, 249, 249, .84); }
.sx-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5em .9em; max-width: 46em; counter-reset: p; }
.sx-points li { position: relative; padding-left: 2em; font-size: .8em; line-height: 1.45; color: rgba(249, 249, 249, .78); }
.sx-points li::before { counter-increment: p; content: counter(p, decimal-leading-zero); position: absolute; left: 0; top: .05em; font-weight: 700; font-size: .9em; color: var(--orange); }
.sx-tags { display: flex; flex-wrap: wrap; gap: .45em; list-style: none; margin: 0; padding: 0; }
.sx-tags li { padding: .32em .85em; border-radius: 999px; font-size: .72em; font-weight: 500; color: #EDE7E1; border: 1px solid rgba(249, 249, 249, .22); background: rgba(0, 0, 0, .25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sx-cta {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .9em; margin-top: .2em;
  padding: .35em 1.3em .35em .35em; border-radius: 999px; border: 1px solid rgba(249, 249, 249, .55);
  color: #fff; text-decoration: none; font-size: .74em; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  transition: background .4s ease, border-color .4s ease, transform .4s var(--ease-out);
}
.sx-cta span { width: 2.3em; height: 2.3em; border-radius: 50%; background: var(--orange); display: grid; place-items: center; transition: transform .4s var(--ease-out); }
.sx-cta span::before { content: ""; width: .5em; height: .5em; border-top: 2px solid #000; border-right: 2px solid #000; transform: translateX(-1px) rotate(45deg); }
.sx-cta:hover { background: rgba(232, 80, 2, .18); border-color: var(--orange); }
.sx-cta:hover span { transform: translateX(3px) scale(1.08); }
.sx-intro { margin: .6em 0 0; max-width: 46ch; font-size: .78em; line-height: 1.55; color: var(--light); border-top: 1px solid rgba(249, 249, 249, .14); padding-top: 1em; }

/* ---------- Cards ---------- */
.sx-side { align-self: end; min-width: 0; display: flex; flex-direction: column; gap: clamp(10px, 2vh, 24px); }
.sx-cards { display: flex; gap: clamp(10px, 1.2vw, 20px); list-style: none; margin: 0; padding: 14px 0 0; }
.sx-cards li { flex: none; }
.sx-cards li.is-active { display: none; }
.sx-card {
  position: relative; display: block; width: var(--cw); aspect-ratio: 5 / 7; padding: 0; border: 0; border-radius: 14px; overflow: hidden;
  background: #120806; color: #fff; text-align: left; cursor: pointer; font: inherit; text-decoration: none;
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(249, 249, 249, .12);
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out);
}
.sx-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.92); transition: transform .9s var(--ease-out); }
.sx-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, .82) 100%); }
.sx-card-meta { position: absolute; left: .9em; right: .9em; bottom: .9em; z-index: 1; display: flex; flex-direction: column; gap: .35em; }
.sx-card-meta i { width: 20px; height: 2px; background: var(--orange); transition: width .5s var(--ease-out); }
.sx-card-meta small { font-size: .66em; color: #E6DED6; letter-spacing: .02em; }
.sx-card-meta b {
  font-family: var(--display); font-weight: 600; text-transform: uppercase; font-size: 1.02em; line-height: 1.05; letter-spacing: .01em;
  transform-origin: left bottom; transition: transform .5s var(--ease-out);
}
.sx-card:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* hover: the box pops up and zooms in slightly; its photo and headline zoom too */
@media (hover: hover) and (pointer: fine) {
  .sx-card:hover { transform: translateY(-12px) scale(1.05); box-shadow: 0 34px 60px -22px rgba(232, 80, 2, .45), inset 0 0 0 1px rgba(232, 80, 2, .8); }
  .sx-card:hover img { transform: scale(1.1); }
  .sx-card:hover .sx-card-meta i { width: 36px; }
  .sx-card:hover .sx-card-meta b { transform: scale(1.06); }
  .sx-title .sx-l:hover > span { transform: translateY(-4px) scale(1.03); color: #FFE9DC; }
}
.sx-card:active { transform: scale(.97); }

/* ---------- Controls ---------- */
.sx-ctrl { display: flex; align-items: center; gap: 12px; padding-right: var(--pad); }
.sx-arrow {
  width: 46px; height: 46px; flex: none; border-radius: 50%; border: 1px solid rgba(249, 249, 249, .45); background: rgba(0, 0, 0, .2);
  color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .35s ease, border-color .35s ease, transform .35s var(--ease-out);
}
.sx-arrow svg { width: 20px; height: 20px; }
.sx-arrow:hover { background: var(--orange); border-color: var(--orange); color: #000; transform: scale(1.06); }
.sx-arrow:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.sx-progress { position: relative; flex: 1; height: 2px; margin: 0 clamp(8px, 1.6vw, 28px); background: rgba(249, 249, 249, .22); border-radius: 2px; overflow: hidden; }
.sx-progress span { position: absolute; inset: 0 auto 0 0; width: 16.66%; background: linear-gradient(90deg, var(--red), var(--flame), var(--sand)); transition: width .9s var(--ease); }
.sx-count { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(1.9em, 3vw, 3.2em); line-height: 1; min-width: 1.6em; text-align: right; }

/* ---------- Discussion panel (details for one service at a time) ---------- */
button.sx-cta { background: transparent; cursor: pointer; font-family: inherit; }
.sx-scrim { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sx-scrim[hidden], .sx-panel[hidden], .sx-detail[hidden] { display: none; }
.sx-panel {
  position: absolute; top: calc(2 * clamp(14px, 2.2vw, 28px) + 50px); right: 0; bottom: 0; z-index: 41;   /* starts below the fixed top bar */
  border-top-left-radius: 20px; overflow: hidden;
  width: min(900px, 66vw); display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(24, 12, 6, .94), rgba(6, 4, 3, .96) 45%);
  border-left: 1px solid rgba(249, 249, 249, .1);
  box-shadow: -40px 0 90px -30px rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
  font-size: 15px;
}
.sx-panel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--flame), var(--red) 40%, transparent); }
.sx-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px clamp(20px, 3vw, 44px) 10px; }
.sx-panel-eyebrow { margin: 0; font-size: .7rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--sand); }
.sx-close {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(249, 249, 249, .35); background: transparent; color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: background .3s ease, border-color .3s ease, transform .4s var(--ease-out);
}
.sx-close svg { width: 18px; height: 18px; }
.sx-close:hover { background: var(--orange); border-color: var(--orange); color: #000; transform: rotate(90deg); }
.sx-close:focus-visible, .sx-topics button:focus-visible, .sx-d-link:focus-visible, .sx-cta:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* topic switcher */
.sx-topics { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px clamp(20px, 3vw, 44px) 16px; border-bottom: 1px solid rgba(249, 249, 249, .08); }
.sx-topics button {
  display: inline-flex; align-items: center; gap: .5em; padding: .5em .95em; border-radius: 999px; cursor: pointer;
  font: 500 .78rem/1 "Inter", var(--font); color: var(--light); background: rgba(249, 249, 249, .04); border: 1px solid rgba(249, 249, 249, .12);
  transition: color .3s ease, background .3s ease, border-color .3s ease, transform .4s var(--ease-out);
}
.sx-topics button b { font-family: var(--display); font-weight: 500; color: var(--gray); transition: color .3s ease; }
.sx-topics button:hover { color: #fff; border-color: rgba(232, 80, 2, .6); transform: translateY(-2px); }
.sx-topics button[aria-current="true"] { color: #000; background: linear-gradient(100deg, var(--flame), var(--sand)); border-color: transparent; }
.sx-topics button[aria-current="true"] b { color: rgba(0, 0, 0, .6); }

.sx-panel-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 26px clamp(20px, 3vw, 44px) 36px; scrollbar-width: thin; scrollbar-color: rgba(232, 80, 2, .5) transparent; }
.sx-detail { display: flex; flex-direction: column; gap: 26px; }
.sx-d-head { display: flex; flex-direction: column; gap: 12px; }
.sx-d-title { margin: 0; font-family: var(--display); font-weight: 600; text-transform: uppercase; font-size: clamp(2rem, 3.4vw, 3.2rem); line-height: 1; color: #fff; }
.sx-d-lead { margin: 0; max-width: 62ch; font-size: 1rem; line-height: 1.65; color: rgba(249, 249, 249, .86); }
.sx-d-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
.sx-d-block { padding: 20px 22px; border-radius: 14px; background: rgba(249, 249, 249, .035); border: 1px solid rgba(249, 249, 249, .08); transition: border-color .4s ease, background .4s ease; }
.sx-d-block:hover { border-color: rgba(232, 80, 2, .35); background: rgba(232, 80, 2, .04); }
.sx-d-wide { grid-column: 1 / -1; }
.sx-d-block h3 { margin: 0 0 14px; font-size: .7rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--sand); }
.sx-check, .sx-dash { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sx-check li, .sx-dash li { position: relative; padding-left: 28px; font-size: .9rem; line-height: 1.5; color: rgba(249, 249, 249, .86); }
.sx-check li::before {
  content: ""; position: absolute; left: 0; top: .15em; width: 17px; height: 17px; border-radius: 50%; background: var(--orange);
}
.sx-check li::after { content: ""; position: absolute; left: 5.5px; top: calc(.15em + 4.5px); width: 4px; height: 7px; border-right: 2px solid #000; border-bottom: 2px solid #000; transform: rotate(45deg); }
.sx-dash li::before { content: ""; position: absolute; left: 0; top: .72em; width: 14px; height: 2px; background: var(--orange); }
.sx-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.sx-steps li { position: relative; padding-top: 44px; font-size: .88rem; line-height: 1.55; color: rgba(249, 249, 249, .78); }
.sx-steps li::before { counter-increment: s; content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 0; font-family: var(--display); font-size: 1.9rem; line-height: 1; color: var(--orange); }
.sx-steps li::after { content: ""; position: absolute; left: 44px; right: 0; top: 14px; height: 1px; background: rgba(249, 249, 249, .14); }
.sx-steps li:last-child::after { display: none; }
.sx-steps b { display: block; margin-bottom: 4px; font-weight: 600; color: #fff; }
.sx-d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding-top: 4px; }
.sx-cta--solid { background: var(--orange); border-color: var(--orange); color: #000; }
.sx-cta--solid span { background: #000; }
.sx-cta--solid span::before { border-color: var(--orange); }
.sx-cta--solid:hover { background: var(--flame); border-color: var(--flame); }
.sx-d-link { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--white); text-decoration: none; border-bottom: 1px solid rgba(249, 249, 249, .35); padding-bottom: 3px; transition: color .3s ease, border-color .3s ease; }
.sx-d-link:hover { color: var(--flame); border-color: var(--flame); }

@media (max-width: 1100px) { .sx-panel { width: min(900px, 86vw); } }
@media (max-width: 699px) {
  .sx-panel { top: auto; left: 0; width: 100%; height: calc(100% - 80px); border-left: 0; border-top: 1px solid rgba(249, 249, 249, .12); border-radius: 20px 20px 0 0; font-size: 14px; }
  .sx-panel::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 2px; background: linear-gradient(90deg, var(--flame), var(--red) 40%, transparent); border-radius: 20px 20px 0 0; }
  .sx-topics { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sx-topics button { flex: none; }
  .sx-d-grid { grid-template-columns: 1fr; }
  .sx-steps { grid-template-columns: 1fr; }
  .sx-steps li { padding: 0 0 0 46px; }
  .sx-steps li::after { display: none; }
}

/* ---------- Short screens: the text always stays clear of the photo boxes ----------
   js/services.js first shrinks the type, then (only if still needed) drops extras in this order */
.sx.is-tight-1 .sx-intro, .sx.is-tight-1 .sx-h1 span { display: none; }
.sx.is-tight-2 .sx-points { display: none; }
.sx.is-tight-3 .sx-tags, .sx.is-tight-3 .sx-h1 { display: none; }
@media (max-height: 620px) {
  .sx-arrow { width: 38px; height: 38px; }
  .sx-count { font-size: 1.9em; }
  .sx-cards { padding-top: 8px; }
}

/* ---------- Before the intro runs ---------- */
.js .sx-bg, .js .sx-h1, .js .sx-intro, .js .sx-cards li, .js .sx-ctrl { opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) and (min-width: 700px) {
  .sx-layout { grid-template-columns: minmax(0, 48%) minmax(0, 1fr); }
  .sx-points { grid-template-columns: 1fr; }
}
@media (max-width: 819px) {
  /* keep the page links on phones (Services · How it works); Contact steps aside */
  .sx-top .hs-tag { display: none; }
  .sx-top .hs-links, .sx-top .hs-contact { gap: 14px; font-size: .62rem; letter-spacing: .12em; white-space: nowrap; }
  .sx-top .hs-contact { margin-left: 14px; }
  .sx-top .hs-links a { display: inline; white-space: nowrap; }
}
@media (max-width: 440px) { .sx-top .hs-logo span:last-child { display: none; } }
/* Phones: text on top, card row along the bottom (swipe or tap) */
@media (max-width: 699px) {
  .sx { --cw: min(112px, 21vh); font-size: 13px; }
  .sx-layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; padding: 78px 0 18px var(--pad); row-gap: 14px; }
  .sx-texts { align-self: safe end; padding-right: var(--pad); gap: .8em; }
  .sx-h1 span { display: none; }
  .sx-veil { background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .35) 25%, rgba(0, 0, 0, .78) 55%, rgba(0, 0, 0, .9) 100%); }
  .sx-title { font-size: 2.7em; }
  .sx-title--long { font-size: 2.1em; }
  .sx-points { grid-template-columns: 1fr; gap: .35em; }
  .sx-intro { display: none; }
  .sx-arrow { width: 40px; height: 40px; }
  .sx-count { font-size: 2.1em; }
}

@media (prefers-reduced-motion: reduce) {
  .js .sx-bg, .js .sx-h1, .js .sx-intro, .js .sx-cards li, .js .sx-ctrl { opacity: 1; }
  .sx-bg-img.is-kb { animation: none; }
  .sx-card, .sx-card img, .sx-l > span, .sx-progress span { transition: none; }
  .sx-card:hover, .sx-card:hover img, .sx-card:hover .sx-card-meta b, .sx-title .sx-l:hover > span { transform: none; }
}
