/* UNO — Responsive overrides
   Inline styles set the desktop baseline; these media queries override at tablet & phone.
   Strategy: target by section ID + a few class hooks added in JSX. */

* { box-sizing: border-box; }
html, body { overflow-x: clip; max-width: 100vw; }

/* Section headline entrance animation — starts hidden, plays when in view */
@keyframes uno-h2-enter {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
.uno-residences h2,
.uno-amenities h2,
.uno-platform h2,
.uno-roi h2,
.uno-dev h2,
.uno-specs h2,
.uno-loc h2,
.uno-launch h2,
.uno-downloads h2,
.uno-gallery h2 {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1100ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 1100ms cubic-bezier(0.22, 1, 0.36, 1);
}
.uno-residences h2.uno-h2-in,
.uno-amenities h2.uno-h2-in,
.uno-platform h2.uno-h2-in,
.uno-roi h2.uno-h2-in,
.uno-dev h2.uno-h2-in,
.uno-specs h2.uno-h2-in,
.uno-loc h2.uno-h2-in,
.uno-launch h2.uno-h2-in,
.uno-downloads h2.uno-h2-in,
.uno-gallery h2.uno-h2-in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .uno-residences h2, .uno-amenities h2, .uno-platform h2, .uno-roi h2,
  .uno-dev h2, .uno-specs h2, .uno-loc h2, .uno-launch h2,
  .uno-downloads h2, .uno-gallery h2 {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
}

/* Development gallery — hover lift + caption reveal */
.uno-gallery-tile { outline: none; }
.uno-gallery-tile:hover img { transform: scale(1.04); }
.uno-gallery-tile:hover .uno-gallery-overlay { opacity: 1; }
.uno-gallery-tile:focus-visible { outline: 2px solid #A57561; outline-offset: 2px; }

/* ROI calculator slider — black track, terracotta thumb */
.uno-roi-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: #141612;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.uno-roi-slider::-webkit-slider-runnable-track {
  height: 2px; background: #141612; border-radius: 999px;
}
.uno-roi-slider::-moz-range-track {
  height: 2px; background: #141612; border-radius: 999px;
}
.uno-roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #A57561; border: 2px solid #fbf9f4;
  margin-top: -6px; cursor: grab;
  box-shadow: 0 2px 6px rgba(20,22,18,0.25);
}
.uno-roi-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #A57561; border: 2px solid #fbf9f4; cursor: grab;
  box-shadow: 0 2px 6px rgba(20,22,18,0.25);
}

/* iOS doesn't support background-attachment: fixed reliably — fall back on touch devices */
@media (max-width: 900px), (hover: none) {
  .uno-parallax-break { background-attachment: scroll !important; }
}

/* ============ NAV PROGRESSIVE COLLAPSE ============ */
/* As the bar narrows, drop items in order: brochure → language → online-launch box */
@media (max-width: 1400px) {
  .uno-nav-cta-brochure { display: none !important; }
}
@media (max-width: 1240px) {
  .uno-nav-lang { display: none !important; }
}
@media (max-width: 1120px) {
  .uno-nav-countdown { display: none !important; }
}

/* ============ NAV OVERLAP GUARD (≤1280px) ============ */
@media (max-width: 1280px) {
  /* Tighten spacing before the links can collide with the right-side controls */
  .uno-nav { gap: 16px !important; }
  .uno-nav nav { gap: 14px !important; overflow: hidden !important; }
}

