/* ==========================================================================
   Domaine Real Estate — Design Tokens
   ========================================================================== */

:root {
  --color-bg: #F5F1EA;
  --color-bg-secondary: #FFFFFF;
  --color-wood: #8B6F47;
  --color-charcoal: #2D2A24;
  --color-green: #4A6B4A;
  --color-sky: #87B5D9;

  --color-wood-soft: #C9B79C;
  --color-charcoal-soft: rgba(45, 42, 36, 0.65);
  --color-gold-accent: #C9A24B;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);

  --container: 1280px;
}

/* ==========================================================================
   Reset
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-wood);
  outline-offset: 3px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

body {
  background: var(--color-bg);
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--color-charcoal);
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500;
}

h3 {
  font-size: 1.5rem;
  font-weight: 500;
}

p { color: var(--color-charcoal-soft); }

.label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-wood);
  font-weight: 500;
}

button, input, textarea { font-family: var(--font-sans); }

/* ==========================================================================
   Reveal animation base state
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(40px);
}

/* ==========================================================================
   Nav
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem clamp(1.5rem, 5vw, 4rem);
  color: #fff;
  background: transparent;
  transition: background 0.4s var(--ease-soft), box-shadow 0.4s var(--ease-soft), color 0.4s var(--ease-soft);
}

.site-nav.is-scrolled {
  background: rgba(245, 241, 234, 0.94);
  box-shadow: 0 1px 0 rgba(45, 42, 36, 0.08);
  color: var(--color-charcoal);
  backdrop-filter: blur(8px);
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: inherit;
}

.wordmark span {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  font-weight: 400;
  display: block;
  margin-top: 0.15rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: inherit;
}

.nav-links a { opacity: 0.85; transition: opacity 0.3s var(--ease-soft); }
.nav-links a:hover { opacity: 1; }

.nav-cta {
  border: 1px solid currentColor;
  padding: 0.55rem 1.3rem;
  border-radius: 2px;
}

@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ==========================================================================
   1. Hero
   ========================================================================== */

.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(120% 100% at 30% 20%, #3a352c 0%, var(--color-charcoal) 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 clamp(1.5rem, 8vw, 7rem);
  max-width: 880px;
}

.hero-eyebrow {
  color: var(--color-sky);
  margin-bottom: 1.4rem;
  opacity: 0;
}

.hero-headline {
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  color: #fff;
  line-height: 1.08;
  letter-spacing: 0.01em;
  opacity: 0;
}

.hero-sub {
  margin-top: 1.8rem;
  max-width: 460px;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  font-weight: 300;
  opacity: 0;
}

/* ==========================================================================
   2. Scroll-driven Video Section
   ========================================================================== */

.video-section {
  position: relative;
}

.video-pin {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--color-charcoal);
}

.walkthrough-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,18,14,0.35) 0%, rgba(20,18,14,0) 30%, rgba(20,18,14,0) 70%, rgba(20,18,14,0.5) 100%);
  pointer-events: none;
}

.video-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s var(--ease-premium), transform 1s var(--ease-premium);
  transform: translateY(20px);
}

.video-text.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.video-text-inner {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-style: italic;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 30px rgba(0,0,0,0.35);
}

.video-text--alt .video-text-inner {
  font-style: normal;
  font-weight: 500;
}

.video-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.15);
  z-index: 3;
}

.video-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-wood-soft);
  transform-origin: left;
}

/* ==========================================================================
   3. Property Details
   ========================================================================== */

.property-statement {
  background: var(--color-charcoal);
  text-align: center;
  padding: clamp(4rem, 9vw, 6.5rem) clamp(1.5rem, 8vw, 5rem);
}

.property-statement .label { color: var(--color-sky); margin-bottom: 0.9rem; }
.property-statement h2 { color: #fff; }

.property-specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--color-bg-secondary);
}

.spec-card {
  position: relative;
  padding: clamp(2.4rem, 5vw, 4rem) 1.5rem;
  text-align: center;
}

.spec-value {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--color-wood);
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.spec-label {
  opacity: 0;
  transform: translateY(12px);
}

.spec-divider-line {
  position: absolute;
  top: 50%;
  right: 0;
  width: 1px;
  height: 56%;
  background: rgba(45, 42, 36, 0.14);
  transform: translateY(-50%) scaleY(0);
  transform-origin: center;
}

