/* ============================================================
   Terra Firma Realty — Coming Soon
   One continuous dark architectural field. The photographs are
   apertures cut into it; gold hairlines are the connective tissue.
   Greens are sampled from the brand mark.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --pine-abyss: #04120e;
  --pine-deep:  #06211a;
  --pine:       #0c4b3b;
  --leaf:       #8cc63f;

  --ivory:      #f4f1e8;
  --ivory-soft: rgba(244, 241, 232, .74);
  --sage:       #9baea2;

  --gold:        #c9a96b;
  --gold-bright: #e6d2a4;
  --gold-dim:    rgba(201, 169, 107, .28);
  --gold-faint:  rgba(201, 169, 107, .14);

  --rule-light: rgba(244, 241, 232, .22);

  /* --night runs 0 -> 1 down the page and cools the whole field from dusk
     toward night. --field is what every section paints with. */
  --night: 0;
  --night-ink: #02090f;
  --field: var(--pine-abyss);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --text:    "Archivo", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 5.5rem);

  --ease-out:  cubic-bezier(.19, 1, .22, 1);
  --ease-soft: cubic-bezier(.22, 1, .36, 1);

  /* film grain, inline so it costs no request */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Where color-mix is supported, --field becomes a live blend driven by
   --night. Declared after :root so it overrides the plain fallback. */
@supports (color: color-mix(in oklab, red, blue)) {
  :root {
    --field: color-mix(in oklab, var(--pine-abyss), var(--night-ink) calc(var(--night) * 68%));
  }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--field);
  color: var(--ivory);
  font-family: var(--text);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, p, figure, address { margin: 0; }
address { font-style: normal; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 4px;
}

::selection { background: var(--gold); color: var(--pine-abyss); }

.shell {
  width: 100%;
  max-width: 82rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -100vw;
  top: 0;
  z-index: 200;
  padding: .75rem 1.25rem;
  background: var(--gold);
  color: var(--pine-abyss);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 0; }

/* ============================================================
   motion primitives

   Every animated element renders in its FINAL state by default,
   so the page is complete without JavaScript. The `.js` class
   (set inline in <head>) opts each one into its starting state.
   ============================================================ */

.horizon {
  display: block;
  height: 1px;
  background: var(--rule-light);
  transform-origin: left center;
  transition: transform 1.4s var(--ease-soft);
}
.horizon--gold { background: var(--gold-dim); }
.js .horizon { transform: scaleX(0); }
.js .is-in > .horizon,
.js .horizon.is-in { transform: scaleX(1); }

.lift {
  display: block;
  overflow: hidden;
  padding-bottom: .14em;
  margin-bottom: -.14em;
}
.lift > span {
  display: block;
  transition: transform 1.05s var(--ease-out);
}
.lift:nth-child(2) > span { transition-delay: .09s; }
.lift:nth-child(3) > span { transition-delay: .18s; }
.js .lift > span { transform: translateY(108%); }
.js .is-in .lift > span { transform: translateY(0); }

/* ============================================================
   boot sequence
   ============================================================ */
.boot { display: none; }
.js .boot {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: var(--pine-abyss);
  transition: transform 1.15s var(--ease-out), visibility 0s linear 1.15s;
}
.boot__inner { display: grid; justify-items: center; gap: 1.75rem; }

.boot__mark {
  width: 54px;
  height: auto;
  opacity: 0;
  transform: translateY(10px);
  animation: boot-mark .9s var(--ease-out) .1s forwards;
}
@keyframes boot-mark { to { opacity: 1; transform: none; } }

.boot__rule {
  display: block;
  width: min(42vw, 230px);
  height: 1px;
  background: rgba(244, 241, 232, .14);
  overflow: hidden;
}
.boot__rule > i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  /* finishes ~200ms before the curtain lifts, so it never reads as cut off */
  animation: boot-rule 1.15s cubic-bezier(.3, .6, .2, 1) .2s forwards;
}
@keyframes boot-rule {
  0%   { transform: scaleX(0); }
  62%  { transform: scaleX(.74); }
  100% { transform: scaleX(1); }
}

.is-booted .boot {
  transform: translateY(-101%);
  visibility: hidden;
}

.booting .hero__copy { visibility: hidden; }

/* ============================================================
   masthead
   ============================================================ */
