/* ─── Premium patterns & motion ─── */

:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Page atmosphere */
.page-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.page-grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 169, 106, 0.07) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
}

body.is-loaded .cursor-glow {
  opacity: 1;
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  .cursor-glow { display: none; }
}

/* Section patterns */
.section {
  position: relative;
  overflow: hidden;
}

.section > .container,
.section > .masterplan,
.stats > .container {
  position: relative;
  z-index: 1;
}

.section__pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  mask-image: linear-gradient(180deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
}

.section__pattern--grid {
  background: url('/assets/patterns/grid.svg') repeat;
  animation: patternDrift 80s linear infinite;
}

.section__pattern--weave {
  background: url('/assets/patterns/weave.svg') repeat;
  animation: patternDrift 60s linear infinite reverse;
}

.section__pattern--dots {
  background: url('/assets/patterns/dots.svg') repeat;
}

.section__pattern--arcs {
  background: url('/assets/patterns/arcs.svg') repeat;
  opacity: 0.25;
}

.section__glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.12;
}

.section__glow--gold {
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
}

.section__glow--top-right {
  top: -20%;
  right: -15%;
}

.section__glow--bottom-left {
  bottom: -20%;
  left: -15%;
}

.section__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 var(--gutter) 48px;
  color: var(--color-accent);
  opacity: 0.5;
}

.section__divider::before,
.section__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  max-width: 200px;
}

.section__divider svg {
  width: 20px;
  height: 20px;
  animation: dividerSpin 12s linear infinite;
}

@keyframes patternDrift {
  from { background-position: 0 0; }
  to { background-position: 120px 120px; }
}

@keyframes dividerSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Hero cinematic */
.hero__bg img,
.residence-hero__bg img {
  animation: heroKenBurns 22s var(--ease-in-out) infinite alternate;
  will-change: transform;
}

@keyframes heroKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.hero__overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(196, 169, 106, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(196, 169, 106, 0.05) 0%, transparent 50%);
  animation: heroGlowPulse 8s ease-in-out infinite alternate;
}

@keyframes heroGlowPulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.hero__pattern {
  position: absolute;
  inset: 0;
  background: url('/assets/patterns/weave.svg') repeat;
  opacity: 0.06;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
  z-index: 1;
}

.hero-animate > * {
  opacity: 0;
  transform: translateY(40px);
  animation: heroFadeUp 1s var(--ease-out-expo) forwards;
}

.hero-animate > *:nth-child(1) { animation-delay: 0.2s; }
.hero-animate > *:nth-child(2) { animation-delay: 0.35s; }
.hero-animate > *:nth-child(3) { animation-delay: 0.5s; }
.hero-animate > *:nth-child(4) { animation-delay: 0.65s; }
.hero-animate > *:nth-child(5) { animation-delay: 0.8s; }
.hero-animate > *:nth-child(6) { animation-delay: 0.95s; }

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header entrance */
.header {
  transform: translateY(-100%);
  animation: headerSlide 0.9s var(--ease-out-expo) 0.1s forwards;
}

@keyframes headerSlide {
  to { transform: translateY(0); }
}

/* Enhanced reveals */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 0.9s var(--ease-out-expo),
    transform 0.9s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--left {
  transform: translateX(-40px);
}

.reveal--left.visible {
  transform: translateX(0);
}

.reveal--right {
  transform: translateX(40px);
}

.reveal--right.visible {
  transform: translateX(0);
}

.reveal--scale {
  transform: scale(0.95);
}

.reveal--scale.visible {
  transform: scale(1);
}

.reveal-group .reveal {
  transition-delay: calc(var(--i, 0) * 0.1s);
}

/* Section eyebrow line draw */
.section__eyebrow {
  position: relative;
  display: inline-block;
}

.section__eyebrow::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 1s var(--ease-out-expo) 0.3s;
}

.reveal.visible .section__eyebrow::after,
.section__header.visible .section__eyebrow::after {
  width: 100%;
}

/* Stats counter */
.stat {
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  transform: scaleX(0);
  transition: transform 1s var(--ease-out-expo);
}

.stat.visible::before {
  transform: scaleX(1);
}

.stat__value {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  transition: none;
}

.btn--primary:hover::before {
  animation: btnShine 0.7s ease;
}

@keyframes btnShine {
  from { left: -100%; }
  to { left: 150%; }
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(196, 169, 106, 0.25);
}

.btn--ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Collection cards */
.collection-card {
  transition:
    transform 0.5s var(--ease-out-expo),
    border-color var(--transition),
    box-shadow 0.5s var(--ease-out-expo);
}

.collection-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.5s ease;
  pointer-events: none;
}

.collection-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(196, 169, 106, 0.2);
}

.collection-card:hover::after {
  border-color: rgba(196, 169, 106, 0.3);
}

.collection-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(15, 15, 14, 0.6) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.collection-card__image {
  position: relative;
}

.collection-card:hover .collection-card__image::after {
  opacity: 1;
}

/* About image */
.about__image img {
  transition: transform 1.2s var(--ease-out-expo);
}

.about__image:hover img {
  transform: scale(1.03);
}

.about__image-accent {
  animation: accentPulse 4s ease-in-out infinite alternate;
}

@keyframes accentPulse {
  from { opacity: 0.6; transform: translate(0, 0); }
  to { opacity: 1; transform: translate(-4px, 4px); }
}

/* Infrastructure hover icon */
.infra__item {
  transition: transform 0.4s var(--ease-out-expo), background var(--transition);
}

.infra__item:hover {
  transform: translateY(-4px);
}

.infra__item:hover .infra__icon {
  animation: iconFloat 0.6s var(--ease-out-expo);
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.infra__icon {
  transition: color 0.3s ease;
}

.infra__item:hover .infra__icon {
  color: var(--color-accent-light);
}

/* Author cards */
.author-card__photo {
  transition: transform 0.5s var(--ease-out-expo), border-color 0.3s ease;
}

.author-card:hover .author-card__photo {
  transform: scale(1.05);
  border-color: var(--color-accent);
}

.author-card__photo img {
  transition: filter 0.5s ease, transform 0.5s var(--ease-out-expo);
}

.author-card:hover .author-card__photo img {
  filter: grayscale(0%);
  transform: scale(1.05);
}

/* Lifestyle cards */
.lifestyle__card-content {
  transform: translateY(10px);
  transition: transform 0.5s var(--ease-out-expo);
}

.lifestyle__card:hover .lifestyle__card-content {
  transform: translateY(0);
}

/* FAQ */
.faq__item {
  transition: background 0.3s ease;
}

.faq__item.open {
  background: rgba(196, 169, 106, 0.03);
}

/* Masterplan lot pulse for available */
.lot--available {
  animation: lotPulse 3s ease-in-out infinite;
}

.lot--available:hover,
.lot--available.active {
  animation: none;
}

@keyframes lotPulse {
  0%, 100% { fill: rgba(196, 169, 106, 0.45); }
  50% { fill: rgba(196, 169, 106, 0.65); }
}

/* Logo subtle shimmer on hover */
.logo__name {
  background: linear-gradient(90deg, var(--color-text) 0%, var(--color-accent-light) 50%, var(--color-text) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.6s ease;
}

.logo:hover .logo__name {
  background-position: 100% center;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-animate > * {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .header {
    transform: none;
    animation: none;
  }

  .cursor-glow { display: none; }
}
