/* ==========================================================================
   Blue Housing landing
   Full-bleed video storytelling on black, scroll-revealed.
   ========================================================================== */

.blue-housing-page .site-main {
    padding-top: 0;
    padding-bottom: 0;
    /* Runs up behind the floating navbar, so no strip of body shows above. */
    margin-top: calc(var(--navbar-height) * -1);
}

.bh {
    --bh-black: #000000;
    --bh-near: #07070a;
    --bh-panel: #0f1014;
    --bh-line: rgba(255, 255, 255, 0.1);
    --bh-text: #f5f5f7;
    --bh-muted: #a1a1a8;
    --bh-cyan: #35b6ff;
    --bh-blue: #1567f5;
    --bh-gap: clamp(4rem, 9vw, 9rem);
    --bh-pad: clamp(1.25rem, 5vw, 4rem);
    --bh-radius: clamp(14px, 1.6vw, 26px);

    position: relative;
    background: var(--bh-black);
    color: var(--bh-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

.bh h1,
.bh h2,
.bh h3 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.06;
    color: #fff;
    text-wrap: balance;
}

.bh p {
    margin: 0;
    color: var(--bh-muted);
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.6;
}

.bh :not(pre) > code {
    padding: 0.1em 0.4em;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #d9e6ff;
    font-size: 0.92em;
}

.bh .bh-eyebrow {
    margin: 0 0 0.9rem;
    color: var(--bh-cyan);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* ---------------------------------------------------------------- video -- */

.bh-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #05050a;
}

.bh-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius);
    background: #05050a;
    aspect-ratio: 16 / 9;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

/* ----------------------------------------------------------------- hero -- */

.bh-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 100svh;
    padding: clamp(6rem, 14vh, 12rem) var(--bh-pad) clamp(3.5rem, 8vh, 6rem);
    overflow: hidden;
    isolation: isolate;
}

.bh-hero__media {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.bh-hero__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.25) 38%, rgba(0, 0, 0, 0.9) 100%),
        radial-gradient(120% 70% at 50% 100%, rgba(0, 0, 0, 0.85), transparent 70%);
}

.bh-hero__inner {
    width: min(74rem, 100%);
    margin: 0 auto;
}

.bh .bh-hero__badge {
    display: inline-block;
    margin: 0 0 1.6rem;
    padding: 0.42rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(14px);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
}

.bh-hero__logo {
    width: min(30rem, 72vw);
    height: auto;
    margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
}

.bh .bh-hero__title {
    max-width: 16ch;
    font-size: clamp(2.9rem, 7.2vw, 6.2rem);
}

.bh .bh-hero__lead {
    max-width: 46ch;
    margin-top: 1.5rem;
    color: #d6d6dd;
    font-size: clamp(1.05rem, 1.5vw, 1.4rem);
}

.bh-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: clamp(1.8rem, 3.5vw, 2.8rem);
}

.bh-hero__scroll {
    position: absolute;
    bottom: 1.4rem;
    left: 50%;
    width: 22px;
    height: 36px;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    transform: translateX(-50%);
}

.bh-hero__scroll::after {
    content: '';
    position: absolute;
    top: 7px;
    left: 50%;
    width: 3px;
    height: 7px;
    border-radius: 2px;
    background: #fff;
    transform: translateX(-50%);
    animation: bh-scroll 2s ease-in-out infinite;
}

@keyframes bh-scroll {
    0%, 100% { opacity: 0; transform: translate(-50%, 0); }
    30% { opacity: 1; }
    70% { opacity: 0; transform: translate(-50%, 12px); }
}

/* --------------------------------------------------------------- button -- */

.bh-button {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.7rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.bh-button:hover { transform: translateY(-2px); }

.bh-button--primary {
    background: linear-gradient(135deg, var(--bh-cyan), var(--bh-blue));
    color: #fff;
    box-shadow: 0 12px 34px rgba(21, 103, 245, 0.35);
}

.bh-button--primary:hover { color: #fff; }

.bh-button--ghost {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    backdrop-filter: blur(12px);
}

.bh-button--ghost:hover {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
}

.bh-play {
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid currentColor;
}

/* -------------------------------------------------------------- trailer -- */

/* The third term keeps the 16:9 frame under ~78vh on short viewports, so the
   close button above it never ends up off screen. */
.bh-trailer {
    position: fixed;
    inset: 0;
    width: min(68rem, 92vw, 139vh);
    height: fit-content;
    margin: auto;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: var(--bh-radius);
    background: transparent;
    overflow: visible;
}

.bh-trailer::backdrop {
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
}

.bh-trailer__frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius);
    background: #000;
    aspect-ratio: 16 / 9;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
}

