/* ==========================================================================
   FGX — Services page (services/index.html)
   Builds on /assets/fgx/fgx-type.css (fonts + fluid type scale) and
   ui-ux.css (tokens, grid, buttons, theme switching, shared modules).
   Only the services-specific modules live here:
     FGX-SV-01 journey funnel hero     FGX-SV-05 expanding tool panels
     FGX-SV-03 sticky journey rail +   FGX-SV-06 story chapters + panorama
               service cards           FGX-SV-09 brief builder + floating pill
   ========================================================================== */

.sv .ux-statement__text { text-indent: 0; }

/* ---------- 01 Hero + funnel -------------------------------------------- */
.sv-hero { position: relative; padding-top: clamp(120px, 17vh, 200px); padding-bottom: clamp(88px, 11vw, 180px); overflow: hidden; }
.sv-hero::before {
  content: ""; position: absolute; left: 30vw; top: 38vh; width: 80vw; height: 80vw; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(229, 36, 33, .15), transparent 70%);
}
.sv-hero__body { position: relative; display: grid; gap: 56px; margin-top: clamp(40px, 5vw, 88px); }
@media (min-width: 1200px) { .sv-hero__body { grid-template-columns: 5fr 7fr; gap: var(--ux-gap); align-items: start; } .sv-hero__copy { padding-top: 12px; } }
.sv-hero__copy .ux-lead { max-width: 26ch; }

.sv-funnel {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: clamp(56px, 5vw, 76px) 0 0;
  border: 0; border-radius: 0;
  background: transparent;
  overflow: visible; isolation: isolate;
}
.sv-funnel::before {
  content: none;
}
.sv-funnel__cap { position: absolute; left: 0; top: 20px; display: flex; align-items: center; gap: 10px; margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(244, 240, 238, .55); }
.sv-funnel__rec { width: 8px; height: 8px; border-radius: 50%; background: var(--ux-red); animation: ux-pulse 2.4s infinite; }
.sv-funnel__band {
  --w: calc(100% - var(--i) * 10%);
  position: relative; z-index: 1; display: grid; grid-template-columns: 40px 1fr auto 24px; align-items: center; gap: 14px;
  width: var(--w); min-height: clamp(62px, 5.4vw, 84px); padding: 0 clamp(18px, 2vw, 30px);
  border: 1px solid rgba(244, 240, 238, .14); border-radius: 999px; overflow: hidden; isolation: isolate;
  background: color-mix(in srgb, #e52421 calc(var(--i) * 9%), #1a1a1a);
  color: #fff; text-decoration: none;
  transition: width .7s var(--ux-ease), border-color .4s, color .4s, box-shadow .4s;
}
.sv-funnel__band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ux-paper); transform: translateY(101%); transition: transform .55s var(--ux-ease); }
.sv-funnel__band b { font-family: var(--ux-display); font-weight: 600; font-size: clamp(22px, 2vw, 36px); letter-spacing: -.04em; line-height: 1; }
.sv-funnel__n { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: rgba(255, 255, 255, .55); }
.sv-funnel__c { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .6); white-space: nowrap; }
.sv-funnel__band i { font-style: normal; font-size: 20px; transition: transform .5s var(--ux-ease); }
.sv-funnel:hover .sv-funnel__band:not(:hover) { color: rgba(255, 255, 255, .55); }
.sv-funnel__band:hover, .sv-funnel__band:focus-visible { width: min(100%, calc(var(--w) + 8%)); color: var(--ux-ink); border-color: var(--ux-paper); outline: 0; }
.sv-funnel__band:hover::before, .sv-funnel__band:focus-visible::before { transform: translateY(0); }
.sv-funnel__band:hover .sv-funnel__n, .sv-funnel__band:hover .sv-funnel__c,
.sv-funnel__band:focus-visible .sv-funnel__n, .sv-funnel__band:focus-visible .sv-funnel__c { color: rgba(15, 15, 15, .6); }
.sv-funnel__band:hover i, .sv-funnel__band:focus-visible i { transform: rotate(-45deg); color: var(--ux-red); }
.sv-funnel__band.is-hit { border-color: rgba(255, 255, 255, .85); box-shadow: 0 0 0 4px rgba(229, 36, 33, .25), 0 0 40px rgba(229, 36, 33, .35); }
.sv-funnel__dot { position: absolute; left: 50%; top: 40px; z-index: 2; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .12), 0 0 24px rgba(255, 255, 255, .6); opacity: 0; pointer-events: none; }
@media (max-width: 767px) {
  .sv-funnel__band { --w: calc(100% - var(--i) * 6%); grid-template-columns: 28px 1fr 20px; }
  .sv-funnel__c { display: none; }
}

/* ---------- 02 Statement -------------------------------------------------- */
.sv-statement__foot { margin-top: clamp(40px, 5vw, 88px); }
.sv-verbs { margin-top: 0 !important; }

