/* ==========================================================================
   Crown Home Improvement — polish layer (loads last)
   typography · rounder buttons · floating header · section 04 · 3D map · custom select
   ========================================================================== */
:root {
  --font-head: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --radius: 18px; --radius-lg: 28px;
  --header-h: 92px;
}

/* ---------- typography: calmer weights, cleaner tracking ---------- */
body { font-size: 16.5px; line-height: 1.7; letter-spacing: -.003em; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.025em; }
.section-title { font-weight: 700; font-size: clamp(32px, 3.8vw, 52px); line-height: 1.08; letter-spacing: -.03em; }
.hero-title { font-weight: 800; font-size: clamp(40px, 5.6vw, 78px); line-height: 1.02; letter-spacing: -.035em; }
.chapter h2 { font-weight: 800; font-size: clamp(40px, 6vw, 88px); letter-spacing: -.04em; line-height: 1; }
.cine-line { font-weight: 800; letter-spacing: -.04em; }
.cta-inner h2 { font-weight: 800; }
.eyebrow { font-family: var(--font-body); font-weight: 600; font-size: 12px; letter-spacing: .22em; }
.hero-sub, .lead, .section-intro { font-weight: 400; letter-spacing: -.005em; }
.lead { font-size: 18.5px; line-height: 1.65; }
.stat-num, .score, .about-badge-num, .cut-num { font-weight: 800; }
.marquee-row:first-child .marquee-track span { font-weight: 800; letter-spacing: -.03em; }
.svc-row h3 { font-weight: 600; letter-spacing: -.02em; }
.why-item h3, .step h3, .anatomy-list strong, .review cite { font-weight: 600; }
.logo-text strong { font-weight: 800; letter-spacing: .2em; font-size: 20px; }
.logo-text small { font-family: var(--font-body); font-weight: 600; letter-spacing: .3em; }
.ch-num, .svc-caption, .story-hint, .ba-tag, .cine-meta, .svc-n { font-family: var(--font-body); }

/* ---------- buttons: fully rounded, softer, with a light edge ---------- */
.btn { --bh: 50px; border-radius: 999px; padding: 0 28px; font-family: var(--font-body); font-weight: 600; font-size: 15px; letter-spacing: 0; gap: .6em; }
.btn-lg { --bh: 58px; padding: 0 34px; font-size: 16px; }
.btn-sm { --bh: 44px; padding: 0 22px; font-size: 14px; }
.btn-gold { color: #14110b; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(0, 0, 0, .12), 0 10px 30px -12px rgba(213, 166, 74, .75); }
.btn-ghost { border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .28); }
.btn-navy { border-radius: 999px; }
.btn-block { white-space: nowrap; padding-block: 0; min-height: 54px; font-size: 15px; }
@media (max-width: 420px) { .btn-block { white-space: normal; padding: 12px 22px; } }
.btn .ico { width: 1.05em; height: 1.05em; }
.link-more { font-family: var(--font-body); font-weight: 600; }
.trust-chip { border-radius: 999px; }
.field input, .field select, .field textarea, .cselect-btn { border-radius: 16px; }
.lb-nav, .lb-close, .socials a, .nav-toggle { border-radius: 999px; }

/* ==========================================================================
   HEADER — a floating glass pill that flows with the page
   ========================================================================== */
