/* After the film: a paper sheet slides up over the finished patio and the
   page becomes a working catalogue. Structure borrowed from the Aiman Motor
   brief: explorer, range, kit (the exploded view), samples, delivery, contact. */

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
}

/* Fixed film furniture steps back once the sheet arrives. */
.receipt, .rail, .preview-tag { transition: opacity .3s var(--ease-out), translate .3s var(--ease-out); }
body.is-after .receipt, body.is-after .rail, body.is-after .preview-tag { opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity .3s var(--ease-out), visibility 0s linear .3s; }
body.is-after .chrome { background: rgba(28,34,41,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chrome { transition: background-color .3s ease, box-shadow .3s ease; }

.after { position: relative; z-index: 25; background: var(--paper); color: var(--paper-ink);
         border-radius: 22px 22px 0 0; box-shadow: 0 -30px 60px rgba(0,0,0,.35); margin-top: -2px; }
.after__lip { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--paper-rule); margin: 0 auto; translate: 0 14px; }
.after section { padding: clamp(72px, 9vw, 128px) clamp(16px, 5vw, 72px); max-width: 1280px; margin: 0 auto; }
.after section + section { border-top: 1px solid var(--paper-rule); }
.after h2 { font-family: var(--sc-font-display); font-weight: 500; letter-spacing: -.02em; line-height: 1.04;
            font-size: clamp(2.1rem, 1.3rem + 2.6vw, 3.6rem); margin: 0 0 16px; max-width: 16ch; }
.after .lede { font-size: clamp(1.02rem, .96rem + .25vw, 1.2rem); line-height: 1.55; color: var(--paper-soft); max-width: 36em; margin: 0 0 36px; }
.after .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green); margin: 0 0 14px; }
.after .btn { transition: background-color .15s ease, transform .16s var(--ease-out); }
.after .btn:active { transform: scale(.97); }
.num { font-variant-numeric: tabular-nums; }

/* Entrance: sections settle in once, never on every pass. */
.rise { opacity: 0; translate: 0 18px; transition: opacity .6s var(--ease-out), translate .6s var(--ease-out); }
.rise.is-in { opacity: 1; translate: 0 0; }

/* ---------- 1. Stone switcher ---------- */
.stone { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 4vw, 64px); align-items: start; }
.stone__view { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #e8e5de;
               box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 18px 40px rgba(28,34,41,.14); }
.stone__view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stone__view img.is-new { clip-path: inset(0 100% 0 0); }
.stone__view img.is-new.go { clip-path: inset(0 0 0 0); transition: clip-path .62s var(--ease-io); }
.stone__badge { position: absolute; left: 14px; bottom: 14px; z-index: 2; background: rgba(251,250,247,.94); padding: 8px 12px; border-radius: 8px;
                font-size: 13px; font-weight: 600; }
.filters { display: flex; gap: 8px; margin: 0 0 16px; }
.filters button { all: unset; cursor: pointer; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--paper-rule); font-size: 14px; font-weight: 500;
                  transition: background-color .15s ease, border-color .15s ease, transform .16s var(--ease-out); }