/* ---------- 03 Journey ---------------------------------------------------- */
.sv-journey__intro { margin-top: 28px !important; }
.sv-journey__layout { display: grid; gap: 40px; }
@media (min-width: 992px) { .sv-journey__layout { grid-template-columns: 4fr 8fr; gap: var(--ux-gap); } }
.sv-rail { display: none; }
@media (min-width: 992px) {
  .sv-rail { display: block; }
  .sv-rail__inner { position: sticky; top: 120px; padding-bottom: 40px; }
}
.sv-rail__n { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--ux-muted); }
.sv-rail__n b { color: var(--ux-red); }
.sv-rail__name { margin-top: 10px !important; font-family: var(--ux-display); font-weight: 600; font-size: clamp(44px, 4.6vw, 92px); line-height: .95; letter-spacing: -.055em; min-height: 1em; }
.sv-rail__steps { position: relative; list-style: none; margin: 40px 0 0; padding: 0 0 0 26px; }
.sv-rail__steps a { display: flex; align-items: center; gap: 14px; padding: 10px 0; color: var(--ux-muted); text-decoration: none; font-size: 15px; font-weight: 700; transition: color .4s, transform .5s var(--ux-ease); }
.sv-rail__steps a i { position: absolute; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--ux-bg); border: 2px solid var(--ux-line); transition: background .4s, border-color .4s, transform .4s; }
.sv-rail__steps a:hover { color: var(--ux-fg); }
.sv-rail__steps a.is-past i { background: var(--ux-fg); border-color: var(--ux-fg); }
.sv-rail__steps a span { transition: transform .5s var(--ux-ease); }
.sv-rail__steps a.is-on { color: var(--ux-fg); }
.sv-rail__steps a.is-on span { transform: translateX(6px); }
.sv-rail__steps a.is-on i { background: var(--ux-red); border-color: var(--ux-red); transform: scale(1.35); }
.sv-rail__steps::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: 18px; width: 1px; background: var(--ux-line); }
.sv-rail__steps::after { content: ""; position: absolute; left: 5px; top: 18px; bottom: 18px; width: 1px; background: var(--ux-red); transform-origin: 50% 0; transform: scaleY(var(--sv-p, 0)); }

.sv-stages { display: grid; gap: clamp(88px, 10vw, 180px); }
.sv-stage { position: relative; scroll-margin-top: 110px; }
.sv-stage__head { position: relative; padding-bottom: 36px; }
.sv-stage__n { position: absolute; right: 0; top: -.12em; font-family: var(--ux-display); font-weight: 700; font-size: clamp(110px, 12vw, 230px); line-height: .8; letter-spacing: -.07em; color: transparent; -webkit-text-stroke: 1px var(--ux-line); pointer-events: none; }
.sv-stage__head .ux-label { padding: 0 0 14px; color: var(--ux-red); }
.sv-stage__head .ux-h3 { margin-bottom: 20px; }
.sv-stage__head .ux-body { max-width: 56ch; }
@media (min-width: 992px) { .sv-stage__head .ux-h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; } }

.sv-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 768px) { .sv-cards { grid-template-columns: 1fr 1fr; } }
.sv-card {
  position: relative; display: flex; flex-direction: column; min-height: 250px; padding: clamp(22px, 2.2vw, 32px);
  border: 1px solid var(--ux-line); border-radius: var(--ux-radius); overflow: hidden; isolation: isolate;
  transition: color .45s var(--ux-ease), border-color .45s var(--ux-ease);
}
.sv-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ux-ink); transform: translateY(101%); transition: transform .6s var(--ux-ease); }
.sv-card__n { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--ux-red); }
.sv-card__t { margin: 36px 0 12px; font-family: var(--ux-display); font-weight: 600; font-size: clamp(26px, 2.2vw, 40px); line-height: 1; letter-spacing: -.04em; }
.sv-card__d { margin: 0; max-width: 34ch; font-size: 16px; line-height: 1.45; color: var(--ux-muted); transition: color .45s; }
.sv-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 28px; }
.sv-card__link { position: relative; z-index: 1; font-size: 14px; font-weight: 700; color: inherit; text-decoration: none; }
.sv-card__link span { display: inline-block; transition: transform .4s var(--ux-ease); }
.sv-card__link:hover span { transform: translate(3px, -3px); }
.sv-card__link--muted { color: var(--ux-muted); font-weight: 500; }
/* Cards with their own page: whole card clickable via the link's stretched hit area */
.sv-card--page { cursor: pointer; }
.sv-card--page .sv-card__t::after { content: " ↗"; font-size: .6em; vertical-align: super; color: var(--ux-red); }
@media (hover: hover) {
  .sv-card:hover { color: var(--ux-paper); border-color: var(--ux-ink); }
  .sv-card:hover::before { transform: translateY(0); }
  .sv-card:hover .sv-card__d, .sv-card:hover .sv-card__link--muted { color: rgba(244, 240, 238, .65); }
}
.sv-card--page .sv-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.sv-card--page .sv-card__link { position: static; }
.sv-card--page .sv-card__foot { position: static; }

