/* ==========================================================================
   Canyon View Domes — Central Otago, NZ
   Palette & type from the CVD brand book.
   ========================================================================== */

:root {
  /* Brand colours */
  --deep-earth: #3A2F2A;   /* primary dark — headers, footer, hero overlays */
  --canyon-taupe: #6E5E54; /* secondary text, accents */
  --soft-stone: #B8A99B;   /* muted background blocks */
  --warm-cream: #F3EDE4;   /* main background */
  --linen-white: #FBF8F3;  /* whitespace / cards */
  --rock-brown: #6E4B3F;   /* accent */
  --clay: #A87867;         /* warm accent */

  /* Semantic */
  --bg: var(--warm-cream);
  --surface: var(--linen-white);
  --text: var(--deep-earth);
  --text-soft: var(--canyon-taupe);
  --line: rgba(58, 47, 42, 0.14);
  --line-light: rgba(251, 248, 243, 0.18);

  /* Type */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Spacious rhythm */
  --space-section: clamp(5rem, 12vw, 11rem);
  --gutter: clamp(1.5rem, 5vw, 6rem);
  --maxw: 1240px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 2px; }

.visually-hidden, .signup label.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--clay); margin-bottom: 1.6rem;
}
.eyebrow--light { color: var(--soft-stone); }

.statement {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.75rem, 8vw, 6.5rem); line-height: 1.02;
  letter-spacing: -0.01em; color: var(--text);
}
.statement--light { color: var(--linen-white); }

.heading-lg {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 4rem); line-height: 1.06;
  letter-spacing: -0.005em;
}

.lede { font-size: clamp(1.15rem, 1.8vw, 1.45rem); color: var(--text-soft); line-height: 1.55; }

/* Line-mask reveal (JS wraps heading lines) */
.rl-mask { display: block; overflow: hidden; padding-bottom: 0.22em; margin-bottom: -0.22em; }
.rl-inner { display: block; will-change: transform; }

/* Brand symbol — the real logo mark, recoloured per context via CSS mask */
.cvd-mark {
  display: inline-block; aspect-ratio: 560 / 250;
  background-color: currentColor;
  -webkit-mask: url("../assets/cvd-symbol.png") center / contain no-repeat;
          mask: url("../assets/cvd-symbol.png") center / contain no-repeat;
}

.section { padding: var(--space-section) var(--gutter); max-width: var(--maxw); margin-inline: auto; }
.section--cream { background: var(--warm-cream); }
.section--dark { background: var(--deep-earth); color: var(--linen-white); max-width: none; }
.section--dark .section { }
.section__head { max-width: 760px; margin-bottom: clamp(3rem, 6vw, 5rem); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 1.05em 1.9em; border-radius: 100px;
  transition: transform 0.25s var(--ease), background-color 0.3s var(--ease),
              color 0.3s var(--ease), border-color 0.3s var(--ease), opacity 0.3s;
  will-change: transform;
}
.btn--solid { background: var(--deep-earth); color: var(--linen-white); }
.btn--solid:hover { background: var(--rock-brown); transform: translateY(-2px); }
.section--dark .btn--solid { background: var(--linen-white); color: var(--deep-earth); }
.section--dark .btn--solid:hover { background: var(--clay); color: var(--linen-white); }
.btn--ghost { border: 1px solid var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--rock-brown); color: var(--rock-brown); }
.btn--text { padding: 1.05em 0.4em; letter-spacing: 0.1em; }
.btn--text .btn__arrow { transition: transform 0.3s var(--ease); }
.btn--text:hover .btn__arrow { transform: translateX(5px); }

/* ==========================================================================
   Preloader
   ========================================================================== */
.preloader {
  position: fixed; inset: 0; z-index: 200; background: var(--deep-earth);
  display: grid; place-items: center; color: var(--soft-stone);
}
.preloader__mark { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.preloader .mark-symbol { width: 110px; color: var(--soft-stone); }
.preloader__word {
  font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.55em;
  text-transform: uppercase; padding-left: 0.55em; opacity: 0.75;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h); display: flex; align-items: center; gap: 2rem;
  padding: 0 var(--gutter);
  color: var(--linen-white);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease),
              box-shadow 0.4s var(--ease), backdrop-filter 0.4s;
}
.nav.is-solid {
  background: rgba(251, 248, 243, 0.88);
  backdrop-filter: saturate(140%) blur(14px);
  color: var(--deep-earth);
  box-shadow: 0 1px 0 var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 0.7rem; margin-right: auto; }
