/* =====================================================================
   VILLA ALMA — Sierra Blanca, Marbella
   Nordic restraint · Andalusian light
   Type: Instrument Serif (display) · PP Neue Montreal (body) · Geist Mono (data)
   ===================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500&display=swap");

@font-face {
  font-family: "PP Neue Montreal";
  src: url("../fonts/PPNeueMontreal-Regular.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Palette — warm alabaster / warm ink / bronze (precious, small doses) */
  --sand:       #EFEAE0;
  --sand-deep:  #E5DECF;
  --ink:        #16140F;
  --ink-soft:   #262219;
  --stone:      #837B6C;
  --bronze:     #9C6B3F;
  --paper:      #FAF8F3;

  --line-dark:  rgba(22, 20, 15, 0.14);
  --line-light: rgba(250, 248, 243, 0.16);

  --font-display: "Instrument Serif", Georgia, serif;
  --font-body:    "PP Neue Montreal", "Helvetica Neue", system-ui, sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "Cascadia Mono", monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --pad-x: clamp(20px, 4vw, 64px);
  --section-gap: clamp(120px, 16vw, 220px);
}

* , *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: auto; }
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, p, dl, dd, dt, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.container {
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -100px;
  z-index: 200;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Masked line reveals ---------- */
.mask { display: block; overflow: hidden; }
.mask__inner {
  display: block;
  transform: translateY(110%);
  will-change: transform;
}
.mask__inner.is-italic { font-style: italic; }

/* No-JS / reduced motion safety: everything visible */
@media (prefers-reduced-motion: reduce) {
  .mask__inner { transform: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* =====================================================================
   NAV
   ===================================================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad-x);
  mix-blend-mode: difference;   /* stays legible over light & dark */
  color: #fff;
}
.nav__brand {
  font-family: var(--font-body);
  font-size: 17px;
  letter-spacing: 0.28em;
  font-weight: 500;
  display: flex; align-items: baseline; gap: 14px;
}
.nav__brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
}
.nav__ticker { opacity: 0.75; }
.nav__right { display: flex; align-items: center; gap: 24px; }
.nav__coords { opacity: 0.6; }
.nav__progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(255,255,255,0.14);
}
.nav__progress span {
  display: block; height: 100%;
  background: #fff;
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 26px;
  border-radius: 100px;
  border: 1px solid currentColor;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}
.button:hover { transform: translateY(-1px); }
.nav .button { height: 38px; padding: 0 20px; font-size: 11px; }
.nav .button:hover { background: #fff; color: #000; }

.button--solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.enquire .button:not(.button--solid):hover { background: var(--paper); color: var(--ink); }
.button--solid:hover { background: var(--sand-deep); border-color: var(--sand-deep); }

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  position: relative;
  height: 100svh;
  min-height: 640px;
  display: grid;
  place-items: center;
  overflow: clip;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  will-change: transform;
}
.hero__scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 55%, rgba(22,20,15,0.38) 0%, rgba(22,20,15,0.12) 60%, transparent 100%),
    linear-gradient(180deg, rgba(22,20,15,0.55) 0%, rgba(22,20,15,0.18) 38%, rgba(22,20,15,0.68) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-inline: var(--pad-x);
}
.eyebrow {
  color: currentColor;
  opacity: 0.72;
}
.hero__content .eyebrow { margin-bottom: clamp(20px, 3vh, 36px); }
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(72px, 15vw, 220px);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.hero__sub {
  margin-top: clamp(24px, 3.5vh, 40px);
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.6;
  opacity: 0.85;
}
.hero__meta {
  position: absolute;
  z-index: 2;
  left: var(--pad-x); right: var(--pad-x); bottom: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  opacity: 0.8;
}
.hero__scrollcue { display: inline-flex; align-items: center; gap: 10px; }
.hero__scrollcue i {
  display: block;
  width: 44px; height: 1px;
  background: currentColor;
  transform-origin: left;
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue {
  0%   { transform: scaleX(0); opacity: 0; }
  40%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1) translateX(12px); opacity: 0; }
}

/* =====================================================================
   SHARED — light editorial sections
   ===================================================================== */
.section--light {
  position: relative;
  background: var(--sand);
  color: var(--ink);
}
.villa, .setting { padding-block: var(--section-gap); }

.statement {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 6.4vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  max-width: 18ch;
  margin-top: clamp(28px, 4vw, 56px);
}
.statement em { font-style: italic; color: var(--bronze); }
.statement--sm { font-size: clamp(36px, 5vw, 80px); }
.statement--lg { max-width: none; }

.lead {
  font-size: clamp(19px, 1.9vw, 26px);
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.body { font-size: 16px; line-height: 1.7; color: var(--stone); }

[data-reveal] { opacity: 0; transform: translateY(28px); }

/* =====================================================================
   01 · THE VILLA
   ===================================================================== */
.villa__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(48px, 7vw, 120px);
  margin-top: clamp(64px, 8vw, 128px);
  align-items: start;
}
.villa__text { display: grid; gap: clamp(24px, 3vw, 40px); max-width: 560px; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line-dark);
  margin-top: clamp(16px, 2vw, 28px);
}
.stats__item {
  padding: 22px 0;
  border-bottom: 1px solid var(--line-dark);
}
.stats__item:nth-child(odd) { padding-right: 28px; }
.stats__item:nth-child(even) { padding-left: 28px; border-left: 1px solid var(--line-dark); }
.stats__item dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--stone); }
.stats__item dd {
  margin-top: 10px;
  display: flex; align-items: baseline; gap: 6px;
}
.stats__item dd .mono:first-child {
  font-size: clamp(30px, 3vw, 44px);
  letter-spacing: -0.02em;
  text-transform: none;
}
.stats__unit { font-size: 13px; color: var(--stone); }

