/* ======================================
   Casa Serena — Bohemian Chic Tulum Luxury
   ====================================== */

:root {
  /* Palette — warm earth, jungle, coast */
  --bg: #F5F0EB;
  --bg-deep: #EDE7DF;
  --white: #FFFDF9;
  --sand: #D9CEBC;
  --sand-dark: #C4B8A4;
  --clay: #B8A48E;
  --terracotta: #C08B6E;
  --terracotta-light: #D4A98C;
  --sage: #A3AA95;
  --sage-dark: #7A8270;
  --charcoal: #2C2A26;
  --charcoal-light: #4A4640;
  --text: #2C2A26;
  --text-muted: #7A756D;

  /* Type */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Outfit', 'Helvetica Neue', sans-serif;

  /* Spacing */
  --section-pad: clamp(80px, 12vw, 160px);
  --side-pad: clamp(24px, 5vw, 80px);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea {
  font-family: var(--font-body);
  font-weight: 300;
  border: none;
  outline: none;
  background: none;
  color: var(--text);
}

/* ── Loader ── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-inner { text-align: center; }
.loader-text {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 300;
  color: var(--sand);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.loader-bar {
  width: 120px;
  height: 1px;
  background: rgba(217, 206, 188, 0.2);
  margin: 24px auto 0;
  overflow: hidden;
}
.loader-progress {
  width: 0%;
  height: 100%;
  background: var(--sand);
  transition: width 0.3s ease;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--side-pad);
  transition: background 0.4s ease, padding 0.4s ease;
}
.nav.scrolled {
  background: rgba(245, 240, 235, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px var(--side-pad);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  transition: color 0.4s ease;
}
.nav.scrolled .nav-logo { color: var(--charcoal); }
.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 253, 249, 0.7);
  transition: color 0.3s ease;
}
.nav-links a:hover { color: var(--white); }
.nav.scrolled .nav-links a { color: var(--text-muted); }
.nav.scrolled .nav-links a:hover { color: var(--charcoal); }

.lang-toggle {
  font-size: 11px;
  letter-spacing: 0.15em;
  font-weight: 400;
  color: rgba(255, 253, 249, 0.7);
  cursor: pointer;
  padding: 6px 14px;
  border: 1px solid rgba(255, 253, 249, 0.25);
  border-radius: 2px;
  transition: all 0.3s ease;
  margin-left: 12px;
}
.lang-toggle:hover { color: var(--white); border-color: rgba(255, 253, 249, 0.5); }
.nav.scrolled .lang-toggle { color: var(--text-muted); border-color: rgba(44, 42, 38, 0.2); }
.nav.scrolled .lang-toggle:hover { color: var(--charcoal); border-color: rgba(44, 42, 38, 0.4); }

.nav-menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 4px;
}
.nav-menu-btn span {
  width: 24px;
  height: 1px;
  background: var(--white);
  transition: background 0.4s, transform 0.3s;
}
.nav.scrolled .nav-menu-btn span { background: var(--charcoal); }
.nav-menu-btn.active span:first-child { transform: rotate(45deg) translate(2.5px, 2.5px); }
.nav-menu-btn.active span:last-child { transform: rotate(-45deg) translate(2.5px, -2.5px); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--charcoal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 300;
  color: var(--sand);
  letter-spacing: 0.08em;
}

/* ── Hero ── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--charcoal);
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
}
.hero-video-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(192, 139, 110, 0.15) 0%, transparent 60%),
    linear-gradient(160deg, var(--charcoal) 0%, #3D3830 50%, #2C2A26 100%);
  z-index: 0;
}
.hero-gradient-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 250px;
  background: linear-gradient(to bottom, var(--charcoal), transparent);
  z-index: 2;
}
.hero-gradient-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--bg) 0%, var(--bg) 10%, rgba(245, 240, 235, 0.9) 25%, rgba(245, 240, 235, 0.5) 50%, transparent 100%);
  z-index: 2;
}
.hero-gradient-sides {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(44, 42, 38, 0.7) 0%, transparent 20%, transparent 80%, rgba(44, 42, 38, 0.7) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 var(--side-pad);
}
.hero-location {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease 0.5s forwards;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 110px);
  font-weight: 300;
  line-height: 1.05;
  color: var(--white);
  letter-spacing: -0.01em;
}
.hero-title-line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 1s ease forwards;
}
.hero-title-line:nth-child(1) { animation-delay: 0.7s; }
.hero-title-line:nth-child(2) { animation-delay: 0.9s; }

.hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 200;
  color: rgba(255, 253, 249, 0.6);
  margin-top: 24px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease 1.2s forwards;
}
.hero-cta {
  display: inline-block;
  margin-top: 40px;
  padding: 16px 44px;
  background: rgba(255, 253, 249, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 253, 249, 0.5);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  transition: all 0.4s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease 1.4s forwards;
}
.hero-cta:hover {
  background: var(--white);
  color: var(--charcoal);
  border-color: var(--white);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--sand));
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ── Sections ── */
.section {
  padding: var(--section-pad) var(--side-pad);
}
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.section-label {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 48px;
  color: var(--charcoal);
}

/* ── Philosophy ── */
.philosophy { background: var(--bg); }
.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.philosophy-text p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.value-item {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(44, 42, 38, 0.08);
}
.value-item:first-child { border-top: 1px solid rgba(44, 42, 38, 0.08); }
.value-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  color: var(--terracotta);
  line-height: 1.2;
}
.value-item h4 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 6px;
}
.value-item p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Scroll Sequence (Exploding View) ── */
.scroll-sequence {
  height: 400vh;
  position: relative;
}
.scroll-sequence-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url(https://assets.tulumi.digital/casa-serena-demo/frames/frame_0001.jpg?v=2) center/cover no-repeat;
}
.scroll-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scroll-overlay-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(44, 42, 38, 0.7) 100%);
  z-index: 2;
}

