/* RIVAGE — demo site. Warm editorial theme: charcoal chapters, paper sections, copper accent. */

/* Self-hosted fonts, font-display:optional — no late swap, text LCP lands at first paint. */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('../fonts/instrument.woff2') format('woff2');
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 600;
  font-display: optional;
  src: url('../fonts/hanken.woff2') format('woff2');
}

:root {
  --bg: #141210;
  --bg-2: #1a1815;
  --panel: #201d19;
  --ink: #efe9df;
  --muted: #a69e91;
  --line: #2c2823;
  --copper: #c28450;
  --copper-deep: #96613a;
  /* warm daylight theme for the paper sections */
  --paper: #f4efe7;
  --paper-2: #ebe4d7;
  --ink-dark: #241e17;
  --muted-dark: #6f675a;
  --line-dark: rgba(36, 30, 23, 0.14);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* no scroll-behavior:smooth — Lenis owns smoothing; native smooth fights the pin spacer */
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: 0.005em; }

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 4px;
}

.overline {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.85rem 1.9rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.btn:hover { background: transparent; color: var(--ink); transform: translateY(-1px); }
.btn--small { padding: 0.55rem 1.25rem; font-size: 0.85rem; }
.btn--copper { background: var(--copper); border-color: var(--copper); color: #160f09; }
.btn--copper:hover { background: transparent; color: var(--copper); }

/* ---------- Demo badge ---------- */
.demo-badge {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 60;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(20, 18, 16, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.25s ease, color 0.25s ease;
}
.demo-badge:hover { border-color: var(--copper); color: var(--copper); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.nav.is-solid {
  background: rgba(20, 18, 16, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.nav__logo {
  font-family: var(--serif);
  font-size: 1.55rem;
  letter-spacing: 0.16em;
}
.nav__links { display: flex; gap: clamp(1rem, 2.5vw, 2rem); }
.nav__links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__right { display: flex; align-items: center; gap: 0.9rem; }
.nav__lang {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav__lang:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- Chapters (pinned frame-scrub scenes) ---------- */
.chapter {
  position: relative;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-2); /* holds the frame while poster/frames arrive — no white flash */
}
.chapter__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chapter__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* readability scrims: gentle darkening at top (nav) and bottom (captions) */
.chapter__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(14, 12, 10, 0.5), transparent 22%),
    linear-gradient(to top, rgba(14, 12, 10, 0.55), transparent 38%);
}
.chapter__loader {
  position: absolute;
  left: 50%;
  bottom: 2.4rem;
  transform: translateX(-50%);
  z-index: 6;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  opacity: 0.85;
}
.chapter__loader-label {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.chapter__loader-track {
  display: block;
  width: 140px;
  height: 2px;
  border-radius: 2px;
  background: rgba(239, 233, 223, 0.18);
  overflow: hidden;
}
.chapter__loader-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

/* ---------- Story overlays ---------- */
.story__brand {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  pointer-events: none;
  padding: 0 1.5rem 10vh;
}
.story__title {
  font-size: clamp(3.6rem, 13vw, 10rem);
  letter-spacing: 0.24em;
  margin-left: 0.24em; /* optically recenter the tracked-out wordmark */
  line-height: 1;
  text-shadow: 0 2px 44px rgba(10, 9, 7, 0.65);
}
.story__tagline {
  margin-top: 1.2rem;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  color: var(--ink);
  text-shadow: 0 1px 24px rgba(10, 9, 7, 0.6);
}
.story__sub {
  margin-top: 0.8rem;
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  color: rgba(239, 233, 223, 0.78);
  max-width: 44ch;
}
.story__caption {
  position: absolute;
  left: clamp(1.5rem, 6vw, 6rem);
  bottom: clamp(5rem, 14vh, 9rem);
  max-width: min(86vw, 560px);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  padding: 1.4rem 1.7rem;
  border-radius: 16px;
  color: var(--ink);
  background: rgba(14, 12, 10, 0.38);
  border: 1px solid rgba(239, 233, 223, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.story__caption h2 {
  font-size: clamp(1.9rem, 4.8vw, 3.4rem);
  line-height: 1.08;
  text-shadow: 0 2px 30px rgba(10, 9, 7, 0.45);
}
.story__caption .sub {
  margin-top: 0.9rem;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: rgba(239, 233, 223, 0.82);
}
.story__caption .overline { margin-bottom: 0.8rem; }
.story__caption--cta { pointer-events: auto; }
.story__caption--cta .btn { margin-top: 1.4rem; }
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.6;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

/* ---------- Interludes (paper breathers between chapters) ---------- */
.interlude {
  display: grid;
  place-items: center;
  min-height: 46vh;
  padding: clamp(3rem, 8vw, 5rem) clamp(1.25rem, 6vw, 6rem);
  background: var(--paper);
  color: var(--ink-dark);
  text-align: center;
}
.interlude__line {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  line-height: 1.3;
  max-width: 30ch;
  color: var(--ink-dark);
}

/* ---------- Sections (paper by default; contact + nexa stay night) ---------- */
.section {
  padding: clamp(4.5rem, 10vw, 8rem) clamp(1.25rem, 6vw, 6rem);
  border-top: 1px solid var(--line-dark);
  background: var(--paper);
  color: var(--ink-dark);
}
.section .overline { color: var(--copper-deep); }
.vie { background: var(--paper-2); }
.section__title {
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  line-height: 1.15;
  max-width: 24ch;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

/* Residences */
.units { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.unit {
  background: #fffdf8;
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.75rem;
  box-shadow: 0 10px 30px rgba(36, 30, 23, 0.06);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.unit:hover {
  border-color: var(--copper-deep);
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(36, 30, 23, 0.12);
}
.unit__img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1.3rem;
  background: var(--paper-2);
}
.unit h3 { font-size: 1.5rem; }
.unit__size { color: var(--muted-dark); font-size: 0.85rem; letter-spacing: 0.08em; margin: 0.2rem 0 0.8rem; }
.unit__desc { color: var(--muted-dark); font-size: 0.95rem; min-height: 3em; }
.unit__price { margin-top: 1.1rem; font-weight: 600; color: var(--copper-deep); }

/* Amenities */
.amenities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.amenity { border-top: 1px solid var(--line-dark); padding-top: 1.2rem; }
.amenity h3 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.amenity p { color: var(--muted-dark); font-size: 0.93rem; }

/* Neighbourhood */
.quartier__para {
  max-width: 58ch;
  color: var(--muted-dark);
  font-size: 1.05rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem 1rem; max-width: 900px; }
.stat { border-left: 2px solid var(--copper-deep); padding-left: 1rem; }
.stat__value { display: block; font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--ink-dark); }
.stat__label { color: var(--muted-dark); font-size: 0.85rem; }

/* Contact (stays night — the story ends at dusk, the form inherits that mood) */
.contact { background: var(--bg-2); color: var(--ink); border-top-color: var(--line); }
.contact .overline { color: var(--copper); }
.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.contact__line { color: var(--muted); }
.form { display: grid; gap: 1.1rem; }
.form label { display: grid; gap: 0.4rem; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.form input, .form select {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  transition: border-color 0.2s ease;
}
.form input:focus, .form select:focus { outline: none; border-color: var(--copper); }
.form .btn { justify-self: start; margin-top: 0.4rem; }
.form__success { color: var(--copper); font-weight: 600; }

/* NexaWebDev banner */
.nexa {
  text-align: center;
  color: var(--ink);
  border-top-color: var(--line);
  background:
    radial-gradient(60% 120% at 50% 0%, rgba(194, 132, 80, 0.10), transparent 60%),
    var(--bg);
}
.nexa .overline { color: var(--copper); }
.nexa .section__title { margin-left: auto; margin-right: auto; }
.nexa__line { color: var(--muted); max-width: 52ch; margin: 0 auto clamp(1.5rem, 4vw, 2.5rem); }

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-end;
  padding: 3rem clamp(1.25rem, 6vw, 6rem) 4.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer__logo { font-family: var(--serif); font-size: 1.4rem; letter-spacing: 0.16em; color: var(--ink); margin-bottom: 0.6rem; }
.footer__addr { margin-top: 0.4rem; font-size: 0.85rem; }
.footer__legal { font-size: 0.78rem; opacity: 0.8; max-width: 52ch; }

/* ---------- Reveals (JS-gated so no-JS still shows everything) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .units, .amenities { grid-template-columns: 1fr 1fr; }
  .contact__inner { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 1.5rem; }
}
@media (max-width: 560px) {
  .units, .amenities { grid-template-columns: 1fr; }
  .unit__desc { min-height: 0; }
  .story__caption {
    left: 1.1rem;
    right: 1.1rem;
    max-width: none;
    bottom: clamp(4rem, 12vh, 7rem);
    padding: 1.1rem 1.25rem;
  }
  .nav .btn--small { display: none; }
}

/* ---------- Reduced motion: scrub stays (user-driven), self-playing motion stops ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-hint { animation: none; }
  html.js .reveal { transition: none; transform: none; opacity: 1; }
  .btn, .unit { transition: none; }
  .chapter__loader-bar { transition: none; }
}
