/* ==========================================================================
   Estiva — Responsive Breakpoints
   Targets: 320 / 375 / 390 / 414 / 768 / 1024 / 1280 / 1440 / 1600 / 1920
   ========================================================================== */

/* —— Large desktops: keep airy side padding, no column cap —— */
@media (min-width: 1600px) {
  :root {
    --page-pad-x: clamp(1.75rem, 2.5vw, 3.5rem);
  }
}

@media (min-width: 1920px) {
  :root {
    --page-pad-x: clamp(2rem, 3vw, 4rem);
  }
}

/* —— Tablet landscape / small desktop (≤1280) —— */
@media (max-width: 1280px) {
  .amenities__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .specs__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .investment__visual {
    left: 34%;
    right: 1%;
    top: 8%;
    bottom: 6%;
  }

  .investment__visual picture {
    width: 100%;
    max-width: 40rem;
    margin: 0;
  }

  .split__panel {
    padding: clamp(3rem, 2.5rem + 2vw, 5rem) clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
  }
}

/* —— Tablet (≤1024) —— */
@media (max-width: 1024px) {
  .nav__links {
    gap: 1rem;
  }

  .nav__anchor {
    font-size: 0.9375rem;
  }

  .amenities__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .specs__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process__layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .process__title {
    position: static;
    max-width: 18ch;
  }

  .process__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process__item-inner {
    min-height: 9.5rem;
    padding: 1.25rem 1.15rem 1.15rem;
  }

  .scenario__board {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact__panel {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .contact__primary {
    grid-template-columns: 1fr 1fr;
  }

  .about__intro {
    grid-template-columns: 1fr;
    row-gap: 1rem;
    min-width: 0;
  }

  .about__lead,
  .pricing__details-text {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
  }

  .about__lead {
    font-size: clamp(1.125rem, 1.05rem + 0.5vw, 1.35rem);
    line-height: 1.45;
    letter-spacing: -0.01em;
  }

  .pricing__panel {
    padding: 2rem 1.5rem;
  }

  .pricing__details {
    grid-template-columns: 1fr;
    row-gap: 0.65rem;
  }

  .scenario {
    padding: 1.25rem 1rem 1.4rem;
    gap: 1.35rem;
  }

  .scenario__controls {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .scenario__control {
    padding: 0.9rem 0.95rem 0.75rem;
  }

  .scenario__control-top {
    grid-template-columns: minmax(0, 1fr) 4.25rem;
    column-gap: 0.6rem;
  }

  .scenario__value {
    width: 4.25rem;
    font-size: 1.05rem;
  }

  .scenario__range {
    height: 2.25rem;
  }

  .scenario__board {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .scenario__chart {
    min-height: 14rem;
  }

  .scenario__metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
  }

  .scenario__metric:not(.scenario__metric--payback) {
    padding: 0.85rem 0;
  }

  .scenario__metric:nth-child(1),
  .scenario__metric:nth-child(2) {
    border-bottom: 1px solid rgba(54, 55, 50, 0.12);
  }

  .scenario__metric:nth-child(3) {
    border-bottom: none;
  }

  .scenario__metrics .scenario__metric--payback {
    grid-column: 1 / -1;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    padding: 1.15rem 1.2rem 1.2rem;
  }

  .scenario__metric-value {
    font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  }

  .faq__header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .faq__list {
    width: 100%;
    margin-left: 0;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .investment__visual {
    left: 30%;
    right: 0;
    top: 10%;
    bottom: 8%;
  }

  .investment__visual picture {
    width: 100%;
    max-width: 34rem;
    margin: 0;
    opacity: 1;
  }

  .management__media {
    min-height: clamp(22rem, 70vw, 32rem);
  }

  .management__content {
    gap: 2rem;
    padding: clamp(2.5rem, 8vw, 4rem) clamp(1.25rem, 4vw, 2rem);
  }

  .split__grid {
    grid-template-columns: 1fr;
  }

  .split__media {
    min-height: 0;
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: 9 / 16;
    max-height: none;
    margin-inline: 0;
    order: -1;
    container-type: normal;
    background: #000;
  }

  .split__embed {
    /* Keep the full 9:16 frame — do not cover-crop on mobile */
    overflow: hidden;
  }

  .split__iframe {
    inset: 0;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    max-width: none;
    max-height: none;
  }

  .split__panel {
    padding: clamp(2.5rem, 5vw, 4rem) clamp(1.25rem, 4vw, 2rem) clamp(2rem, 4vw, 3rem);
  }

  .split__title {
    max-width: none;
  }

  .location__grid {
    grid-template-columns: 1fr;
  }

  .location__media {
    min-height: clamp(14rem, 42vw, 22rem);
    order: -1;
  }

  .location__panel {
    padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 1.75rem);
  }

  .location__title {
    max-width: none;
  }

  .gallery__slide {
    aspect-ratio: 3 / 2;
  }

  .testimonials__header {
    align-items: center;
    text-align: center;
    max-width: 22rem;
    margin-inline: auto;
  }

  .testimonials__trust {
    justify-content: center;
  }

  .testimonials__set,
  .testimonials__track {
    gap: 1rem;
  }

  .testimonials__card {
    width: min(20rem, 85vw);
    min-height: min(21rem, 88vw);
  }
}

/* —— Tablet portrait (≤768) —— */
@media (max-width: 768px) {
  :root {
    --page-pad-x: 1.15rem;
    --section-gap: 1.15rem;
    /* Keep desktop type scale — only layout/spacing changes below */
  }

  .heading-1,
  .heading-2,
  .heading-2-serif,
  .heading-3,
  .heading-4 {
    max-width: 100%;
    overflow-wrap: break-word;
    text-wrap: balance;
  }

  .site-header {
    --header-height: 4.25rem;
    height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    padding-inline: 1.15rem;
  }

  .site-header.is-scrolled {
    background: rgba(245, 243, 239, 0.96);
  }

  /* Keep header transition continuous when menu opens (no backdrop-filter pop) */
  body.nav-open .site-header {
    background: rgba(245, 243, 239, 0.98);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    border-bottom-color: rgba(54, 55, 50, 0.08);
    box-shadow: 0 8px 28px rgba(32, 33, 30, 0.06);
  }

  .nav {
    display: flex;
    justify-content: space-between;
  }

  .logo__wordmark {
    font-size: 0.9375rem;
  }

  .nav__links,
  .nav__cta {
    display: none;
  }

  .nav__toggle {
    display: inline-flex;
    position: relative;
    z-index: 120;
  }

  .site-header.is-scrolled .nav__toggle,
  body.nav-open .nav__toggle {
    background: #fff;
    border-color: rgba(54, 55, 50, 0.12);
    color: var(--color-dark);
  }

  .site-header.is-scrolled .logo,
  body.nav-open .logo {
    color: var(--color-dark);
  }

  .nav__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(32, 33, 30, 0.48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.28s var(--ease-out),
      visibility 0.28s;
  }

  .nav__backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav__backdrop[hidden] {
    display: none;
  }

  .nav__backdrop.is-open[hidden] {
    display: block;
  }

  .nav__sheet {
    display: block;
    position: fixed;
    top: calc(4.25rem + env(safe-area-inset-top, 0px) + 0.5rem);
    left: 1rem;
    right: 1rem;
    z-index: 120;
    max-height: min(70vh, 32rem);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 16px 48px rgba(32, 33, 30, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.4rem);
    pointer-events: none;
    transition:
      opacity 0.28s var(--ease-out),
      transform 0.28s var(--ease-out),
      visibility 0.28s;
  }

  .nav__sheet.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav__sheet[hidden] {
    display: none;
  }

  .nav__sheet.is-open[hidden] {
    display: block;
  }

  .nav__sheet-inner {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 1rem 0.85rem 1.1rem;
  }

  .nav__sheet-label {
    margin: 0;
    padding: 0.35rem 0.75rem 0.55rem;
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .nav__sheet-label--spaced {
    margin-top: 0.65rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(54, 55, 50, 0.1);
  }

  .nav__sheet-link {
    display: flex;
    align-items: center;
    min-height: 2.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    color: var(--color-dark);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s var(--ease-out);
  }

  .nav__sheet-link--quiet {
    font-weight: 500;
    color: var(--text-secondary);
  }

  .nav__sheet-link:hover,
  .nav__sheet-link:focus-visible {
    background: rgba(54, 55, 50, 0.06);
  }

  .about {
    gap: 1.5rem;
    padding-block: 0;
  }

  .about__label {
    margin: 0;
  }

  .specs {
    gap: 1.2rem;
  }

  .specs__header {
    gap: 0.5rem;
  }

  .specs__title {
    max-width: none;
  }

  .specs__lead {
    max-width: none;
  }

  .specs__item {
    gap: 0.35rem;
    padding: 0.9rem 1.05rem;
  }

  .specs__label {
    color: rgba(54, 55, 50, 0.55);
  }

  .investment {
    min-height: 0;
    padding: 2rem 1.25rem;
  }

  .investment__content {
    gap: 1.35rem;
    width: 100%;
    max-width: none;
  }

  .investment__content .heading-2 {
    max-width: none;
  }

  .split__panel {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  .split__inner {
    gap: 1.35rem;
  }

  .split__top {
    gap: 0.95rem;
    width: 100%;
    min-width: 0;
  }

  .split__title {
    max-width: none;
  }

  .split__rating {
    align-self: stretch;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    border-radius: 14px;
    padding: 0.7rem 0.85rem 0.7rem 0.7rem;
  }

  .split__rating-text {
    flex: 1;
    font-size: 0.8125rem;
  }

  .process__title {
    max-width: none;
  }

  .contact__title {
    max-width: none;
  }

  #about,
  #specs,
  #pricing,
  #contact,
  #split,
  #process,
  #investment {
    scroll-margin-top: calc(var(--header-height, 4.25rem) + 0.75rem);
  }

  .hero {
    width: calc(100% + 2 * var(--page-pad-x));
    margin-inline: calc(-1 * var(--page-pad-x));
    min-height: 0;
    height: auto;
    padding: 0;
    justify-content: flex-start;
    background: #2c2d29;
  }

  /* Clear photo band — shorter so next content is visible (~60vh) */
  .hero__media {
    position: relative;
    inset: auto;
    width: 100%;
    height: min(58vh, 19.5rem);
    min-height: 13.5rem;
    max-height: 19.5rem;
    aspect-ratio: auto;
    flex-shrink: 0;
  }

  .hero__media-inner {
    inset: 0;
    transform: none;
  }

  .hero__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 46% 40%;
    image-rendering: auto;
  }

  .hero__overlay {
    background:
      linear-gradient(
        180deg,
        rgba(32, 33, 30, 0.42) 0%,
        rgba(32, 33, 30, 0.08) 28%,
        rgba(32, 33, 30, 0.05) 62%,
        rgba(32, 33, 30, 0.55) 100%
      );
  }

  /* Solid text panel = proper backdrop under copy */
  .hero__content {
    position: relative;
    z-index: 3;
    gap: 1.1rem;
    width: 100%;
    margin: 0;
    padding: 1.35rem 1.25rem 1.65rem;
    background:
      linear-gradient(
        180deg,
        rgba(44, 45, 41, 0.97) 0%,
        #2c2d29 28%,
        #262722 100%
      );
  }

  .hero__text {
    gap: 0.7rem;
    max-width: none;
  }

  .hero__text .heading-1 {
    font-size: clamp(2rem, 6.5vw, 2.5rem);
  }

  .hero__title-line {
    white-space: normal;
  }

  .hero__text .body-l {
    font-size: var(--fs-body-m);
    max-width: none;
    opacity: 0.92;
  }

  .hero__stats {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding-top: 1rem;
  }

  .hero__stat--end {
    text-align: right;
    align-items: flex-end;
    margin-left: 0;
  }

  .amenities__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery__slide {
    aspect-ratio: 4 / 3;
    border-radius: 14px;
  }

  .gallery__controls {
    margin-top: 0.85rem;
  }

  .gallery__nav {
    width: 2.75rem;
    height: 2.75rem;
  }

  .gallery__pagination .swiper-pagination-bullet {
    width: 0.55rem;
    height: 0.55rem;
  }

  .showcase {
    width: calc(100% + 2 * var(--page-pad-x));
    margin-inline: calc(-1 * var(--page-pad-x));
    height: min(64vh, 30rem);
    min-height: 18.5rem;
    border-radius: 0;
  }

  .showcase__panel {
    gap: 0.85rem;
    width: 100%;
    padding: 1.15rem 0 1.25rem;
    padding-left: var(--page-pad-x);
  }

  .showcase__caption {
    font-size: 1.05rem;
    padding-right: var(--page-pad-x);
  }

  .showcase__selector {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding-right: var(--page-pad-x);
  }

  .showcase__selector::-webkit-scrollbar {
    display: none;
  }

  .showcase__tabs {
    display: inline-flex;
    width: max-content;
    max-width: none;
    gap: 0.2rem;
    padding: 0.4rem;
  }

  .showcase__tab {
    flex: 0 0 auto;
    padding: 0.8rem 1.2rem;
    min-height: 2.75rem; /* 44px tap target */
    font-size: 0.875rem;
    white-space: nowrap;
  }

  .ph-trigger {
    width: 2.75rem; /* 44px */
    height: 2.75rem;
  }

  .ph-trigger-spot {
    width: 1.9rem;
    height: 1.9rem;
  }

  .ph-tip {
    width: min(14rem, 78vw);
  }

  .view360__frame {
    aspect-ratio: 4 / 3;
    min-height: 18rem;
    border-radius: 14px;
  }

  .view360__start {
    min-height: 2.75rem;
    padding: 0.7rem 1.35rem;
    font-size: 0.9375rem;
  }

  .pricing__panel {
    padding: 1.75rem 1.25rem;
    gap: 1.5rem;
  }

  .pricing__amount {
    font-size: clamp(2.35rem, 1.6rem + 6vw, 3.25rem);
  }

  .investment__visual {
    display: none;
  }

  .process__grid {
    grid-template-columns: 1fr;
  }

  .process__item-inner {
    min-height: 8.5rem;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
  }

  .process__value {
    font-size: 2.5rem;
  }

  .process__label {
    max-width: 14em;
    text-align: right;
  }

  .faq-trigger {
    gap: 1rem;
    padding: 1.15rem 1.15rem;
  }

  .faq-answer {
    padding: 0 3.5rem 1.15rem 1.15rem;
  }

  .contact__panel {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding: 1.75rem 1.25rem;
  }

  .contact__primary {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .contact__quick {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .contact__chip {
    font-size: 0.8125rem;
  }

  .contact__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .contact__submit {
    width: 100%;
  }

  .contact__title {
    max-width: none;
  }

  .contact__lead {
    max-width: none;
  }

  .site-footer__links {
    flex-direction: column;
    gap: 0.85rem;
  }

  .site-footer__link {
    font-size: clamp(1.65rem, 7vw, 2rem);
  }

  .management__content {
    max-width: none;
  }
}

/* —— Phones only (≤640): compact type, not applied to desktop/tablet —— */
@media (max-width: 640px) {
  :root {
    --fs-h1: clamp(1.85rem, 1.55rem + 1.5vw, 2.25rem);
    --fs-h2: clamp(1.75rem, 1.5rem + 1.2vw, 2rem); /* ≈28–32px */
    --fs-h2-serif: clamp(1.75rem, 1.5rem + 1.2vw, 2.125rem);
    --fs-h3: clamp(1.25rem, 1.15rem + 0.6vw, 1.5rem);
    --lh-heading: 1.12;
  }

  .specs__lead {
    font-size: 0.9375rem;
    line-height: 1.45;
  }

  .specs__item {
    gap: 0.28rem;
    padding: 0.8rem 1rem;
  }

  .specs__label {
    font-size: 0.75rem;
    letter-spacing: 0.03em;
  }

  .specs__value {
    font-size: 1rem;
  }
}

/* —— Large phones (≤414) —— */
@media (max-width: 414px) {
  .amenities__grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .specs__grid {
    grid-template-columns: 1fr;
  }

  .card--amenity {
    padding: 1rem;
  }

  .hero__content {
    gap: 1.15rem;
  }

  .management__content {
    gap: 1.5rem;
    padding-block: 2.5rem;
  }

  .split__media {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
  }

  .split__panel {
    padding: 1.5rem 1.15rem 1.35rem;
  }

  .btn--accent .btn__arrow {
    display: none;
  }

  .btn--accent:hover .btn__track,
  .btn--accent:focus-visible .btn__track {
    transform: none;
  }

  .btn--accent .btn__clip {
    height: auto;
  }

  .btn--accent .btn__track {
    display: block;
  }

  .btn--accent .btn__row:last-child {
    display: none;
  }
}

/* —— Small phones (≤375 / 320) —— */
@media (max-width: 375px) {
  :root {
    --page-pad-x: 1rem;
    --page-pad-y: 0.75rem;
    --fs-h2: 1.75rem; /* 28px on small phones only */
  }

  .hero__media {
    height: min(54vh, 17.5rem);
    max-height: 17.5rem;
  }

  .amenities__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .btn--primary {
    width: 100%;
  }

  .split__panel {
    padding: 1.35rem 1rem 1.25rem;
  }
}

/* —— Prevent horizontal overflow on all sizes —— */
@media (max-width: 320px) {
  .page {
    padding-inline: 0.625rem;
  }

  .heading-1,
  .heading-2,
  .heading-2-serif {
    word-break: break-word;
  }
}

/* —— Safe area for notched devices —— */
@supports (padding: max(0px)) {
  .page {
    padding-left: max(var(--page-pad-x), env(safe-area-inset-left));
    padding-right: max(var(--page-pad-x), env(safe-area-inset-right));
  }
}