.bh-trailer__frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.bh-trailer__close {
    position: absolute;
    top: -3rem;
    right: 0;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.bh-trailer__close:hover { background: rgba(255, 255, 255, 0.18); }

@media (max-width: 40rem) {
    .bh-trailer__close { top: -2.8rem; }
}

/* ------------------------------------------------------------ statement -- */

.bh-statement {
    padding: clamp(6rem, 14vh, 11rem) var(--bh-pad) clamp(2.5rem, 5vh, 4rem);
    background: var(--bh-black);
}

.bh .bh-statement__text {
    width: min(58rem, 100%);
    margin: 0 auto;
    color: #fff;
    font-size: clamp(2rem, 5.4vw, 4.2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-align: center;
    text-wrap: balance;
}

/* ---------------------------------------------------------------- scene -- */

.bh-scene {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
    gap: clamp(2.5rem, 5vw, 5rem);
    align-items: center;
    width: min(82rem, 100%);
    margin: 0 auto;
    padding: var(--bh-gap) var(--bh-pad);
}

.bh-scene--reverse .bh-scene__media { order: 2; }

.bh-scene__copy h2 {
    font-size: clamp(2rem, 3.6vw, 3.3rem);
}

.bh-scene__copy p { margin-top: 1.15rem; }

/* ----------------------------------------------------------------- band -- */

.bh-band {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: min(86svh, 46rem);
    padding: var(--bh-pad);
    overflow: hidden;
    isolation: isolate;
}

.bh-band__video {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.bh-band__scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 35%, rgba(0, 0, 0, 0.92) 100%);
}

.bh-band__copy {
    width: min(82rem, 100%);
    margin: 0 auto;
    padding-bottom: clamp(1rem, 4vw, 3rem);
}

.bh-band__copy h2 {
    max-width: 18ch;
    font-size: clamp(2.1rem, 5vw, 4rem);
}

.bh-band__copy p {
    max-width: 52ch;
    margin-top: 1.3rem;
    color: #d2d2da;
}

/* ----------------------------------------------------------- section head */

.bh-section-head {
    width: min(64rem, 100%);
    margin: 0 auto clamp(2.6rem, 5vw, 4.5rem);
    text-align: center;
}

.bh-section-head h2 {
    font-size: clamp(2.1rem, 4.6vw, 3.8rem);
}

.bh .bh-section-head__lead {
    max-width: 60ch;
    margin: 1.4rem auto 0;
    font-size: clamp(1.05rem, 1.35vw, 1.3rem);
}

/* ----------------------------------------------------------------- trio -- */

.bh-trio {
    padding: var(--bh-gap) var(--bh-pad);
    background: var(--bh-near);
}

.bh-trio__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    gap: clamp(1.4rem, 2.5vw, 2.4rem);
    width: min(82rem, 100%);
    margin: 0 auto;
}

.bh-card h3 {
    margin-top: 1.5rem;
    font-size: 1.35rem;
}

.bh-card p { margin-top: 0.7rem; font-size: 1rem; }

/* --------------------------------------------------------------- backup -- */

.bh-backup {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
    gap: clamp(2.5rem, 5vw, 5rem);
    align-items: center;
    width: min(82rem, 100%);
    margin: 0 auto;
    padding: var(--bh-gap) var(--bh-pad);
}

.bh-backup__stage {
    display: grid;
    gap: 1.1rem;
}

.bh-backup__after { margin-left: clamp(1.5rem, 6vw, 5rem); }

.bh-backup__copy h2 { font-size: clamp(2rem, 3.6vw, 3.3rem); }
.bh-backup__copy p { margin-top: 1.15rem; }

.bh-tag {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    backdrop-filter: blur(10px);
}

.bh-tag--warn { background: rgba(245, 158, 11, 0.9); color: #14120b; }
.bh-tag--ok { background: rgba(16, 185, 129, 0.9); color: #04120c; }

/* -------------------------------------------------------------- scripting */

.bh-script {
    padding: var(--bh-gap) var(--bh-pad);
    background:
        radial-gradient(70% 45% at 50% 0%, rgba(21, 103, 245, 0.22), transparent 70%),
        var(--bh-black);
}

.bh-script__stage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    width: min(82rem, 100%);
    margin: 0 auto;
}

.bh-editor {
    overflow: hidden;
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius);
    background: #0b0b10;
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7);
}

.bh-editor .bh-video {
    aspect-ratio: 1074 / 1162;
    height: auto;
}

.bh-script__notes { display: grid; gap: 1.6rem; }

.bh-note {
    padding-left: 1.1rem;
    border-left: 2px solid rgba(53, 182, 255, 0.55);
}

.bh-note h3 { font-size: 1.2rem; }
.bh-note p { margin-top: 0.5rem; font-size: 0.98rem; }

.bh-code {
    width: min(52rem, 100%);
    margin: clamp(2.5rem, 5vw, 4rem) auto 0;
    padding: 1.5rem 1.7rem;
    overflow-x: auto;
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius);
    background: #0b0b10;
    color: #e6e6ef;
    font-family: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo, monospace;
    font-size: clamp(0.88rem, 1vw, 1.02rem);
    line-height: 1.75;
}

.bh-code code {
    display: grid;
    justify-items: start;
    padding: 0;
    background: none;
    color: #e6e6ef;
    font-size: inherit;
}

.bh-code__line {
    display: block;
    white-space: pre;
}

