/* ==========================================================================
   Totality Estates — Homepage
   Section-by-section styles. Depends on tokens.css + base.css.
   ========================================================================== */

/* ==========================================================================
   Hero
   ========================================================================== */
.te-hero {
  position: relative;
  min-height: min(760px, 100svh);
  background: var(--te-photo-base);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.te-hero__bg {
  position: absolute; inset: 0;
  background: var(--te-photo-base) center / cover no-repeat;
  /* Real skyline photograph drops in here (background-image) when supplied. */
}
.te-hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  border: 0;
}
/* Honour reduced-motion: hide the video, fall back to the poster still. */
@media (prefers-reduced-motion: reduce) {
  .te-hero__video { display: none; }
}
.te-hero__scrim { position: absolute; inset: 0; background: var(--te-scrim-hero); pointer-events: none; z-index: 0; }

/* Reserve space for the transparent over-hero header so centered content
   never slides under the nav (the bg/scrim are absolute and ignore padding). */
body.te-over-hero .te-hero { padding-top: clamp(116px, 13vh, 156px); }

.te-hero__inner {
  position: relative; z-index: 1;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 26px;
  width: 100%; max-width: var(--te-content-max); margin-inline: auto;
  padding: clamp(28px, 4vw, 44px) clamp(16px, 4vw, 24px) 40px;
}

.te-hero__eyebrow {
  font-size: var(--te-fs-14); font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--te-on-dark-72);
}
.te-hero__title {
  margin: 0; color: var(--te-white);
  font-size: var(--te-fs-d1); line-height: var(--te-lh-hero);
  letter-spacing: var(--te-track-hero); max-width: 20ch; text-wrap: balance;
}
.te-hero__sub {
  font-size: clamp(16.5px, 1.6vw, 21px); line-height: 1.55;
  color: var(--te-on-dark-88); max-width: 60ch;
}

.te-hero__trust {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 14px 22px;
  font-size: var(--te-fs-135); letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--te-on-dark-78);
}
.te-hero__trust-item { display: inline-flex; align-items: center; gap: 8px; }
.te-hero__trust-sep { color: var(--te-on-dark-border-24); }

.te-hero__search {
  display: flex; align-items: center;
  width: 100%; max-width: 640px;
  background: var(--te-white); border-radius: var(--te-r-14);
  padding: 9px 9px 9px 22px;
  box-shadow: var(--te-shadow-hero-search);
}
.te-hero__search input {
  flex: 1; min-width: 0; border: 0; background: none;
  font-size: var(--te-fs-17); color: var(--te-ink);
}
.te-hero__search input:focus { outline: none; }
.te-hero__search input::placeholder { color: var(--te-label); }
.te-hero__search button {
  width: 52px; height: 52px; flex-shrink: 0;
  background: var(--te-accent); border: 0; border-radius: var(--te-r-11);
  color: var(--te-white);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--te-hover-transition);
}
.te-hero__search button:hover { background: var(--te-accent-hover); }

.te-hero__or {
  display: flex; align-items: center; gap: 14px;
  color: var(--te-on-dark-62); font-size: var(--te-fs-14);
}
.te-hero__or::before, .te-hero__or::after {
  content: ""; width: 34px; height: 1px; background: rgba(255,255,255,0.4);
}

.te-hero__cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--te-white); color: var(--te-accent);
  font-size: clamp(16px, 1.5vw, 19px); font-weight: 600;
  padding: 18px clamp(22px, 3vw, 40px); border-radius: var(--te-r-12);
  box-shadow: var(--te-shadow-hero-cta);
  transition: color var(--te-hover-transition);
}
.te-hero__cta:hover { color: var(--te-accent-hover); }

.te-hero__scroll {
  position: relative; z-index: 1; align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding-bottom: 34px;
  color: var(--te-on-dark-78); font-size: var(--te-fs-15);
}
.te-hero__scroll-label { animation: te-scroll-fade 2.4s ease-in-out infinite; }
.te-hero__scroll-chevron { animation: te-scroll-bob 2.4s ease-in-out infinite; line-height: 1; }

@keyframes te-scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50%      { transform: translateY(7px); opacity: 1; }
}
@keyframes te-scroll-fade {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* ==========================================================================
   Why Dubai
   ========================================================================== */
.te-why__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(40px, 6vw, 96px); align-items: start;
}
.te-why__h2 { margin: 18px 0 0; font-size: var(--te-fs-d2); line-height: 1.1; }
.te-why__h2 em { font-style: normal; color: var(--te-accent); }
.te-why__lead { margin: 20px 0 0; font-size: var(--te-fs-20); line-height: 1.6; color: var(--te-muted); }
.te-why__link { margin-top: 20px; }
.te-why__body > p { margin: 0; font-size: var(--te-fs-19); line-height: 1.65; color: var(--te-body); }
.te-why__body > p strong { color: var(--te-ink); font-weight: 700; }
.te-quote {
  margin-top: 28px; display: flex; gap: 14px; align-items: flex-start;
  background: var(--te-ink-strong); color: var(--te-white);
  border-radius: var(--te-r-16); border-left: 4px solid var(--te-accent);
  padding: 30px 34px;
}
.te-quote__icon { color: var(--te-accent); flex-shrink: 0; margin-top: 2px; }
.te-quote__text { margin: 0; font-style: italic; font-size: var(--te-fs-19); line-height: 1.6; }

