/* ===========================================================
   Grand Home Builders — Editorial Luxury  ·  core
   tokens · reset · type · buttons · nav · hero · footer · motion
   Interactivity powered by GSAP + ScrollTrigger, Lenis, Swiper.
   =========================================================== */

:root {
   /* palette — warm light luxury */
   --ink:        #1b1714;
   --ink-soft:   #3a342e;
   --muted:      #7c7269;
   --line:       #e4dccf;
   --paper:      #fbf7f0;
   --cream:      #f3ecdf;
   --surface:    #ffffff;
   --gold:       #b08a4f;
   --gold-deep:  #936f38;
   --gold-tint:  #e9dcc3;
   --shadow:     28px 40px 80px -40px rgba(40, 28, 12, .35);

   /* text on the current surface. The block "Background" select re-points
      these per section (see "SECTION TONE" in home-sections.css), so copy
      flips light on dark and dark on light without touching each block.
      Anything that paints its own surface — a card, chip, input, dark panel —
      re-declares them so its own text stays put. */
   --tone-bg:     var(--paper);
   --tone-fg:     var(--ink);
   --tone-soft:   var(--ink-soft);
   --tone-muted:  var(--muted);
   --tone-line:   var(--line);
   --tone-accent: var(--gold-deep);  /* pale gold reads on ink, deep gold on paper */

   /* type */
   --serif: "Playfair Display", Georgia, serif;
   --sans:  "Inter", system-ui, -apple-system, sans-serif;

   --text-eyebrow: .74rem;
   --text-lede:    clamp(1.05rem, .98rem + .35vw, 1.28rem);
   --display:      clamp(2.1rem, 1.2rem + 3.4vw, 4.1rem);
   --display-lg:   clamp(2.7rem, 1rem + 6.4vw, 6rem);

   /* rhythm */
   --shell:    min(92vw, 1240px);
   --space:    clamp(4.5rem, 3rem + 6vw, 9rem);
   --radius:   18px;
   --radius-sm: 12px;

   --dur:   .55s;
   --ease:  cubic-bezier(.16, 1, .3, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
body {
   margin: 0;
   font-family: var(--sans);
   color: var(--ink);
   background: var(--paper);
   font-size: 1rem;
   line-height: 1.65;
   -webkit-font-smoothing: antialiased;
   text-rendering: optimizeLegibility;
   overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.04; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--gold); color: #fff; }

.skip-link {
   position: fixed; top: -100px; left: 1rem; z-index: 200;
   background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 8px;
   transition: top .2s;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- layout ---------- */
.shell { width: var(--shell); margin-inline: auto; }
.section { padding-block: var(--space); }
.section--tight { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }

/* ---------- type helpers ---------- */
.eyebrow {
   display: inline-flex; align-items: center; gap: .6rem;
   font-size: var(--text-eyebrow); font-weight: 600;
   letter-spacing: .22em; text-transform: uppercase; color: var(--tone-accent);
   margin: 0 0 1.4rem;
}
.eyebrow .idx {
   font-family: var(--serif); font-style: italic; font-weight: 500;
   font-size: 1.05rem; letter-spacing: 0; color: var(--tone-fg);
   text-transform: none;
}
.eyebrow--light { color: var(--tone-accent); }
.eyebrow--light .idx { color: var(--tone-fg); }

.display {
   font-family: var(--serif);
   font-size: var(--display);
   font-weight: 600; letter-spacing: -.015em; line-height: 1.06;
   max-width: 16ch;
}
.display em { font-style: italic; color: var(--tone-accent); }

.lede { font-size: var(--text-lede); color: var(--tone-soft); max-width: 54ch; margin-top: 1.4rem; }

.section-head { margin-bottom: clamp(2.4rem, 1.5rem + 3vw, 4rem); }
.section-head--center { text-align: center; }
/* .lede is capped at 54ch, so without the auto margin it hugs the left edge of a
   centred head while its own text sits centred — the box has to be centred too */
.section-head--center .eyebrow,
.section-head--center .lede,
.section-head--center .display { margin-inline: auto; }
.section-head--center .display { max-width: 20ch; }
.section-head--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; }
.section-head__note { color: var(--tone-muted); margin-top: .9rem; letter-spacing: .04em; }

.link-arrow {
   display: inline-flex; align-items: center; gap: .55rem;
   font-weight: 600; color: var(--tone-fg); padding-bottom: 2px;
   border-bottom: 1px solid currentColor; width: fit-content;
   transition: gap var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.link-arrow i { transition: transform var(--dur) var(--ease); }
.link-arrow:hover { color: var(--tone-accent); gap: .9rem; border-color: var(--gold); }
.link-arrow:hover i { transform: translateX(4px); }

/* ---------- buttons ---------- */
.btn {
   --bg: var(--ink); --fg: #fff;
   position: relative; display: inline-flex; align-items: center; gap: .6rem;
   padding: .95rem 1.6rem; border-radius: 100px; font-weight: 600; font-size: .95rem;
   background: var(--bg); color: var(--fg);
   transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
   will-change: transform;
}
.btn i { transition: transform var(--dur) var(--ease); }
.btn:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -16px rgba(27,23,20,.5); }
.btn:hover i { transform: translateX(3px); }
/* Both read the section tone, so a band flipped to ink gets a light pill with
   dark type instead of ink-on-ink. Nav and hero variants override --fg below
   and keep winning on specificity. */
.btn--solid { --bg: var(--tone-fg); --fg: var(--tone-bg); }
.btn--solid:hover { background: var(--gold-deep); --fg: #fff; } /* gold is mid-dark on either tone — type stays white */
.btn--lg { padding: 1.15rem 2.1rem; font-size: 1.05rem; }
.btn--ghost { --bg: transparent; --fg: var(--tone-fg); border: 1px solid var(--tone-line); padding-block: .8rem; }
.btn--ghost:hover { --bg: var(--tone-fg); --fg: var(--tone-bg); box-shadow: none; }
.btn--line-light { --bg: transparent; --fg: #fff; border: 1px solid rgba(255,255,255,.45); }
.btn--line-light:hover { --bg: rgba(255,255,255,.1); box-shadow: none; }

.circ {
   width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line);
   display: grid; place-items: center; font-size: 1.05rem; color: var(--tone-fg);
   transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.circ:hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-2px); }
.circ.is-disabled { opacity: .35; pointer-events: none; }

/* ===========================================================
   NAV
   =========================================================== */
.nav {
   position: fixed; inset: 0 0 auto; z-index: 100;
   transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform .4s var(--ease), color var(--dur) var(--ease);
   color: #fff;
}
/* Glass over a hero. Painted on ::before (z-index:-1 → under the nav content,
   above the page) so the frosted band can be masked: blur AND tint fade to
   nothing at the bottom edge, which is what stops it cutting a hard bar across
   the hero photo the way a flat translucent background does. The tint alone
   (.52 at the top) carries the white-on-photo contrast, so a browser without
   backdrop-filter still reads fine — no fallback rule needed. .is-solid fades
   this layer out and hands over to the cream glass below. */
.nav::before {
   content: ""; position: absolute; inset: 0 0 -3rem; z-index: -1; pointer-events: none;
   background: linear-gradient(180deg, rgba(18,12,7,.52) 0%, rgba(18,12,7,.3) 52%, rgba(18,12,7,0) 100%);
   -webkit-backdrop-filter: saturate(150%) blur(16px);
   backdrop-filter: saturate(150%) blur(16px);
   -webkit-mask-image: linear-gradient(180deg, #000 62%, rgba(0,0,0,.45) 84%, transparent 100%);
   mask-image: linear-gradient(180deg, #000 62%, rgba(0,0,0,.45) 84%, transparent 100%);
   transition: opacity var(--dur) var(--ease);
}
.nav.is-solid::before { opacity: 0; }
/* The layer hangs 3rem past the header box, so translateY(-100%) alone would
   leave that overhang parked on screen as a stray blurred strip. Fade it. */
.nav.is-hidden::before { opacity: 0; }
body:not(:has(.hero, .phero, .chero, .shov)) .nav::before { opacity: 0; }
.nav__inner {
   display: flex; align-items: center; justify-content: space-between;
   padding-block: 1.25rem;
}
.nav.is-solid {
   background: rgba(251,247,240,.86);
   backdrop-filter: saturate(160%) blur(14px);
   box-shadow: 0 1px 0 var(--line);
   color: var(--ink);
}
/* A page with no hero-class section (rare/none today, but a CMS page could
   ship an empty layout) renders the nav solid from the very first paint via
   :has() — the same call initNav() would make at scroll y=0 (solidAt=-1) —
   so there's no JS-load wait and no white-then-transparent flash. Hero pages
   stay in the base transparent state until initNav() flips .is-solid on scroll.
   Kept as its OWN rule (not comma-joined with .nav.is-solid above): a browser
   without :has() support drops only this rule, not the core JS-driven one —
   comma-joining them would let one unsupported selector invalidate the whole
   list, breaking is-solid everywhere on that browser. */
body:not(:has(.hero, .phero, .chero, .shov)) .nav {
   background: rgba(251,247,240,.86);
   backdrop-filter: saturate(160%) blur(14px);
   box-shadow: 0 1px 0 var(--line);
   color: var(--ink);
}
.nav.is-hidden { transform: translateY(-100%); }

.brand { display: inline-flex; align-items: center; color: inherit; }
.brand__logo { height: 60px; width: auto; display: block; }
.brand__logo--dark { display: none; }
.nav.is-solid .brand__logo--light { display: none; }
.nav.is-solid .brand__logo--dark { display: block; }
body:not(:has(.hero, .phero, .chero, .shov)) .nav .brand__logo--light { display: none; }
body:not(:has(.hero, .phero, .chero, .shov)) .nav .brand__logo--dark { display: block; }

.nav__links { display: flex; gap: 2rem; }
.nav__links a {
   position: relative; font-weight: 500; font-size: .95rem; padding-block: .3rem; opacity: .92;
}
.nav__links a::after {
   content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
   background: currentColor; transition: width var(--dur) var(--ease);
}
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after { width: 100%; }

/* About dropdown — desktop hover/focus; mobile uses the drawer */
.nav__has-sub { position: relative; display: flex; align-items: center; }
.nav__caret { font-size: .6rem; margin-left: .35rem; transition: transform var(--dur) var(--ease); }
.nav__has-sub:hover .nav__caret, .nav__has-sub:focus-within .nav__caret { transform: rotate(180deg); }
.nav__sub {
   position: absolute; top: 100%; left: 50%; translate: -50% 0; margin-top: .7rem;
   min-width: 196px; padding: .45rem; display: grid; gap: .1rem;
   background: var(--paper); color: var(--ink);
   border: 1px solid var(--line); border-radius: var(--radius-sm);
   box-shadow: 0 26px 54px -30px rgba(15, 10, 5, .45);
   opacity: 0; visibility: hidden; transform: translateY(7px);
   transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
   z-index: 20;
}
.nav__sub::before { content: ""; position: absolute; left: 0; right: 0; top: -.7rem; height: .7rem; } /* hover bridge over the gap */
.nav__has-sub:hover .nav__sub, .nav__has-sub:focus-within .nav__sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__sub a {
   display: block; padding: .55rem .8rem; border-radius: 9px; opacity: .92;
   font-size: .9rem; font-weight: 500; color: var(--tone-fg); white-space: nowrap;
   transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav__sub a::after { display: none; }
.nav__sub a:hover { background: var(--cream); color: var(--gold-deep); opacity: 1; }

.nav__actions { display: flex; align-items: center; gap: 1rem; }
.nav.is-solid .btn--ghost { --fg: var(--ink); border-color: var(--line); }
.nav.is-solid .btn--ghost:hover { --bg: var(--ink); --fg: #fff; border-color: var(--ink); }
body:not(:has(.hero, .phero, .chero, .shov)) .nav .btn--ghost { --fg: var(--ink); border-color: var(--line); }
body:not(:has(.hero, .phero, .chero, .shov)) .nav .btn--ghost:hover { --bg: var(--ink); --fg: #fff; border-color: var(--ink); }
.nav:not(.is-solid) .btn--ghost { --fg: #fff; border-color: rgba(255,255,255,.4); }
.nav:not(.is-solid) .btn--ghost:hover { --bg: #fff; --fg: var(--ink); }

.nav__progress {
   display: block; height: 2px; width: 0; background: var(--gold);
   transition: width .1s linear;
}

.nav__burger { display: none; width: 42px; height: 42px; position: relative; }
.nav__burger span {
   position: absolute; left: 9px; right: 9px; height: 2px; background: currentColor;
   transition: transform .3s var(--ease), opacity .3s var(--ease); border-radius: 2px;
}
.nav__burger span:first-child { top: 16px; }
.nav__burger span:last-child { bottom: 16px; }
body.menu-open .nav__burger span:first-child { transform: translateY(4px) rotate(45deg); }
body.menu-open .nav__burger span:last-child { transform: translateY(-5px) rotate(-45deg); }

/* drawer */
.drawer {
   position: fixed; inset: 0; z-index: 90;
   background: var(--ink); color: #fff;
   display: flex; flex-direction: column; justify-content: flex-start; gap: 1.4rem;
   padding: 7.5rem 8vw 2.5rem; overflow-y: auto;
   transform: translateY(-100%); transition: transform .5s var(--ease);
   visibility: hidden;
}
body.menu-open .drawer { transform: translateY(0); visibility: visible; }
.drawer__links { display: grid; gap: .4rem; }
.drawer__links a {
   font-family: var(--serif); font-size: clamp(1.5rem, 6.5vw, 2.2rem); font-weight: 500;
   padding-block: .25rem; opacity: 0; transform: translateY(18px);
}
body.menu-open .drawer__links a { animation: drawerIn .5s var(--ease) forwards; }
body.menu-open .drawer__links a:nth-child(1) { animation-delay: .08s; }
body.menu-open .drawer__links a:nth-child(2) { animation-delay: .14s; }
body.menu-open .drawer__links a:nth-child(3) { animation-delay: .20s; }
body.menu-open .drawer__links a:nth-child(4) { animation-delay: .26s; }
body.menu-open .drawer__links a:nth-child(5) { animation-delay: .32s; }
body.menu-open .drawer__links a:nth-child(6) { animation-delay: .38s; }
@keyframes drawerIn { to { opacity: 1; transform: none; } }
.drawer__cta { color: var(--gold-tint) !important; display: inline-flex; align-items: center; gap: .8rem; }
.drawer__meta { letter-spacing: .2em; text-transform: uppercase; font-size: .72rem; color: var(--tone-muted); }

/* ===========================================================
   HERO
   =========================================================== */
.hero {
   position: relative; min-height: 100svh; display: flex; flex-direction: column;
   justify-content: flex-end; color: #fff; overflow: hidden;
   padding-bottom: clamp(2rem, 1rem + 4vw, 4rem);
}
.hero__media { position: absolute; inset: -8% 0 0; z-index: -2; }
.hero__still, .hero__video {
   position: absolute; inset: 0;
   width: 100%; height: 116%; object-fit: cover; object-position: center 35%;
}
.hero__still { animation: heroZoom 18s ease-out forwards; }
.hero__video { opacity: 0; transition: opacity 1.2s var(--ease); }
.hero__video.is-ready { opacity: 1; }
@keyframes heroZoom { from { transform: scale(1.12); } to { transform: scale(1); } }

.hero__sound {
   position: absolute; z-index: 4;
   top: clamp(84px, 13vh, 124px); right: clamp(16px, 4vw, 40px);
   width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
   background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); color: #fff;
   backdrop-filter: blur(8px); font-size: 1.05rem;
   transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.hero__sound[hidden] { display: none; }
.hero__sound:hover { background: rgba(255,255,255,.32); transform: translateY(-2px); }
/* Text overlay removed — keep only a soft bottom vignette + edge falloff so the
   video reads full-frame while the scroll cue stays legible. */
.hero__scrim {
   position: absolute; inset: 0; z-index: -1;
   background:
      linear-gradient(0deg, rgba(16,11,6,.55) 0%, rgba(16,11,6,0) 26%),
      radial-gradient(130% 120% at 50% 32%, transparent 58%, rgba(14,9,5,.42) 100%);
}
/* ponytail: static SVG noise overlay for cinematic grain — one data-URI, no assets */
.hero__grain {
   position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .07;
   mix-blend-mode: overlay;
   background-image: 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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__content { position: relative; }
.hero__title {
   font-family: var(--serif); font-weight: 500;
   font-size: var(--display-lg); line-height: 1.02; letter-spacing: -.02em;
   margin: .4rem 0 0; text-wrap: balance;
}
.hero__title span { display: block; }
.hero__title em { font-style: italic; color: var(--tone-accent); }
.hero__lede { max-width: 46ch; margin-top: 1.6rem; font-size: var(--text-lede); color: rgba(255,255,255,.86); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }

.hero__foot {
   position: relative; z-index: 1; margin-top: clamp(2.5rem, 2rem + 4vw, 4.5rem);
   display: flex; align-items: flex-end; justify-content: center; gap: 2rem;
}
.hero__facts { display: flex; gap: clamp(1.5rem, 4vw, 3.5rem); margin: 0; }
.hero__facts dt { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--tone-accent); }
.hero__facts dd { margin: .25rem 0 0; font-family: var(--serif); font-size: 1.15rem; }
.hero__scroll {
   display: inline-flex; flex-direction: column; align-items: center; gap: .7rem;
   font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: rgba(255,255,255,.82);
}
/* Cinematic scroll cue: a thin rail with a gold highlight that travels down. */
.hero__scroll-line {
   width: 1px; height: 48px; position: relative; overflow: hidden;
   background: rgba(255,255,255,.24);
}
.hero__scroll-line::after {
   content: ""; position: absolute; inset: 0;
   background: linear-gradient(180deg, transparent, var(--gold-tint), transparent);
   animation: scrollTrail 2.1s var(--ease) infinite;
}
@keyframes scrollTrail { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

.sr-only {
   position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
   overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ===========================================================
   FOOTER
   =========================================================== */
.ft { background: var(--ink); color: rgba(255,255,255,.72); padding-top: clamp(4rem, 3rem + 4vw, 7rem); }
.ft__grid {
   display: grid; gap: 3rem 2rem;
   grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
   padding-bottom: 3.5rem; border-bottom: 1px solid rgba(255,255,255,.12);
}
.ft__brand img { width: 132px; height: auto; margin-bottom: 1.2rem; }
.ft__brand p { max-width: 34ch; }
.ft__social { display: flex; gap: .7rem; margin-top: 1.4rem; }
.ft__social a {
   width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
   border: 1px solid rgba(255,255,255,.18); color: #fff;
   transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.ft__social a:hover { background: var(--gold); border-color: var(--gold); transform: translateY(-3px); }
.ft__col h4 {
   font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-tint);
   margin-bottom: 1.2rem; font-weight: 600;
}
.ft__col a { display: block; padding: .35rem 0; color: rgba(255,255,255,.74); transition: color var(--dur) var(--ease), padding-left var(--dur) var(--ease); }
.ft__col a:hover { color: #fff; padding-left: 6px; }
.ft__contact p { margin-bottom: 1rem; }
.ft__contact .link-arrow { color: #fff; border-color: rgba(255,255,255,.5); }
.ft__contact .link-arrow:hover { color: var(--gold-tint); border-color: var(--gold); }
.ft__base {
   display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
   padding-block: 1.8rem; font-size: .82rem; color: var(--tone-muted);
}

/* ===========================================================
   MOTION — reveal is JS-gated so GSAP owns it; no-JS = visible
   =========================================================== */
html.js [data-reveal] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
   html.js [data-reveal] { opacity: 1; }
   .hero__still, .hero__scroll-line::after { animation: none; }
   .btn, .circ { transition: none; }
}