.site-header { position: fixed; inset: 0 0 auto; z-index: 100; height: auto; padding-top: 14px; pointer-events: none; background: none !important; box-shadow: none !important; border: 0 !important; transform: translateY(-140%); transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.loaded .site-header { transform: none; }
.loaded .site-header.tucked { transform: translateY(-130%); }
.site-header.scrolled { height: auto; }
.header-inner { pointer-events: auto; position: relative; isolation: isolate; width: min(100% - 28px, 1260px); height: 66px; margin-inline: auto; padding: 0 10px 0 16px; gap: 18px; border-radius: 999px; transition: width .6s cubic-bezier(.2, .8, .2, 1), height .5s; }
.site-header.scrolled .header-inner { width: min(100% - 28px, 1120px); height: 62px; }
/* glass lives on a pseudo-element, so the mobile menu (position: fixed) is not trapped inside the pill */
.header-inner::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: rgba(12, 14, 18, .42); border: 1px solid rgba(255, 255, 255, .07); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); box-shadow: 0 20px 50px -25px rgba(0, 0, 0, .9); transition: background-color .5s; }
.site-header.scrolled .header-inner::before { background: rgba(12, 14, 18, .72); }
/* a gold light that travels around the edge of the pill */
@property --hx { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.header-inner::after { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--hx), transparent 0deg, transparent 250deg, rgba(213, 166, 74, .0) 270deg, rgba(232, 196, 122, .95) 320deg, rgba(213, 166, 74, 0) 345deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: headerFlow 7s linear infinite; }
@keyframes headerFlow { to { --hx: 360deg; } }
.logo-mark { width: 40px; height: 40px; border-radius: 999px; }
.logo-mark .ico { width: 22px; height: 22px; }
/* nav with a sliding highlight */
.main-nav ul { position: relative; gap: 2px; }
.main-nav ul a { position: relative; z-index: 1; padding: 9px 16px; border-radius: 999px; font-family: var(--font-body); font-weight: 500; font-size: 14.5px; color: rgba(255, 255, 255, .78); }
.main-nav ul a::after { display: none; }
.main-nav ul a.active, .main-nav ul a:hover { color: #fff; }
.nav-glow { position: absolute; z-index: 0; top: 0; left: 0; height: 100%; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(213, 166, 74, .35); opacity: 0; pointer-events: none; transition: transform .55s cubic-bezier(.2, .8, .2, 1), width .55s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.nav-glow.on { opacity: 1; }
.header-cta { --bh: 46px; padding: 0 22px; font-size: 14px; }
.scroll-progress { top: 0; height: 2px; }
@media (max-width: 1020px) {
  .header-inner { padding-right: 8px; }
  .nav-toggle { width: 46px; height: 46px; border-radius: 999px; background: rgba(255, 255, 255, .06); }
  .main-nav { z-index: -2; inset: 0; padding: 120px 28px 36px; background: rgba(8, 9, 11, .97); }
  .main-nav ul a { font-family: var(--font-head); font-size: 30px; font-weight: 700; padding: 12px 4px; border-radius: 12px; opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s cubic-bezier(.2, .8, .2, 1), color .2s; }
  .nav-open .main-nav ul a { opacity: 1; transform: none; }
  .nav-open .main-nav li:nth-child(2) a { transition-delay: .05s; } .nav-open .main-nav li:nth-child(3) a { transition-delay: .1s; } .nav-open .main-nav li:nth-child(4) a { transition-delay: .15s; } .nav-open .main-nav li:nth-child(5) a { transition-delay: .2s; } .nav-open .main-nav li:nth-child(6) a { transition-delay: .25s; }
  .nav-glow { display: none; }
}
@media (max-width: 520px) { .logo-text small { display: none; } .logo-text strong { font-size: 18px; } }

/* ==========================================================================
   SECTION 04 — Precision (the Printed Building), now in a framed stage
   ========================================================================== */
.craft { height: auto; min-height: 0; padding: clamp(80px, 9vw, 120px) 0; background: radial-gradient(ellipse 70% 50% at 50% 100%, rgba(213, 166, 74, .07), transparent 60%), var(--bg); }
.craft-scrim { display: none; }
.craft-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap; margin-bottom: 34px; }
.craft-top .section-title { margin: 0; }
.craft-top .craft-lede { max-width: 520px; margin: 14px 0 0; color: var(--muted-d); font-size: 17px; }
.craft-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.craft-frame { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius-lg); height: min(76vh, 760px); min-height: 420px; background: #dfe7ef; border: 1px solid var(--line-d); box-shadow: 0 60px 120px -60px rgba(0, 0, 0, .95), 0 0 0 1px rgba(213, 166, 74, .12); }
.craft-frame #scene { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.craft-frame::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 -80px 120px -60px rgba(10, 11, 13, .55); }
.craft-loading { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; color: #5b6573; font: 600 13px var(--font-body); letter-spacing: .2em; text-transform: uppercase; background: linear-gradient(180deg, #9bc2ea, #e3ecf4); transition: opacity 1s; }
.scene-ready .craft-loading { opacity: 0; }
.craft-frame .craft-hint { position: absolute; left: 50%; right: auto; top: auto; bottom: 20px; z-index: 2; transform: translate(-50%, 8px); white-space: nowrap; max-width: calc(100% - 32px); }
.scene-ready .craft-frame .craft-hint { transform: translate(-50%, 0); }
.craft-tag { position: absolute; left: 20px; top: 18px; z-index: 2; padding: 7px 14px; border-radius: 999px; background: rgba(10, 11, 13, .55); backdrop-filter: blur(6px); color: #fff; font: 600 11px var(--font-body); letter-spacing: .2em; text-transform: uppercase; }
@media (max-width: 760px) { .craft-frame { height: 62vh; min-height: 380px; } .craft-frame .craft-hint { white-space: normal; text-align: center; } }

/* ==========================================================================
   3D MAP
   ========================================================================== */
.map { aspect-ratio: auto; height: 420px; border-radius: var(--radius-lg); }
.map-3d { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity 1.2s; }
.map.ready .map-3d { opacity: 1; }
.map.ready .map-ph { opacity: 0; pointer-events: none; }
.map-ph { transition: opacity .8s; }
.map .maplibregl-ctrl-group { background: rgba(14, 16, 20, .85); border-radius: 999px; overflow: hidden; border: 1px solid var(--line-d); box-shadow: none; }
.map .maplibregl-ctrl-group button { width: 34px; height: 34px; }
.map .maplibregl-ctrl-group button + button { border-top: 1px solid var(--line-d); }
.map .maplibregl-ctrl-icon { filter: invert(1) brightness(1.3); }
.map .maplibregl-ctrl-attrib { background: rgba(10, 11, 13, .7); color: #8d8a82; font-size: 10px; border-radius: 999px 0 0 0; }
.map .maplibregl-ctrl-attrib a { color: #b3afa6; }
.map-pin { position: relative; width: 46px; height: 46px; }
.map-pin .core { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #e8c47a, var(--gold) 55%, #b8862f); box-shadow: 0 10px 30px -6px rgba(213, 166, 74, .8), 0 0 0 4px rgba(10, 11, 13, .6); }
.map-pin .core svg { width: 24px; height: 24px; fill: #14110b; }
.map-pin::before, .map-pin::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gold); animation: pinPulse 2.4s cubic-bezier(.2, .8, .2, 1) infinite; }
.map-pin::after { animation-delay: 1.2s; }
@keyframes pinPulse { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
.map-card { position: absolute; left: 16px; bottom: 16px; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; border-radius: 999px; background: rgba(10, 11, 13, .78); backdrop-filter: blur(10px); border: 1px solid var(--line-d); color: var(--text-d); font-size: 13.5px; text-decoration: none; transition: border-color .3s; }
.map-card:hover { border-color: var(--gold); color: #fff; }
.map-card .ico { color: var(--gold); }
.map-3d-badge { position: absolute; right: 16px; top: 16px; z-index: 2; padding: 6px 12px; border-radius: 999px; background: rgba(10, 11, 13, .7); color: var(--gold-2); font: 600 11px var(--font-body); letter-spacing: .18em; text-transform: uppercase; pointer-events: none; }
.map .maplibregl-ctrl-top-right { top: 52px; }

/* ==========================================================================
   CUSTOM SELECT (Service Needed) — no native arrows
   ========================================================================== */
.cselect { position: relative; }
.cselect select { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.cselect-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; text-align: left; font: inherit; font-size: 16px; color: var(--text-d); background: #0c0e12; border: 1.5px solid var(--line-d); cursor: pointer; transition: border-color .2s, background-color .2s, box-shadow .2s; }
.cselect-btn .ph-text { color: #6f6b64; }
.cselect-btn:hover { border-color: rgba(255, 255, 255, .18); }
.cselect-btn:focus-visible, .cselect.open .cselect-btn { outline: none; background: #0f1116; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(213, 166, 74, .14); }
.cselect-chev { width: 18px; height: 18px; flex: none; color: var(--gold); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.cselect.open .cselect-chev { transform: rotate(180deg); }
.cselect-list { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; margin: 0; padding: 8px; list-style: none; border-radius: 18px; background: rgba(20, 23, 29, .98); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .9); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top; transition: opacity .25s, transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .3s; max-height: 320px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(213, 166, 74, .4) transparent; }
.cselect.open .cselect-list { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.cselect-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius: 12px; cursor: pointer; color: var(--text-d); font-size: 15px; transition: background-color .15s, color .15s; }
.cselect-list li.hl { background: rgba(213, 166, 74, .12); color: #fff; }
.cselect-list li[aria-selected="true"] { color: var(--gold-2); }
.cselect-list li[aria-selected="true"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.field.invalid .cselect-btn { background: #1c1012; border-color: #d9534f; }
.field.valid .cselect-btn { border-color: #2e8b57; }

/* small fixes */
@media (min-width: 861px) { .story-hint { left: auto; right: 70px; transform: none; } }
@media (max-width: 1020px) { .main-nav { background: #08090b; } }

/* ==========================================================================
   v5 — calmer, more professional; real video hero; real before/after
   ========================================================================== */
/* header: the old "scrolled" rule put backdrop-filter on the header itself, which turned the fixed mobile menu
   into a box the size of the header (menu items over the page). Never filter/transform the header. */
.site-header, .site-header.scrolled { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; filter: none !important; }
.nav-open .site-header { transform: none !important; }
@media (max-width: 1020px) {
  .main-nav { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; background: #08090b !important; overflow-y: auto; }
}
body.nav-open { overflow: hidden; }

/* no film grain or custom cursor */
body::before { display: none !important; }
.cursor-dot, .cursor-ring { display: none !important; }
@media (hover: hover) and (pointer: fine) { body, a, button, #scene { cursor: auto; } a, button, .g-item, .svc-row { cursor: pointer; } #scene { cursor: pointer; } }

/* ---------- hero: cinematic video ---------- */
.hero-v { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; background: #0a0b0d; }
.hero-v-media { position: absolute; inset: 0; z-index: -2; }
.hero-v-video { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); animation: heroDrift 24s ease-in-out infinite alternate; }
@keyframes heroDrift { from { transform: scale(1.06) translate3d(0, 0, 0); } to { transform: scale(1.12) translate3d(-1.2%, -1%, 0); } }
.hero-v-shade { position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(90deg, rgba(10, 11, 13, .86) 0%, rgba(10, 11, 13, .55) 38%, rgba(10, 11, 13, .1) 70%),
  linear-gradient(180deg, rgba(10, 11, 13, .55) 0%, rgba(10, 11, 13, 0) 22%, rgba(10, 11, 13, 0) 55%, rgba(10, 11, 13, .92) 100%); }
.hero-v-content { padding: calc(var(--header-h) + 60px) 0 clamp(70px, 10vh, 120px); }
.hero-v-content > * { max-width: 700px; }
.hero-v-foot { display: flex; align-items: center; gap: 18px 26px; flex-wrap: wrap; }
.hero-v-meta { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: rgba(233, 229, 220, .78); }
.hero-v-meta .ico { color: var(--gold); }
.hero-v-meta span { color: rgba(255, 255, 255, .35); }
.hero-v .scroll-cue { bottom: 34px; }
@media (max-width: 860px) {
  .hero-v-shade { background: linear-gradient(180deg, rgba(10, 11, 13, .55) 0%, rgba(10, 11, 13, .15) 30%, rgba(10, 11, 13, .65) 60%, rgba(10, 11, 13, .96) 100%); }
  .hero-v-content { padding-bottom: 60px; }
}
@media (prefers-reduced-motion: reduce) { .hero-v-video { animation: none; } }

/* cinematic section uses a real photo */
.cine-frame .cine-img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.3 - var(--p) * .25)); will-change: transform; display: block; }

/* ---------- services: real photos ---------- */
.svc-photos { background: #0c0e12; }
.svc-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity .8s var(--ease), transform 6s linear; }
.svc-photos img.on { opacity: 1; transform: scale(1); }
.svc-photos::after { box-shadow: inset 0 -120px 120px -80px rgba(10, 11, 13, .7); }
.svc-stage.svc-photos { aspect-ratio: 4 / 5; }
@media (max-width: 960px) { .svc-stage.svc-photos { aspect-ratio: 4 / 3; } }

/* ---------- before / after (real projects) ---------- */
.ba-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 auto 30px; }
.ba-tab { padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line-d); background: rgba(255, 255, 255, .03); color: var(--text-d); font: 500 14.5px var(--font-body); cursor: pointer; transition: background-color .25s, border-color .25s, color .25s; }
.ba-tab:hover { border-color: rgba(213, 166, 74, .5); }
.ba-tab.on { background: var(--gold); border-color: var(--gold); color: #14110b; font-weight: 600; }
.ba-stage { position: relative; }
.ba-pane { display: none; grid-template-columns: 1fr 56px 1fr; align-items: center; gap: 0; }
.ba-pane.on { display: grid; animation: baIn .6s var(--ease); }
@keyframes baIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.ba-shot { position: relative; margin: 0; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-d); background: var(--surface); cursor: zoom-in; }
.ba-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.ba-shot:hover img { transform: scale(1.04); }
.ba-label { position: absolute; left: 16px; top: 16px; padding: 7px 14px; border-radius: 999px; background: rgba(10, 11, 13, .72); backdrop-filter: blur(6px); color: #fff; font: 600 11.5px var(--font-body); letter-spacing: .18em; text-transform: uppercase; }
.ba-label-after { background: var(--gold); color: #14110b; }
.ba-arrow { justify-self: center; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid rgba(213, 166, 74, .45); color: var(--gold); }
.ba-desc { grid-column: 1 / -1; text-align: center; margin: 22px auto 0; max-width: 620px; color: var(--muted-d); }
@media (max-width: 700px) {
  .ba-pane.on { grid-template-columns: 1fr; gap: 12px; }
  .ba-arrow { transform: rotate(90deg); }
  .ba-shot { aspect-ratio: 4 / 3; }
}

/* ---------- gallery: real photos ---------- */
.hg-track .g-item { width: clamp(260px, 26vw, 400px); height: min(60vh, 560px); }
.hg-track .g-wide { width: clamp(320px, 40vw, 620px); }
.g-cap small { letter-spacing: .14em; }

/* quieter hovers (no tilt) */
.service-card:hover, .review:hover, .why-item:hover { transform: translateY(-3px); }
.map-fallback { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map.is-fallback .map-3d-badge { display: none; }
.ba-shot { cursor: default; }
.hero-v-video { animation: none; transform: none; }
.hero-replay { position: absolute; right: 28px; bottom: 30px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(10, 11, 13, .55); backdrop-filter: blur(8px); color: #fff; font: 500 14px var(--font-body); cursor: pointer; transition: background-color .25s, border-color .25s; }
.hero-replay:hover { background: var(--gold); border-color: var(--gold); color: #14110b; }
.hero-replay[hidden] { display: none; }
@media (max-width: 860px) { .hero-replay { right: 16px; bottom: 16px; } }
.svc-stage:not(.svc-photos) { aspect-ratio: 1 / 1; }
.powered { color: rgba(255, 255, 255, .55); text-decoration: none; font-size: 13.5px; transition: color .2s; }
.powered strong { color: var(--gold-2); font-weight: 600; letter-spacing: .02em; }
.powered:hover { color: #fff; }
.footer-bottom { gap: 14px 28px; }

/* ==========================================================================
   v6 — scroll-played hero film + the trowel companion
   ========================================================================== */
:root { --font-serif: "Instrument Serif", "Times New Roman", serif; }
.scrub { --p: 0; position: relative; height: 560vh; background: #0a0b0d; }
.scrub-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
.scrub-poster, .scrub-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.scrub-poster { object-fit: cover; z-index: -3; }
.scrub-canvas { z-index: -2; display: block; }
.scrub-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; background:
  linear-gradient(90deg, rgba(10, 11, 13, .82) 0%, rgba(10, 11, 13, .45) 34%, rgba(10, 11, 13, 0) 62%),
  linear-gradient(180deg, rgba(10, 11, 13, .5) 0%, rgba(10, 11, 13, 0) 20%, rgba(10, 11, 13, 0) 60%, rgba(10, 11, 13, .85) 100%); }
.scrub .chapter-hero .container { padding-top: var(--header-h); }
.scrub .story-rail { right: auto; left: 22px; }
.scrub .story-hint { left: 50%; right: auto; transform: translateX(-50%); }

/* scene titles, in the style of the reference: bold caps + an italic serif accent */
.scene { align-items: flex-end; padding-bottom: 15vh; }
.scene .container > * { transform: translateY(28px); opacity: 0; transition: transform 1s cubic-bezier(.2, .8, .2, 1), opacity .8s; }
.scene.on .container > * { transform: none; opacity: 1; }
.scene.on .container > *:nth-child(2) { transition-delay: .12s; }
.scene-title { font-family: var(--font-head); font-weight: 800; text-transform: uppercase; letter-spacing: -.035em; line-height: .95; font-size: clamp(40px, 7.2vw, 112px); color: #fff; margin: 0 0 18px; text-shadow: 0 4px 40px rgba(0, 0, 0, .35); }
.scene-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: -.01em; color: var(--gold-2); }
.scene p { font-size: clamp(16px, 1.4vw, 19px); color: rgba(255, 255, 255, .85); max-width: 460px; margin: 0; }
.scene-end { justify-content: center; text-align: center; align-items: center; padding-bottom: 0; }
.scene-end .scene-title { margin-bottom: 30px; }
@media (max-width: 860px) {
  .scrub-shade { background: linear-gradient(180deg, rgba(10, 11, 13, .5) 0%, rgba(10, 11, 13, .05) 28%, rgba(10, 11, 13, .45) 58%, rgba(10, 11, 13, .92) 100%); }
  .scene { padding-bottom: 110px; }
  .scrub .story-rail { display: none; }
}
@media (prefers-reduced-motion: reduce) { .scrub { height: auto; } .scrub-stage { position: relative; } .scene { display: none; } }

/* ---------- the trowel companion ---------- */
.buddy { --trip: 0; position: fixed; right: 18px; top: calc(16vh + var(--trip) * 56vh); z-index: 95; width: 118px; height: 118px; opacity: 0; transform: scale(.6) translateY(20px); pointer-events: none; transition: opacity .6s, transform .8s cubic-bezier(.2, .8, .2, 1), top .25s linear; }
.loaded .buddy.ready { opacity: 1; transform: none; pointer-events: auto; }
.buddy-btn { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: radial-gradient(circle at 50% 45%, rgba(213, 166, 74, .16), rgba(10, 11, 13, 0) 68%); cursor: pointer; }
.buddy-btn::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 1px solid rgba(213, 166, 74, .0); transition: border-color .3s, inset .3s; }
.buddy-btn:hover::after, .buddy.open .buddy-btn::after { border-color: rgba(213, 166, 74, .45); inset: 8px; }
.buddy-btn canvas { width: 100%; height: 100%; display: block; }
.buddy-bubble { position: absolute; right: calc(100% + 4px); top: 50%; width: max-content; max-width: 250px; padding: 12px 16px; border-radius: 18px 18px 4px 18px; background: rgba(20, 23, 29, .92); backdrop-filter: blur(10px); border: 1px solid rgba(213, 166, 74, .35); color: #f1ede4; font: 500 14px/1.45 var(--font-body); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .9); opacity: 0; transform: translate(10px, -50%) scale(.96); transform-origin: right center; transition: opacity .35s, transform .45s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.buddy.talk .buddy-bubble { opacity: 1; transform: translate(0, -50%); }
.buddy-menu { position: absolute; right: calc(100% + 6px); top: 50%; transform: translateY(-50%); width: 240px; padding: 16px; border-radius: 20px; background: rgba(16, 18, 23, .96); backdrop-filter: blur(12px); border: 1px solid rgba(213, 166, 74, .35); box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .95); display: grid; gap: 8px; animation: menuIn .35s cubic-bezier(.2, .8, .2, 1); }
.buddy-menu[hidden] { display: none; }
@keyframes menuIn { from { opacity: 0; transform: translate(8px, -50%) scale(.96); } to { opacity: 1; transform: translateY(-50%); } }
.buddy-menu-title { margin: 0 0 4px; font: 600 12px var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-2); }
.buddy-menu .btn { width: 100%; }
.buddy-link { color: rgba(233, 229, 220, .8); font-size: 14px; text-decoration: none; padding: 6px 4px; }
.buddy-link:hover { color: var(--gold-2); }
@media (max-width: 720px) {
  .buddy { top: auto; bottom: 86px; right: 8px; width: 86px; height: 86px; transition: opacity .6s, transform .8s cubic-bezier(.2, .8, .2, 1); }
  .buddy-bubble { max-width: 200px; font-size: 13px; top: auto; bottom: 50%; transform: translate(10px, 0) scale(.96); border-radius: 16px 16px 4px 16px; }
  .buddy.talk .buddy-bubble { transform: none; }
  .buddy-menu { top: auto; bottom: 0; transform: none; animation: none; }
}
@media (prefers-reduced-motion: reduce) { .buddy { transition: opacity .3s; } }

/* 3D map: MapLibre's own CSS sets `.maplibregl-map { position: relative }` on the container, which collapsed it to
   0px height (the map loaded but was invisible). Keep the container filling the frame. */
.map .map-3d, .map .map-3d.maplibregl-map { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; }

/* ---------- the hammer guide: glides side to side, strikes, knocks out a fact card ---------- */
.buddy { top: auto !important; bottom: 18vh; left: 18px; right: auto; width: 124px; height: 124px; transform: none; --x: calc(100vw - 124px - 36px - var(--sbw, 0px));
  transition: opacity .6s, translate 1.1s cubic-bezier(.65, 0, .35, 1); translate: var(--x) 0; }
.buddy[data-side="left"] { translate: 0 0; }
.loaded .buddy.ready { transform: none; }
.buddy-btn { background: radial-gradient(circle at 50% 55%, rgba(213, 166, 74, .14), rgba(10, 11, 13, 0) 66%); }
.buddy-card { position: absolute; bottom: 62%; width: 260px; padding: 14px 18px 15px; border-radius: 18px; background: linear-gradient(160deg, rgba(28, 31, 38, .96), rgba(14, 16, 20, .96)); backdrop-filter: blur(10px); border: 1px solid rgba(213, 166, 74, .45); box-shadow: 0 24px 50px -22px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .03) inset; opacity: 0; transform: scale(.4) translateY(30px); pointer-events: none; transition: opacity .35s, transform .35s; }
.buddy[data-side="right"] .buddy-card { right: 78%; transform-origin: 100% 100%; }
.buddy[data-side="left"] .buddy-card { left: 78%; transform-origin: 0 100%; }
.buddy-card.pop { opacity: 1; transform: none; animation: cardPop .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes cardPop { 0% { opacity: 0; transform: scale(.3) translateY(30px) rotate(-6deg); } 60% { opacity: 1; } 100% { transform: none; } }
.buddy-card strong { display: block; font: 800 22px/1.1 var(--font-head); letter-spacing: -.02em; color: var(--gold-2); margin-bottom: 6px; }
.buddy-card span { display: block; font: 400 14px/1.5 var(--font-body); color: #ece8df; }
/* the strike: a shock ring + sparks at the hammer face */
.buddy-impact { position: absolute; top: 18%; width: 10px; height: 10px; pointer-events: none; }
.buddy[data-side="right"] .buddy-impact { left: 4%; } .buddy[data-side="left"] .buddy-impact { right: 4%; }
.buddy-impact::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--gold-2); opacity: 0; }
.buddy-impact i { position: absolute; left: 4px; top: 4px; width: 3px; height: 10px; border-radius: 2px; background: #ffd98a; opacity: 0; transform-origin: 50% 0; }
.buddy-impact i:nth-child(1) { --a: -70deg; } .buddy-impact i:nth-child(2) { --a: -35deg; } .buddy-impact i:nth-child(3) { --a: 0deg; } .buddy-impact i:nth-child(4) { --a: 35deg; } .buddy-impact i:nth-child(5) { --a: 70deg; } .buddy-impact i:nth-child(6) { --a: 180deg; }
.buddy.impact .buddy-impact::before { animation: ring .55s ease-out; }
.buddy.impact .buddy-impact i { animation: spark .5s ease-out; }
@keyframes ring { from { opacity: .9; transform: scale(.3); } to { opacity: 0; transform: scale(4); } }
@keyframes spark { from { opacity: 1; transform: rotate(var(--a)) translateY(4px) scaleY(1); } to { opacity: 0; transform: rotate(var(--a)) translateY(26px) scaleY(.3); } }
.buddy-menu { bottom: 0; top: auto; transform: none; animation: none; }
.buddy[data-side="right"] .buddy-menu { right: calc(100% + 6px); left: auto; }
.buddy[data-side="left"] .buddy-menu { left: calc(100% + 6px); right: auto; }
@media (max-width: 720px) {
  .buddy { bottom: 84px; left: 8px; width: 88px; height: 88px; --x: calc(100vw - 88px - 16px); }
  .buddy-card { width: min(230px, 62vw); bottom: 70%; }
  .buddy-card strong { font-size: 18px; } .buddy-card span { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .buddy { transition: opacity .3s; } }

/* ===================== FAQ ===================== */
.faq { background: radial-gradient(ellipse 55% 60% at 10% 0%, rgba(213, 166, 74, .06), transparent 60%), var(--bg-2); }
.faq-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.faq-head { position: sticky; top: 120px; }
.faq-head p:not(.eyebrow) { color: var(--muted-d); margin-top: 16px; }
.faq-list { display: grid; gap: 12px; min-width: 0; }
.faq-item { border: 1px solid var(--line-d); border-radius: 18px; background: rgba(255, 255, 255, .02); transition: border-color .3s, background .3s; }
.faq-item[open] { border-color: rgba(213, 166, 74, .35); background: rgba(213, 166, 74, .04); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 18px; }
.faq-item h3 { font-size: clamp(1rem, 1.6vw, 1.12rem); font-weight: 600; letter-spacing: -.01em; margin: 0; }
.faq-ico { position: relative; flex: 0 0 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(213, 166, 74, .45); }
.faq-ico::before, .faq-ico::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; background: var(--gold-2); transform: translate(-50%, -50%); transition: transform .3s; }
.faq-ico::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item[open] .faq-ico::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq-item p { margin: 0; padding: 0 24px 22px; color: var(--muted-d); line-height: 1.7; }
@media (max-width: 860px) { .faq-grid { grid-template-columns: minmax(0, 1fr); } .faq-head { position: static; } }