/* ==========================================================================
   Featured Off-Plan
   ========================================================================== */
.te-featured__control { display: flex; justify-content: center; margin-top: 28px; }
.te-featured__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 28px; margin-top: 40px;
}
/* Match the reference card proportions (near square) instead of a tall fixed height. */
.te-featured__grid .te-pcard { height: auto; aspect-ratio: 18 / 19; }
.te-featured__grid .te-pcard[hidden] { display: none !important; }
.te-featured__empty { grid-column: 1 / -1; text-align: center; color: var(--te-muted); margin: 20px 0; }
.te-featured__empty[hidden] { display: none; }
.te-featured__foot { text-align: center; margin-top: 36px; }

/* ==========================================================================
   How we work
   ========================================================================== */
.te-how__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
  gap: 14px; margin-top: 44px;
}
.te-how__foot { text-align: center; margin-top: 40px; }

/* ==========================================================================
   Strategic Areas
   ========================================================================== */
.te-areas__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 26px; margin-top: 44px;
}
.te-areas__foot { text-align: center; margin-top: 36px; }

/* ==========================================================================
   Why Totality
   ========================================================================== */
.te-whyt__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px; margin-top: 44px;
}

/* ==========================================================================
   Led by experience
   ========================================================================== */
.te-led__grid {
  display: grid;
  grid-template-columns: minmax(0, 280px) 1fr;
  gap: clamp(36px, 5vw, 76px); align-items: center;
}
.te-led__portrait { width: 280px; height: 280px; max-width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--te-photo-base) center / cover no-repeat; }
.te-led__h2 { font-size: var(--te-fs-d4); line-height: 1.1; margin: 0; }
.te-led__body { margin: 22px 0 0; }
.te-led__body p { margin: 0 0 16px; font-size: var(--te-fs-19); line-height: 1.65; color: var(--te-body); }
@media (max-width: 640px) {
  .te-led__grid { grid-template-columns: 1fr; justify-items: start; }
}

/* ==========================================================================
   Investment Pathways
   ========================================================================== */
.te-pathways__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px; margin-top: 44px;
}

/* ==========================================================================
   Testimonials
   ========================================================================== */
.te-tst__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 26px; margin-top: 40px;
}
.te-tst__investors { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--te-border); text-align: center; }
.te-tst__investors-label { font-size: var(--te-fs-14); text-transform: uppercase; letter-spacing: 0.14em; color: var(--te-label); margin: 0 0 22px; }

/* ==========================================================================
   Insights & guides
   ========================================================================== */
.te-insights__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(36px, 5vw, 80px); margin-top: 12px;
}
.te-insights__colhead { font-size: var(--te-fs-22); margin: 0 0 24px; }
.te-articles { display: flex; flex-direction: column; gap: 22px; }
.te-article {
  display: grid; grid-template-columns: minmax(90px, 130px) 1fr auto;
  gap: 20px; align-items: center;
}
.te-article__thumb { height: 82px; border-radius: var(--te-r-8); background: var(--te-photo-base) center / cover no-repeat; }
.te-article__cat { font-size: var(--te-fs-14); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--te-accent); }
.te-article__title { margin: 6px 0 0; font-size: var(--te-fs-19); line-height: 1.35; }
.te-article__chevron { color: var(--te-chevron); }
.te-articles__foot { margin-top: 26px; }

.te-resources { display: flex; flex-direction: column; gap: 14px; }
.te-resource {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--te-divider); border-radius: var(--te-r-14);
  padding: 22px 24px; transition: border-color var(--te-hover-transition);
}
.te-resource:hover { border-color: var(--te-border-hover); }
.te-resource__chip { background: var(--te-fill); font-size: 14.5px; padding: 6px 12px; border-radius: var(--te-r-7); color: var(--te-ink); flex-shrink: 0; }
.te-resource__title { flex: 1; font-size: var(--te-fs-19); font-weight: 700; }
.te-resource__chevron { color: var(--te-chevron); }
.te-article__chevron svg, .te-resource__chevron svg { transform: rotate(-90deg); }

/* ==========================================================================
   FAQ (home)
   ========================================================================== */
.te-homefaq__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(36px, 5vw, 80px); align-items: start;
}
.te-homefaq__lead { margin: 16px 0 0; font-size: var(--te-fs-20); color: var(--te-muted); max-width: 36ch; line-height: 1.55; }
.te-homefaq__link { margin-top: 24px; }

/* ==========================================================================
   Closing CTA
   ========================================================================== */
.te-closing { text-align: center; }
.te-closing__inner { max-width: 900px; margin-inline: auto; padding-inline: var(--te-gutter); }
.te-closing__title { color: var(--te-white); font-size: var(--te-fs-d2); max-width: 18ch; margin: 0 auto; }
.te-closing__lead { margin: 22px auto 0; font-size: var(--te-fs-20); line-height: 1.6; color: var(--te-on-dark-72); max-width: 52ch; }
.te-closing__actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 34px; }
.te-closing__fine { margin: 26px 0 0; font-size: var(--te-fs-16); color: var(--te-on-dark-45); }