.frame { overflow: clip; }
.frame img { width: 100%; height: 100%; object-fit: cover; }

.villa__figure .frame {
  aspect-ratio: 4 / 5;
}
.villa__figure .frame img {
  height: 116%;
  will-change: transform;
}
.villa__figure figcaption {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  margin-top: 14px;
}

/* =====================================================================
   02 · THE FILM
   ===================================================================== */
.film { position: relative; background: var(--ink); }
.film__stage {
  position: relative;
  height: 100svh;
  overflow: clip;
}
.film__video, .film__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.film__canvas { display: none; }
.film.is-canvas .film__canvas { display: block; }
.film.is-canvas .film__video { display: none; }
.film__vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(22,20,15,0.5) 0%, transparent 22%, transparent 70%, rgba(22,20,15,0.62) 100%);
}
.film__hud {
  position: absolute;
  top: 84px; left: var(--pad-x); right: var(--pad-x);
  display: flex; justify-content: space-between;
  opacity: 0.7;
}
.film__captions {
  position: absolute;
  left: var(--pad-x); bottom: 84px;
  height: clamp(56px, 7vw, 110px);
}
.film__caption {
  position: absolute; left: 0; bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 92px);
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.film__caption em { font-style: italic; }
.film__caption.is-active { opacity: 1; transform: none; }
.film__bar {
  position: absolute;
  left: var(--pad-x); right: var(--pad-x); bottom: 40px;
  height: 1px;
  background: var(--line-light);
}
.film__bar span {
  display: block; height: 100%;
  background: var(--paper);
  transform-origin: left;
  transform: scaleX(0);
}

/* =====================================================================
   03 · SPACES — pinned horizontal
   ===================================================================== */
.spaces { padding-top: var(--section-gap); }
.spaces__intro { padding-bottom: clamp(48px, 6vw, 96px); }
.spaces__pin {
  overflow: clip;
  height: 100svh;
  display: flex;
  align-items: center;
}
.spaces__track {
  display: flex;
  align-items: stretch;
  gap: clamp(24px, 3vw, 56px);
  padding-inline: var(--pad-x);
  width: max-content;
}
.panel {
  width: min(72vw, 880px);
  height: min(74svh, 820px);
  flex: none;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 22px;
}
.panel__media { min-height: 0; }
.panel__media img { transition: transform 1.2s var(--ease); }
.panel:hover .panel__media img { transform: scale(1.035); }
.panel__text {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 22px;
  align-items: baseline;
  border-top: 1px solid var(--line-dark);
  padding-top: 16px;
}
.panel__num { color: var(--bronze); }
.panel__text h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 40px);
  letter-spacing: -0.01em;
}
.panel__text p {
  grid-column: 2;
  margin-top: 6px;
  font-size: 15px;
  color: var(--stone);
  max-width: 44ch;
}

/* =====================================================================
   04 · THE SETTING
   ===================================================================== */
.setting { background: var(--sand-deep); overflow: clip; }
.setting__contours {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  color: var(--ink);
  opacity: 0.1;
  pointer-events: none;
}
.setting .container { position: relative; }
.setting__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(48px, 7vw, 120px);
  margin-top: clamp(56px, 7vw, 112px);
  align-items: start;
}
.setting .lead { max-width: 42ch; }
.ledger { border-top: 1px solid var(--line-dark); }
.ledger__row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-dark);
  font-size: clamp(17px, 1.6vw, 21px);
}
.ledger__row i { flex: 1; border-bottom: 1px dotted var(--line-dark); }
.ledger__row .mono { color: var(--bronze); }

/* =====================================================================
   05 · ENQUIRE + FOOTER
   ===================================================================== */
.enquire {
  background: var(--ink);
  color: var(--paper);
  padding-top: var(--section-gap);
  overflow: clip;
}
.enquire__inner { text-align: center; }
.enquire .statement { margin-inline: auto; }
.enquire__lead {
  margin: clamp(28px, 4vw, 48px) auto 0;
  max-width: 44ch;
  opacity: 0.75;
}
.enquire__actions {
  margin-top: clamp(36px, 5vw, 64px);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer { margin-top: clamp(100px, 14vw, 200px); }
.footer__word {
  overflow: hidden;
  line-height: 0.72;
  text-align: center;
  border-bottom: 1px solid var(--line-light);
}
.footer__word span {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(160px, 24vw, 420px);
  letter-spacing: 0.04em;
  transform: translateY(20%);
  margin-bottom: -0.06em;
  opacity: 0.92;
  will-change: transform;
}
.footer__row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 22px var(--pad-x) 26px;
  opacity: 0.55;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .nav__ticker, .nav__coords { display: none; }
  .hero__sub br { display: none; }
  .villa__grid, .setting__grid { grid-template-columns: 1fr; }
  .villa__figure { order: -1; max-width: 480px; }
  .panel { width: 84vw; height: min(64svh, 700px); }
  .film__hud { top: 72px; }
  .hero__meta span:nth-child(2) { display: none; }
}
@media (max-width: 560px) {
  .stats__item:nth-child(even) { padding-left: 18px; }
  .stats__item:nth-child(odd) { padding-right: 18px; }
  .hero__meta span:nth-child(3) { display: none; }
  .enquire__actions .button { width: 100%; }
}
