/* =========================================================
   Sabrina Residences — landing page
   ========================================================= */

/* STEP 1 — fonts & base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: "Archivo", system-ui, sans-serif;
  color: #fff;
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
}

p,
h1,
h2 {
  margin: 0;
}

/* STEP 2 — page background wrapping both sections */
.page {
  position: relative;
  background-image:
    radial-gradient(40% 18% at 30% 12%, rgba(120, 170, 255, .35), rgba(120, 170, 255, 0) 70%),
    radial-gradient(35% 14% at 78% 26%, rgba(130, 175, 255, .28), rgba(130, 175, 255, 0) 70%),
    radial-gradient(30% 10% at 55% 3%, rgba(110, 160, 255, .3), rgba(110, 160, 255, 0) 70%),
    linear-gradient(180deg, #1150ef 0%, #135af3 30%, #3c7af6 52%, #76a2fa 64%, #86acfb 70%, #b9cffd 84%, #ffffff 100%);
}

.gridlines {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.gl {
  position: absolute;
  top: 0;
  height: 100%;
  width: 1px;
  background: rgba(255, 255, 255, .28);
  transform-origin: top center;
  animation: lineGrow 1.6s cubic-bezier(.65, 0, .35, 1) var(--gdel, 0s) backwards;
}

@keyframes lineGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

/* =========================================================
   STEP 3 — hero
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(760px, 75vw, 1300px);
  display: flex;
  flex-direction: column;
}

.house {
  position: absolute;
  right: 4.8vw;
  bottom: 0;
  width: max(83vw, 640px);
  height: auto;
  z-index: 1;
  animation: houseRise 4.2s cubic-bezier(.22, .61, .24, 1) .2s backwards;
}

@keyframes houseRise {
  0%   { opacity: 0; transform: translateY(70%) scale(1.06); }
  25%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   STEP 4 — header / nav
   ========================================================= */
.nav {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 24px clamp(16px, 2.2vw, 40px) 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  width: 40px;
  height: 30px;
}

.brand svg {
  width: 40px;
  height: 30px;
}

.desktop-nav {
  display: flex;
  gap: 1px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: -.035em;
  white-space: nowrap;
  cursor: pointer;
}

.pill--solid {
  background: #fff;
  color: #161616;
}

.pill--glass {
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  transition: background-color .35s ease;
}

.pill--glass:hover {
  background: rgba(255, 255, 255, .3);
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* language switch */
.lang {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lang-btn {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -.03em;
  cursor: pointer;
  transition: background-color .3s ease, color .3s ease;
}

.lang-btn.is-active {
  background: #fff;
  color: #161616;
}

/* sign in */
.signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 41px;
  padding: 0 19px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: -.035em;
  white-space: nowrap;
  transition: background-color .3s ease, color .3s ease;
}

.signin:hover {
  background: #fff;
  color: #1150ef;
}

/* hamburger + dropdown (≤ 860px) */
.burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
}

.menu {
  display: none;
}

.pill--tall {
  height: 48px;
  width: 100%;
}

/* nav fade-down entrance */
.fd {
  animation: fadeDown .8s cubic-bezier(.2, .7, .2, 1) var(--fdel, 0s) backwards;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   STEP 5 — headline + tagline
   ========================================================= */
.headline-row {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  padding: clamp(28px, 3.4vw, 60px) clamp(16px, 2.2vw, 40px) 0;
  position: relative;
  z-index: 3;
}

.h1 {
  font-family: "Playfair Display", serif;
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(40px, calc(39px + 4.9vw), 170px);
  line-height: .87;
  letter-spacing: -.005em;
}

.h1 .ln {
  display: block;
}

.h1 .ln--indent {
  padding-left: .92em;
}

.tagline {
  margin-left: auto;
  margin-top: clamp(24px, 4.3vw, 80px);
  font-family: "Archivo", sans-serif;
  text-transform: uppercase;
  font-size: clamp(13px, 1.66vw, 26px);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.tl {
  display: block;
}

.tagline .tl--indent {
  padding-left: 3.6em;
}

/* =========================================================
   STEP 6 — explore link
   ========================================================= */
.explore {
  padding: clamp(36px, 5.6vw, 100px) clamp(16px, 2.2vw, 40px) 0;
  position: relative;
  z-index: 3;
}

.explore-a {
  display: inline-flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  font-size: clamp(13px, 1.3vw, 20px);
  letter-spacing: -.01em;
  text-transform: uppercase;
  transition: opacity .3s ease;
}

.explore-a:hover {
  opacity: .8;
}

.explore-txt {
  display: inline-flex;
  gap: .3em;
}

/* =========================================================
   STEP 7 — bottom-left video card
   ========================================================= */
.vcard {
  position: absolute;
  left: clamp(16px, 2.2vw, 40px);
  bottom: clamp(36px, 8.6vw, 140px);
  width: clamp(150px, 17vw, 290px);
  z-index: 3;
  animation: cardIn 1s cubic-bezier(.2, .7, .2, 1) 2s backwards;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.vbox {
  aspect-ratio: 1.7;
  border-radius: clamp(8px, .9vw, 14px);
  overflow: hidden;
  background: rgba(255, 255, 255, .2);
}

.vbox video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vcap {
  margin-top: 8px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(13px, 1.4vw, 22px);
  line-height: 1.02;
  letter-spacing: .035em;
}

.bars {
  margin-top: 12px;
  display: flex;
  gap: 5px;
  align-items: center;
  transform-origin: left center;
  animation: barsGrow .9s cubic-bezier(.2, .7, .2, 1) 2.55s backwards;
}

@keyframes barsGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.bar {
  display: flex;
  align-items: center;
  flex: 1;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: flex-grow .6s ease;
}

.bar i {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .4);
  transition: background-color .6s ease;
}

.bar.is-active {
  flex-grow: 1.7;
}

.bar.is-active i {
  background: #fff;
}

/* =========================================================
   STEP 8 — word-by-word reveal
   ========================================================= */
.w {
  display: inline-block;
  animation: wordIn var(--wd, 1s) cubic-bezier(.2, .7, .2, 1) var(--wdel, 0s) backwards;
}

@keyframes wordIn {
  from { opacity: 0; transform: translateY(.45em); filter: blur(10px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* =========================================================
   STEP 9 — "Our Latest Houses"
   ========================================================= */
.houses {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  row-gap: 32px;
  padding: clamp(56px, 9.9vw, 170px) clamp(16px, 4vw, 70px) clamp(40px, 4.4vw, 80px) clamp(16px, 2.8vw, 48px);
}

.h-h {
  flex: 1 1 max(200px, 24.5vw);
  margin-top: clamp(0px, .9vw, 16px);
}

.h2 {
  font-family: "Playfair Display", serif;
  font-weight: 400;
  font-size: clamp(40px, 4.6vw, 80px);
  line-height: 1.2;
  color: #0d0d0d;
}

.h2 .ln {
  display: block;
}

.h2 .w2 {
  display: inline-block;
  opacity: 0;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .06em;
}

/* hidden initial state until the section intersects */
.houses .h-card {
  opacity: 0;
  transform: translateY(30px) scale(.97);
}

.houses.in .h2 .w2 {
  animation: wordIn .9s cubic-bezier(.2, .7, .2, 1) var(--w2del, 0s) forwards;
}

.houses.in .h-card {
  animation: cardIn 1.1s cubic-bezier(.2, .7, .2, 1) var(--cdel, 0s) forwards;
}

.houses.in .h-card:nth-child(1) { --cdel: .2s; }
.houses.in .h-card:nth-child(2) { --cdel: .35s; }
.houses.in .h-card:nth-child(3) { --cdel: .5s; }

.h-g {
  flex: 999 1 540px;
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: clamp(10px, 1.25vw, 20px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.h-g::-webkit-scrollbar {
  display: none;
}

.h-card {
  margin: 0;
  aspect-ratio: .79;
  border-radius: clamp(6px, .8vw, 12px);
  overflow: hidden;
  scroll-snap-align: start;
}

.h-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s cubic-bezier(.2, .7, .2, 1);
}

.h-card:hover img {
  transform: scale(1.05);
}

/* =========================================================
   STEP 10 — responsive rules
   ========================================================= */
@media (max-width: 860px) {
  .desktop-nav {
    display: none;
  }

  .burger {
    display: inline-flex;
  }

  .menu {
    display: none;
    position: absolute;
    top: 78px;
    right: clamp(16px, 2.2vw, 40px);
    width: min(280px, calc(100vw - 32px));
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .18);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    z-index: 20;
  }

  .menu.open {
    display: flex;
    animation: fadeDown .45s cubic-bezier(.2, .7, .2, 1) backwards;
  }
}

@media (max-width: 720px) {
  .tagline {
    margin-left: 0;
    flex: 1 1 100%;
  }
}

/* graceful fallback for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  .gl,
  .house,
  .fd,
  .w,
  .vcard,
  .bars,
  .menu.open {
    animation: none;
  }

  .h2 .w2,
  .houses .h-card {
    opacity: 1;
    transform: none;
  }
}
