/* ============================================
   BUILD PANEL — "What Do You Want to Build?"
   Slide-in from right, 80% screen width.
   Incorporates Our Story hero aesthetics.
   ============================================ */

/* ---- BACKDROP ---- */
.bp__backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(8, 20, 32, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s var(--ease-out);
}

.bp__backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

/* ---- PANEL ----
   `display: none` initially instead of off-screen `transform: translateX(100%)`.
   iOS Safari doesn't clip fixed-positioned elements that extend past the
   viewport — even with `overflow-x: hidden` on html/body — so the off-screen
   panel was creating a horizontal scrollbar. `display: none` keeps it out of
   the layout entirely until needed. */
.bp {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    z-index: 9999;
    pointer-events: none;
    display: none;
    height: 100vh;
    height: 100dvh;
}

.bp--open {
    display: flex;
    pointer-events: auto;
    animation: bp-slide-in 0.5s var(--ease-out-expo) both;
}

@keyframes bp-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* ---- CLOSE STRIP ---- */
.bp__close-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    flex-shrink: 0;
    background: var(--color-pure-white, #fff);
    border: none;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
    padding: 0;
    transition: background 0.3s var(--ease-out);
}

.bp__close-strip:hover {
    background: var(--color-gray-50, #f7f7f7);
}

@media (min-width: 1024px) {
    .bp__close-strip { width: 80px; }
}

.bp__close-text {
    font-family: var(--font-body, "Urbanist", sans-serif);
    font-size: var(--text-xs, 0.8125rem);
    font-weight: var(--font-bold, 700);
    letter-spacing: var(--tracking-widest, 0.16em);
    text-transform: uppercase;
    color: var(--color-navy, #0C1B2A);
    writing-mode: vertical-lr;
    transform: rotate(180deg);
}

/* ---- MAIN CONTENT ---- */
.bp__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-pure-white, #fff);
    position: relative;
    overflow: hidden;
}

/* Architectural grid background */
.bp__main::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(50, 48, 47, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(50, 48, 47, 0.07) 1px, transparent 1px),
        linear-gradient(rgba(50, 48, 47, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(50, 48, 47, 0.03) 1px, transparent 1px);
    background-size: 160px 160px, 160px 160px, 40px 40px, 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Top fade to white */
.bp__main::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, #FFFFFF, transparent);
    pointer-events: none;
    z-index: 0;
}

/* ---- HEADER BAR ---- */
.bp__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5, 1.25rem) var(--space-8, 2rem);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 1;
    background: var(--color-pure-white, #fff);
}

.bp__heading {
    font-family: var(--font-body, "Urbanist", sans-serif);
    font-size: var(--text-xs, 0.8125rem);
    font-weight: var(--font-medium, 500);
    letter-spacing: var(--tracking-widest, 0.16em);
    text-transform: uppercase;
    color: var(--color-gray-300, #b3b3b3);
}

.bp__header-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-gold, #C0392B);
    flex-shrink: 0;
}

/* ---- THREE COLUMNS ---- */
.bp__columns {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    min-height: 0;
    position: relative;
    z-index: 1;
}

@media (min-width: 768px) {
    .bp__columns {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: 1fr;
    }
}

/* ---- COLUMN ---- */
.bp__col {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-text-primary, #32302F);
    padding: var(--space-8, 2rem) var(--space-6, 1.5rem);
    position: relative;

    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--ease-out-expo),
                transform 0.5s var(--ease-out-expo);
}

@media (min-width: 1024px) {
    .bp__col {
        padding: var(--space-8, 2rem) var(--space-8, 2rem);
    }
}

.bp--open .bp__col {
    opacity: 1;
    transform: translateY(0);
}

.bp--open .bp__col:nth-child(1) { transition-delay: 0.10s; }
.bp--open .bp__col:nth-child(2) { transition-delay: 0.20s; }
.bp--open .bp__col:nth-child(3) { transition-delay: 0.30s; }

/* Dividers */
.bp__col + .bp__col {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
    .bp__col + .bp__col {
        border-top: none;
        border-left: 1px solid rgba(0, 0, 0, 0.06);
    }
}