/* ============ TABLET (≤1100px) ============ */
@media (max-width: 1100px) {
  /* Generic section padding clamp */
  section, footer { padding-left: 32px !important; padding-right: 32px !important; }

  /* Nav: hide secondary links, keep brochure+reserve */
  .uno-nav { padding: 14px 24px !important; gap: 8px !important; }
  .uno-nav nav { display: none !important; }
  .uno-nav-countdown { display: none !important; }
  .uno-nav-mobile-toggle {
    display: flex !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }
  .uno-nav-cta-brochure { display: none !important; }

  /* Hero */
  .uno-hero h1 { font-size: clamp(56px, 11vw, 96px) !important; }
  .uno-hero-bottom { padding: 0 32px !important; flex-direction: column !important; gap: 24px !important; align-items: flex-start !important; }
  .uno-hero-countdown { gap: 20px !important; }

  /* Intro: stack the sticky eyebrow above the body */
  .uno-intro-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .uno-intro-grid > div:first-child { position: static !important; }
  .uno-intro-body { grid-template-columns: 1fr !important; gap: 28px !important; }

  /* Residences: full-bleed image stays edge-to-edge; tighten content column */
  .uno-residence-card > div:last-child {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    padding: 40px 24px 0 !important;
  }
  .uno-residence-stats { grid-template-columns: repeat(2, 1fr) !important; }
  /* Hero image edge-to-edge on phone — fills the full screen width with minimal crop */
  .uno-residence-card .uno-parallax-image-wrap {
    aspect-ratio: 16 / 9 !important;
  }
  .uno-residence-card .uno-parallax-image-wrap > div {
    top: 0 !important;
    bottom: 0 !important;
  }
  .uno-residence-card .uno-parallax-image-wrap img {
    object-fit: cover !important;
  }
  .uno-residence-card { padding-left: 0 !important; padding-right: 0 !important; }
  .uno-residence-card > div:first-child { margin: 0 !important; }

  /* Platform 3 cards → 1 column on tablet */
  .uno-platform-grid { grid-template-columns: 1fr !important; gap: 32px !important; }

  /* ROI: inputs over outputs */
  .uno-roi-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .uno-roi-outputs { grid-template-columns: repeat(2, 1fr) !important; }

  /* Developer */
  .uno-dev-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .uno-dev-projects { grid-template-columns: repeat(2, 1fr) !important; }

  /* Gallery — 2 cols on tablet */
  .uno-gallery-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .uno-gallery-header { grid-template-columns: 1fr !important; gap: 32px !important; align-items: start !important; }

  /* Location */
  .uno-loc-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .uno-loc-map { min-height: 420px !important; }
  /* Don't pin the description column — it ends up hovering over the POI list */
  .uno-loc-preview { position: static !important; top: auto !important; }

  /* Downloads */
  .uno-downloads-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Footer */
  .uno-footer-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 32px !important; }
}

