﻿/* ==========================================================================
   DREAM STONE REAL ESTATE
   Responsive behaviour
   Breakpoints: 1920+ | <=1279 | <=1023 (tablet, menu) | <=767 (mobile) | <=479 | <=359
   ========================================================================== */

/* --------------------------------------------------------------------------
   Large displays (1920+)
   -------------------------------------------------------------------------- */
@media (min-width: 1920px) {
  :root {
    --container: 1680px;
    --header-h: 84px;
  }
  .brand { font-size: 1.0625rem; }
  .hpanel--project { width: min(74vw, 96rem); }
}

/* --------------------------------------------------------------------------
   Small laptop (<=1279)
   -------------------------------------------------------------------------- */
@media (max-width: 1279px) {
  .nav-list { gap: 1.25rem; }
  .header-inner { gap: 1.5rem; }
  .brand { font-size: 0.9375rem; }

  .intro-media { grid-column: 1 / span 7; }
  .intro-aside { grid-column: 8 / span 5; }

  .principles { grid-column: 7 / span 6; }
  .connect-list { grid-column: 6 / span 7; }

  .why-aside { grid-column: 1 / -1; position: static; }
  .why-index { display: none; }
  .why-list { grid-column: 1 / -1; }

  .footer-brand { grid-column: 1 / span 12; }
  .footer-col:nth-of-type(2) { grid-column: 1 / span 4; }
  .footer-col:nth-of-type(3) { grid-column: 5 / span 4; }
  .footer-col:nth-of-type(4) { grid-column: 9 / span 4; }
}

