/**
 * Ariva — cross-device responsive layer
 * Phone · tablet · laptop · ultrawide · TV (65–75" / 4K)
 */

:root {
    --ariva-gutter: clamp(1rem, 2.5vw, 2.5rem);
    --ariva-content-max: 80rem;
    --ariva-tv-zoom: 0.8;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 5.5rem;
}

body {
    overflow-x: clip;
    -webkit-tap-highlight-color: transparent;
}

/* Dynamic viewport — iOS Safari, Android Chrome, in-app browsers */
#hero {
    height: 100svh;
    height: 100dvh;
    min-height: max(640px, 100svh);
    min-height: max(640px, 100dvh);
}

.hero-shell {
    min-height: calc(100svh - 5rem);
    min-height: calc(100dvh - 5rem);
}

@supports not (height: 100dvh) {
    #hero {
        height: 100vh;
        min-height: max(640px, 100vh);
    }
    .hero-shell {
        min-height: calc(100vh - 5rem);
    }
}

/* Shared content width — all main sections */
.page-curtain .max-w-7xl.mx-auto,
#footer-inner.max-w-\[1400px\],
.footer-rera.max-w-\[1400px\],
.footer-copyright {
    width: 100%;
    padding-left: var(--ariva-gutter);
    padding-right: var(--ariva-gutter);
}

.page-curtain .max-w-7xl.mx-auto {
    max-width: var(--ariva-content-max);
}

#footer-inner.max-w-\[1400px\],
.footer-rera.max-w-\[1400px\] {
    max-width: min(100%, 87.5rem);
}

/* ── Small phones (320–479px) ── */
@media (max-width: 479px) {
    #hero {
        min-height: max(680px, 100svh);
        min-height: max(680px, 100dvh);
        padding-top: 4.75rem;
    }

    .hero-tagline {
        right: max(0.75rem, env(safe-area-inset-right, 0px));
        bottom: max(4.5rem, calc(env(safe-area-inset-bottom, 0px) + 3.5rem));
        font-size: clamp(0.75rem, 3.4vw, 0.875rem) !important;
        max-width: calc(100vw - 1.5rem);
    }

    .hero-scroll-hint {
        bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    }

    .ariva-float-stack {
        bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    }
}

/* ── Phones landscape / short viewports ── */
@media (max-height: 520px) and (orientation: landscape) {
    #hero {
        min-height: auto;
        height: auto;
        padding-top: 4.5rem;
        padding-bottom: 2rem;
    }

    .hero-shell {
        min-height: auto;
        padding-bottom: 2rem !important;
    }

    .hero-tagline,
    .hero-scroll-hint {
        display: none;
    }

    .hero-logo {
        width: min(55vw, 18rem) !important;
    }

    .hero-stats {
        flex-wrap: wrap;
    }
}

/* ── Tablets portrait (768–1023px) ── */
@media (min-width: 768px) and (max-width: 1023px) {
    .page-curtain .max-w-7xl.mx-auto {
        max-width: min(94vw, 56rem);
    }

    #hero .hero-content {
        max-width: min(92vw, 40rem);
    }

    .hero-tagline {
        font-size: clamp(1.75rem, 4.5vw, 2.75rem) !important;
        max-width: min(52vw, 28rem);
    }
}

/* ── Laptops / desktop (1024–1919px) ── */
@media (min-width: 1024px) and (max-width: 1919px) {
    .hero-tagline {
        font-size: clamp(2.25rem, 3.2vw, 3.5rem) !important;
    }
}

/* ── Large screens (1920px+) — overflow guard, no upscaling ── */
@media (min-width: 1920px) {
    .page-curtain {
        max-width: 100vw;
        overflow-x: clip;
    }

    .page-curtain .max-w-7xl.mx-auto {
        max-width: min(94vw, var(--ariva-content-max));
    }

    #footer-inner.max-w-\[1400px\],
    .footer-rera.max-w-\[1400px\] {
        max-width: min(94vw, 87.5rem);
    }

    .hero-logo {
        width: min(100%, 42rem) !important;
    }

    .hero-tagline {
        font-size: clamp(2.25rem, 2.2vw, 3.25rem) !important;
        max-width: min(42vw, 36rem);
    }

    #amenity-slider-track {
        height: clamp(600px, 38vh, 750px) !important;
    }

    #about-visual {
        /* let the frame's aspect-ratio set the height so the render scales with
           the column instead of being pinned to 520px on wide screens */
        height: auto !important;
    }

    .ariva-film__logo-stage {
        width: min(90vw, 56rem) !important;
    }

    .gallery-lightbox__figure {
        max-width: min(92vw, 1400px) !important;
    }

    .layout-plan-lightbox__figure {
        width: min(94vw, 1500px) !important;
    }
}

/*
 * Smart TV (Samsung 65–75" etc.) at 100% browser zoom
 * User-confirmed 80% browser zoom looks perfect → apply 0.8 scale at 100% zoom.
 * Targets: Tizen/Samsung UA, coarse pointer, or no hover on large screens.
 */