.nav__symbol { width: 46px; color: currentColor; }
.nav__word {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  letter-spacing: 0.28em; text-transform: uppercase; padding-left: 0.28em;
  white-space: nowrap;
}
.nav__word em { font-style: normal; font-size: 1em; opacity: 0.8; letter-spacing: 0.28em; }
.nav__links { display: flex; gap: 2.2rem; }
.nav__links a {
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em; position: relative;
  padding: 0.4rem 0; opacity: 0.9;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: currentColor; transition: width 0.3s var(--ease);
}
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after { width: 100%; }
.nav__cta { padding: 0.75em 1.4em; }
.nav.is-solid .nav__cta { border-color: var(--line); }
.nav__toggle { display: none; flex-direction: column; gap: 6px; padding: 8px; }
.nav__toggle span { width: 26px; height: 1.5px; background: currentColor; transition: transform .3s var(--ease), opacity .3s; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column;
  justify-content: center; padding: var(--nav-h) var(--gutter) 0;
  overflow: hidden; color: var(--linen-white);
}
.hero__scene { position: absolute; inset: 0; z-index: 0; background: var(--deep-earth); overflow: hidden; }
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; will-change: transform;
}
.hero__vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(36,28,24,0.55) 0%, rgba(36,28,24,0.12) 30%, rgba(36,28,24,0.15) 55%),
    linear-gradient(0deg, rgba(36,28,24,0.88) 0%, rgba(36,28,24,0.1) 42%, rgba(36,28,24,0) 62%);
}

.hero__content { position: relative; z-index: 2; max-width: 880px; }
.hero__logo { margin-bottom: 2rem; }
.hero__wordmark {
  font-family: var(--font-display); font-weight: 500; line-height: 1; margin: 0;
  font-size: clamp(1.6rem, 7.7vw, 6.5rem); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--linen-white); white-space: nowrap;
}
@media (max-width: 400px) { .hero__wordmark { letter-spacing: 0.012em; } }
.hero__tagline {
  font-size: clamp(1.05rem, 1.7vw, 1.35rem); max-width: 46ch; color: #ece3d5;
  line-height: 1.6; margin-bottom: 2.4rem;
}
.hero__tagline p { margin: 0; }
.hero__tagline p + p { margin-top: 1rem; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem; }
.hero__actions .btn--text { color: var(--linen-white); }

.hero__scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--soft-stone);
}
.hero__scroll-line { width: 1px; height: 46px; background: linear-gradient(var(--soft-stone), transparent); position: relative; overflow: hidden; }
.hero__scroll-line::after {
  content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%;
  background: var(--linen-white); animation: scrollDrop 2s var(--ease) infinite;
}
@keyframes scrollDrop { 0% { top: -50%; } 60%,100% { top: 100%; } }

/* ==========================================================================
   The Place / stats
   ========================================================================== */
.place__body {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 4rem);
  margin: clamp(2rem, 5vw, 3.5rem) 0 clamp(3.5rem, 7vw, 6rem);
}
.place__body p:not(.lede) { color: var(--text-soft); max-width: 46ch; }
@media (max-width: 760px) { .place__body { grid-template-columns: 1fr; } }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
  border-top: 1px solid var(--line); padding-top: clamp(2rem, 4vw, 3rem);
}
.stats li { display: flex; flex-direction: column; gap: 0.7rem; position: relative; }
.stats__num, .stats__figure {
  font-family: var(--font-display); font-weight: 500; color: var(--rock-brown);
  font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: 1;
  height: clamp(3rem, 6.6vw, 4.8rem); display: flex; align-items: flex-end;
}
.stats__num--inf { font-size: clamp(2.9rem, 6.2vw, 4.6rem); }
.stats__num--text { font-size: clamp(1.5rem, 3.2vw, 2.2rem); }
.stats__figure { align-items: baseline; }
.stats__suffix { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 3vw, 2.4rem); color: var(--rock-brown); margin-left: 0.05em; }
.stats__label { font-size: 0.78rem; letter-spacing: 0.08em; color: var(--text-soft); }
@media (max-width: 680px) { .stats { grid-template-columns: repeat(2, 1fr); gap: 2rem; } }

/* ==========================================================================
   The Domes
   ========================================================================== */
.domes__grid {
  display: grid; grid-template-columns: 0.95fr 1.05fr; gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.domes__art { position: sticky; top: 96px; }
.domes__photo {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px;
  box-shadow: 0 34px 66px -42px rgba(58, 47, 42, 0.55);
}
.domes__text .heading-lg { margin: 0.5rem 0 0.5rem; }
.domes__features { margin-top: 2rem; display: grid; gap: 1.9rem; }
.domes__feature { border-top: 1px solid var(--line); padding-top: 1.6rem; }
.domes__feature h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.4rem, 2.4vw, 1.95rem); line-height: 1.1;
  margin-bottom: 0.55rem; color: var(--deep-earth);
}
.domes__feature p { color: var(--text-soft); font-size: 1rem; line-height: 1.65; }
@media (max-width: 820px) {
  .domes__grid { grid-template-columns: 1fr; }
  .domes__art { position: static; }
  .domes__photo { aspect-ratio: 3 / 2; }
}

