/* =============================================================================
   17645 PNW — STYLES
   Dark woodland / architectural-retreat aesthetic.
   Palette tokens live in :root — tweak once, applies everywhere.
============================================================================= */

:root {
  --bg:          #0e0d0b;   /* near-black base            */
  --bg-2:        #16140f;   /* raised surface             */
  --bg-3:        #1e1b15;   /* cards                      */
  --line:        #2c2820;   /* hairline dividers          */
  --gold:        #d8b874;   /* primary warm accent        */
  --gold-soft:   #e7d3a3;   /* lighter gold               */
  --cream:       #f3ead6;   /* headings / high emphasis   */
  --text:        #cfc7b8;   /* body                       */
  --text-dim:    #8f877a;   /* muted                      */

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body:    "Jost", system-ui, -apple-system, sans-serif;

  --maxw: 1200px;
  --maxw-wide: 1680px;  /* areas section — big, near-full-bleed imagery */
  --pad:  clamp(1.25rem, 5vw, 5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Shared typographic helpers ---------- */
.kicker {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--cream);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.btn {
  display: inline-block;
  padding: 0.9rem 2.4rem;
  border: 1px solid var(--gold);
  border-radius: 40px;
  color: var(--gold-soft);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), transform 0.4s var(--ease);
}
.btn:hover {
  background: var(--gold);
  color: #1a1710;
  transform: translateY(-2px);
}

/* =============================================================================
   NAV
============================================================================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: 0 var(--pad);
  transition: background 0.5s var(--ease), backdrop-filter 0.5s var(--ease), border-color 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(14, 13, 11, 0.82);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.nav__brand { display: flex; align-items: center; gap: 0.6rem; }
.nav__mark { color: var(--gold); font-size: 1rem; }
.nav__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.14em;
  color: var(--cream);
}
.nav__links {
  display: flex;
  gap: 2rem;
  margin-left: auto;
  margin-right: 1.5rem;
}
.nav__links a {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.3s var(--ease);
}
.nav__links a:hover { color: var(--gold-soft); }

/* Environment toggle */
.env-toggle {
  position: relative;
  display: flex;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: var(--bg-2);
}
.env-toggle__btn {
  position: relative;
  z-index: 2;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.5rem 1.15rem;
  border-radius: 40px;
  transition: color 0.4s var(--ease);
}
.env-toggle__btn.is-active { color: #1a1710; }
.env-toggle__slider {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 5px;
  height: calc(100% - 10px);
  width: calc(50% - 5px);
  background: var(--gold);
  border-radius: 40px;
  transition: transform 0.45s var(--ease);
}
.env-toggle[data-env="interior"] .env-toggle__slider { transform: translateX(100%); }

/* =============================================================================
   HERO
============================================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 70% 10%, #23201a 0%, #0e0d0b 60%),
    linear-gradient(180deg, #14120d 0%, #0b0a08 100%);
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  will-change: transform;
}
.hero__media video,
.hero__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,13,11,0.55) 0%, rgba(14,13,11,0.35) 40%, rgba(14,13,11,0.92) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  text-align: center;
}
.hero__eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--cream);
  font-size: clamp(3.5rem, 13vw, 9rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  display: flex;
  gap: 0.35em;
  justify-content: center;
  align-items: baseline;
}
.hero__title-accent { color: var(--gold); }
.hero__tagline {
  margin: 1.5rem auto 2.5rem;
  max-width: 34ch;
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
}
.hero__scroll {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 56px;
  background: linear-gradient(180deg, transparent, var(--gold));
  overflow: hidden;
}
.hero__scroll span {
  position: absolute; top: -20px; left: 0;
  width: 100%; height: 20px;
  background: var(--gold);
  animation: scrollDown 2.2s var(--ease) infinite;
}
@keyframes scrollDown {
  0%   { top: -20px; }
  100% { top: 56px; }
}

/* =============================================================================
   OVERVIEW
============================================================================= */
.overview {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 9rem) var(--pad);
}
.overview__grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.overview__right p {
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  color: var(--text);
  font-weight: 300;
}
.overview__hint {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  font-size: 0.9rem;
  color: var(--text-dim);
}
.overview__hint strong { color: var(--gold-soft); font-weight: 500; }
.overview__hint-icon {
  color: var(--gold);
  font-size: 1.3rem;
  animation: nudge 2s var(--ease) infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(5px); }
}