.masthead {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.1rem, 3vw, 2.25rem) var(--gutter);
  transition: opacity .9s var(--ease-out) .55s, transform .9s var(--ease-out) .55s;
}
.js .masthead { opacity: 0; transform: translateY(-8px); }
.is-booted .masthead { opacity: 1; transform: none; }

.masthead__brand {
  display: flex;
  align-items: center;
  gap: .72rem;
  text-decoration: none;
}
.masthead__brand .mark { width: 30px; }
.masthead__brand .wordmark { width: clamp(7rem, 13vw, 8.5rem); }

.masthead__place {
  font-size: .75rem;
  color: var(--ivory-soft);
  letter-spacing: .02em;
  padding-top: .4rem;
}

/* ============================================================
   hero
   ============================================================ */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  background: var(--field);
}
/* Only lengthen the track when the scrub can actually run, so a reduced-motion
   or no-JS visitor never scrolls through dead space. */
.scrub-on .hero { height: 215svh; }

.hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: clip;
  background: var(--field);
}

/* The plate carries the parallax offset (no transition, so scrolling is
   never animated); the image inside carries the slow entrance scale. */
.hero__plate {
  position: absolute;
  inset: -8% 0 -8% 0;
  z-index: 0;
  /* --hero-p runs 0 -> 1 across the pinned scroll; the photograph pushes
     deeper and dims as the type leaves. */
  transform: scale(calc(1 + var(--hero-p, 0) * .16)) translate3d(0, calc(var(--hero-p, 0) * -3vh), 0);
  will-change: transform;
}
/* --vel is 0..1 scroll speed. A hair of blur on the photography only, so
   fast scrolling carries a little motion weight; it decays within ~200ms. */
.hero__plate img,
.grove__plate img {
  transition: filter .2s linear;
}
.scrub-on .hero__plate img,
.scrub-on .grove__plate img {
  filter: saturate(.86) contrast(1.06) brightness(.92) blur(calc(var(--vel, 0) * 2.4px));
}
.scrub-on .grove__plate img {
  filter: saturate(.72) contrast(1.08) brightness(.8) blur(calc(var(--vel, 0) * 2.4px));
}

.hero__plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
  transform: scale(1);
  transition: transform 2.4s var(--ease-out);
  /* a cooler, deeper grade so the photograph belongs to the dark field */
  filter: saturate(.86) contrast(1.06) brightness(.92);
}
.js .hero__plate img { transform: scale(1.12); }
.is-booted .hero__plate img { transform: scale(1); }

/* the frame darkens as it recedes — one solid layer, cheaper than a filter */
.hero__plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pine-abyss);
  opacity: calc(var(--hero-p, 0) * .5);
  pointer-events: none;
}

/* scrim: a short vignette under the masthead and a deep one under the copy */
.hero__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, rgba(4, 18, 14, .72) 0%, rgba(4, 18, 14, .44) 6%, rgba(4, 18, 14, .16) 14%, rgba(4, 18, 14, 0) 26%),
    linear-gradient(to top, rgba(4, 18, 14, .92) 0%, rgba(4, 18, 14, .84) 18%, rgba(4, 18, 14, .66) 36%, rgba(4, 18, 14, .4) 52%, rgba(4, 18, 14, .14) 70%, rgba(4, 18, 14, 0) 86%);
  pointer-events: none;
}

/* film grain, over the photograph but under the type */
.hero__stage::before,
.grove__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: var(--grain);
  background-size: 160px 160px;
  opacity: .055;
  pointer-events: none;
}

.hero__copy {
  position: relative;
  z-index: 3;
  --exit: clamp(0, calc((var(--hero-p, 0) - .34) / .5), 1);
  transform: translate3d(0, calc(var(--exit) * -9vh), 0);
  opacity: calc(1 - var(--exit));
  width: 100%;
  max-width: 82rem;
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(3.5rem, 9vh, 6.5rem);
}

.hero__copy > .horizon {
  margin-bottom: clamp(1rem, 2.6vw, 1.75rem);
  transition-delay: .3s;
}
.is-booted .hero__copy > .horizon { transform: scaleX(1); }

