/* =====================================================
 * "From Scratch" blueprint card
 * A line-blueprint traced from a real DOTS build, swept
 * in by a scan, labelled, then cross-faded to the photo.
 * ===================================================== */

.bp-card {
    position: relative;
    aspect-ratio: 1400 / 788;
    border-radius: 18px;
    overflow: hidden;
    background:
        radial-gradient(130% 120% at 20% 0%, #16294a 0%, #0c1830 48%, #081020 100%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(123, 160, 220, 0.18);
}

/* technical grid */
.bp-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(rgba(126, 162, 222, 0.10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(126, 162, 222, 0.10) 1px, transparent 1px),
        linear-gradient(rgba(126, 162, 222, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(126, 162, 222, 0.045) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 30px 30px, 30px 30px;
    pointer-events: none;
}

/* corner ticks + stamp */
.bp-corner {
    position: absolute;
    width: 22px; height: 22px;
    border: 2px solid rgba(255, 122, 26, 0.75);
    z-index: 6; pointer-events: none;
}
.bp-corner--tl { top: 16px; left: 16px; border-right: 0; border-bottom: 0; }
.bp-corner--tr { top: 16px; right: 16px; border-left: 0; border-bottom: 0; }
.bp-corner--bl { bottom: 16px; left: 16px; border-right: 0; border-top: 0; }
.bp-corner--br { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }

.bp-stamp {
    position: absolute;
    top: 18px; right: 46px;
    z-index: 6;
    color: rgba(150, 178, 222, 0.6);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 11px; letter-spacing: 1.5px;
    pointer-events: none;
}

/* ---------- Stage (keeps lines, labels and photo aligned) ---------- */
.bp-stage { position: absolute; inset: 0; z-index: 2; }

.bp-lines,
.bp-final {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center;
}

.bp-lines {
    filter: drop-shadow(0 0 6px rgba(120, 170, 255, 0.35));
    clip-path: inset(0 100% 0 0);
}
.bp-card.is-playing .bp-lines { animation: bpWipe 2.3s cubic-bezier(.6,.01,.25,1) forwards; }
.bp-card.is-done .bp-lines { clip-path: inset(0 0 0 0); }
@keyframes bpWipe { to { clip-path: inset(0 0 0 0); } }

/* sweeping scan line that "draws" the blueprint */
.bp-scan {
    position: absolute;
    top: 0; bottom: 0;
    width: 10%;
    left: -12%;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(207, 227, 255, 0.12) 42%,
        rgba(255, 122, 26, 0.85) 50%,
        rgba(207, 227, 255, 0.12) 58%,
        transparent 100%);
    mix-blend-mode: screen;
}
.bp-card.is-playing .bp-scan { animation: bpScan 2.3s cubic-bezier(.6,.01,.25,1) forwards; }
@keyframes bpScan {
    0% { left: -12%; opacity: 1; }
    92% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* ---------- Labels ---------- */
.bp-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; }
.bp-callouts line { stroke: rgba(180, 206, 245, 0.75); stroke-width: 1.2; }
.bp-callouts circle { fill: #ff7a1a; }
.bp-callouts text {
    fill: #eaf1fd;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 17px; letter-spacing: 1.4px; font-weight: 600;
    paint-order: stroke; stroke: #0a1222; stroke-width: 3px;
}
.bp-call { opacity: 0; }
.bp-card.is-playing .bp-call {
    animation: bpCall 0.5s ease forwards;
    animation-delay: calc(1.55s + var(--c, 0s));
}
.bp-card.is-done .bp-call { opacity: 1; }
@keyframes bpCall { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Finished photo reveal ---------- */
.bp-final { opacity: 0; z-index: 5; }
.bp-card.is-playing .bp-final { animation: bpFinalIn 1.15s ease forwards; animation-delay: 2.95s; }
.bp-card.is-done .bp-final { opacity: 1; }
@keyframes bpFinalIn { from { opacity: 0; } to { opacity: 1; } }

.bp-final-tag {
    position: absolute;
    left: 20px; bottom: 20px;
    z-index: 7;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(8, 14, 26, 0.72);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    color: #fff; font-size: 12.5px; font-weight: 600; letter-spacing: 0.4px;
    opacity: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.5);
}
.bp-final-tag::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: #ff7a1a; box-shadow: 0 0 10px #ff7a1a;
}
.bp-card.is-playing .bp-final-tag { animation: bpFinalIn 0.6s ease forwards; animation-delay: 3.5s; }
.bp-card.is-done .bp-final-tag { opacity: 1; }

/* ---------- Replay ---------- */
.bp-replay {
    position: absolute;
    right: 18px; bottom: 18px;
    z-index: 8;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px 8px 11px;
    border: 0; border-radius: 999px;
    background: rgba(255, 122, 26, 0.92);
    color: #0a0a0a; font-size: 12.5px; font-weight: 700; letter-spacing: 0.3px;
    cursor: pointer; opacity: 0;
    transition: opacity 0.4s ease, transform 0.15s ease;
}
.bp-replay svg { width: 15px; height: 15px; }
.bp-card.is-done .bp-replay { opacity: 1; }
.bp-replay:hover { transform: translateY(-1px); }

/* ---------- In the home hero image card ---------- */
.hero-image-card--blueprint { position: relative; padding: 0; }
.hero-image-card--blueprint .bp-card {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    aspect-ratio: auto;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(123, 160, 220, 0.18);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .bp-callouts text { font-size: 21px; }
    .bp-stamp { right: 44px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .bp-lines { clip-path: inset(0 0 0 0) !important; animation: none !important; }
    .bp-scan { display: none !important; }
    .bp-call, .bp-final, .bp-final-tag, .bp-replay { opacity: 1 !important; animation: none !important; }
}