/* =============================================================================
   AREAS
============================================================================= */
.areas {
  /* wider than the text sections so the comparison frames read near full-bleed */
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(4rem, 10vw, 7rem);
}
.areas__head { margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.areas__list {
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 10vw, 8rem);
}

/* Asymmetric rows: narrow text column, dominant image column (alternating sides) */
.area {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2.3fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}
.area:nth-child(even) {
  grid-template-columns: minmax(0, 2.3fr) minmax(280px, 1fr);
}
.area:nth-child(even) .area__text { order: 2; }

.area__text .area__wave {
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9rem;
  display: block;
}
.area__title {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--cream);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.1;
  margin-bottom: 1.1rem;
}
.area__caption {
  color: var(--text);
  font-size: 1rem;
  max-width: 44ch;
  margin-bottom: 1.6rem;
}
.area__meta {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.area__meta button {
  background: none; border: 0; cursor: pointer;
  color: var(--gold-soft);
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: border-color 0.3s var(--ease);
}
.area__meta button:hover { border-color: var(--gold); }

/* =============================================================================
   BEFORE / AFTER SLIDER  (horizontal wipe: before on the left, after on the right)
============================================================================= */
.ba {
  position: relative;
  width: 100%;
  aspect-ratio: var(--frame-aspect, 3 / 2);
  border-radius: 0; /* square frames — sharp architectural corners */
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-3);
  user-select: none;
  touch-action: pan-y; /* allow vertical page scroll; we handle horizontal */
  cursor: ew-resize;
}
/* BEFORE = base layer (the default view) */
.ba__layer {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.ba__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* AFTER = top layer, revealed left→right; the handle clips its right edge */
.ba__after {
  clip-path: inset(0 var(--reveal, 100%) 0 0); /* 100% clipped = full before */
}
.ba__tag {
  position: absolute;
  z-index: 4;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 30px;
  background: rgba(14,13,11,0.7);
  backdrop-filter: blur(6px);
  color: var(--cream);
  border: 1px solid var(--line);
  transition: opacity 0.3s var(--ease);
}
/* after wipes in from the left → its tag lives left; before recedes right */
.ba__tag--after  { top: 1rem; left: 1rem; color: var(--gold-soft); }
.ba__tag--before { bottom: 1rem; right: 1rem; }

/* Drag handle line + knob */
.ba__handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--reveal-line, 30%);
  z-index: 5;
  width: 2px;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(216,184,116,0.6);
  transform: translateX(-1px);
  pointer-events: none;
}
.ba__knob {
  position: absolute;
  left: 50%;
  top: 50%;
  /* always dead-center on the divider line; the frame clips the outer half
     when the handle rests at an edge */
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(14,13,11,0.75);
  backdrop-filter: blur(6px);
  border: 1px solid var(--gold);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 1.05rem;
  pointer-events: none;
}
/* Countdown arc: during the pre-sweep hold, only the half of the halo facing
   the image fills — top → bottom along the right semicircle (the handle rests
   at the left edge, so this is the visible half). --hold (0→1) is driven by
   main.js while the frame has .is-holding. */
