/* 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: hidden; max-width: 100vw; }

/* 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; }
}

/* ============ 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-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: stack image + copy */
  .uno-residence-card { grid-template-columns: 1fr !important; gap: 32px !important; }
  .uno-residence-card > div:first-child { order: 1 !important; }
  .uno-residence-card > div:last-child { order: 2 !important; padding: 0 !important; }
  .uno-residence-stats { grid-template-columns: repeat(2, 1fr) !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; }

  /* 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 top/bottom padding */
  .uno-video-section { padding: 0 !important; }
  .uno-video-section > div { aspect-ratio: 4 / 5 !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 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("https://framerusercontent.com/images/6csN5FJQGMYETsAbTkXeL49IE.jpg?width=1600") !important;
    background-size: cover !important;
    background-position: center !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; }
  .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; }
  .uno-hero-bottom {
    position: relative !important;
    bottom: auto !important; left: auto !important; right: auto !important;
    margin-top: 56px !important;
    padding: 0 24px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 28px !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; }
  .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; }

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

  /* Residences */
  .uno-residences h2 { font-size: clamp(36px, 9vw, 56px) !important; }
  .uno-residence-card h3 { font-size: 44px !important; }
  .uno-residence-card .uno-residence-cta { width: 100% !important; text-align: center !important; }
  .uno-residence-pricing { flex-wrap: wrap !important; }

  /* Amenities — already a horizontal scroll, just trim section title */
  .uno-amenities h2 { font-size: clamp(36px, 9vw, 56px) !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; }
  .uno-dev-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; }

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

  /* Specs (full-bleed image card) */
  .uno-specs h2 { font-size: clamp(28px, 7vw, 40px) !important; }
  .uno-specs-list { grid-template-columns: 1fr !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; }

  /* 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; }
