/* Hospytts, The Causeway, Great Horkesley
   Scroll-driven listing page for Christopher Anthony Estates.
   Palette follows the agency's own monochrome brand (#000 / #fff), warmed to
   paper and ink so a 15th-century thatched house doesn't read like a tech site. */

:root {
  --paper:        #f2efe8;
  --paper-deep:   #e7e2d8;
  --ink:          #16140f;
  --ink-soft:     #55504a;
  --brass:        #8a6f45;
  --text-on-dark: #f2efe8;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
}

/* ---------------------------------------------------------------- loader */

#loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  transition: opacity 0.8s ease;
}
#loader.hidden { opacity: 0; pointer-events: none; }

.loader-brand { text-align: center; }
.loader-brand-main {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1;
}
.loader-brand-sub {
  display: block;
  margin-top: 0.9rem;
  font-size: 0.68rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(242, 239, 232, 0.55);
}

#loader-bar-track {
  width: min(280px, 50vw);
  height: 1px;
  background: rgba(242, 239, 232, 0.2);
}
#loader-bar {
  width: 0%;
  height: 100%;
  background: var(--text-on-dark);
  transition: width 0.25s ease;
}
#loader-percent {
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: rgba(242, 239, 232, 0.55);
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 1.8rem 5vw;
  mix-blend-mode: difference;
}
.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
}
.logo span { opacity: 0.6; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #fff;
}
.nav-cta { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.4); padding-bottom: 2px; }

/* ------------------------------------------------------------------ hero */

.hero-standalone {
  position: relative;
  z-index: 40;
  height: 100vh;
  width: 100%;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 5vw;
}
.hero-inner { max-width: 58vw; }

.hero-heading {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(5rem, 15vw, 13rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
  margin: 1.6rem 0 2rem;
}
.hero-heading .word { display: inline-block; overflow: hidden; vertical-align: bottom; }
.hero-heading .word > span { display: inline-block; }

.hero-tagline {
  max-width: 34rem;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.75;
  color: var(--ink-soft);
}

.scroll-indicator {
  position: absolute;
  bottom: 3.2rem;
  left: 5vw;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.64rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.scroll-indicator svg {
  width: 14px;
  height: 24px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.2;
  animation: nudge 2s ease-in-out infinite;
}
@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------------------------------------------------------------- canvas */

.canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 10;
  clip-path: circle(0% at 50% 50%);
}
#canvas { display: block; width: 100%; height: 100%; }

#dark-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #0c0b09;
  opacity: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------- marquee */

.marquee-wrap {
  position: fixed;
  top: 50%;
  left: 0;
  width: 100%;
  z-index: 15;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
}
.marquee-text {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 13vw;
  font-weight: 300;
  font-style: italic;
  line-height: 1;
  color: rgba(22, 20, 15, 0.14);
}

/* ------------------------------------------------------- scroll sections */

#scroll-container {
  position: relative;
  z-index: 30;
  height: 950vh;
  pointer-events: none;
}

.scroll-section {
  position: absolute;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
}
.scroll-section.is-live { pointer-events: auto; }

.align-left  { padding-left: 5vw;  padding-right: 55vw; }
.align-right { padding-left: 55vw; padding-right: 5vw; text-align: right; }
.align-left .section-inner,
.align-right .section-inner { max-width: 40vw; }

.section-label {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.5rem;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.6rem, 5.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.012em;
  margin-bottom: 1.6rem;
}

.section-body {
  font-size: clamp(0.95rem, 1.08vw, 1.08rem);
  line-height: 1.8;
  color: var(--ink-soft);
  max-width: 30rem;
}
.align-right .section-body { margin-left: auto; }

/* ------------------------------------------------------------------ stats */

.section-stats {
  padding: 0 7vw;
  text-align: center;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3vw;
  max-width: 1200px;
  margin: 0 auto;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }

.stat-number {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1;
  color: var(--text-on-dark);
}
.stat-suffix {
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--brass);
}
.stat-label {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(242, 239, 232, 0.62);
  max-width: 12rem;
}

/* -------------------------------------------------------------------- cta */

.section-cta {
  padding-left: 5vw;
  padding-right: 50vw;
}
.section-cta .section-inner { max-width: 42vw; }
.cta-heading { font-size: clamp(2.4rem, 4.6vw, 4.4rem); }

.cta-button {
  display: inline-block;
  margin-top: 2.2rem;
  padding: 1.05rem 2.6rem;
  background: var(--ink);
  color: var(--text-on-dark);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  /* Only `background` transitions here. GSAP owns `transform` on this element
     for the entrance reveal, and a CSS transition on the same property fought
     it badly enough to strand the button 50px low over the address line. */
  transition: background 0.3s ease, letter-spacing 0.3s ease;
}
.cta-button:hover { background: var(--brass); letter-spacing: 0.34em; }

.section-note {
  margin-top: 2rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------- mobile */

@media (max-width: 860px) {
  .site-header { padding: 1.2rem 6vw; }
  .nav-price { display: none; }
  .logo { font-size: 0.72rem; letter-spacing: 0.1em; white-space: nowrap; }
  .nav-links { font-size: 0.62rem; letter-spacing: 0.14em; }

  .hero-inner { max-width: 100%; }
  .hero-heading { font-size: clamp(3.6rem, 19vw, 6rem); }

  #scroll-container { height: 620vh; }

  /* Side zones collapse: portrait footage already fills the screen, so text
     needs its own readable backdrop rather than sitting on the frame. */
  .align-left, .align-right, .section-cta {
    padding: 2.6rem 7vw;
    text-align: left;
  }
  .align-left .section-inner,
  .align-right .section-inner,
  .section-cta .section-inner { max-width: 100%; }
  .align-right .section-body { margin-left: 0; }

  .section-content .section-inner,
  .section-cta .section-inner {
    background: rgba(12, 11, 9, 0.82);
    padding: 2rem 1.8rem;
    color: var(--text-on-dark);
  }
  .section-content .section-heading,
  .section-cta .section-heading { color: var(--text-on-dark); }
  .section-content .section-body,
  .section-cta .section-body,
  .section-note { color: rgba(242, 239, 232, 0.72); }

  .section-heading { font-size: clamp(2rem, 8.5vw, 2.9rem); }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 2.6rem 1.5rem; }
  .stat-number { font-size: clamp(2.4rem, 11vw, 3.4rem); }

  .cta-button { background: var(--paper); color: var(--ink); }
  .marquee-text { font-size: 20vw; }
}