/* --------------------------------------------------------------------------
   Tablet (<=1023): mobile menu, single-axis storytelling, no pinning
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  :root {
    --header-h: 68px;
    --section: clamp(2.75rem, 6vw, 4.25rem);
  }

  .nav, .header-cta { display: none; }
  .menu-toggle { display: block; margin-left: auto; }

  /* Hero */
  .hero-foot { grid-template-columns: 1fr; align-items: start; }

  /* Intro */
  .intro-media { grid-column: 1 / -1; }
  .intro-aside { grid-column: 1 / -1; margin-top: 2.5rem; }
  .intro-aside .fact-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Horizontal projects become a vertical stack */
  .hscroll, .js .hscroll { overflow: visible; scroll-snap-type: none; }
  .hscroll-track {
    flex-direction: column;
    align-items: stretch;
    width: auto;
    min-height: 0;
    gap: clamp(1.75rem, 4vw, 2.75rem);
    padding: var(--section) var(--gutter);
    will-change: auto;
  }
  .hpanel--intro, .hpanel--end { width: 100%; }
  .hpanel--intro { max-width: 36rem; }
  .hpanel--project { width: 100%; grid-template-columns: 1fr; gap: 2rem; }
  .project-media { max-height: none; }
  .project-media img { transform: none; }
  .end-link { flex-direction: row; align-items: center; justify-content: space-between; font-size: clamp(1.75rem, 5vw, 2.5rem); }
  .end-link-box { width: 4rem; height: 4rem; }

  /* Approach */
  .approach-sticky { grid-column: 1 / -1; position: static; }
  .principles { grid-column: 1 / -1; padding-top: 3.5rem; }

  /* Process: 2x2 */
  .process-head .h2, .process-head .lead { grid-column: 1 / -1; }
  .split-text > .h2, .split-text > .h1, .split-text-body { grid-column: 1 / -1; }
  .process-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 3.5rem; }
  .process-rail { display: none; }
  .step { border-top: 1px solid var(--c-line); }

  /* Locations */
  .place-band { min-height: min(46svh, 22rem); }
  .connect-aside { grid-column: 1 / -1; position: static; }
  .connect-list { grid-column: 1 / -1; margin-top: 1.25rem; }

  /* Statement */
  .statement-grid .h1 { grid-column: 1 / -1; }
  .commitments { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }

  /* Enquiry */
  .visit-copy, .visit-form { grid-column: 1 / -1; }

  /* Inner pages */
  .page-hero .h1 { grid-column: 1 / -1; }
  .page-hero-sub { grid-column: 1 / span 9; }
  .why-intro-label, .why-intro-statement { grid-column: 1 / -1; }
  .why-intro-label { margin-top: 0; }
  .why-intro-body { grid-column: 3 / -1; }
  .split-hero-copy { grid-column: 1 / -1; }
  .split-hero-media { grid-column: 1 / -1; aspect-ratio: 16 / 11; }
  .wide-media { aspect-ratio: 16 / 9; }

  .stack-card { position: relative; top: auto; min-height: 0; row-gap: 2rem; }
  .stack-copy, .stack-media { grid-column: 1 / -1; }
  .stack-media { aspect-ratio: 16 / 10; min-height: 0; }

  .cta-split-media, .cta-split-copy { grid-column: 1 / -1; }

  /* Project detail pages */
  .project-hero--wide .split-hero-copy, .project-hero--wide .split-hero-media { grid-column: 1 / -1; }
  .project-hero .split-hero-media { max-height: 80svh; }
  .project-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 1.75rem; }
  .project-facts > div:nth-child(3n+1) { padding-left: 0; border-left: 0; }
  .amenity-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nearby-group { grid-column: span 6; }
  .project-overview > .h2, .project-overview-body { grid-column: 1 / -1; }
  .doc { grid-column: span 6; }
  .project-row-media { grid-column: 1 / span 6; }
  .project-row-body { grid-column: 7 / span 6; }
  .gallery-item:nth-child(n) { grid-column: span 6; margin-top: 0; align-self: start; }
  .gallery-item:nth-child(n) .media { aspect-ratio: 4 / 3; }
  .gallery-item:nth-child(3n+1) { grid-column: 1 / -1; }
  .gallery-item:nth-child(3n+1) .media { aspect-ratio: 16 / 9; }
  .project-videos { grid-template-columns: 1fr; row-gap: 2.5rem; }

  .feature-media, .feature--reverse .feature-media { grid-column: 1 / -1; grid-row: auto; }
  .feature-body, .feature--reverse .feature-body { grid-column: 1 / span 10; grid-row: auto; }

  .bento-cell--image { grid-column: 1 / -1; grid-row: auto; min-height: 26rem; }
  .bento-cell--tint, .bento-cell--sand { grid-column: span 6; }

  .enquiry-aside { grid-column: 1 / -1; position: static; }
  .enquiry-form { grid-column: 1 / -1; }

  .explorer-visual, .explorer-panel { grid-column: 1 / -1; }
  .explorer-panel { position: static; }

  .footer-wordmark { font-size: 18vw; }
}