.sv-card--ask { border-style: dashed; background: transparent; }
.sv-card--ask .sv-card__n { font-family: var(--ux-display); font-size: 22px; }
.sv-card--ask .sv-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.sv-card--ask .sv-card__link, .sv-card--ask .sv-card__foot { position: static; }
.sv-card--ask { cursor: pointer; }
.sv-add {
  all: unset; box-sizing: border-box; position: relative; z-index: 2; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 10px; border: 1px solid currentColor; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap; opacity: .85; transition: background .35s var(--ux-ease), border-color .35s, color .35s, opacity .35s;
}
.sv-add i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ux-red); color: #fff; font-style: normal; font-size: 15px; line-height: 1; transition: transform .45s var(--ux-ease); }
.sv-add:hover { opacity: 1; }
.sv-add[aria-pressed="true"] { opacity: 1; background: var(--ux-red); border-color: var(--ux-red); color: #fff; }
.sv-add[aria-pressed="true"] i { background: #fff; color: var(--ux-red); transform: rotate(45deg); }
.sv-add:focus-visible { outline: 3px solid #f2d200; outline-offset: 3px; }

/* ---------- 05 Tool panels ----------------------------------------------- */
.sv-panels { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sv-panel {
  --tone: #e52421;
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--ux-radius);
  border: 1px solid rgba(255, 255, 255, .22);
  background: linear-gradient(180deg, rgba(8, 8, 8, .38) 0%, rgba(8, 8, 8, .62) 45%, rgba(8, 8, 8, .9) 100%), var(--sv-img, none) center / cover no-repeat #0b0b0b;
  transition: flex-grow .9s var(--ux-ease), border-color .5s;
}
.sv-panel.is-open { border-color: rgba(255, 255, 255, .4); }
.sv-panel:nth-child(1) { --sv-img: url("/assets/fgx/components/services/img/sv-fckexpensive.webp"); }
.sv-panel:nth-child(2) { --sv-img: url("/assets/fgx/components/services/img/sv-rocketgogo.webp"); }
.sv-panel:nth-child(3) { --sv-img: url("/assets/fgx/components/services/img/sv-notarentalqr.webp"); }
.sv-panel:nth-child(4) { --sv-img: url("/assets/fgx/components/services/img/sv-icu404.webp"); }
.sv-panel:nth-child(5) { --sv-img: url("/assets/fgx/components/services/img/sv-widgetgizmo.webp"); }
.sv-panel__head { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 18px; width: 100%; padding: 24px 26px; color: #fff; }
.sv-panel__head:focus-visible { outline: 3px solid #f2d200; outline-offset: -3px; }
.sv-panel__n { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--tone); }
.sv-panel__t { font-family: var(--ux-display); font-weight: 600; font-size: clamp(24px, 2.2vw, 38px); letter-spacing: -.04em; line-height: 1; white-space: nowrap; }
.sv-panel__body { display: grid; grid-template-rows: 0fr; padding: 0 26px; transition: grid-template-rows .8s var(--ux-ease), padding .8s var(--ux-ease); }
.sv-panel__body > * { overflow: hidden; }
.sv-panel.is-open .sv-panel__body { grid-template-rows: auto auto 1fr auto; padding-bottom: 26px; }
.sv-panel__big { font-family: var(--ux-display); font-weight: 700; font-size: clamp(64px, 7vw, 140px); line-height: .9; letter-spacing: -.07em; color: var(--tone); white-space: nowrap; }
.sv-panel__kicker { margin: 10px 0 12px !important; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(244, 240, 238, .6); }
.sv-panel__d { max-width: 50ch; font-size: clamp(16px, 1.1vw, 19px); line-height: 1.5; color: rgba(244, 240, 238, .75); }
.sv-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; }
.sv-tags li { padding: 7px 12px; border: 1px solid rgba(244, 240, 238, .2); border-radius: 999px; font-size: 12px; font-weight: 700; color: rgba(244, 240, 238, .8); }
@media (max-width: 991px) {
  .sv-panel__body { display: none; padding-bottom: 26px; }
  .sv-panel.is-open .sv-panel__body { display: block; }
  .sv-panel__big { display: block; }
}

@media (min-width: 992px) {
  .sv-panels { flex-direction: row; height: clamp(520px, 38vw, 640px); }
  .sv-panel { flex: 1 1 0; min-width: 0; }
  .sv-panel.is-open { flex-grow: 4.2; }
  .sv-panel__head { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 26px; }
  .sv-panel__t { writing-mode: vertical-rl; transform: rotate(180deg); transition: opacity .4s; }
  .sv-panel.is-open .sv-panel__head { bottom: auto; flex-direction: row; justify-content: flex-start; }
  .sv-panel.is-open .sv-panel__t { writing-mode: horizontal-tb; transform: none; }
  .sv-panel__body { position: absolute; left: 0; right: 0; bottom: 0; display: block; padding: 0 30px 30px; opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .8s var(--ux-ease); }
  .sv-panel.is-open .sv-panel__body { opacity: 1; transform: none; transition-delay: .25s; padding-bottom: 30px; min-width: 460px; }
  .sv-panel__body > * { overflow: visible; }
  .sv-panel:not(.is-open):hover { border-color: rgba(255, 255, 255, .45); }
}

/* ---------- 06 Story ------------------------------------------------------ */
.sv-chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 48px var(--ux-gap); }
@media (min-width: 992px) { .sv-chapters { grid-template-columns: repeat(3, 1fr); } }
.sv-chapters li { padding-top: 28px; border-top: 1px solid var(--ux-line); }
.sv-chapters__y { display: block; margin-bottom: 28px; font-family: var(--ux-display); font-weight: 600; font-size: clamp(56px, 6vw, 118px); line-height: .9; letter-spacing: -.065em; }
.sv-chapters li:nth-child(2) .sv-chapters__y { color: var(--ux-red); }
.sv-pano {
  position: relative; margin: clamp(80px, 9vw, 160px) auto clamp(64px, 8vw, 140px);
  width: calc(100% - var(--ux-edge) * 2); max-width: calc(var(--ux-canvas) - var(--ux-edge) * 2);
  aspect-ratio: 1917 / 860; min-height: 340px; overflow: hidden; border-radius: calc(var(--ux-radius) + 8px); background: #d9d4d1;
}
.sv-pano > img { position: absolute; left: 0; top: -8%; width: 100%; height: 116%; max-width: none; object-fit: cover; object-position: center 18%; }
.sv-pano figcaption { position: absolute; left: 24px; right: 24px; bottom: 20px; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
.sv-stats { margin-bottom: 0; }

/* ---------- 09 Brief builder + floating pill ------------------------------ */
.sv-brief { margin-top: 36px; padding: 24px; border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--ux-radius); background: rgba(10, 10, 10, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-width: 720px; }
.sv-brief__t { display: flex; align-items: center; gap: 10px; margin: 0 0 14px !important; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.sv-brief__t b { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--ux-red); color: #fff; letter-spacing: 0; }
.sv-brief__list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.sv-brief__list:empty { display: none; }
.sv-brief__list button, .sv-chip {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: #fff; transition: background .3s, border-color .3s, transform .3s var(--ux-ease);
}
.sv-brief__list button { background: var(--ux-red); }
.sv-brief__list button::after { content: "×"; font-size: 18px; line-height: 1; opacity: .8; }
.sv-brief__list button:hover { background: #fff; color: var(--ux-ink); }
.sv-brief__empty { margin: 0 0 14px !important; font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, .7); }
.sv-brief__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-chip { border: 1px solid rgba(255, 255, 255, .3); }
.sv-chip:hover { border-color: #fff; }
.sv-chip::before { content: "+ "; color: var(--ux-red); }
.sv-brief.has-items .sv-brief__empty, .sv-brief.has-items .sv-brief__chips { display: none; }
.sv-brief__list button:focus-visible, .sv-chip:focus-visible { outline: 3px solid #f2d200; outline-offset: 3px; }

.sv-pill {
  position: fixed; right: clamp(16px, 2vw, 32px); bottom: clamp(16px, 2vw, 32px); z-index: 9000;
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 12px 10px 20px; border-radius: 999px;
  background: var(--ux-red); color: #fff; text-decoration: none; font-family: var(--ux-text); font-size: 15px; font-weight: 700;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
  opacity: 0; transform: translateY(24px) scale(.9); pointer-events: none;
  transition: opacity .45s var(--ux-ease), transform .6s var(--ux-ease);
}
.sv-pill.is-on { opacity: 1; transform: none; pointer-events: auto; }
.sv-pill b { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--ux-red); }
.sv-pill i { font-style: normal; font-size: 18px; transition: transform .4s var(--ux-ease); }
.sv-pill:hover i { transform: rotate(45deg); }
.sv-pill.is-bump b { animation: sv-bump .5s var(--ux-ease); }
@keyframes sv-bump { 40% { transform: scale(1.35); } }

@media (prefers-reduced-motion: reduce) {
  .sv-funnel__rec { animation: none; }
  .sv-panel, .sv-panel__body, .sv-funnel__band { transition: none; }
}
