/* assets/css/main.css */
@import 'tokens.css';

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul { list-style: none; }

/* ── Body ── */
body {
  background: var(--color-near-black);
  color: var(--color-off-white);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transition: opacity 0.5s ease;
}
body.loaded { opacity: 1; }

/* ── Scroll-reveal base state ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: transparent;
  transition: background var(--transition-mid);
}
.nav.scrolled {
  background: rgba(26, 23, 20, 0.94);
  backdrop-filter: blur(8px);
}

.nav-logo {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--color-off-white);
  font-weight: 400;
}
.nav-logo span {
  color: var(--color-gold);
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}
.nav-link {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(245, 239, 230, 0.55);
  transition: color var(--transition-fast);
}
.nav-link:hover { color: var(--color-off-white); }
.nav-link.active { color: var(--color-gold); }

/* Mobile hamburger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--color-off-white);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Mobile overlay menu */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-near-black);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-mid);
}
.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.nav-overlay .nav-link {
  font-size: 20px;
  letter-spacing: 4px;
  color: var(--color-off-white);
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-overlay { display: flex; }
}

/* ── HOME: Hero ── */
.home-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}
.home-hero__image {
  position: absolute;
  inset: 0;
}
.home-hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-dark-bottom);
}
.home-hero__content {
  position: absolute;
  bottom: var(--space-2xl);
  left: var(--gutter-wide);
  z-index: 2;
}
.home-hero__label {
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-sm);
}
.home-hero__title {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: 400;
  font-style: italic;
  color: var(--color-off-white);
  line-height: var(--leading-tight);
  max-width: 12ch;
}

/* Scroll indicator */
.home-hero__scroll {
  position: absolute;
  bottom: var(--space-lg);
  right: var(--gutter);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}
.home-hero__scroll-text {
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(245, 239, 230, 0.45);
  writing-mode: vertical-rl;
}
.home-hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(201,168,122,0.7), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.5; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.15); }
}

/* ── HOME: Villa viewport sections ── */
.villa-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 500px;
  overflow: hidden;
  cursor: pointer;
}
.villa-section__image {
  position: absolute;
  inset: 0;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.villa-section:hover .villa-section__image {
  transform: scale(1.04);
}

/* Left overlay (default) */
.villa-section__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-dark-left);
}
/* Right overlay (mirrored) */
.villa-section__overlay--right {
  background: var(--overlay-dark-right);
}

/* Content anchor — left */
.villa-section__content {
  position: absolute;
  top: 50%;
  left: var(--gutter-wide);
  transform: translateY(-50%);
  display: flex;
  align-items: flex-start;
  gap: 20px;
  z-index: 2;
}
/* Content anchor — right */
.villa-section__content--right {
  left: auto;
  right: var(--gutter-wide);
  flex-direction: row-reverse;
}

/* Gold vertical rule */
.villa-section__rule {
  width: 1.5px;
  height: 72px;
  background: var(--color-gold);
  flex-shrink: 0;
  margin-top: 8px;
}

.villa-section__text {
  max-width: 340px;
}
.villa-section__number {
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(201, 168, 122, 0.75);
  margin-bottom: var(--space-xs);
}
.villa-section__name {
  font-family: var(--font-serif);
  font-size: var(--text-villa);
  font-weight: 400;
  font-style: italic;
  color: var(--color-off-white);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-sm);
}
.villa-section__desc {
  font-family: var(--font-sans);
  font-size: 15px;
  color: rgba(245, 239, 230, 0.88);
  line-height: 1.75;
  margin-bottom: var(--space-md);
  max-width: 34ch;
}

/* CTA link with animated underline */
.villa-section__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--color-gold);
  transition: gap var(--transition-fast);
}
.villa-section__cta:hover { gap: 16px; }
.villa-section__cta-line {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--color-gold);
  transition: width var(--transition-fast);
}
.villa-section__cta:hover .villa-section__cta-line { width: 36px; }