/* --------------------------------------------------------------------------
   Mobile (<=767)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  :root {
    --header-h: 64px;
    --grid-gap: 1rem;
  }
  body { font-size: 1rem; }

  .brand { font-size: 0.875rem; }

  .lead { max-width: none; }

  /* Hero */
  .hero-content { padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
  .hero-title { margin-bottom: 1.5rem; }
  .hero-media img { object-position: 60% 50%; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero--page { min-height: 78vh; min-height: 78svh; }

  /* Intro */
  .intro-media { aspect-ratio: 4 / 5; }
  .intro-aside .fact-list { grid-template-columns: 1fr; }

  /* Projects */
  .spec-list div { grid-template-columns: 6.5rem 1fr; }

  /* Approach */
  .approach-media { aspect-ratio: 4 / 3; }
  .principle { grid-template-columns: 3rem minmax(0, 1fr); padding-block: 2.25rem; }

  /* Process */
  .process-steps { grid-template-columns: 1fr; row-gap: 0; }
  .step { padding-block: 2rem; display: grid; grid-template-columns: 4.5rem 1fr; column-gap: 1rem; }
  .step::before { display: none; }
  .step-num { font-size: 2.5rem; margin: 0; grid-row: span 2; }

  /* Locations */
  .connect-item { grid-template-columns: 1fr; gap: 0.35rem; padding-block: 1rem; }
  .hero {
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
  }
  .enquiry-form, .visit-form { padding-bottom: 4.5rem; }
  .connect-item .meta { padding-top: 0; }

  /* Statement */
  .commitments { grid-template-columns: 1fr; }

  /* Forms */
  .form-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .form-submit-row .btn { width: 100%; }

  /* Inner pages */
  .page-hero-sub { grid-column: 1 / -1; }
  .why-intro-body { grid-column: 1 / -1; }
  .why-list { grid-template-columns: 1fr; }
  .why-item { padding-block: 2rem 2.5rem; }
  .why-num { font-size: 3.25rem; margin-bottom: 1.25rem; }
  .wide-media { aspect-ratio: 4 / 3; }
  .split-hero-media { aspect-ratio: 4 / 5; }
  .feature-body, .feature--reverse .feature-body { grid-column: 1 / -1; }
  .stack-card { padding: 1.75rem 1.5rem; }
  .bento-cell--tint, .bento-cell--sand { grid-column: 1 / -1; min-height: 0; }
  .bento-cell--image { min-height: 22rem; }
  .duo-item { grid-column: 1 / -1; }

  /* Project detail pages */
  .project-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-facts > div:nth-child(n) { padding-left: 1.25rem; border-left: 1px solid var(--c-line); }
  .project-facts > div:nth-child(2n+1) { padding-left: 0; border-left: 0; }
  .amenity-list { grid-template-columns: 1fr; }
  .nearby-group, .doc { grid-column: 1 / -1; }
  .project-row-media, .project-row-body { grid-column: 1 / -1; }
  .gallery-item:nth-child(n), .gallery--docs .gallery-item:nth-child(n) { grid-column: 1 / -1; }
  .gallery-item:nth-child(n) .media { aspect-ratio: 4 / 3; }
  .gallery--docs .gallery-item:nth-child(n) .media { aspect-ratio: 1638 / 1158; }
  .explore-link .end-link-box { width: 3rem; height: 3rem; }

  /* Explorer */
  .floor-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-card .spec-list div { grid-template-columns: 7rem 1fr; }

  /* Compare table stacks into rows of labelled values */
  .compare { min-width: 0; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compare tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.25rem; border-top: 1px solid var(--c-line); padding-block: 1.25rem; }
  .compare tbody th { grid-column: 1 / -1; width: auto; padding: 0 0 0.75rem; border: 0; }
  .compare td { width: auto; padding: 0; border: 0; font-size: 0.9375rem; }
  .compare td::before { content: attr(data-label); display: block; margin-bottom: 0.35rem; font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-ink); }

  /* Footer */
  .footer-cta { flex-direction: column; align-items: flex-start; }
  .footer-col:nth-of-type(2), .footer-col:nth-of-type(3) { grid-column: span 6; }
  .footer-col:nth-of-type(4) { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; }
}

/* --------------------------------------------------------------------------
   Small phones (<=479)
   -------------------------------------------------------------------------- */
@media (max-width: 479px) {
  .btn { padding-inline: 1.25rem; }
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .link-arrow { align-self: flex-start; }
  .hero-actions { flex-direction: column; align-items: stretch; }

  .commitments, .intro-aside .fact-list { gap: 1.5rem; }
  .floor-list { grid-template-columns: 1fr 1fr; }
  .floor-btn { flex-direction: column; align-items: flex-start; gap: 0; }
}

/* --------------------------------------------------------------------------
   Very small phones (<=359, e.g. 320px)
   -------------------------------------------------------------------------- */