.spec-card:last-child .spec-divider-line { display: none; }

@media (max-width: 720px) {
  .property-specs { grid-template-columns: repeat(2, 1fr); }
  .spec-divider-line { display: none; }
  .spec-card { border-bottom: 1px solid rgba(45,42,36,0.08); }
  .spec-card:nth-child(odd) { border-right: 1px solid rgba(45,42,36,0.08); }
}

/* ==========================================================================
   4. Features
   ========================================================================== */

.features {
  padding: clamp(5rem, 10vw, 8rem) clamp(1.5rem, 8vw, 6rem);
  max-width: var(--container);
  margin: 0 auto;
}

.features-head {
  text-align: center;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.features-head .label { display: block; margin-bottom: 1rem; }

.features-label,
.features-heading {
  opacity: 0;
  transform: translateY(16px);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
}

.feature-card {
  background: var(--color-bg-secondary);
  padding: clamp(2.2rem, 4vw, 3rem) clamp(1.8rem, 3vw, 2.4rem);
  border-radius: 4px;
  opacity: 0;
  transform: translateY(40px);
}

.feature-icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  color: var(--color-wood);
  margin-bottom: 1.6rem;
  opacity: 0;
  transform: scale(0.6) rotate(-12deg);
  transition: color 0.4s var(--ease-soft);
}

.feature-card:hover .feature-icon { color: var(--color-gold-accent); }

.feature-icon svg { width: 100%; height: 100%; }

.feature-card h3 { margin-bottom: 0.9rem; }

@media (max-width: 860px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   5. Contact
   ========================================================================== */

.contact {
  background: var(--color-charcoal);
  padding: clamp(5rem, 10vw, 8rem) clamp(1.5rem, 8vw, 6rem);
}

.contact-inner {
  max-width: 780px;
  margin: 0 auto;
}

.contact-head { text-align: center; margin-bottom: 3.2rem; }
.contact-head .label { display: block; margin-bottom: 1rem; color: var(--color-sky); }
.contact-head h2 { color: #fff; }
.contact-sub { color: rgba(245,241,234,0.65); margin-top: 1rem; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.form-row { display: flex; flex-direction: column; gap: 0.6rem; }

.form-row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
}

.form-row--split > div { display: flex; flex-direction: column; gap: 0.6rem; }

@media (max-width: 600px) {
  .form-row--split { grid-template-columns: 1fr; }
}

.contact-form label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-wood-soft);
}

.contact-form input,
.contact-form textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(245,241,234,0.3);
  padding: 0.7rem 0.1rem;
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.3s var(--ease-soft);
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-wood-soft);
}