@media (min-width: 1920px) and (hover: none) {
    html {
        zoom: var(--ariva-tv-zoom);
    }
}

html.ariva-tv-viewport {
    zoom: var(--ariva-tv-zoom);
}

@supports not (zoom: 0.8) {
    html.ariva-tv-viewport {
        font-size: 80%;
    }
}

/* ── Touch / coarse pointer (phones, tablets, TV remotes) ── */
@media (hover: none), (pointer: coarse) {
    .nav-link,
    .nav-cta,
    .hero-cta-row a,
    .hero-cta-row button,
    .footer-link,
    .layout-tab-btn,
    .ariva-float-btn,
    .ariva-gps-btn,
    .ariva-film__skip.is-ready {
        min-height: 44px;
        min-width: 44px;
    }

    .gallery-item:hover img {
        transform: none;
    }
}

/* ── Fine pointer (mouse/trackpad) — keep hover polish ── */
@media (hover: hover) and (pointer: fine) {
    .hero-cta-row a:hover,
    .hero-cta-row button:hover {
        transform: translateY(-2px);
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    #hero,
    .hero-shell {
        height: auto;
        min-height: 640px;
    }
}

/* ============================================================
   PHONE PASS (11 Oct 2026)
   ============================================================ */

/* The 360° button sat mid-screen on the left and covered copy, FAQ
   questions and the enquiry form on phones. It now lives bottom-left as
   a compact pill, level with the call / WhatsApp stack. */
@media (max-width: 767px) {
    .ariva-gps-btn {
        top: auto;
        bottom: max(1rem, env(safe-area-inset-bottom, 0px));
        left: max(0.85rem, env(safe-area-inset-left, 0px));
        transform: none;
        width: auto;
        min-height: 2.75rem;
        flex-direction: row;
        gap: 0.4rem;
        padding: 0.5rem 0.9rem 0.5rem 0.7rem;
        border: 1px solid rgba(203, 174, 124, 0.4);
        border-radius: 9999px;
        box-shadow: 0 10px 24px rgba(28, 13, 33, 0.3);
    }
    .ariva-gps-btn svg { width: 1.2rem; height: 1.2rem; }
    .ariva-gps-btn__label { font-size: 0.66rem; }

    .ariva-float-stack { gap: 0.55rem; right: max(0.85rem, env(safe-area-inset-right, 0px)); bottom: max(1rem, env(safe-area-inset-bottom, 0px)); }
    .ariva-float-btn { width: 2.75rem; height: 2.75rem; }
    .ariva-float-btn svg, .ariva-float-btn i { width: 1.2rem; height: 1.2rem; }

    #contact, #faq { padding-bottom: 6rem; }
    #footer-copyright { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }

    .about-image-card__label, .footer-col__title, .contact-label, .contact-label__opt,
    .amenity-text-slide__eyebrow, .footer-brand__eyebrow, .footer-rera__label, .footer-rera__link,
    .footer-cta__text, .about-overline { font-size: 0.72rem; }
    .nav-cta--compact .ariva-flair__content, .nav-cta--compact { font-size: 0.68rem; }

    .spec-dot { box-sizing: content-box; padding: 10px 6px; background-clip: content-box; min-width: 0.5rem; }
    .spec-dot.is-active { min-width: 1.5rem; }

    #contact .contact-detail__link, #contact .contact-lede__tel { display: inline-block; padding: 0.35rem 0; }
}

@media (max-width: 380px) {
    #navbar { padding-left: 0.75rem; padding-right: 0.75rem; }
    .nav-brand-logo { max-width: 44vw; }
    .nav-cta--compact { padding: 0.5rem 0.6rem; font-size: 0.6rem; letter-spacing: 0.08em; }
    #mobile-menu-btn { min-width: 2.5rem; min-height: 2.5rem; padding: 0.35rem; margin-right: 0; }
}

/* ── 360° button on phones + tablets (21 Oct 2026): middle-RIGHT edge, a compact vertical tab
   (mirrors the desktop left-edge tab). Overrides the bottom-left pill from the 11 Oct phone pass. ── */
@media (max-width: 1023px) {
    .ariva-gps-btn {
        top: 50%;
        bottom: auto;
        left: auto;
        right: 0;
        transform: translateY(-50%);
        flex-direction: column;
        gap: 0.3rem;
        width: 3.4rem;
        min-height: 0;
        padding: 0.8rem 0.4rem 0.8rem 0.5rem;
        border-left: 1px solid rgba(203, 174, 124, 0.4);
        border-right: none;
        border-radius: 0.85rem 0 0 0.85rem;
        box-shadow: -4px 0 24px rgba(28, 13, 33, 0.3);
    }
    .ariva-gps-btn svg { width: 1.7rem; height: 1.7rem; }
    .ariva-gps-btn__label { font-size: 0.6rem; }
    /* the call / WhatsApp stack stays bottom-right; keep it clear of the tab */
    .ariva-float-stack { bottom: max(1rem, env(safe-area-inset-bottom, 0px)); }
}

/* ==========================================================================
   ABOUT — phone/tablet image treatment (25 Oct 2026)
   On a phone the render deck was a 314x260 card sunk inside a pale 1px frame,
   with the podium photo below it in a different, square-cornered treatment.
   Below 1024px the frame is dropped, the deck fills the column at a portrait-
   friendly ratio, both images share the brochure's stadium radius and caption,
   and the auto-advancing deck gets dots plus swipe. Desktop is untouched.
   ========================================================================== */
@media (max-width: 1023.98px) {

    /* the inset rule reads as a stray border at phone width — let the image fill */
    #about .about-frame {
        padding: 0;
        border: 0;
    }

    /* square on phones: the renders are 1.3:1, so a 1:1 crop keeps the towers
       whole while giving the image real presence on a 375px screen */
    #about .about-visual {
        aspect-ratio: 1 / 1;
        min-height: 0;
    }

    /* a 714px square is too tall on a tablet — go back towards the render shape */
    @media (min-width: 641px) {
        #about .about-visual { aspect-ratio: 4 / 3; }
    }

    #about .about-frame .about-visual-frame {
        background: transparent;
    }

    /* both renders carry the same stadium radius and shadow */
    #about .about-visual,
    #about .about-second-image {
        border-radius: clamp(22px, 6vw, 34px);
        overflow: hidden;
        box-shadow: 0 18px 38px rgba(12, 5, 16, 0.28);
    }

    /* the podium photo matches the deck instead of sitting square-cornered */
    #about .about-second-image {
        position: relative;
        margin-top: 1.5rem;
    }
    #about .about-second-image img {
        height: auto;
        aspect-ratio: 16 / 10;
        width: 100%;
        object-fit: cover;
    }
    #about .about-second-image__label {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 2.75rem 1.25rem 1rem;
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0.22em;
        text-transform: uppercase;
        color: #fff;
        background: linear-gradient(to top, rgba(8, 4, 10, 0.9) 0%, transparent 100%);
        pointer-events: none;
    }

    /* even rhythm: copy -> podium -> deck, rather than a 3rem grid gap */
    #about .about-row {
        row-gap: 1.5rem;
    }

    /* the deck advances on a timer, so say so and make it swipeable */
    #about .about-deck-dots {
        display: flex;
        justify-content: center;
        gap: 0.4rem;
        margin-top: 0.9rem;
    }
    #about .about-deck-dot {
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.28);
        transition: width 0.35s ease, background-color 0.35s ease;
    }
    #about .about-deck-dot.is-active {
        width: 20px;
        background: #CBAE7C;
    }
}

