/* Sections after the hero scroll: case studies (story cards) and the diagnostic quiz.
   Both sit above the engine's fixed layers (z 0–50) with an opaque background. */

.cases { position: relative; z-index: 45; background: #fff; border-radius: 36px 36px 0 0;
  box-shadow: 0 -30px 80px rgba(0,0,0,.06); padding: clamp(80px, 13vh, 150px) 20px clamp(40px, 8vh, 90px);
  color: var(--sw-ink); font-family: var(--sw-font-body); }
.cases ~ .contact { border-radius: 0; box-shadow: none; padding-top: clamp(56px, 10vh, 120px); }
.wrap { max-width: 1120px; margin: 0 auto; }
.kicker { font-size: .95rem; font-weight: 600; color: var(--sw-accent-ink); margin: 0; }
.h2 { font-family: var(--sw-font-display); font-weight: 600; letter-spacing: -.028em; line-height: 1.04;
  font-size: clamp(2.3rem, 5vw, 4rem); margin: 14px 0 0; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.22rem); line-height: 1.55; color: var(--sw-ink-soft); margin: 22px 0 0; max-width: 64ch; }

/* --- story cards (Nebari-style: tall, image-filled, badge + title over a fade) --- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(40px, 6vh, 64px); }
.card-story { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; border: 0; padding: 0; margin: 0;
  border-radius: 32px; overflow: hidden; background: var(--sw-bg); cursor: pointer; text-align: left; font: inherit; color: inherit;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 20px 50px rgba(0,0,0,.07); transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; }
.card-story:hover { transform: translateY(-6px); box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 30px 70px rgba(0,0,0,.12); }
.card-story:focus-visible { outline: 3px solid var(--sw-accent); outline-offset: 4px; }
.card-story img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 18%;
  transform-origin: 50% 22%; transform: scale(1.32); transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.card-story:hover img.bg { transform: scale(1.4); }
.card-story::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 38%, rgba(255,255,255,.86) 64%, #fff 84%); }
.card-story.is-dark { background: #1d1d1f; color: #fff; }
.card-story.is-dark::after { background: linear-gradient(180deg, rgba(29,29,31,0) 34%, rgba(29,29,31,.82) 62%, #1d1d1f 84%); }
.card-story.is-dark img.bg { filter: invert(1) contrast(.95); }
.badge { position: absolute; z-index: 2; top: 22px; left: 22px; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 999px; background: #1d1d1f; color: #fff; font-size: .9rem; font-weight: 600; }
.is-dark .badge { background: #fff; color: #1d1d1f; }
.badge svg { width: 16px; height: 16px; }
.card-story__body { position: absolute; z-index: 2; left: 26px; right: 26px; bottom: 24px; }
.card-story__metric, .card-story__title, .card-story__sub { display: block; }
.card-story__metric { font-family: var(--sw-font-display); font-weight: 600; letter-spacing: -.03em; line-height: 1;
  font-size: clamp(2.2rem, 3.4vw, 3rem); margin: 0; }
.card-story__title { font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; margin: 10px 0 0; }
.card-story__sub { margin: 4px 0 0; color: var(--sw-ink-soft); font-size: .98rem; }
.is-dark .card-story__sub { color: #a1a1a6; }
.card-story__chip { display: inline-block; margin-top: 12px; padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.card-story__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: .9rem; font-weight: 600; }
.card-story__more i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #1d1d1f; color: #fff; font-style: normal; transition: transform .3s; }
.is-dark .card-story__more i { background: #fff; color: #1d1d1f; }
.card-story:hover .card-story__more i { transform: rotate(90deg); background: var(--sw-accent); color: #fff; }

/* --- story dialog: the progression behind each card --- */
.story { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 32px;
  background: #fff; color: var(--sw-ink); box-shadow: 0 40px 120px rgba(0,0,0,.25); overflow: auto; font-family: var(--sw-font-body); }
.story::backdrop { background: rgba(243,238,231,.6); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.story[open] { animation: story-in .45s cubic-bezier(.2,.8,.2,1); }
@keyframes story-in { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
.story__head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 22px; background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.story__head .badge { position: static; }
.story__close { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--sw-bg); color: var(--sw-ink); font-size: 1.3rem; cursor: pointer; }
.story__inner { padding: 6px clamp(22px, 5vw, 48px) 40px; }
.story h3 { font-family: var(--sw-font-display); font-weight: 600; letter-spacing: -.025em; line-height: 1.05; font-size: clamp(1.9rem, 4.4vw, 2.8rem); margin: 6px 0 0; }
.callout { margin: 18px 0 0; padding: 16px 18px; border-radius: 18px; background: var(--sw-bg); font-size: 1.02rem; line-height: 1.5; color: var(--sw-ink-soft); }
.callout b { color: var(--sw-ink); }
.steps { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 0; }
.step { position: relative; padding: 0 0 28px 34px; }
.step::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: -8px; width: 2px; background: #e5e5ea; }
.step:last-child::before { display: none; }
.step::after { content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #1d1d1f; }
.step.is-key::after { background: var(--sw-accent); border-color: var(--sw-accent); }
.step h4 { margin: 0; font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sw-ink-soft); }
.step p { margin: 8px 0 0; font-size: 1.06rem; line-height: 1.55; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.stat { background: var(--sw-bg); border-radius: 20px; padding: 18px 16px; }
.stat b { display: block; font-family: var(--sw-font-display); font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.stat span { display: block; margin-top: 8px; font-size: .85rem; color: var(--sw-ink-soft); line-height: 1.35; }
.bars { display: grid; gap: 10px; margin-top: 16px; }
.bar { display: grid; grid-template-columns: 74px 1fr 92px; align-items: center; gap: 12px; font-size: .88rem; }
.bar em { font-style: normal; color: var(--sw-ink-soft); }
.bar div { height: 12px; border-radius: 6px; background: #f0f0f2; overflow: hidden; }
.bar div i { display: block; height: 100%; width: 0; border-radius: 6px; background: #1d1d1f; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.bar:last-child div i { background: var(--sw-accent); }
.bar strong { text-align: right; font-weight: 600; }
.quote { margin: 18px 0 0; padding: 20px 22px; border-radius: 20px; background: #1d1d1f; color: #fff; }
.quote p { margin: 0; font-family: var(--sw-font-display); font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.quote cite { display: block; margin-top: 8px; font-style: normal; font-size: .85rem; color: #a1a1a6; }
.pieces { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.piece { border: 1px solid #e5e5ea; border-radius: 18px; padding: 14px 16px; }
.piece b { display: block; font-size: .98rem; } .piece span { display: block; margin-top: 4px; font-size: .88rem; color: var(--sw-ink-soft); line-height: 1.4; }
.story__cta { display: inline-flex; margin-top: 8px; padding: 14px 22px; border-radius: 999px; background: var(--sw-accent); color: #fff; text-decoration: none; font-weight: 600; transition: background .2s; }
.story__cta:hover { background: var(--sw-accent-ink); }
.story__links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 8px; }
.story__more { margin-top: 8px; color: var(--sw-ink); font-weight: 600; text-decoration: none; }
.story__more:hover { color: var(--sw-accent-ink); }

/* --- diagnostic quiz: contact first, then tiles; every step is saved to FOCUS Core --- */
.quiz { scroll-margin-top: 90px; position: relative; background: var(--sw-bg); border-radius: 32px; padding: clamp(22px, 3.4vw, 36px); min-height: 560px; display: flex; flex-direction: column;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.03); }
.quiz a { color: var(--sw-ink); }
.quiz .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.quiz__top { display: flex; align-items: center; gap: 14px; min-height: 36px; }
.quiz__back { border: 0; background: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; color: var(--sw-ink); flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: transform .2s; }
.quiz__back:hover { transform: translateX(-2px); }
.quiz__back[hidden] { display: none; }
.quiz__progress { flex: 1; display: grid; grid-auto-flow: column; gap: 5px; }
.quiz__progress i { height: 5px; border-radius: 3px; background: #e4ddd2; overflow: hidden; position: relative; }
.quiz__progress i::after { content: ""; position: absolute; inset: 0; background: var(--sw-accent); border-radius: 3px; transform: scaleX(0); transform-origin: left;
  transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.quiz__progress i.is-done::after { transform: scaleX(1); }
.quiz__count { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--sw-ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quiz__count .saved { display: inline-flex; align-items: center; gap: 4px; color: var(--sw-accent-ink); font-weight: 600; opacity: 0; transition: opacity .3s; }
.quiz__count .saved.is-on { opacity: 1; }
.quiz__count .saved svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.qstep { display: none; flex: 1; flex-direction: column; margin-top: 26px; }
.qstep.is-on { display: flex; animation: q-in .45s cubic-bezier(.2,.8,.2,1); }
.quiz.is-back .qstep.is-on { animation-name: q-in-back; }
@keyframes q-in { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes q-in-back { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.qkicker { margin: 0 0 8px; font-size: .82rem; font-weight: 600; color: var(--sw-accent-ink); }
.qstep legend, .qstep h3 { padding: 0; margin: 0; font-family: var(--sw-font-display); font-size: clamp(1.5rem, 2.6vw, 1.9rem); font-weight: 600; letter-spacing: -.022em; line-height: 1.12; }
fieldset.qstep { border: 0; padding: 0; min-width: 0; }
.qhint { margin: 8px 0 0; font-size: .95rem; line-height: 1.45; color: var(--sw-ink-soft); }
.qstep > .field { margin-top: 18px; }
.qstep > .form__row { margin-top: 14px; }

/* WhatsApp field with a fixed +34 */
.phone { display: flex; align-items: stretch; background: #fff; border: 1px solid #d2d2d7; border-radius: 14px; transition: border-color .2s, box-shadow .2s; }
.phone:focus-within { border-color: var(--sw-accent); box-shadow: 0 0 0 4px rgba(184,97,61,.14); }
.phone__cc { display: grid; place-items: center; padding: 0 12px 0 15px; font-weight: 600; font-variant-numeric: tabular-nums; border-right: 1px solid #e5e5ea; }
.field .phone input { border: 0; box-shadow: none; flex: 1; border-radius: 0 14px 14px 0; letter-spacing: .02em; }
.field .phone input:focus { box-shadow: none; }
.quiz.was-checked .phone:has(input:invalid) { border-color: #b3261e; }
.quiz.was-checked .field input:invalid { border-color: #b3261e; }
.quiz.was-checked .consent input:invalid { outline: 2px solid #b3261e; outline-offset: 2px; }
.qstep .consent { margin: 18px 0 0; }
.qstep .contact__legal { display: block; margin-top: 18px; }
.qi-sm { width: 12px; height: 12px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* option tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.tiles--3 { grid-template-columns: 1fr; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 112px; padding: 16px; border-radius: 20px;
  background: #fff; border: 1.5px solid transparent; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: border-color .2s, transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s; }
.tiles--3 .tile { flex-direction: row; align-items: center; min-height: 0; padding: 14px 16px; }
.tile--wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.07); }
.tile:active { transform: scale(.985); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile__ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--sw-bg); color: #1d1d1f; flex-shrink: 0; transition: background .25s, color .25s; }
.tile__ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile__t { font-size: .98rem; font-weight: 500; line-height: 1.3; margin-top: auto; }
.tiles--3 .tile__t, .tile--wide .tile__t { margin-top: 0; }
.tile--num b { font-family: var(--sw-font-display); font-size: 1.9rem; font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile--num .tile__t { color: var(--sw-ink-soft); font-size: .88rem; margin-top: auto; }
.tile__ok { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid #d2d2d7; transition: background .2s, border-color .2s; }
.tiles--3 .tile__ok, .tile--wide .tile__ok { top: 50%; margin-top: -11px; right: 16px; }
.tile__ok svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s cubic-bezier(.3,1.6,.5,1); }
.tile:has(input:checked) { border-color: var(--sw-accent); }
.tile:has(input:checked) .tile__ico { background: var(--sw-accent); color: #fff; }
.tile:has(input:checked) .tile__ok { background: var(--sw-accent); border-color: var(--sw-accent); }
.tile:has(input:checked) .tile__ok svg { opacity: 1; transform: none; }
.tile:has(input:focus-visible) { outline: 3px solid rgba(184,97,61,.35); outline-offset: 2px; }

/* ticket slider */
.ticket { margin-top: 22px; padding: 20px 20px 16px; border-radius: 20px; background: #fff; }
.ticket output { display: block; font-family: var(--sw-font-display); font-size: clamp(2.6rem, 5vw, 3.6rem); font-weight: 600; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.ticket input[type=range] { width: 100%; margin: 16px 0 0; accent-color: var(--sw-accent); }
.ticket__scale { display: flex; justify-content: space-between; font-size: .78rem; color: #86868b; margin-top: 4px; }
.calc { margin-top: 12px; padding: 16px 18px; border-radius: 16px; background: #fff; font-size: 1rem; line-height: 1.5; }
.calc b { font-weight: 600; }
.qnext { align-self: flex-start; margin-top: auto; }
.qstep .qnext { margin-top: 24px; }
.btn-dark { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 1rem; font-weight: 600; color: #fff; background: #1d1d1f; border: 0; border-radius: 999px;
  padding: 15px 24px; cursor: pointer; transition: transform .2s, opacity .2s; }
.btn-dark:hover { transform: translateY(-1px); }
.btn-dark span { transition: transform .2s; }
.btn-dark:hover span { transform: translateX(3px); }
.btn-dark:disabled { opacity: .6; cursor: default; transform: none; }
.btn-ghost { display: inline-flex; margin-top: 22px; padding: 13px 20px; border-radius: 999px; background: #fff; color: var(--sw-ink); text-decoration: none; font-weight: 600; font-size: .95rem; }

/* result + last details */
.result { border-radius: 22px; background: #1d1d1f; color: #fff; padding: 20px 22px; }
.result small { display: block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: #a1a1a6; font-weight: 600; }
.result strong { display: block; margin-top: 8px; font-family: var(--sw-font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.result p { margin: 8px 0 0; color: #d2d2d7; font-size: .96rem; line-height: 1.5; }
.result ul { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid rgba(255,255,255,.12); list-style: none; display: grid; gap: 10px; font-size: .94rem; line-height: 1.4; color: #e5e5ea; }
.result li { position: relative; padding-left: 1.5em; }
.result li::before { content: "→"; position: absolute; left: 0; color: #e9a687; }
.qlast { margin: 20px 0 0; font-weight: 600; font-size: 1.02rem; }
.field__l { font-size: .85rem; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 10px 16px; border-radius: 999px; background: #fff; border: 1.5px solid #e5e5ea; font-size: .92rem; font-weight: 500; transition: background .2s, color .2s, border-color .2s; }
.chip:hover span { border-color: #c7c7cc; }
.chip input:checked + span { background: var(--sw-accent); border-color: var(--sw-accent); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid rgba(184,97,61,.35); outline-offset: 2px; }
.qstep[data-step=final] .form__submit { margin-top: 22px; }

/* sent */
.qdone { align-items: center; justify-content: center; text-align: center; outline: none; }
.qdone__ok { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--sw-accent); color: #fff; animation: pop .6s cubic-bezier(.3,1.6,.5,1); }
.qdone__ok svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .5s .25s ease-out forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.qdone h3 { margin-top: 22px; }
.qdone p { margin: 10px 0 0; max-width: 32ch; font-size: 1.02rem; line-height: 1.5; color: var(--sw-ink-soft); }
.qdone p b { color: var(--sw-ink); }
.quiz.is-sent .quiz__top { visibility: hidden; }

@media (max-width: 860px) {
  .quiz { min-height: 0; border-radius: 28px; }
  .tile { min-height: 104px; padding: 14px; }
  .tile--wide, .tiles--3 .tile { min-height: 0; }
  .cases { border-radius: 28px 28px 0 0; }
  /* Stacked deck: each card sticks under the top bar and the next one slides over it;
     scrolling back up fans them out again. extra.js shrinks/dims the covered cards. */
  .cards { display: block; padding-bottom: 8px; }
  .card-story { position: sticky; top: calc(84px + var(--i, 0) * 14px); margin: 0 auto 22px; max-width: 460px;
    aspect-ratio: 4 / 5; max-height: calc(100dvh - 140px); transform-origin: 50% 0; will-change: transform; }
  .card-story:nth-child(2) { --i: 1; } .card-story:nth-child(3) { --i: 2; margin-bottom: 0; }
  .card-story:hover { transform: none; }
  .card-story .shade { position: absolute; inset: 0; z-index: 3; background: #000; opacity: 0; pointer-events: none; border-radius: inherit; }
  .stats { grid-template-columns: 1fr; }
  .pieces { grid-template-columns: 1fr; }
  .story { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 28px 28px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .card-story, .card-story img.bg, .bar div i, .story[open], .qstep.is-on, .tile, .qdone__ok, .qdone__ok svg { transition: none; animation: none; }
  .qdone__ok svg { stroke-dashoffset: 0; }
}

/* mobile-only line break */
.br-m { display: none; }
@media (max-width: 860px) { .br-m { display: inline; } }
.result .result__cta { white-space: nowrap; font-size: min(.96rem, 3.95vw); }
