/* Header + hero (preloader → hero). Colours and fonts come from theme.css. */

/* ---------- header: glass pills ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px clamp(16px, 3vw, 40px); pointer-events: none;
}
.pill {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 26px; border-radius: 999px; color: #fff; text-decoration: none;
  font: 500 15px var(--font-body); letter-spacing: .01em; white-space: nowrap;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  transition: background .3s;
}
.pill:hover { background: rgba(255, 255, 255, .24); }
.pill--nav { gap: 46px; }
.pill--nav a { color: inherit; text-decoration: none; opacity: .92; }
.pill--nav a:hover { opacity: 1; }
@media (max-width: 820px) {
  .pill { padding: 10px 16px; font-size: 13px; }
  .pill--nav { gap: 16px; }
  .pill--nav a:nth-child(2) { display: none; }
}
@media (max-width: 480px) {
  .pill--cta { padding: 10px 12px; }
  .pill--cta .pill-label { display: none; }
}

/* ---------- hero ---------- */
/* layer order: photo (1) → navy veil (2) → giant word (3) → foreground cut-out (4) → copy (5) */
.hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--primary); }
.hero-frame, .hero-media { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-frame { overflow: hidden; }
.hero-media { z-index: 1; }
.ph-photo, .ph-fg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.hero-veil { position: absolute; inset: 0; z-index: 2; background: var(--primary); }
.hero-frame::before { /* soft shade at the bottom so the description stays readable */
  content: ''; position: absolute; inset: auto 0 0 0; height: 45%; z-index: 4; pointer-events: none;
  background: linear-gradient(0deg, rgba(7, 20, 49, .5), rgba(7, 20, 49, 0)); }

.ph-bigword {
  position: absolute; z-index: 3; left: clamp(16px, 2.6vw, 40px); right: clamp(16px, 2.6vw, 40px); top: 11vh; top: 11svh;
  margin: 0; font-family: var(--font-display); font-weight: 400;
  /* "DHRUV ESTATE" in Anton is ~5.1em wide, so this fills the width with pure CSS (JS only fine-tunes it) */
  font-size: calc((100vw - 2 * clamp(16px, 2.6vw, 40px)) / 5.15);
  line-height: .86; letter-spacing: -.005em; color: #f6f8fc; white-space: nowrap; text-transform: uppercase;
  will-change: transform;
}
.bw-line { display: inline-block; vertical-align: top; }
.bw-gap { display: inline-block; width: .16em; }
.ch { display: inline-block; will-change: transform; }
.ph-fg { z-index: 4; pointer-events: none; }

.ph-desc {
  position: absolute; z-index: 5; left: clamp(20px, 3vw, 44px); bottom: clamp(28px, 6vh, 64px);
  max-width: 540px; margin: 0; font: 400 clamp(15px, 1.3vw, 19px)/1.5 var(--font-body); color: #fff;
  text-shadow: 0 1px 12px rgba(7, 20, 49, .4);
}
.theme-toggle {
  position: absolute; z-index: 5; right: clamp(20px, 3vw, 44px); bottom: clamp(28px, 6vh, 64px);
  display: flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.theme-toggle button {
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: transparent; color: rgba(255, 255, 255, .85); cursor: pointer; transition: background .3s, color .3s;
}
.theme-toggle button.is-active { background: #fff; color: var(--primary); }

/* dusk grading for the photo + cut-out (kept identical so the layers stay matched) */
.ph-photo, .ph-fg, .ep-thumb { transition: filter .8s ease; }
body.is-dusk .ph-photo, body.is-dusk .ph-fg { filter: brightness(.55) saturate(.8) contrast(1.08); }
body.is-dusk .ph-bigword { color: var(--navy-100); }

.ph-hint { position: absolute; z-index: 6; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.ph-hint i { width: 1px; height: 38px; background: linear-gradient(#fff, transparent); animation: phHint 1.6s ease-in-out infinite; transform-origin: top; }
@keyframes phHint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* while the letters are dropping in the page can't scroll yet */
html.is-preloading, html.is-preloading body { overflow: hidden; }

/* mobile: the word stacks on two lines; photo focuses on the house */
@media (max-width: 820px) {
  .ph-bigword { top: 12svh; font-size: calc((100vw - 32px) / 2.62); } /* "ESTATE" is ~2.56em wide */
  .bw-line { display: block; }
  .bw-gap { display: none; }
  .ph-photo, .ph-fg { object-position: 42% 50%; }
  .ph-desc { right: 20px; bottom: 92px; font-size: 15px; }
  .theme-toggle { right: 20px; bottom: 24px; }
}