@media (max-width: 359px) {
  :root { --gutter: 1rem; }
  .brand { font-size: 0.8125rem; }
  .btn { font-size: 0.75rem; letter-spacing: 0.06em; }
  .spec-list div, .unit-card .spec-list div { grid-template-columns: 1fr; gap: 0.125rem; }
  .footer-col:nth-of-type(2), .footer-col:nth-of-type(3) { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   Short landscape screens: keep hero content visible
   -------------------------------------------------------------------------- */
@media (max-height: 560px) and (orientation: landscape) {
  .hero, .hero--page { min-height: 0; }
  .hero-content { padding-top: calc(var(--header-h) + 2.5rem); }
  .hero-title { font-size: clamp(2rem, 6vw, 3.25rem); }
}

/* --------------------------------------------------------------------------
   Gallery and testimonials
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) and (max-width: 1320px) {
  .header-inner { gap: 1.15rem; }
  .nav-list { gap: 0.8rem; }
  .nav-link { font-size: 0.8125rem; }
  .header-cta { padding-inline: 0.85rem; }
}
@media (max-width: 1023px) {
  .story-hero-copy { grid-column: 1 / -1; }
  .folio-item--xl,
  .folio-item--lg,
  .folio-item--md { grid-column: span 6; }
  .folio-item--lg .media,
  .folio-item--md .media,
  .folio-item--xl .media { aspect-ratio: 4 / 3; }
  .folio-item--cinema .media { aspect-ratio: 16 / 9; }
  .story--wide,
  .story--narrow { grid-column: span 6; }
  .story--offset { margin-top: 0; }
  .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox-stage { grid-template-columns: minmax(0, 1fr); }
  .lightbox-nav { position: absolute; bottom: 5.5rem; }
  .lightbox-stage { position: relative; }
  .lightbox-nav--prev { left: 1rem; }
  .lightbox-nav--next { right: 1rem; }
}
@media (max-width: 767px) {
  .scroll-cue { display: none; }
  .folio-item--xl,
  .folio-item--lg,
  .folio-item--md,
  .folio-item--cinema { grid-column: 1 / -1; }
  .folio-item--xl .media,
  .folio-item--lg .media,
  .folio-item--md .media { aspect-ratio: 4 / 3; }
  .folio-item--cinema .media { aspect-ratio: 3 / 2; }
  .story-feature { max-width: none; }
  .story--wide,
  .story--narrow { grid-column: 1 / -1; }
  .trust-grid { grid-template-columns: 1fr; }
  .lightbox { padding: 0.75rem; }
  .lightbox-frame img { max-height: 62vh; }
  .lightbox-nav, .lightbox-close { width: 2.75rem; height: 2.75rem; }
  .home-folio { grid-template-columns: 1fr 1fr; }
  .home-folio-item--feature { grid-column: 1 / -1; grid-row: auto; }
  .home-folio-item--feature .media { aspect-ratio: 16 / 10; height: auto; min-height: 0; }
  .process-list { grid-template-columns: 1fr; }
  .process-step { border-right: 0; border-bottom: 1px solid var(--c-line); padding-right: 0; }
}
@media (max-width: 1023px) and (min-width: 768px) {
  .process-list { grid-template-columns: 1fr 1fr; }
  .process-step { border-bottom: 1px solid var(--c-line); }
  .home-folio { grid-template-columns: 1fr 1fr; }
  .home-folio-item--feature { grid-column: 1 / -1; grid-row: auto; }
  .home-folio-item--feature .media { aspect-ratio: 16 / 10; height: auto; }
}

/* --------------------------------------------------------------------------
   Reduced motion: no transitions that move content, no smooth scrolling
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .curtain { display: none; }
  .menu-link, .menu-foot { transform: none; }
  .media [data-parallax] { top: 0; bottom: 0; }
  .project-media img { transform: none; }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .menu, .curtain, .footer-wordmark, .hero-scrim, .wa-float { display: none !important; }
  .hero { min-height: 0; color: var(--c-ink); background: none; }
  .hero-media { position: static; }
  body { background: #fff; }
}