/* ── HOME: Location section ── */
.home-location {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 440px;
  overflow: hidden;
}
.home-location__image {
  position: absolute;
  inset: 0;
}
.home-location__overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 23, 20, 0.55);
}
.home-location__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--gutter);
  z-index: 2;
}
.home-location__label {
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-sm);
}
.home-location__title {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: 400;
  font-style: italic;
  color: var(--color-off-white);
  margin-bottom: var(--space-md);
}
.home-location__body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: rgba(245, 239, 230, 0.65);
  line-height: 1.8;
  max-width: 520px;
}

/* ── HOME: Contact section ── */
.home-contact {
  background: var(--color-off-white);
  padding: var(--space-2xl) var(--gutter);
}
.home-contact__inner {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.home-contact__label {
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-sm);
}
.home-contact__title {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: 400;
  font-style: italic;
  color: var(--color-espresso);
  margin-bottom: var(--space-xs);
}
.home-contact__subtitle {
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(58, 48, 37, 0.5);
  letter-spacing: 1px;
  margin-bottom: var(--space-lg);
}

/* Contact form */
.contact-form { text-align: left; }
.contact-form__field { margin-bottom: var(--space-md); }
.contact-form__label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(58, 48, 37, 0.5);
  margin-bottom: var(--space-xs);
}
.contact-form__input {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(58, 48, 37, 0.25);
  padding: var(--space-xs) 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--color-espresso);
  outline: none;
  transition: border-color var(--transition-fast);
}
.contact-form__input:focus { border-bottom-color: var(--color-espresso); }
.contact-form__textarea { resize: vertical; min-height: 100px; }
.contact-form__submit {
  margin-top: var(--space-md);
  padding: 14px 40px;
  background: var(--color-espresso);
  color: var(--color-off-white);
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  transition: background var(--transition-fast), transform var(--transition-fast);
  width: 100%;
}
.contact-form__submit:hover {
  background: var(--color-near-black);
  transform: translateY(-1px);
}
.contact-form__status {
  margin-top: var(--space-sm);
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}
.contact-form__status.success { color: var(--color-sage); }
.contact-form__status.error   { color: #c0614a; }

/* Footer */
.site-footer {
  background: var(--color-near-black);
  border-top: 1px solid rgba(240, 232, 220, 0.08);
  padding: var(--space-lg) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.site-footer__copy {
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  letter-spacing: 1.5px;
  color: rgba(245, 239, 230, 0.3);
}
.site-footer__links {
  display: flex;
  gap: var(--space-md);
}
.site-footer__links a {
  font-family: var(--font-sans);
  font-size: var(--text-micro);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(245, 239, 230, 0.35);
  transition: color var(--transition-fast);
}
.site-footer__links a:hover { color: var(--color-off-white); }

/* ── RESPONSIVE: main.css ── */

/* Tablet */
@media (max-width: 1024px) {
  .villa-section__content,
  .villa-section__content--right {
    left: var(--gutter);
    right: auto;
  }
  .villa-section__content--right {
    right: var(--gutter);
    left: auto;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .home-hero__content {
    bottom: var(--space-lg);
    left: var(--gutter);
  }
  .home-hero__scroll { display: none; }

  /* Villa sections: text overlays image at bottom */
  .villa-section__content,
  .villa-section__content--right {
    bottom: var(--space-lg);
    top: auto;
    left: var(--gutter);
    right: auto;
    transform: none;
    flex-direction: row;
  }
  .villa-section__overlay,
  .villa-section__overlay--right {
    background: linear-gradient(to top, rgba(26,23,20,0.88) 0%, transparent 55%);
  }
  .villa-section__name { font-size: 36px; }
  .villa-section__desc { display: none; }

  /* Location */
  .home-location__body { font-size: 13px; }

  /* Contact */
  .home-contact { padding: var(--space-xl) var(--gutter); }

  /* Footer */
  .site-footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero__scroll-line { animation: none; }
}
