/**
 * 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(48vw, 12rem) !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%, 17rem) !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(201, 168, 76, 0.35);
        border-radius: 9999px;
        box-shadow: 0 10px 24px rgba(26, 11, 46, 0.32);
    }
    .ariva-gps-btn svg { width: 1.2rem; height: 1.2rem; }
    .ariva-gps-btn__label { font-size: 0.66rem; }

    /* call / WhatsApp: a little smaller so they cover less of the page */
    .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; }

    /* keep the last line of every section clear of the floating buttons */
    #contact, #faq { padding-bottom: 6rem; }
    #footer-copyright { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }

    /* eyebrow / label type was rendering at 9.9–10.4px; floor it at ~11.5px */
    .about-image-card__label, .footer-col__title, .contact-label, .contact-label__opt,
    .amenity-text-slide__eyebrow, .content-text-card__label, .gallery-text-slide__label,
    .footer-brand__eyebrow, .footer-rera__label, .footer-rera__link, .footer-cta__text,
    .about-overline, .about-subheading { font-size: 0.72rem; }
    .nav-cta--compact .ariva-flair__content, .nav-cta--compact { font-size: 0.68rem; }

    /* spec-slider dots: 8px dots with a 28px hit area */
    .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 card links: comfortable tap height */
    #contact .contact-detail__link, #contact .contact-lede__tel { display: inline-block; padding: 0.35rem 0; }
}

/* Narrow phones (≤ 380px): the header row (logo + Enquire + menu) was 6px
   wider than the screen. */
@media (max-width: 380px) {
    #navbar { padding-left: 0.75rem; padding-right: 0.75rem; }
    .nav-brand-logo { height: 1.35rem; 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(201, 168, 76, 0.35);
        border-right: none;
        border-radius: 0.85rem 0 0 0.85rem;
        box-shadow: -4px 0 24px rgba(26, 11, 46, 0.32);
    }
    .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)); }
}