/* "Coming soon" — letters rise from behind the horizon */
.announce {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.6rem, 11.5vw, 9.5rem);
  line-height: .94;
  letter-spacing: -.012em;
  color: var(--gold);
  margin-bottom: clamp(1.1rem, 2.6vw, 1.9rem);
  font-variation-settings: "SOFT" 34, "WONK" 1, "opsz" 144, "wght" 300;
}
.announce__set { display: inline-block; white-space: nowrap; }

.g {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: .16em;
  margin-bottom: -.16em;
}
.g > span {
  display: inline-block;
  transition: transform 1.15s var(--ease-out);
}
.js .g > span { transform: translateY(112%); }
.is-booted .g > span { transform: translateY(0); }

.announce__set:first-child .g:nth-child(1) > span { transition-delay: .42s; }
.announce__set:first-child .g:nth-child(2) > span { transition-delay: .48s; }
.announce__set:first-child .g:nth-child(3) > span { transition-delay: .54s; }
.announce__set:first-child .g:nth-child(4) > span { transition-delay: .60s; }
.announce__set:first-child .g:nth-child(5) > span { transition-delay: .66s; }
.announce__set:first-child .g:nth-child(6) > span { transition-delay: .72s; }
.announce__set:last-child  .g:nth-child(1) > span { transition-delay: .80s; }
.announce__set:last-child  .g:nth-child(2) > span { transition-delay: .86s; }
.announce__set:last-child  .g:nth-child(3) > span { transition-delay: .92s; }
.announce__set:last-child  .g:nth-child(4) > span { transition-delay: .98s; }

.hero__title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.3rem, 3.1vw, 2.2rem);
  line-height: 1.24;
  letter-spacing: -.005em;
  max-width: 22ch;
  color: var(--ivory);
  font-variation-settings: "SOFT" 24, "WONK" 1, "opsz" 96, "wght" 300;
  transition: opacity 1s var(--ease-out) 1.08s, transform 1s var(--ease-out) 1.08s;
}
.js .hero__title { opacity: 0; transform: translateY(14px); }
.is-booted .hero__title { opacity: 1; transform: none; }

/* ---------- countdown ---------- */
.countdown {
  margin-top: clamp(1.5rem, 4vw, 2.6rem);
  padding-top: clamp(1.1rem, 2.6vw, 1.75rem);
  border-top: 1px solid var(--gold-dim);
  max-width: 34rem;
  transition: opacity 1s var(--ease-out) 1.26s, transform 1s var(--ease-out) 1.26s;
}
.js .countdown { opacity: 0; transform: translateY(14px); }
.is-booted .countdown { opacity: 1; transform: none; }

/* shown when JavaScript cannot run the clock */
.countdown__static {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: var(--gold);
  font-variation-settings: "SOFT" 24, "WONK" 1, "opsz" 72, "wght" 300;
}

.countdown__grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.35rem, 5vw, 3.1rem);
}

.unit { display: grid; gap: .3rem; }

.unit__n {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.9rem, 5.4vw, 3.5rem);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums lining-nums;
  font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 144, "wght" 300;
  min-width: 2ch;
  transition: opacity .34s ease;
}
/* set with no transition, then removed so the value eases back in */
.unit__n.is-tick { opacity: .45; transition: none; }

.unit__l {
  font-size: .6875rem;
  letter-spacing: .035em;
  color: var(--sage);
}

@media (max-width: 47.99rem) {
  /* portrait crop: hold the house in frame rather than the tree alone */
  .hero__plate img { object-position: 66% 58%; }
  /* a shorter pin on a phone — two full screens of holding reads as stuck */
  .scrub-on .hero { height: 165svh; }
}
@media (max-width: 29.99rem) {
  /* the location is carried by the hero copy and the contact block */
  .masthead__place { display: none; }
}

/* ============================================================
   grove
   ============================================================ */
.grove {
  position: relative;
  height: 100vh;
  height: 100svh;
  background: var(--field);
}
/* a second screen of hold, which is what the crossfade plays across */
.scrub-on .grove { height: 230svh; }
@media (max-width: 47.99rem) {
  .scrub-on .grove { height: 180svh; }
}

.grove__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: clip;
  background: var(--field);
}
.grove__plate {
  position: absolute;
  inset: -12% 0 -12% 0;
  z-index: 0;
  transform: translate3d(0, var(--py, 0px), 0) scale(var(--pz, 1));
  will-change: transform;
}
/* The second frame exists only while the crossfade can run, so a
   reduced-motion visitor gets the single photograph as before. */