.filters button:active { transform: scale(.97); }
.filters button[aria-pressed="true"] { background: var(--paper-ink); color: #fff; border-color: var(--paper-ink); }
.filters button:focus-visible, .swatches button:focus-visible, .xp-list button:focus-visible, .tray button:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.swatches { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatches li[hidden] { display: none; }
.swatches button { all: unset; cursor: pointer; display: grid; gap: 6px; font-size: 12.5px; line-height: 1.25; font-weight: 500; text-align: left; }
.swatches .sw { aspect-ratio: 1; border-radius: 10px; overflow: hidden; outline: 2px solid transparent; outline-offset: 2px;
                transition: outline-color .15s ease, transform .16s var(--ease-out); }
.swatches .sw img { width: 100%; height: 100%; object-fit: cover; display: block; }
.swatches button:active .sw { transform: scale(.96); }
.swatches button[aria-pressed="true"] .sw { outline-color: var(--green); }
@media (hover: hover) and (pointer: fine) { .swatches button:hover .sw { transform: translateY(-2px); } }
.quote { background: #fff; border: 1px solid var(--paper-rule); border-radius: 12px; padding: 20px; }
.quote h3 { font-family: var(--sc-font-display); font-weight: 500; font-size: 22px; margin: 0 0 4px; }
.quote .for { font-size: 14px; color: var(--paper-soft); margin: 0 0 14px; }
.quote dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0 0 14px; font-size: 15px; }
.quote dt { color: var(--paper-soft); }
.quote dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.quote .total { font-family: var(--sc-font-display); font-size: 30px; }
.quote .swap { transition: filter .22s ease, opacity .22s ease; }
.quote.is-swapping .swap { filter: blur(2px); opacity: .55; }
.quote .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.quote .stamp { margin: 0 0 14px; }

/* ---------- 2. Exploded patio ---------- */
.xp { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 4vw, 64px); align-items: center; }
.xp-stage { position: relative; aspect-ratio: 1 / .9; perspective: 1400px; perspective-origin: 50% 30%; }
.xp-stack { position: absolute; left: 50%; top: 56%; width: 62%; aspect-ratio: 3 / 2; translate: -50% -50%;
            transform-style: preserve-3d; transform: rotateX(58deg) rotateZ(-34deg); }
.xp-layer { position: absolute; inset: 0; transform-style: preserve-3d; transition: opacity .25s ease, filter .25s ease; }
.xp-face { position: absolute; inset: 0; border-radius: 2px; background-size: cover; background-position: center; }
.xp-edge { position: absolute; left: 0; right: 0; bottom: 0; height: var(--t, 14px); transform-origin: bottom; transform: rotateX(-90deg);
           background: var(--edge, #8d8579); filter: brightness(.82); }
.xp-edge--r { left: auto; top: 0; width: var(--t, 14px); height: auto; transform-origin: right; transform: rotateY(90deg); filter: brightness(.68); }
.xp-layer[data-k="base"] .xp-face { background: radial-gradient(circle at 20% 30%, #9b958c 0 2px, transparent 3px) 0 0 / 14px 14px,
  radial-gradient(circle at 70% 60%, #6f6a62 0 2px, transparent 3px) 0 0 / 11px 11px, #847e75; }
.xp-layer[data-k="base"] { --t: 34px; --edge: #7a746b; }
.xp-layer[data-k="bed"] .xp-face { background: radial-gradient(circle, rgba(0,0,0,.08) 1px, transparent 1.5px) 0 0 / 6px 6px, #c9b48d; }
.xp-layer[data-k="bed"] { --t: 22px; --edge: #b39d74; }
.xp-layer[data-k="primer"] .xp-face { background: #5f6266; opacity: .92; }
.xp-layer[data-k="primer"] { --t: 3px; --edge: #4a4d50; }
.xp-layer[data-k="slab"] { --t: 10px; --edge: #b7b2a9; }
.xp-layer[data-k="slab"] .xp-face { background-image: var(--stone); }
.xp-layer[data-k="joint"] { --t: 0px; }
.xp-layer[data-k="joint"] .xp-face { background:
  linear-gradient(90deg, var(--joint, #8e8f8f) 0 3px, transparent 3px) 0 0 / 33.333% 100%,
  linear-gradient(0deg, var(--joint, #8e8f8f) 0 3px, transparent 3px) 0 0 / 100% 33.333%; }
.xp-layer[data-k="joint"] .xp-edge { display: none; }
.xp-layer[data-k="joint"] .xp-face { clip-path: inset(4px); }
.xp-stage.has-pick .xp-layer:not(.is-pick) { opacity: .28; filter: saturate(.3); }
.xp-tag { position: absolute; font-size: 12.5px; font-weight: 600; background: #fff; border: 1px solid var(--paper-rule); border-radius: 999px;
          padding: 4px 10px; white-space: nowrap; pointer-events: none; opacity: var(--tag, 0); transition: opacity .2s ease; }
.xp-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.xp-list button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center;
                  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--paper-rule); background: #fff; font-size: 15px; font-weight: 500;
                  transition: border-color .15s ease, background-color .15s ease, transform .16s var(--ease-out); }
.xp-list button:active { transform: scale(.98); }
.xp-list button[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.xp-list .dot { width: 14px; height: 14px; border-radius: 4px; background: var(--c); }
.xp-list small { color: var(--paper-soft); font-weight: 400; font-size: 13px; }
.xp-card { min-height: 158px; background: #fff; border: 1px solid var(--paper-rule); border-radius: 12px; padding: 18px 20px; }
.xp-card h3 { font-family: var(--sc-font-display); font-weight: 500; font-size: 20px; margin: 0 0 6px; }
.xp-card p { margin: 0 0 12px; color: var(--paper-soft); font-size: 15px; line-height: 1.5; }
.xp-card .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.xp-card .flag { font-size: 12.5px; color: #7a3d00; background: #fff4e5; padding: 3px 8px; border-radius: 6px; }

/* ---------- 3. Samples ---------- */
.tray { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.tray button { all: unset; cursor: pointer; display: grid; gap: 8px; font-size: 12.5px; font-weight: 500; line-height: 1.25; position: relative; }
.tray .chip { aspect-ratio: 1; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.12);
              transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.tray .chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray button[aria-pressed="true"] .chip { transform: translateY(-6px) rotate(-2deg); box-shadow: 0 10px 22px rgba(28,34,41,.22); }
.tray button:active .chip { transform: scale(.96); }
.tray .ok { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff;
            display: grid; place-items: center; font-size: 12px; opacity: 0; scale: .9; transition: opacity .2s var(--ease-out), scale .2s var(--ease-out); }
.tray button[aria-pressed="true"] .ok { opacity: 1; scale: 1; }
.tray-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tray-bar .sum { font-size: 16px; }

/* ---------- 4. Delivery ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; position: relative; counter-reset: s; }
.steps::before { content: ""; position: absolute; left: 0; right: 0; top: 19px; height: 2px; background: var(--green); transform-origin: left;
                 transform: scaleX(0); transition: transform 1.1s var(--ease-io) .1s; }
.steps.is-in::before { transform: scaleX(1); }
.steps li { position: relative; }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
                    background: var(--paper); border: 2px solid var(--green); color: var(--green); font-weight: 700; margin-bottom: 16px; position: relative; }
.steps h3 { font-family: var(--sc-font-display); font-weight: 500; font-size: 21px; margin: 0 0 6px; }
.steps p { margin: 0; color: var(--paper-soft); font-size: 15px; line-height: 1.55; }
.steps li { opacity: 0; translate: 0 10px; transition: opacity .5s var(--ease-out), translate .5s var(--ease-out); }
.steps.is-in li { opacity: 1; translate: 0 0; }
.steps.is-in li:nth-child(2) { transition-delay: .35s; }
.steps.is-in li:nth-child(3) { transition-delay: .7s; }
.note { font-size: 13px; color: var(--paper-soft); margin-top: 28px; }

/* ---------- 5. Close ---------- */
.close { background: var(--sc-canvas); color: #fff; border-radius: 22px; padding: clamp(36px, 5vw, 64px); display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: end; }
.close h2 { color: #fff; max-width: 18ch; }
.close p { color: var(--sc-ink-soft); margin: 0 0 22px; font-size: 1.1rem; line-height: 1.55; }
.close .big { font-family: var(--sc-font-display); font-size: clamp(2.6rem, 2rem + 2vw, 3.8rem); line-height: 1; margin: 0 0 6px; color: #fff; }
.close .acts { display: grid; gap: 10px; }
.foot { max-width: 1280px; margin: 0 auto; padding: 32px clamp(16px, 5vw, 72px) 48px; display: flex; flex-wrap: wrap; gap: 12px 32px; font-size: 13.5px; color: var(--paper-soft); }
.foot a { color: var(--paper-ink); }

@media (max-width: 860px) {
  .stone, .xp, .close { grid-template-columns: 1fr; }
  .swatches { grid-template-columns: repeat(4, 1fr); }
  .tray { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 26px; }
  .steps::before { left: 19px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; transform: scaleY(0); transform-origin: top; }
  .steps.is-in::before { transform: scaleY(1); }
  .steps li { padding-left: 58px; }
  .steps li::before { position: absolute; left: 0; top: 0; }
  .xp-stage { aspect-ratio: 1 / 1.1; }
  .xp-stack { top: 62%; width: 58%; }
  .after section { padding-top: 64px; padding-bottom: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .rise, .steps li, .steps::before { transition: none !important; opacity: 1; translate: none; transform: none; }
  .stone__view img.is-new.go { transition: none; }
  .tray button[aria-pressed="true"] .chip { transform: none; }
}