/* ==========================================================================
   Experiences
   ========================================================================== */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.5vw, 1.75rem); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(1.75rem, 3vw, 2.75rem); position: relative; overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -30px rgba(58,47,42,0.5); border-color: transparent; }
.card__index {
  font-family: var(--font-display); font-style: italic; font-size: 1.3rem;
  color: var(--clay); margin-bottom: 2.2rem;
}
.card h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 0.7rem; }
.card p { color: var(--text-soft); font-size: 0.98rem; max-width: 38ch; }
@media (max-width: 680px) { .cards { grid-template-columns: 1fr; } }

/* ==========================================================================
   Journey / timeline
   ========================================================================== */
.journey { max-width: var(--maxw); margin-inline: auto; }
.journey__intro { color: var(--soft-stone); max-width: 52ch; margin-top: 1.4rem; }
.timeline {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem;
  position: relative; margin-top: 1rem;
}
.timeline::before {
  content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 1px;
  background: var(--line-light);
}
.timeline__item { position: relative; padding-top: 2.4rem; }
.timeline__dot {
  position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--soft-stone); background: var(--deep-earth); transition: all 0.3s;
}
.timeline__item.is-done .timeline__dot { background: var(--soft-stone); }
.timeline__item.is-active .timeline__dot {
  background: var(--clay); border-color: var(--clay);
  box-shadow: 0 0 0 5px rgba(168,120,103,0.22);
}
.timeline__phase { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--clay); }
.timeline__item h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; margin: 0.5rem 0 0.5rem; color: var(--linen-white); }
.timeline__item p { font-size: 0.9rem; color: var(--soft-stone); line-height: 1.5; }
.timeline__item:not(.is-done):not(.is-active) { opacity: 0.62; }
@media (max-width: 900px) {
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline::before { top: 0; bottom: 0; left: 6px; right: auto; width: 1px; height: auto; }
  .timeline__item { padding: 0 0 2rem 2.2rem; }
  .timeline__dot { top: 4px; }
}

/* ==========================================================================
   Gallery — placeholder scenes built from brand tones
   ========================================================================== */
.gallery__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}
.gallery__item {
  position: relative; border-radius: 16px; overflow: hidden;
  display: flex; align-items: flex-end; padding: 1.25rem; color: var(--linen-white);
}
.gallery__item figcaption {
  position: relative; z-index: 2; font-family: var(--font-display); font-style: italic;
  font-size: 1.15rem; text-shadow: 0 1px 12px rgba(0,0,0,0.5);
  transform: translateY(8px); opacity: 0; transition: transform 0.4s var(--ease), opacity 0.4s;
}
.gallery__item:hover figcaption { transform: translateY(0); opacity: 1; }
.gallery__item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(36,28,24,0.55), transparent 60%); z-index: 1; }
.gallery__item--tall { grid-row: span 2; }
.gallery__item--wide { grid-column: span 2; }