.scroll-text-panels {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 var(--side-pad);
}
.scroll-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  width: max(320px, 40vw);
  background: linear-gradient(180deg, rgba(10,10,11,0.25) 0%, rgba(10,10,11,0.08) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 36px 32px;
}
.scroll-panel.active { opacity: 1; }
.scroll-panel-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--terracotta);
  display: block;
  margin-bottom: 16px;
}
.scroll-panel h3 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 300;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 20px;
}
.scroll-panel p {
  font-size: 16px;
  color: rgba(255, 253, 249, 0.55);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Services ── */
.services { background: var(--bg-deep); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.service-card {
  padding: 48px 40px;
  background: var(--bg);
  border-radius: 2px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(44, 42, 38, 0.08);
}
.service-icon {
  width: 48px;
  height: 48px;
  color: var(--terracotta);
  margin-bottom: 24px;
}
.service-card h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 12px;
}
.service-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Portfolio ── */
.portfolio { background: var(--bg); }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.portfolio-item { cursor: pointer; }
.portfolio-item--wide { grid-column: span 2; }
.portfolio-img {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  overflow: hidden;
  transition: transform 0.6s ease;
  background: var(--sand);
}
.portfolio-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.6s ease;
}
.portfolio-item:hover .portfolio-img img {
  transform: scale(1.04);
  filter: brightness(1.05);
}
.portfolio-item--wide .portfolio-img { aspect-ratio: 16 / 9; }
.portfolio-item:hover .portfolio-img { /* hover handled on img */ }
.portfolio-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portfolio-placeholder span {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 300;
  color: var(--charcoal);
  opacity: 0.35;
}
.portfolio-info {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── Testimonial ── */
.testimonial {
  background: var(--charcoal);
  text-align: center;
}
.testimonial-quote p {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.4;
  color: var(--sand);
  max-width: 800px;
  margin: 0 auto 32px;
}
.testimonial-quote cite {
  font-style: normal;
}
.testimonial-quote cite strong {
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.testimonial-quote cite span {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Contact ── */
.contact { background: var(--bg-deep); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.contact-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 380px;
}
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 16px 0;
  font-size: 15px;
  border-bottom: 1px solid rgba(44, 42, 38, 0.15);
  background: transparent;
  transition: border-color 0.3s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--terracotta);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--clay);
}
.form-group select {
  cursor: pointer;
  color: var(--clay);
  -webkit-appearance: none;
}
.form-group textarea {
  resize: vertical;
  min-height: 100px;
}
.form-submit {
  align-self: flex-start;
  padding: 16px 48px;
  background: var(--charcoal);
  color: var(--sand);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s ease;
}
.form-submit:hover {
  background: var(--terracotta);
  color: var(--white);
}

/* ── Footer ── */
.footer {
  padding: 64px var(--side-pad) 32px;
  background: var(--charcoal);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand);
  display: block;
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--sand); }
.footer-contact p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(217, 206, 188, 0.1);
}
.footer-bottom span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Reveal Animations ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr 1fr; }
  .portfolio-item--wide { grid-column: span 2; }
}

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

  .philosophy-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  .portfolio-item--wide { grid-column: span 1; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .scroll-panel h3 {
    font-size: clamp(28px, 6vw, 40px);
  }
  .lightbox-content {
    flex-direction: column !important;
    max-height: 90vh !important;
    width: 92vw !important;
    max-width: 92vw !important;
  }
  .lightbox-img-wrap {
    max-height: 40vh !important;
  }
  .lightbox-details {
    padding: 28px 24px !important;
  }
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 42, 38, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}
.lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  background: var(--white);
  border-radius: 3px;
  max-width: 900px;
  width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.4s ease;
}
.lightbox.open .lightbox-content {
  transform: translateY(0) scale(1);
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  transition: color 0.3s;
}
.lightbox-close:hover { color: var(--charcoal); }
.lightbox-img-wrap {
  flex: 1.2;
  min-height: 300px;
  background: var(--sand);
  overflow: hidden;
}
.lightbox-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lightbox-details {
  flex: 1;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lightbox-type {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 12px;
}
.lightbox-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 8px;
  color: var(--charcoal);
}
.lightbox-location {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: block;
}
.lightbox-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.lightbox-cta {
  display: inline-block;
  align-self: flex-start;
  padding: 16px 40px;
  background: var(--charcoal);
  color: var(--sand);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: all 0.4s ease;
  cursor: pointer;
}
.lightbox-cta:hover {
  background: var(--terracotta);
  color: var(--white);
}
