/* "Any plan, digitised in seconds." on the site's home page (index.html, in place of the old how-it-works reel).
   The rules are the floor plan page's own (styles/floor-plans-landing.css: framed media, the wipe slider, the sketch cards,
   the S1c section), copied here so the home page does not load that whole stylesheet; the script is
   scripts/floor-plans-landing.js. Keep both copies in step when the section changes. */

.fp-home-digi {
    --fp-orange: #ff9000;
    --fp-amber: #ffb14d;
    --fp-ink: #1e1e1e;
    --fp-copy: #5a5a5a;
    --fp-paper: #fcfcfa;
    --fp-card: #ffffff;
    --fp-line: rgba(0, 0, 0, 0.08);
    --fp-dark: #111214;
    --fp-ease: cubic-bezier(.2, .8, .2, 1);
    --fp-pop: cubic-bezier(.2, 1.4, .4, 1);
}
#how-it-works.fp-home-digi .rl-section-title { margin-bottom: 14px; }
.fp-home-lede { max-width: 640px; margin: 0 0 36px; color: var(--fp-copy); font: 400 17px/1.55 Inter, sans-serif; }

/* ---------- framed media ---------- */
.fp-frame {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: var(--fp-paper);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.fp-frame-light { box-shadow: 0 24px 60px rgba(17, 18, 20, 0.12), 0 0 0 1px var(--fp-line); }
.fp-frame img,
.fp-frame video { display: block; width: 100%; height: auto; }
.fp-tag {
    position: absolute;
    z-index: 3;
    top: 14px;
    padding: 6px 11px;
    border-radius: 999px;
    font: 600 12px/1 Inter, sans-serif;
    pointer-events: none;
}
.fp-tag-left { left: 14px; color: #fff; background: rgba(17, 18, 20, 0.78); }
.fp-tag-right { right: 14px; color: #151515; background: var(--fp-orange); }


/* ---------- M1 wipe: sketch over plan, the handle at --fp-pos ---------- */
.fp-wipe {
    --fp-pos: 50%;
    position: relative;
    overflow: hidden;
    border-radius: inherit;
    touch-action: pan-y;
}
.fp-wipe > img { display: block; width: 100%; height: auto; }
.fp-wipe-top {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    clip-path: inset(0 calc(100% - var(--fp-pos)) 0 0);
}
.fp-wipe-line {
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    left: var(--fp-pos);
    width: 3px;
    margin-left: -1.5px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}
.fp-wipe-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--fp-orange);
    color: #151515;
    box-shadow: 0 0 0 4px #fff, 0 12px 28px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%);
}
.fp-wipe-knob svg { width: 26px; height: 26px; }
.fp-wipe input[type="range"] {
    position: absolute;
    z-index: 4;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
}
.fp-wipe input[type="range"]:focus-visible ~ .fp-wipe-line .fp-wipe-knob { box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--fp-orange); }

.fp-pick {
    width: 74px;
    height: 74px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--fp-line);
    cursor: pointer;
    transition: transform 300ms var(--fp-pop), border-color 200ms ease;
}
.fp-pick img { width: 100%; height: 100%; object-fit: cover; }
.fp-pick:hover { transform: translateY(-3px); }
.fp-pick[aria-selected="true"] { border-color: var(--fp-orange); }
.fp-panel[hidden] { display: none !important; }

/* S1c "Any plan, digitised": the sketch photos fanned across the top (the picked one lifts). Below, a stage of fixed height
   (the screen height left under the header and the fan: --fp-fit from the tabs script) holds the sketch, an arrow and the
   clean plan / visualized slider. Every plan is contained in the same box, so a switch never moves the page. */
.fp-digi { display: grid; gap: 14px; }
.fp-digi .fp-arc { position: relative; height: 236px; margin: 0; padding: 0; list-style: none; }
.fp-arc li { position: absolute; left: var(--x); top: var(--y); z-index: var(--z); width: 150px; margin-left: -75px; transform: rotate(var(--r)); transform-origin: 50% 100%; transition: transform 320ms var(--fp-pop); }
.fp-arc li:hover { z-index: 15; transform: rotate(var(--r)) translateY(-8px); }
.fp-arc li:has(.fp-pick[aria-selected="true"]) { z-index: 20; transform: translateY(-16px) scale(1.06); }
.fp-arc .fp-pick { display: block; width: 100%; height: auto; padding: 6px 6px 8px; overflow: visible; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 14px 30px rgba(17, 18, 20, 0.16), 0 0 0 1px var(--fp-line); text-align: left; transition: box-shadow 200ms ease; }
.fp-arc .fp-pick:hover { transform: none; }
.fp-arc .fp-pick img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.fp-arc .fp-pick[aria-selected="true"] { box-shadow: 0 0 0 3px var(--fp-orange), 0 18px 40px rgba(17, 18, 20, 0.22); }
.fp-arc-name { display: block; padding: 6px 2px 0; color: var(--fp-ink); font: 600 12px/1.25 Inter, sans-serif; }
.fp-digi-out { min-width: 0; }
.fp-digi-flow { --stage: clamp(300px, var(--fp-fit, 60vh), 760px); --h: var(--stage); display: grid; grid-template-columns: minmax(0, 0.72fr) 56px minmax(0, 1.28fr); grid-template-rows: minmax(0, 1fr); align-items: center; justify-items: center; gap: 10px; height: var(--h); }
/* the sketch and the slider take their own shape (--ar) inside the fixed stage: the stage, not the frame, sets the page's height */
.fp-digi-result { display: grid; place-items: center; width: 100%; height: 100%; min-width: 0; }
.fp-digi-sketch, .fp-digi-result > .fp-frame { width: min(100%, calc(var(--h) * var(--ar, 1))); aspect-ratio: var(--ar, 1); }
.fp-digi-sketch { background: #fff; }
.fp-digi-arrow { width: 56px; height: 24px; overflow: visible; }
.fp-digi-arrow path { fill: none; stroke: var(--fp-orange); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.fp-digi-panel.is-in .fp-digi-arrow path { animation: fp-digi-draw 420ms ease-out 360ms both; }
.fp-digi-panel.is-in .fp-digi-arrow path + path { animation-delay: 640ms; animation-duration: 220ms; }
.fp-digi-panel.is-in .fp-digi-result { animation: fp-digi-result 620ms var(--fp-pop) 560ms both; }
@keyframes fp-digi-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fp-digi-result { from { opacity: 0; transform: translateX(24px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
    .fp-digi .fp-arc { display: flex; gap: 12px; height: auto; padding: 10px 4px 16px; overflow-x: auto; scroll-snap-type: x mandatory; }
    .fp-arc li, .fp-arc li:hover, .fp-arc li:has(.fp-pick[aria-selected="true"]) { position: static; flex: 0 0 132px; width: auto; margin: 0; transform: none; scroll-snap-align: start; }
    /* narrow: the picked card above already shows the sketch, so the slider gets the stage */
    .fp-digi-flow { --h: min(var(--stage), 118vw); grid-template-columns: 1fr; }
        .fp-digi-sketch, .fp-digi-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .fp-digi-panel.is-in .fp-digi-arrow path, .fp-digi-panel.is-in .fp-digi-result { animation: none; }
}