/* ============ PHONE (≤760px) ============ */
@media (max-width: 760px) {
  section, footer { padding-left: 20px !important; padding-right: 20px !important; }
  section { padding-top: 80px !important; padding-bottom: 80px !important; }

  /* Feature video — edge to edge, no padding, keep 16:9 so the film isn't letterboxed */
  .uno-video-section { padding: 0 !important; }
  .uno-video-section > div { aspect-ratio: 16 / 9 !important; }

  /* Residences — simplify the meta line: just "22 available" / "4 available" */
  .uno-residence-meta .uno-rm-type,
  .uno-residence-meta .uno-rm-size,
  .uno-residence-meta .uno-rm-sep { display: none !important; }

  /* Nav */
  .uno-nav { padding: 12px 16px !important; }
  .uno-nav-cta-brochure { display: none !important; }
  .uno-nav-countdown { display: none !important; }
  .uno-nav a.uno-logo { font-size: 18px !important; letter-spacing: 4px !important; }

  /* Hero — break absolute layout, restack as flex column with breathing room */
  .uno-hero {
    min-height: 0 !important; height: auto !important;
    padding: 140px 0 56px !important;
    /* Replace the JS parallax with a static background so the image
       actually shows on mobile (the absolute layers are hidden below). */
    background-image:
      linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.15) 30%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0.7) 100%),
      url("media/hero-v4.jpg") !important;
    background-size: cover !important;
    background-position: center !important;
    background-color: transparent !important;
    background-repeat: no-repeat !important;
  }
  /* Hide the JS parallax layer (1st child) and the dark gradient overlay (2nd child) */
  .uno-hero > div:nth-child(1),
  .uno-hero > div:nth-child(2) { display: none !important; }
  /* Promote the content block (3rd child) into normal flow */
  .uno-hero > div:nth-child(3) {
    position: relative !important; inset: auto !important;
    padding: 0 24px !important;
    transform: none !important; opacity: 1 !important;
  }
  .uno-hero-eyebrow { font-size: 9px !important; letter-spacing: 3px !important; margin-bottom: 16px !important; padding: 0 16px !important; opacity: 1 !important; transform: none !important; transition: none !important; }
  .uno-hero h1 { font-size: clamp(48px, 14vw, 72px) !important; }
  .uno-hero-sub { font-size: 16px !important; margin-top: 20px !important; padding: 0 8px !important; }
  .uno-hero-cta { margin-top: 28px !important; padding: 14px 24px !important; font-size: 10px !important; }
  /* Keep the hero one viewport tall; full image width shown (no side crop) */
  .uno-hero { height: 100vh !important; min-height: 560px !important; padding-bottom: 0 !important; aspect-ratio: auto !important; }
  .uno-hero-bottom {
    position: absolute !important;
    bottom: 28px !important; left: 0 !important; right: 0 !important;
    margin-top: 0 !important;
    padding: 0 24px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 18px !important;
    /* Show immediately on mobile — no entrance delay/animation */
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .uno-hero-bottom > div:first-child { font-size: 9px !important; }
  .uno-hero-bottom > div:first-child > div:last-child { font-size: 16px !important; }
  .uno-hero-countdown { gap: 20px !important; align-self: stretch !important; justify-content: space-between !important; order: 2 !important; }
  .uno-hero-countdown > div > div:first-child { font-size: 32px !important; }
  .uno-hero-countdown > div > div:last-child { font-size: 9px !important; letter-spacing: 2px !important; }
  /* Eyebrow: drop out of absolute-centre into normal flow, last in column, no overlap */
  .uno-hero-bottom > div:first-child { order: 0 !important; }
  .uno-hero-eyebrow {
    position: static !important;
    left: auto !important; bottom: auto !important;
    transform: none !important;
    align-self: center !important;
    order: 3 !important;
    margin-top: 8px !important;
    white-space: normal !important;
    text-align: center !important;
  }

  /* Parallax break image: full width, whole image visible (no crop) on phone.
     Exclude the specs section, which only borrows the class for its bg image. */
  .uno-parallax-break:not(.uno-specs) {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 2000 / 1116 !important;
    background-size: cover !important;
  }

  /* Intro */
  .uno-intro h2 { font-size: clamp(34px, 8vw, 48px) !important; }

  /* Residences */
  .uno-residences h2 { font-size: clamp(36px, 9vw, 56px) !important; }
  /* Full-bleed image: cancel the section's 20px side padding so it touches both edges */
  .uno-residences { padding-left: 0 !important; padding-right: 0 !important; }
  .uno-residences > div:first-child { padding-left: 20px !important; padding-right: 20px !important; }
  .uno-residence-card > div:last-child {
    padding: 32px 20px 0 !important;
    gap: 24px !important;
  }
  .uno-residence-card h3 {
    font-size: clamp(36px, 10vw, 48px) !important;
    letter-spacing: -0.02em !important;
  }
  .uno-residence-card p {
    margin-top: 16px !important;
    font-size: 14.5px !important;
    line-height: 1.6 !important;
  }
  .uno-residence-stats {
    gap: 12px !important;
    margin-top: 0 !important;
  }
  .uno-residence-stats > div > div:first-child { font-size: 9px !important; }
  .uno-residence-stats > div > div:last-child { font-size: 20px !important; }
  .uno-residence-pricing {
    margin-top: 24px !important;
    padding-top: 20px !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
  }
  .uno-residence-pricing > div:first-child { flex: 1 1 auto; }
  .uno-residence-pricing .uno-residence-cta {
    margin-left: 0 !important;
    width: 100% !important;
    text-align: center !important;
    padding: 16px 24px !important;
  }

  /* Amenities — already a horizontal scroll, just trim section title */
  .uno-amenities h2 { font-size: clamp(36px, 9vw, 56px) !important; }
  /* Force the header visible on mobile (the scroll-reveal observer can miss it in the mobile fallback) */
  .uno-amenities h2, .uno-amenities-header { opacity: 1 !important; transform: none !important; }
  .uno-amenities { padding-top: 96px !important; }

  /* Amenities header — stack like 01 Welcome (eyebrow → sage rule → h2 → paragraph) */
  .uno-amenities-header {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    align-items: start !important;
    margin-bottom: 40px !important;
  }
  .uno-amenities-rule { display: block !important; }

  /* Platform */
  .uno-platform h2 { font-size: clamp(34px, 8vw, 48px) !important; }
  .uno-platform-image { display: none !important; }

  /* ROI */
  .uno-roi h2 { font-size: clamp(34px, 8vw, 48px) !important; }
  .uno-roi-outputs { grid-template-columns: 1fr !important; }
  .uno-roi-output-value { font-size: 32px !important; }

  /* Developer */
  .uno-dev h2 { font-size: clamp(34px, 8vw, 48px) !important; }
  .uno-dev-projects { grid-template-columns: 1fr !important; }
  .uno-dev-team-img { aspect-ratio: 4/3 !important; object-position: center 10% !important; }
  .uno-dev-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; }

  /* Gallery on phone — singles, edge to edge */
  .uno-gallery { padding: 80px 20px !important; }
  .uno-gallery h2 { font-size: clamp(34px, 8vw, 48px) !important; }
  .uno-gallery-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .uno-dev-stats > div { min-width: 0 !important; }

  /* Specs (full-bleed image card) */
  .uno-specs { background-attachment: scroll !important; padding-top: 80px !important; padding-bottom: 80px !important; }
  .uno-specs h2 { font-size: clamp(28px, 7vw, 40px) !important; }
  .uno-specs-list { grid-template-columns: 1fr 1fr !important; }
  .uno-specs-list > div { padding: 24px 16px !important; }
  /* Keep each measurement on a single line */
  .uno-specs-list > div > div:last-child { font-size: clamp(20px, 6.5vw, 32px) !important; white-space: nowrap !important; }
  .uno-specs-list > div > div:first-child { font-size: 9px !important; letter-spacing: 2px !important; }

  /* Location */
  .uno-loc h2 { font-size: clamp(34px, 8vw, 48px) !important; }
  .uno-loc-map { min-height: 0 !important; aspect-ratio: 4/3 !important; }
  .uno-loc-poi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  /* Hide the desktop preview image on phone — it relies on hover so it's just decoration on touch */
  .uno-loc-preview-img { display: none !important; }

  /* Downloads */
  .uno-downloads h2 { font-size: clamp(28px, 7vw, 40px) !important; }
  .uno-downloads-grid { grid-template-columns: 1fr !important; }

  /* Launch */
  .uno-launch h2 { font-size: clamp(40px, 10vw, 60px) !important; }
  .uno-launch-countdown { gap: 4px !important; }
  .uno-launch-countdown > div { padding: 0 4px !important; min-width: 0 !important; }
  .uno-launch-countdown > div > div:first-child { font-size: 36px !important; }

  /* Footer */
  .uno-footer-grid { grid-template-columns: 1fr !important; }
  .uno-footer-bottom { flex-direction: column !important; gap: 16px !important; align-items: flex-start !important; text-align: left !important; }

  /* Floating sticky countdown — hide on phone, it eats screen */
  .uno-sticky-countdown { display: none !important; }

  /* Lightbox + popup already responsive via internal media queries */
  .uno-popup-card { grid-template-columns: 1fr !important; }
  .uno-popup-img { display: none !important; }
}

/* ============ MOBILE NAV DRAWER ============ */
.uno-nav-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 18px;
  font-family: inherit;
}
.uno-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 88vw);
  background: #f5f2ec;
  color: #1a1815;
  z-index: 200;
  padding: 80px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.25);
}
.uno-nav-drawer.open { transform: translateX(0); }
.uno-nav-drawer a {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 300;
  text-decoration: none;
  color: inherit;
  padding: 14px 0;
  border-bottom: 1px solid #d9d3c5;
  letter-spacing: 0;
  text-transform: none;
}
.uno-nav-drawer a:last-child { border-bottom: none; }
.uno-nav-drawer .close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid #1a1815;
  cursor: pointer;
  font-size: 16px;
}
.uno-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20,18,15,0.55);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.uno-nav-backdrop.open { opacity: 1; pointer-events: auto; }