.grove__plate--b { display: none; z-index: 1; }
.scrub-on .grove__plate--b { display: block; opacity: var(--x, 0); }
.scrub-on .grove__plate[data-frame="a"] { opacity: calc(1 - var(--x, 0)); }
.grove__plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: saturate(.72) contrast(1.08) brightness(.8);
}
.grove__plate--b img { object-position: 50% 62%; }
.grove__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(to top, rgba(4, 18, 14, .94) 0%, rgba(4, 18, 14, .5) 40%, rgba(4, 18, 14, .14) 78%),
    linear-gradient(to bottom, rgba(4, 18, 14, .78) 0%, rgba(4, 18, 14, 0) 22%);
  pointer-events: none;
}

/* ============================================================
   contact
   ============================================================ */
.contact {
  background: var(--field);
  padding-block: clamp(4.5rem, 15vh, 10rem) clamp(3.5rem, 10vh, 7rem);
}

.contact__title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.018em;
  margin-bottom: clamp(2.5rem, 7vw, 4.5rem);
  color: var(--ivory);
  font-variation-settings: "SOFT" 28, "WONK" 1, "opsz" 110, "wght" 300;
}

.row {
  position: relative;
  display: grid;
  gap: .55rem;
  padding-block: clamp(1.5rem, 4vw, 2.4rem);
}
.row > .horizon { position: absolute; inset: 0 0 auto 0; }
.contact__list .row:last-child { padding-bottom: 0; }

.row__label {
  font-size: .75rem;
  letter-spacing: .05em;
  color: var(--gold);
}
.row__value {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.3rem, 3.4vw, 2.1rem);
  line-height: 1.3;
  letter-spacing: -.005em;
  color: var(--ivory);
  font-variation-settings: "SOFT" 24, "WONK" 1, "opsz" 96, "wght" 300;
}

.link {
  position: relative;
  text-decoration: none;
  display: inline-block;
  padding-block: .5rem;   /* ~44px tap target on a phone */
  transition: color .45s var(--ease-soft);
}
.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: calc(.5rem - .1em);
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .55s var(--ease-soft);
}
.link:hover { color: var(--gold-bright); }
.link:hover::after,
.link:focus-visible::after { transform: scaleX(1); transform-origin: left center; }

@media (min-width: 56rem) {
  .row {
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 2rem;
    align-items: baseline;
  }
  .row__label { padding-top: .5rem; }
}

/* ============================================================
   footer
   ============================================================ */
.site-foot {
  background: var(--field);
  padding-block: clamp(2.5rem, 7vh, 4.5rem) clamp(2rem, 5vh, 3rem);
  border-top: 1px solid var(--gold-faint);
}
.site-foot__grid { display: grid; gap: 1.75rem; align-items: end; }
.site-foot__logo { width: clamp(9.5rem, 26vw, 13rem); }
.site-foot__note {
  font-size: .75rem;
  letter-spacing: .02em;
  color: var(--sage);
}

@media (min-width: 48rem) {
  .site-foot__grid {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }
  .site-foot__note { text-align: right; }
}

/* ============================================================
   reduced motion — show every final state, move nothing
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) { scroll-behavior: auto; }

  html:not(.force-motion) *,
  html:not(.force-motion) *::before,
  html:not(.force-motion) *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }

  html.js:not(.force-motion) .boot { display: none; }
  html.booting:not(.force-motion) .hero__copy { visibility: visible; }
  html.js:not(.force-motion) .masthead { opacity: 1; transform: none; }
  html.js:not(.force-motion) .horizon { transform: scaleX(1); }
  html.js:not(.force-motion) .lift > span,
  html.js:not(.force-motion) .g > span { transform: none; }
  html.js:not(.force-motion) .hero__title,
  html.js:not(.force-motion) .countdown { opacity: 1; transform: none; }
  html.js:not(.force-motion) .hero__plate img { transform: scale(1); }
  html:not(.force-motion) .hero__plate,
  html:not(.force-motion) .grove__plate { --py: 0px !important; }

  html:not(.force-motion) .unit__n.is-tick { opacity: 1; }
  html:not(.force-motion) { --night: 0 !important; --vel: 0 !important; }
}