/* ---- Ghost watermark per column ---- */
.bp__col::before {
    content: attr(data-ghost);
    position: absolute;
    top: var(--space-4, 1rem);
    left: var(--space-4, 1rem);
    font-family: var(--font-heading, "Tiempos Text", serif);
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 800;
    color: rgba(50, 48, 47, 0.04);
    line-height: 0.85;
    letter-spacing: -0.04em;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* ---- Image with blueprint frame ---- */
.bp__col-image-wrap {
    position: relative;
    width: 100%;
    margin-bottom: var(--space-6, 1.5rem);
}

/* Blueprint backdrop (offset behind image) */
.bp__col-image-wrap::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: -12px;
    bottom: -12px;
    background-color: #1a1814;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    border-radius: var(--radius-md, 8px);
    z-index: 0;
}

.bp__col-image {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 3 / 3.2;
    overflow: hidden;
    border-radius: var(--radius-md, 8px);
}

.bp__col-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

.bp__col:hover .bp__col-image img {
    transform: scale(1.03);
}

/* Image caption overlay (like portrait caption) */
.bp__col-image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-4, 1rem) var(--space-5, 1.25rem);
    background: linear-gradient(transparent, rgba(10, 17, 25, 0.7));
    border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
    z-index: 2;
}

.bp__col-image-caption span {
    font-family: var(--font-body, "Urbanist", sans-serif);
    font-size: 0.7rem;
    font-weight: var(--font-semibold, 600);
    letter-spacing: var(--tracking-wider, 0.06em);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

/* ---- Text content ---- */
.bp__col-body {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.bp__col-index {
    font-family: var(--font-body, "Urbanist", sans-serif);
    font-size: 0.7rem;
    font-weight: var(--font-semibold, 600);
    letter-spacing: var(--tracking-wider, 0.06em);
    text-transform: uppercase;
    color: var(--color-text-secondary, #32302F);
    margin-bottom: var(--space-3, 0.75rem);
}

.bp__col-title {
    display: flex;
    align-items: center;
    gap: var(--space-3, 0.75rem);
    font-family: var(--font-heading, "Tiempos Text", serif);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 400;
    line-height: var(--leading-tight, 1.2);
    letter-spacing: -0.6px;
    color: var(--color-text-primary, #32302F);
    margin-bottom: var(--space-3, 0.75rem);
}

/* Gold dot before title */
.bp__col-title::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-gold, #C0392B);
    flex-shrink: 0;
}

.bp__col-desc {
    font-family: var(--font-body, "Urbanist", sans-serif);
    font-size: var(--text-base, 1.0625rem);
    font-weight: 400;
    line-height: var(--leading-normal, 1.7);
    color: var(--color-text-secondary, #32302F);
    max-width: 340px;
    margin-bottom: var(--space-5, 1.25rem);
}

/* ---- CTA pill button (mirrors co-hero__cta) ---- */
.bp__col-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-pure-white, #fff);
    border: 1.5px solid var(--color-gray-300, #b3b3b3);
    border-radius: 100px;
    color: var(--color-navy, #0C1B2A);
    font-family: var(--font-body, "Urbanist", sans-serif);
    font-size: var(--text-sm, 0.9375rem);
    font-weight: var(--font-medium, 500);
    letter-spacing: 0.01em;
    width: fit-content;
    transition: transform var(--duration-base, 300ms) var(--ease-out),
                box-shadow var(--duration-base, 300ms) var(--ease-out),
                background var(--duration-base, 300ms) var(--ease-out),
                border-color var(--duration-base, 300ms) var(--ease-out),
                color var(--duration-base, 300ms) var(--ease-out);
}

.bp__col-cta-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-navy, #0C1B2A);
    color: var(--color-pure-white, #fff);
    font-size: 0.75rem;
    transition: transform 0.3s var(--ease-out),
                background 0.3s var(--ease-out),
                color 0.3s var(--ease-out);
}

.bp__col:hover .bp__col-cta {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(12, 27, 42, 0.12);
    background: var(--color-text-primary, #32302F);
    border-color: var(--color-text-primary, #32302F);
    color: var(--color-pure-white, #fff);
}

.bp__col:hover .bp__col-cta-arrow {
    background: var(--color-pure-white, #fff);
    color: var(--color-text-primary, #32302F);
    transform: translateX(3px);
}


/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
    .bp,
    .bp__backdrop,
    .bp__col,
    .bp__col-image img,
    .bp__col-cta {
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}

/* ---- Body scroll lock ---- */
body.bp-locked {
    overflow: hidden;
}