/* placeholder "photo" scenes */
.gscene { background-size: cover; background-position: center; transition: transform 0.7s var(--ease); }
.gallery__item:hover .gscene, .gscene:hover { transform: scale(1.04); }
.gscene--dawn  { background: linear-gradient(160deg, #7a6455 0%, #4a3b31 55%, #2f251f 100%); }
.gscene--dome  { background: radial-gradient(120% 100% at 50% 120%, #a87867 0%, #6e5e54 45%, #3a2f2a 100%); }
.gscene--river { background: linear-gradient(200deg, #8a9585 0%, #6e5e54 50%, #3a2f2a 100%); }
.gscene--dusk  { background: linear-gradient(180deg, #c99a6a 0%, #a8786755 30%, #6e4b3f 70%, #2f251f 100%); }
.gscene--night { background: radial-gradient(80% 120% at 70% 10%, #4a4258 0%, #2e2830 40%, #1c1815 100%); }
.gscene--dome::before, .gscene--night::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background-image: radial-gradient(1px 1px at 20% 30%, #fff9, transparent), radial-gradient(1px 1px at 70% 20%, #fff7, transparent), radial-gradient(1.5px 1.5px at 45% 55%, #fff8, transparent), radial-gradient(1px 1px at 85% 40%, #fff6, transparent);
}
.gallery__note { text-align: center; margin-top: 2rem; font-size: 0.85rem; color: var(--text-soft); font-style: italic; }
@media (max-width: 760px) {
  .gallery__grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .gallery__item--wide { grid-column: span 2; }
  .gallery__item--tall { grid-row: span 1; }
}

/* ==========================================================================
   Join / signup
   ========================================================================== */
.join { display: grid; place-items: center; text-align: center; }
.join__inner { max-width: 680px; padding-inline: var(--gutter); }
.join__symbol { width: 96px; color: var(--soft-stone); margin: 0 auto 1.8rem; }
.join .statement { margin: 0.4rem 0 1.4rem; }
.join__lede { color: var(--soft-stone); font-size: 1.1rem; margin-bottom: 2.6rem; max-width: 46ch; margin-inline: auto; }

/* Social buttons — the primary call to action */
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; margin-bottom: 2.8rem; }
.social-btn {
  display: inline-flex; align-items: center; gap: 0.7rem;
  padding: 1em 1.8em; border-radius: 100px;
  border: 1px solid var(--line-light); color: var(--linen-white);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  transition: transform 0.3s var(--ease), background-color 0.3s, color 0.3s, border-color 0.3s;
}
.social-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.social-btn:hover { transform: translateY(-3px); background: var(--linen-white); color: var(--deep-earth); border-color: var(--linen-white); }

/* Waitlist — secondary, smaller email capture */
.waitlist { border-top: 1px solid var(--line-light); padding-top: 2.2rem; max-width: 460px; margin-inline: auto; }
.waitlist__label { font-size: 0.82rem; letter-spacing: 0.03em; color: var(--soft-stone); margin-bottom: 1rem; }
.signup__field {
  display: flex; gap: 0.4rem; background: rgba(251, 248, 243, 0.06);
  border: 1px solid var(--line-light); border-radius: 100px; padding: 0.35rem 0.35rem 0.35rem 1.3rem;
  max-width: 460px; margin-inline: auto; transition: border-color 0.3s;
}
.signup__field:focus-within { border-color: var(--clay); }
.signup input {
  flex: 1; background: none; border: none; color: var(--linen-white); font-size: 0.95rem;
  min-width: 0; outline: none;
}
.signup input::placeholder { color: rgba(251, 248, 243, 0.45); }
.signup .btn { white-space: nowrap; padding: 0.85em 1.5em; font-size: 0.75rem; }
.signup__msg { min-height: 1.3em; margin-top: 0.85rem; font-size: 0.85rem; color: var(--soft-stone); }
.signup__msg.is-error { color: #e6a58c; }
.signup__msg.is-ok { color: #cdb79a; }
@media (max-width: 520px) {
  .signup__field { flex-direction: column; border-radius: 18px; padding: 0.8rem; }
  .signup .btn { justify-content: center; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--deep-earth); color: var(--soft-stone);
  padding: clamp(3rem, 6vw, 5rem) var(--gutter);
  display: grid; gap: 1.4rem; justify-items: center; text-align: center;
  border-top: 1px solid var(--line-light);
}
.footer__brand { display: flex; align-items: center; gap: 0.7rem; color: var(--linen-white); }
.footer__symbol { width: 44px; }
.footer__word { font-family: var(--font-display); letter-spacing: 0.28em; text-transform: uppercase; font-size: 1rem; padding-left: 0.28em; }
.footer__word em { font-style: normal; font-size: 0.62em; opacity: 0.75; }
.footer__meta { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; }
.footer__nav a { font-size: 0.85rem; transition: color 0.3s; }
.footer__nav a:hover { color: var(--linen-white); }
.footer__copy { font-size: 0.78rem; opacity: 0.6; }

/* ==========================================================================
   Reveal animation defaults (JS-driven). No-JS = fully visible.
   ========================================================================== */
.js [data-reveal], .js [data-reveal-lines] .rl-inner, .js [data-stagger] > * {
  opacity: 0;
}
/* Failsafe: if animation can't run, show everything statically (never hidden). */
.no-anim [data-reveal], .no-anim [data-reveal-lines] .rl-inner, .no-anim [data-stagger] > * {
  opacity: 1 !important; transform: none !important;
}

/* ---------- Mobile nav ---------- */
@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }
  .nav__links.is-open {
    display: flex; flex-direction: column; position: fixed; inset: var(--nav-h) 0 auto 0;
    background: var(--deep-earth); color: var(--linen-white); padding: 2rem var(--gutter) 2.5rem;
    gap: 1.5rem; box-shadow: 0 20px 40px -20px rgba(0,0,0,0.5);
  }
  .nav__links.is-open a { font-family: var(--font-display); font-size: 1.5rem; opacity: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal], .js [data-reveal-lines] .rl-inner, .js [data-stagger] > * { opacity: 1 !important; transform: none !important; }
  .hero__scroll-line::after { animation: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