.bh-code__caret {
    width: 0.55em;
    height: 1.15em;
    margin-top: 0.15em;
    background: var(--bh-cyan);
    opacity: 0;
}

.bh-js .bh-code__line {
    clip-path: inset(0 100% 0 0);
}

.bh-js .bh-code.is-visible .bh-code__line {
    animation: bh-type var(--bh-type, 0.5s) steps(var(--bh-chars, 20)) var(--bh-type-delay, 0s) forwards;
}

.bh-js .bh-code.is-visible .bh-code__caret {
    animation: bh-caret 1s step-end var(--bh-type-delay, 0s) infinite;
}

/* Safety net: if the typing animation never runs, the lines must not stay clipped. */
.bh-js .bh-code.is-typed .bh-code__line {
    clip-path: none;
    animation: none;
}

@keyframes bh-type {
    to { clip-path: inset(0 0 0 0); }
}

@keyframes bh-caret {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

.bh-code .c-kw { color: #c792ea; }
.bh-code .c-str { color: #9ae6a0; }
.bh-code .c-num { color: #f7a35c; }
.bh-code .c-fn { color: #5cc8ff; }

.bh-mini { margin-top: clamp(4rem, 8vw, 7rem); }

.bh .bh-mini__title {
    margin-bottom: clamp(1.8rem, 3.5vw, 3rem);
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    text-align: center;
}

.bh-mini__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: clamp(1.2rem, 2.2vw, 2rem);
    width: min(82rem, 100%);
    margin: 0 auto;
}

.bh-mini__item { margin: 0; }

.bh-mini__item figcaption {
    display: grid;
    gap: 0.35rem;
    margin-top: 1rem;
}

.bh-mini__item strong { color: #fff; font-size: 1.05rem; }
.bh-mini__item span { color: var(--bh-muted); font-size: 0.92rem; line-height: 1.5; }

/* ----------------------------------------------------------------- grid -- */

.bh-grid-section {
    padding: var(--bh-gap) var(--bh-pad);
    background: var(--bh-near);
}

.bh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    gap: clamp(0.8rem, 1.2vw, 1.1rem);
    width: min(82rem, 100%);
    margin: 0 auto;
}

.bh-tile {
    padding: clamp(1.4rem, 2.4vw, 2rem);
    border: 1px solid var(--bh-line);
    border-radius: 18px;
    background: var(--bh-black);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.bh-tile:hover { border-color: rgba(255, 255, 255, 0.2); }

.bh-tile:hover { background: #0d0d13; }

.bh-tile__icon {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    margin-bottom: 1.1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(53, 182, 255, 0.22), rgba(21, 103, 245, 0.22));
    color: var(--bh-cyan);
    font-size: 1.05rem;
}

.bh-tile h3 { font-size: 1.12rem; }
.bh-tile p { margin-top: 0.55rem; font-size: 0.95rem; }

/* ------------------------------------------------------------------ cta -- */

.bh-cta {
    padding: clamp(6rem, 13vw, 11rem) var(--bh-pad);
    background:
        radial-gradient(60% 60% at 50% 100%, rgba(21, 103, 245, 0.28), transparent 70%),
        var(--bh-black);
    text-align: center;
}

.bh-cta__inner { width: min(46rem, 100%); margin: 0 auto; }

/* base.css sets `img { display: block }`, so the section's text-align does not
   centre this one: it needs the auto margins. */
.bh-cta__mark {
    display: block;
    width: min(22rem, 70vw);
    height: auto;
    margin: 0 auto 2.2rem;
}

.bh-cta h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); }

.bh .bh-cta__price {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: baseline;
    justify-content: center;
    margin-top: 1.4rem;
    color: #fff;
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.bh-cta__price-was {
    color: var(--bh-muted);
    font-size: 0.55em;
    font-weight: 500;
    text-decoration: line-through;
}

.bh-cta__price-off {
    align-self: center;
    padding: 0.3em 0.65em;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--bh-cyan), var(--bh-blue));
    color: #fff;
    font-size: 0.3em;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.bh .bh-cta__launch {
    margin-top: 0.6rem;
    color: var(--bh-cyan);
    font-size: 1.05rem;
    font-weight: 500;
}

.bh-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
    margin-top: 2.4rem;
}

/* -------------------------------------------------------------- reveals -- */

.bh-js .bh-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.bh-js .bh-reveal.is-visible {
    opacity: 1;
    transform: none;
}

.bh-js [data-bh-split] .bh-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.45em);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--bh-i, 0) * 55ms);
}

.bh-js [data-bh-split].is-visible .bh-word,
.bh-js .is-visible [data-bh-split] .bh-word {
    opacity: 1;
    transform: none;
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 60rem) {
    .bh-scene--reverse .bh-scene__media { order: 0; }
    .bh-backup__after { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .bh-js .bh-reveal,
    .bh-js [data-bh-split] .bh-word {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .bh-hero__scroll::after { animation: none; }

    .bh-js .bh-code__line { clip-path: none; animation: none; }
    .bh-js .bh-code__caret { display: none; }

    .bh-button:hover { transform: none; }
}