/* Section head with kicker on dark */
.te-kicker--light .te-eyebrow { color: var(--te-accent-light); }
.te-kicker--light::before { background: var(--te-accent-light); }

/* ==========================================================================
   Mobile: swipe carousels + tighter rhythm (phones)
   Each card grid becomes a horizontal scroll-snap rail with a peeking next card.
   ========================================================================== */
@media (max-width: 640px) {
  .te-featured__grid,
  .te-how__grid,
  .te-areas__grid,
  .te-whyt__grid,
  .te-pathways__grid,
  .te-tst__grid {
    display: flex;
    grid-template-columns: none;
    gap: 13px;
    margin-top: 22px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px 6px;
    scroll-padding-left: 2px;
    overscroll-behavior-x: contain;
  }
  .te-featured__grid::-webkit-scrollbar,
  .te-how__grid::-webkit-scrollbar,
  .te-areas__grid::-webkit-scrollbar,
  .te-whyt__grid::-webkit-scrollbar,
  .te-pathways__grid::-webkit-scrollbar,
  .te-tst__grid::-webkit-scrollbar { display: none; }

  .te-featured__grid > .te-pcard { flex: 0 0 84%; scroll-snap-align: start; aspect-ratio: auto; height: 468px; }
  .te-featured__grid > .te-pcard[hidden] { display: none !important; }
  .te-featured__grid .te-pcard__body { padding: 18px; }
  .te-featured__grid .te-pcard__title { font-size: 23px; line-height: 1.1; }
  .te-featured__grid .te-pcard__area { font-size: 13px; }
  .te-featured__grid .te-pcard__specs { gap: 7px 12px; margin: 4px 0; }
  .te-featured__grid .te-pcard__spec { font-size: 12.5px; }
  .te-featured__grid .te-pcard__price { font-size: 21px; }
  .te-featured__grid .te-pcard__price-label { font-size: 12px; }
  .te-featured__grid .te-pcard__cta { padding: 11px 16px; font-size: 13px; }
  .te-featured__grid .te-pcard__badges { top: 14px; left: 14px; gap: 7px; }
  .te-featured__grid .te-pcard__fav { top: 12px; right: 12px; }
  .te-how__grid > .te-step { flex: 0 0 74%; scroll-snap-align: start; }
  .te-areas__grid > .te-acard { flex: 0 0 80%; scroll-snap-align: start; }
  .te-whyt__grid > .te-fcard { flex: 0 0 80%; scroll-snap-align: start; }
  .te-pathways__grid > .te-fcard { flex: 0 0 80%; scroll-snap-align: start; }
  .te-tst__grid > .te-tcard { flex: 0 0 86%; scroll-snap-align: start; }
  .te-featured__empty { flex: 0 0 100%; }

  /* Section rhythm: less air, headings closer to their rail */
  .te-featured__control { margin-top: 18px; }
  .te-how__foot, .te-areas__foot, .te-featured__foot, .te-tst__investors { margin-top: 24px; }

  /* Swipe affordance line under a rail's section */
  .te-featured .te-section__sub,
  .te-section__sub { margin-bottom: 2px; }
}

/* ==========================================================================
   Carousel dot indicators + cleaner article rows (added by mobile pass)
   ========================================================================== */
.te-dots { display: none; }
.te-article__cat { display: block; }        /* was an inline span → ran into title */
.te-article__title { display: block; }
@media (max-width: 640px) {
  .te-dots { display: flex; gap: 6px; justify-content: center; padding: 15px 0 2px; }
  .te-dots[hidden] { display: none !important; }
  .te-dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--te-border); transition: width .25s, background .25s; }
  .te-dots i.on { background: var(--te-accent); width: 20px; }

  /* Latest articles: tidy thumbnail + label/title row, drop the chevron */
  .te-article { grid-template-columns: 82px 1fr; gap: 13px; align-items: center; }
  .te-article__thumb { height: 64px; }
  .te-article__cat { font-size: 11px; letter-spacing: 0.1em; }
  .te-article__title { font-size: 15px; line-height: 1.3; margin-top: 3px; }
  .te-article__chevron { display: none; }
  .te-articles { gap: 16px; }
}

/* ==========================================================================
   Latest Launches (horizontal rail under the hero)
   ========================================================================== */
.te-latest__kicker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--te-fs-14); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--te-accent); }
.te-latest__live { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,0.18); flex: none; }
.te-latest__grid {
  display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin-top: 32px; padding: 4px 2px 10px; scrollbar-width: none;
}
.te-latest__grid::-webkit-scrollbar { display: none; }
.te-latest__grid .te-pcard { flex: 0 0 340px; scroll-snap-align: start; aspect-ratio: auto; height: 470px; }
.te-latest__grid .te-pcard__title { font-size: 24px; line-height: 1.1; }
.te-latest__foot { margin-top: 24px; }
