/* Room Sequence — a lake house tour, room by room, in a pinned stage */

:root {
  --paper: #f6f3ec;
  --stone: #e9e3d6; /* the stage warms to this as the first room opens */
  --ink: #22201d;
  --muted: rgba(34, 32, 29, 0.62);
  --line: rgba(34, 32, 29, 0.14);

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Albert Sans", system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 3.4vw, 48px);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
em { font-style: italic; }

.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ─────────── Header ─────────── */

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  justify-content: flex-start; /* clear of the centre card, which runs nearly to the top */
  padding: 18px var(--gutter);
  pointer-events: none;
  mix-blend-mode: difference;
  color: #fff;
}
.logo {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.01em;
  pointer-events: auto;
}

/* ─────────── Intro ─────────── */

.intro {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 120px var(--gutter) 90px;
  text-align: center;
  position: relative;
}
.intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.intro-sub {
  margin: 0;
  max-width: 30em;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.55;
  color: var(--muted);
}
.cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  width: 1px;
  height: 44px;
  background: var(--line);
  overflow: hidden;
}
.cue::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  animation: cue 2s var(--ease) infinite;
}
@keyframes cue {
  from { translate: 0 -100%; }
  to { translate: 0 100%; }
}

/* ─────────── The house: pinned stage ─────────── */

/* 100vh of stage, plus the scroll it stays pinned for (set from script.js) */
.house { position: relative; height: var(--track, 640svh); }

.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: #fff;
  contain: paint;
}

/* Every card is sized once to the "main" slot; script.js moves it with
   translate + scale only, and counter-scales the photo so it never stretches.
   No will-change on the card or the photo, on purpose: a card scales ~4×
   between thumbnail and centre, and a pre-promoted layer keeps the raster it
   was made at — blurry, or even blank */
.card {
  position: absolute;
  margin: 0;
  overflow: hidden;
  transform-origin: 0 0;
  background: #d9d1c1; /* a print-coloured placeholder until the photo paints */
}
.card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 50% 50%;
  user-select: none;
}
.shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 16, 14, 0.55), rgba(18, 16, 14, 0) 55%);
  opacity: 0;
  pointer-events: none;
}

/* Masked lines: each piece rises from below its own line */
.mask {
  display: block;
  overflow: hidden;
  padding: 0.05em 0 0.18em;
  margin: -0.05em 0 -0.18em;
}
.hero-piece,
.piece {
  display: block;
  will-change: transform, opacity;
}

.hero {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(24px, 3.4vw, 48px);
  color: #fff;
  pointer-events: none;
}
.hero h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 8.4rem);
  line-height: 0.9;
  letter-spacing: -0.025em;
}

.rooms {
  position: absolute;
  z-index: 10;
  top: 18%;
  bottom: 24%;
  left: 74%;
  right: 3%;
}
.room {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.room h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.room .copy {
  margin: 0;
  max-width: 24rem;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.room .details {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
}

.label {
  position: absolute;
  z-index: 10;
  left: 2.6%;
  bottom: 3.4%;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
}
.count { display: flex; gap: 4px; font-variant-numeric: tabular-nums; }
.count-window { display: block; height: 1.4em; overflow: hidden; line-height: 1.4em; }
.count-col { display: flex; flex-direction: column; will-change: transform; }
.count-col span { display: block; height: 1.4em; }
.count-total { opacity: 0.5; }

/* Phones: the card sits up top, the story underneath */
@media (max-width: 1023px) {
  .rooms { top: 56%; bottom: 16%; left: 6%; right: 6%; }
  .room { gap: 12px; }
  .room h3 { font-size: clamp(1.9rem, 7vw, 2.8rem); }
  .room .copy { font-size: 14px; }
  .label { display: none; }
}

/* ─────────── Outro + footer ─────────── */

.outro {
  min-height: 80svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 120px var(--gutter);
  text-align: center;
  background: var(--stone);
}
.outro h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.book {
  padding: 14px 26px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.4s var(--ease);
}
.book:hover { transform: translateY(-2px); }

.foot {
  display: flex;
  justify-content: space-between;
  padding: 22px var(--gutter);
  background: var(--stone);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .cue::after { animation: none; }
}
