/* =============================================================
   Mandalay Beach Villas — stylesheet
   Design language: architectural monograph. Limestone paper,
   deep sea-pine signature, editorial serif statements, and
   blueprint-style mono annotations for specifications.
   ============================================================= */

/* ---- Tokens ---- */
:root {
  --ink:       #191C1A;
  --paper:     #FAF9F5;
  --sand:      #EBE6DA;
  --sand-line: #D8CFBC;
  --sea:       #1E433D;
  --sea-deep:  #15302B;
  --brass:     #9C7B4B;
  --mist:      #6E736C;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'SFMono-Regular', monospace;

  --measure: 66ch;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --maxw: 1320px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---- Type ---- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; line-height: 1.04; margin: 0; }
.display {
  font-size: clamp(2.6rem, 1.4rem + 5.4vw, 6rem);
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 120, 'SOFT' 30;
}
h2.section-title { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.4rem); }
h3 { font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1.1rem;
}
.lede { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem); line-height: 1.5; color: var(--ink); max-width: 40ch; }
p { max-width: var(--measure); }

/* ---- Layout primitives ---- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3.5rem, 2rem + 6vw, 8rem); }
.section--sand { background: var(--sand); }
.section--sea { background: var(--sea); color: var(--paper); }
.section--sea .eyebrow { color: #C7A877; }
.section--sea p { color: #DCE0D8; }

.datum {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mist);
}
.rule { height: 1px; background: var(--sand-line); border: 0; margin: 0; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--sand-line); }
.site-header__inner {
  max-width: var(--maxw); margin-inline: auto; padding: 1rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wordmark { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.wordmark .logo { height: 40px; width: auto; display: block; }
.wordmark b { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; letter-spacing: 0.01em; }
.wordmark span {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--mist);
}
.nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2.4rem); }
.nav a {
  text-decoration: none; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); position: relative; padding-block: 0.35rem;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: var(--brass); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--sea); }
.nav__toggle { display: none; }

/* ---- Hero ---- */
.hero { position: relative; min-height: min(92vh, 860px); display: flex; align-items: flex-end; color: var(--paper); overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); animation: slowzoom 14s var(--ease) forwards; }
@keyframes slowzoom { to { transform: scale(1); } }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(21,32,29,0.28) 0%, rgba(21,32,29,0.05) 32%, rgba(21,32,29,0.66) 100%);
}
.hero__inner { position: relative; z-index: 2; width: 100%; max-width: var(--maxw); margin-inline: auto; padding: 0 var(--gutter) clamp(2.5rem, 4vw, 4.5rem); }
.hero .eyebrow { color: #E9C892; }
.hero .display { max-width: 15ch; text-shadow: 0 2px 30px rgba(0,0,0,0.25); }
.hero__datum {
  margin-top: 2rem; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.82);
}
.hero__datum.datum { color: rgba(255,255,255,0.82); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none; padding: 0.95rem 1.6rem; border: 1px solid currentColor; color: var(--ink);
  background: transparent; cursor: pointer; transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--solid { background: var(--sea); color: var(--paper); border-color: var(--sea); }
.btn--solid:hover { background: var(--sea-deep); border-color: var(--sea-deep); color: var(--paper); }
.btn--ghost-light { color: var(--paper); }
.btn--ghost-light:hover { background: var(--paper); color: var(--ink); }
.btn .arw { transition: transform 0.35s var(--ease); }
.btn:hover .arw { transform: translateX(4px); }

/* ---- Editorial two-column rows ---- */
.row { display: grid; grid-template-columns: minmax(0,1fr); gap: clamp(1rem,3vw,3rem); }
@media (min-width: 860px) {
  .row--split { grid-template-columns: 0.85fr 1.15fr; align-items: start; }
  .row--index { grid-template-columns: 8rem 1fr; }
}
.index-mark { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em; color: var(--brass); padding-top: 0.4rem; }

/* ---- Intro / statement blocks ---- */
.statement { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 900px) { .statement { grid-template-columns: 1fr 1fr; align-items: end; } }

/* ---- Feature grid (design details) ---- */
.features { display: grid; gap: clamp(1.4rem, 2.5vw, 2.6rem); }
@media (min-width: 720px) { .features { grid-template-columns: repeat(2, 1fr); } }
.feature { border-top: 1px solid var(--sand-line); padding-top: 1.4rem; }
.feature h3 { margin-bottom: 0.6rem; }
.feature .no { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; color: var(--brass); display: block; margin-bottom: 0.9rem; }
.feature p { color: var(--mist); }
.section--sea .feature { border-top-color: rgba(255,255,255,0.2); }
.section--sea .feature p { color: #C9CEC6; }
.section--sea .feature .no { color: #C7A877; }

/* ---- Image treatments ---- */
figure { margin: 0; }
.imgframe { overflow: hidden; background: var(--sand); }
.imgframe img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
a.imgframe:hover img, .imgframe.zoom:hover img { transform: scale(1.05); }
figcaption { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist); margin-top: 0.7rem; }

.gallery { display: grid; gap: clamp(0.5rem, 1.2vw, 1rem); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery .imgframe { aspect-ratio: 4/3; }
.gallery .span-2 { grid-column: span 2; }
@media (min-width: 760px) { .gallery .tall { grid-row: span 2; aspect-ratio: 3/4; } }

.duo { display: grid; gap: clamp(0.5rem, 1.2vw, 1rem); grid-template-columns: 1fr; }
@media (min-width: 720px) { .duo { grid-template-columns: 1fr 1fr; } }
.duo .imgframe { aspect-ratio: 3/2; }

/* ---- Spec sheet (blueprint annotation) ---- */
.specsheet { border: 1px solid var(--sand-line); }
.specsheet__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.4rem clamp(1.2rem,2.5vw,2rem); border-bottom: 1px solid var(--sand-line); }
.specsheet__price { font-family: var(--font-display); font-size: clamp(1.6rem,1.2rem+1.5vw,2.4rem); }
.specsheet__price small { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mist); display: block; }
.specrows { display: grid; grid-template-columns: 1fr; }
@media (min-width: 640px) { .specrows { grid-template-columns: 1fr 1fr; } }
.specrow { display: flex; justify-content: space-between; gap: 1rem; padding: 0.95rem clamp(1.2rem,2.5vw,2rem); border-bottom: 1px solid var(--sand-line); }
.specrow:nth-last-child(-n+1) { border-bottom: 0; }
@media (min-width: 640px) { .specrow:nth-child(odd) { border-right: 1px solid var(--sand-line); } }
.specrow dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mist); margin: 0; }
.specrow dd { margin: 0; font-weight: 600; }