/* dots are a touch affordance only — the desktop deck is hover-driven */
@media (min-width: 1024px) {
    #about .about-deck-dots { display: none; }
}

/* the podium caption only exists for the phone treatment */
@media (min-width: 1024px) {
    #about .about-second-image__label { display: none; }
}

/* ==========================================================================
   CONTACT — phone-width detail cards (25 Oct 2026)
   Two problems on a phone:
   1. the 44px tap-target rule made the phone/email links inline-flex, and an
      inline-flex box sits on the text baseline, so every line box grew to 40px
      and left a dead band above each number;
   2. the 2x2 desktop card (icon stacked over the label) is a lot of empty
      height when there is only one column.
   ========================================================================== */

/* 1 ── tap targets without wrecking the line box: block links with padding are
       both full-width tappable and flush with their label. */
@media (hover: none), (pointer: coarse) {
    #contact .contact-detail__text .contact-detail__tel {
        display: block;
        min-height: 0;
        padding-block: 0.4rem;
        width: fit-content;
    }
    /* the two phone numbers are block now, so the <br> between them would add
       a second break — the address card's <br>s must stay, hence :has() */
    #contact .contact-detail__text:has(.contact-detail__tel) br {
        display: none;
    }
}

/* 2 ── below the 2-column breakpoint the card goes back to icon-left, which
       is both tidier and ~60px shorter per card. */
@media (max-width: 559.98px) {
    #contact .contact-detail {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.9rem;
        padding: 1.15rem 1.1rem;
    }
    #contact .contact-detail__icon {
        width: 2.6rem;
        height: 2.6rem;
    }
    #contact .contact-detail__icon svg,
    #contact .contact-detail__icon i {
        width: 1.15rem;
        height: 1.15rem;
    }
    #contact .contact-detail__title {
        margin-bottom: 0.45rem;
    }
    /* the link is bottom-anchored for the equal-height desktop grid; with one
       column per row there is no height to fill, so sit it under the text */
    #contact .contact-detail__link {
        margin-top: 0.5rem;
        padding-top: 0;
    }
    #contact .contact-details {
        gap: 0.85rem;
    }
}