.ba__knob::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--hold, 0) * 180deg), transparent 0deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.ba.is-holding .ba__knob::after { opacity: 1; }
.ba__expand {
  position: absolute;
  top: 1rem; right: 1rem;
  z-index: 6;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(14,13,11,0.7);
  border: 1px solid var(--line);
  color: var(--cream);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.ba__expand:hover { background: var(--gold); color: #1a1710; }

/* Placeholder look when no image supplied */
.ba__placeholder {
  position: absolute; inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
}
.ba__placeholder--before {
  background:
    repeating-linear-gradient(45deg, #17140f 0 12px, #1b1812 12px 24px);
}
.ba__placeholder--after {
  background:
    radial-gradient(90% 90% at 50% 20%, #2a2419 0%, #16130d 70%);
}
.ba__placeholder-label {
  font-family: var(--font-display);
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1.4;
}
.ba__placeholder-label span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 0.5rem;
}

/* per-area walkthrough video badge */
.area__video {
  margin-top: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 0; /* square, matching the comparison frames */
  overflow: hidden;
}
.area__video video { width: 100%; display: block; }

/* =============================================================================
   TIMELINE
============================================================================= */
.timeline {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: clamp(5rem, 12vw, 8rem) var(--pad);
}
.timeline__head {
  max-width: var(--maxw);
  margin: 0 auto clamp(3rem, 7vw, 5rem);
  text-align: center;
}
.timeline__sub {
  margin: 1.2rem auto 0;
  max-width: 48ch;
  color: var(--text-dim);
}
.timeline__track {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  list-style: none;
  padding-left: clamp(1.5rem, 5vw, 3rem);
}
.timeline__track::before {
  content: "";
  position: absolute;
  left: clamp(0.4rem, 2vw, 0.9rem);
  top: 8px; bottom: 8px;
  width: 1px;
  background: var(--line);
}
.timeline__track::after { /* animated progress fill */
  content: "";
  position: absolute;
  left: clamp(0.4rem, 2vw, 0.9rem);
  top: 8px;
  width: 1px;
  height: var(--progress, 0%);
  background: linear-gradient(180deg, var(--gold), transparent);
  transition: height 0.2s linear;
}
.tl-item {
  position: relative;
  padding: 0 0 clamp(2.5rem, 6vw, 4rem) clamp(1.8rem, 5vw, 3rem);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item__dot {
  position: absolute;
  left: calc(clamp(0.4rem, 2vw, 0.9rem) - clamp(1.8rem, 5vw, 3rem) - 5px + clamp(1.8rem,5vw,3rem));
  left: -1px;
  top: 4px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--line);
  transform: translateX(-6px);
  transition: border-color 0.5s var(--ease), background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.tl-item.is-active .tl-item__dot {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 16px rgba(216,184,116,0.6);
}
.tl-item__phase {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--line);
  line-height: 1;
  transition: color 0.5s var(--ease);
}
.tl-item.is-active .tl-item__phase { color: var(--gold); }
.tl-item__window {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0.5rem 0 0.4rem;
}
.tl-item__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--cream);
  margin-bottom: 0.7rem;
}
.tl-item__desc { color: var(--text); max-width: 52ch; margin-bottom: 1rem; }
.tl-item__links {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
}
.tl-item__links a {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  border: 1px solid var(--line);
  padding: 0.35rem 0.85rem;
  border-radius: 30px;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.tl-item__links a:hover { border-color: var(--gold); background: var(--bg-3); }

/* =============================================================================
   FOOTER
============================================================================= */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 7vw, 5rem) var(--pad);
  text-align: center;
}
.footer__mark { color: var(--gold); font-size: 1.3rem; }
.footer__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.14em;
  color: var(--cream);
  margin: 0.6rem 0 0.4rem;
}
.footer__note { color: var(--text-dim); font-size: 0.85rem; }

/* =============================================================================
   LIGHTBOX
============================================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8,7,6,0.94);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: var(--pad);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage {
  width: min(1440px, 100%);
  transform: scale(0.96);
  transition: transform 0.4s var(--ease);
}
.lightbox.is-open .lightbox__stage { transform: scale(1); }
.lightbox__close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.lightbox__close:hover { border-color: var(--gold); background: var(--bg-3); }

/* =============================================================================
   SCROLL REVEAL
============================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* Environment switch fade */
.switching .areas__list { opacity: 0; transform: translateY(12px); }
.areas__list {
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

/* =============================================================================
   RESPONSIVE
============================================================================= */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .overview__grid { grid-template-columns: 1fr; }
  .area, .area:nth-child(even) { grid-template-columns: 1fr; }
  .area:nth-child(even) .area__text { order: 0; }
  .area__text { order: 0; }
}

@media (max-width: 560px) {
  .nav__title { font-size: 1.1rem; }
  .env-toggle__btn { padding: 0.45rem 0.85rem; font-size: 0.62rem; }
  .hero__title { flex-direction: column; gap: 0; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