.amenities { list-style: none; margin: 1.8rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.amenities li { position: relative; padding-left: 1.6rem; }
.amenities li::before { content: "—"; position: absolute; left: 0; color: var(--brass); font-family: var(--font-mono); }

/* ---- Villa cards (rent / collection) ---- */
.villas { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
@media (min-width: 820px) { .villas { grid-template-columns: repeat(3, 1fr); } }
.villa-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.villa-card .imgframe { aspect-ratio: 3/2.1; }
.villa-card__body { padding-top: 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.villa-card__index { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; color: var(--brass); }
.villa-card h3 { font-size: 1.5rem; }
.villa-card__meta { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mist); }
.villa-card__cta { margin-top: 0.8rem; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 0.5rem; }
.villa-card__cta .arw { transition: transform 0.35s var(--ease); }
.villa-card:hover .villa-card__cta .arw { transform: translateX(5px); }

/* ---- Testimonials ---- */
.quotes { display: grid; gap: clamp(1.5rem,3vw,2.5rem); }
@media (min-width: 820px) { .quotes { grid-template-columns: repeat(3,1fr); } }
.quote { display: flex; flex-direction: column; gap: 1.2rem; }
.quote blockquote { margin: 0; font-family: var(--font-display); font-size: clamp(1.25rem,1rem+0.8vw,1.6rem); line-height: 1.32; }
.quote__by { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: #C7A877; text-decoration: none; margin-top: auto; }
.quote__by:hover { color: var(--paper); }

/* ---- Video ---- */
.videoframe { position: relative; aspect-ratio: 16/9; background: var(--sea-deep); overflow: hidden; }
.videoframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Location ---- */
.mapframe { aspect-ratio: 16/9; border: 1px solid var(--sand-line); overflow: hidden; }
.mapframe iframe { width: 100%; height: 100%; border: 0; filter: grayscale(0.35) contrast(1.02); }

/* ---- Inquiry form ---- */
.inquiry { display: grid; gap: clamp(2rem,4vw,3.5rem); }
@media (min-width: 900px) { .inquiry { grid-template-columns: 1fr 1fr; align-items: start; } }
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.1rem; }
.field label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist); }
.field input, .field textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--sand-line); padding: 0.85rem 0.9rem; border-radius: 0;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--sea); outline-offset: 1px; border-color: var(--sea); }
.contact-card { border: 1px solid var(--sand-line); padding: clamp(1.4rem,3vw,2.2rem); display: flex; flex-direction: column; gap: 1.1rem; }
.contact-card dt { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist); }
.contact-card dd { margin: 0.2rem 0 0; font-size: 1.05rem; }
.contact-card a { color: var(--sea); text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }
.qr { width: 118px; height: 118px; border: 1px solid var(--sand-line); }

/* ---- Downloads ---- */
.downloads { display: grid; gap: 0; }
.download-link { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 0; border-top: 1px solid var(--sand-line); text-decoration: none; color: var(--ink); }
.download-link:last-child { border-bottom: 1px solid var(--sand-line); }
.download-link span:first-child { font-family: var(--font-display); font-size: 1.2rem; }
.download-link .arw { font-family: var(--font-mono); color: var(--brass); transition: transform 0.35s var(--ease); }
.download-link:hover .arw { transform: translateX(5px); }

/* ---- Footer ---- */
.site-footer { background: var(--sea-deep); color: #CBD1C9; padding-block: clamp(3rem,5vw,5rem); }
.site-footer a { color: #CBD1C9; }
.footer-grid { display: grid; gap: 2.5rem; }
@media (min-width: 780px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer .wordmark b { color: var(--paper); }
.site-footer .logo { height: 52px; }
.site-footer .wordmark span { color: #8FA096; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: #8FA096; margin: 0 0 1rem; font-weight: 400; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: var(--paper); }
.footer-bottom { margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,0.14); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-bottom .datum { color: #7E8F84; }

/* ---- Reveal on scroll (visible by default; JS adds .pre to arm it) ---- */
.reveal { transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.pre { opacity: 0; transform: translateY(22px); }
.reveal.pre.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal.pre { opacity: 1; transform: none; } }

/* ---- Skip link + a11y ---- */
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 100; }
.skip:focus { left: 0.5rem; top: 0.5rem; }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }

/* ---- Mobile nav ---- */
@media (max-width: 760px) {
  .nav__toggle {
    display: inline-flex; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 0.4rem;
  }
  .nav__toggle span { width: 26px; height: 1.5px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
  .site-header.nav-open .nav__toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .site-header.nav-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .site-header.nav-open .nav__toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .nav {
    position: fixed; inset: 62px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--sand-line);
    padding: 0.5rem var(--gutter) 1.5rem; transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  }
  .site-header.nav-open .nav { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { width: 100%; padding: 1rem 0; border-bottom: 1px solid var(--sand-line); font-size: 1rem; }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }
}