.btn-submit {
  margin-top: 1rem;
  align-self: flex-start;
  background: var(--color-wood);
  color: #fff;
  border: none;
  padding: 1rem 2.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.4s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.btn-submit:hover { background: #9c7e54; transform: translateY(-2px); }

.form-status {
  font-size: 0.85rem;
  color: var(--color-sky);
  min-height: 1.2rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--color-charcoal);
  border-top: 1px solid rgba(245,241,234,0.1);
  padding: 2.4rem clamp(1.5rem, 8vw, 6rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer .wordmark { color: #fff; }
.site-footer .label { color: rgba(245,241,234,0.5); letter-spacing: 0.08em; }

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.footer-note {
  font-size: 0.68rem;
  color: rgba(245,241,234,0.35);
}

@media (max-width: 600px) {
  .site-footer { flex-direction: column; text-align: center; }
  .footer-meta { align-items: center; }
}

/* ==========================================================================
   6. Gallery Page
   ========================================================================== */

.hero--compact {
  height: auto;
  min-height: 62vh;
  padding: clamp(8rem, 16vw, 10rem) 0 clamp(4rem, 8vw, 5rem);
}

/* ---- Room sections -------------------------------------------------- */

.room-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 7.5rem) clamp(1.5rem, 8vw, 6rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}

.room-section--alt { background: var(--color-bg-secondary); }

.room-section--reverse .room-media { order: 2; }
.room-section--reverse .room-copy { order: 1; }

.room-media {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 4 / 3;
  background: var(--color-charcoal);
  opacity: 0;
}

.room-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  will-change: transform;
}

.room-copy {
  opacity: 0;
}

.room-copy--left { transform: translateX(-44px); }
.room-copy--right { transform: translateX(44px); }

.room-index { color: var(--color-wood); display: block; margin-bottom: 1rem; }

.room-copy h2 { margin-bottom: 1.2rem; }

.room-copy p { max-width: 44ch; }

@media (max-width: 860px) {
  .room-section {
    grid-template-columns: 1fr;
  }
  .room-section--reverse .room-media,
  .room-section--reverse .room-copy {
    order: initial;
  }
  .room-copy--left,
  .room-copy--right {
    transform: translateY(28px);
  }
}

/* ---- Gallery CTA ------------------------------------------------------ */

.gallery-cta {
  background: var(--color-charcoal);
  padding: clamp(5rem, 10vw, 8rem) clamp(1.5rem, 8vw, 6rem);
  text-align: center;
}

.gallery-cta-inner { max-width: 640px; margin: 0 auto; }

.gallery-cta .label { color: var(--color-sky); margin-bottom: 1rem; }
.gallery-cta h2 { color: #fff; }

.gallery-cta-sub {
  color: rgba(245, 241, 234, 0.65);
  margin-top: 1.1rem;
}

.btn-cta {
  display: inline-block;
  margin-top: 2.2rem;
  background: var(--color-wood);
  color: #fff;
  border: none;
  padding: 1rem 2.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.4s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.btn-cta:hover { background: #9c7e54; transform: translateY(-2px); }

/* ==========================================================================
   7. Contact Page
   ========================================================================== */

/* ---- Form refinements shared by the on-page and standalone forms ------ */

.form-row {
  transition: transform 0.05s linear;
}

.form-row:focus-within label {
  color: var(--color-gold-accent);
  transition: color 0.3s var(--ease-soft);
}

.contact-form input[type="date"] {
  color-scheme: dark;
}

.contact-form input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.7;
  cursor: pointer;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@keyframes fieldShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}

.form-row.is-invalid {
  animation: fieldShake 0.4s var(--ease-soft);
}

.form-row.is-invalid label {
  color: #d98c6c;
}

/* ---- Light variant, used where the form sits directly beneath a
   charcoal hero and needs to read as its own block ---------------------- */

.contact--light {
  background: var(--color-bg-secondary);
}

.contact--light .contact-head .label { color: var(--color-wood); }
.contact--light .contact-head h2 { color: var(--color-charcoal); }
.contact--light .contact-sub { color: var(--color-charcoal-soft); }

.contact--light .contact-form label {
  color: var(--color-wood);
}

.contact--light .contact-form input,
.contact--light .contact-form textarea {
  color: var(--color-charcoal);
  border-bottom-color: rgba(45, 42, 36, 0.25);
}

.contact--light .contact-form input:focus,
.contact--light .contact-form textarea:focus {
  border-color: var(--color-wood);
}

.contact--light .contact-form input[type="date"] {
  color-scheme: light;
}

.contact--light .contact-form input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.6;
}

.contact--light .form-status { color: var(--color-wood); }

/* ---- Agent / contact info section -------------------------------------- */

.agent-section {
  background: var(--color-bg);
  padding: clamp(5rem, 10vw, 8rem) clamp(1.5rem, 8vw, 6rem);
}

.agent-card {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.agent-card .label { display: block; margin-bottom: 1rem; }

.agent-name { margin-bottom: 2.2rem; }

.agent-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.8rem;
}

.agent-detail {
  font-size: 1.02rem;
  color: var(--color-charcoal-soft);
  transition: color 0.3s var(--ease-soft);
}

a.agent-detail:hover { color: var(--color-wood); }

.agent-note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-wood);
}

/* ---- Closing note ------------------------------------------------------ */

.closing-note {
  background: var(--color-charcoal);
  padding: clamp(4.5rem, 9vw, 7rem) clamp(1.5rem, 8vw, 6rem);
  text-align: center;
}

.closing-note-inner { max-width: 720px; margin: 0 auto; }

.closing-line {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.5;
  color: #fff;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .spec-label,
  .spec-divider-line,
  .features-label,
  .features-heading,
  .feature-card,
  .feature-icon {
    opacity: 1;
    transform: none;
  }
  .room-media,
  .room-copy {
    opacity: 1;
    transform: none;
  }
  .room-media img {
    transform: none;
  }
  .form-row.is-invalid {
    animation: none;
  }
}
