/* ==========================================================================
   Crown Home Improvement — dark luxury theme + film chapters (loads last)
   ========================================================================== */
:root {
  --bg: #0a0b0d; --bg-2: #0f1115; --surface: #14171d; --surface-2: #1a1e26;
  --line-d: rgba(255, 255, 255, .08); --text-d: #e9e5dc; --muted-d: #9d998f;
  --light: #14171d; --line: rgba(255, 255, 255, .08); --ink: #e9e5dc; --muted: #9d998f;
}
html { background: var(--bg); }
body { background: var(--bg); color: var(--text-d); }
body::before { content: ""; position: fixed; inset: -50%; z-index: 500; pointer-events: none; opacity: .05; 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 1s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }
h1, h2, h3 { color: #f6f2e9; }
a { color: var(--gold-2); }
.eyebrow { color: var(--gold-2); }
.section-intro { color: var(--muted-d); }
.lead { color: var(--text-d); }
.gold { color: var(--gold); }
.section-title { letter-spacing: -.035em; }

/* header */
.site-header.scrolled { background: rgba(10, 11, 13, .78); border-bottom: 1px solid var(--line-d); }
@media (max-width: 1020px) { .main-nav { background: var(--bg); } }

/* buttons */
.btn-navy { background: transparent; color: var(--gold-2); border-color: rgba(213, 166, 74, .6); }
.btn-navy:hover { background: var(--gold); color: #0a0b0d; }
.btn-gold { background: linear-gradient(135deg, #e8c47a, var(--gold) 45%, #b8862f); }
.btn-gold:hover { background: linear-gradient(135deg, #f1d18e, #ddb05a 45%, #c4923a); }

/* sections */
.about, .services, .process, .contact, .reviews, .why, .ba { background: var(--bg); }
.services, .reviews { background: var(--bg-2); }
.why { background: radial-gradient(ellipse 60% 70% at 80% 0%, rgba(213, 166, 74, .08), transparent 60%), var(--bg); }
.why::after { background: radial-gradient(circle, rgba(213, 166, 74, .12), transparent 65%); }

/* stats */
.stats-wrap { margin-top: 0; padding-top: 70px; background: var(--bg); }
.stats { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border-color: var(--line-d); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8); }
.stat + .stat::before { background: var(--line-d); }
.stat:nth-child(n+3) { border-color: var(--line-d); }
.stat-ico { background: rgba(213, 166, 74, .1); color: var(--gold); }
.stat-num { color: #f6f2e9; }
.stat-label, .stats-source { color: var(--muted-d); }

/* marquee */
.marquee { background: var(--bg); border-color: var(--line-d); }
.marquee-row:first-child .marquee-track span { color: #f6f2e9; }
.marquee-row:first-child .marquee-track span:nth-of-type(even) { -webkit-text-stroke-color: rgba(246, 242, 233, .6); }

/* about */
.values li { color: var(--text-d); }
.values .ico { background: rgba(213, 166, 74, .1); color: var(--gold); }
.about-inset { border-color: var(--bg); }
.about-badge { background: rgba(20, 23, 29, .9); border: 1px solid rgba(213, 166, 74, .35); backdrop-filter: blur(8px); }
.ph { --ph-a: #1a1e26; --ph-b: #0d0f13; }

/* cinematic video */
.cine { background: var(--bg); }
.cine-frame video { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.35 - var(--p) * .3)) translateY(calc(var(--p) * -3%)); will-change: transform; display: block; }
.cine-frame { background: #000 center / cover; }

/* ---------- preloader: crown draws itself ---------- */
.preloader { background: var(--bg); }
.pre-mark { background: none; animation: none; width: 96px; height: 96px; }
.pre-crown { width: 96px; height: 96px; overflow: visible; }
.pc-stroke { fill: transparent; stroke: var(--gold); stroke-width: 1.2; stroke-linejoin: round; stroke-dasharray: 160; stroke-dashoffset: 160; animation: pcDraw 1.3s cubic-bezier(.65, 0, .35, 1) .1s forwards, pcFill .6s ease 1.2s forwards; }
.pc-base { fill: var(--gold); transform-origin: 24px 39.5px; transform: scaleX(0); animation: pcBase .7s cubic-bezier(.65, 0, .35, 1) .9s forwards; }
@keyframes pcDraw { to { stroke-dashoffset: 0; } }
@keyframes pcFill { to { fill: var(--gold); } }
@keyframes pcBase { to { transform: scaleX(1); } }
.pre-word { display: flex; gap: .02em; }
.pre-word b { display: inline-block; font-weight: 900; opacity: 0; transform: translateY(16px); animation: preLetter .6s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(1s + var(--i) * 90ms); }
@keyframes preLetter { to { opacity: 1; transform: none; } }

/* ==========================================================================
   CHAPTER 01 · the hero story
   ========================================================================== */
.story { --p: 0; position: relative; height: 680vh; background: radial-gradient(ellipse 90% 70% at 60% 30%, #1b2234, #0a0b0d 70%); }
.story-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
.story-fallback { position: absolute; inset: 0; z-index: -3; transition: opacity 1.4s; }
.story-fallback img { width: 100%; height: 100%; object-fit: cover; opacity: .55; transform: scale(1.06); }
.house-ready .story-fallback { opacity: 0; }
#house-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; opacity: 0; transition: opacity 1.4s; }
.house-ready #house-canvas { opacity: 1; }
.story-scrim { position: absolute; inset: 0; z-index: -1; pointer-events: none; background:
  linear-gradient(90deg, rgba(10, 11, 13, .88) 0%, rgba(10, 11, 13, .55) 32%, rgba(10, 11, 13, 0) 62%),
  linear-gradient(180deg, rgba(10, 11, 13, .5) 0%, transparent 20%, transparent 75%, rgba(10, 11, 13, .9) 100%); }
.letterbox span { position: absolute; left: 0; right: 0; height: calc(clamp(0, (var(--p) - .1) * 12, 1) * (1 - clamp(0, (var(--p) - .94) * 20, 1)) * 8vh); background: #000; z-index: 3; pointer-events: none; }
.letterbox span:first-child { top: 0; } .letterbox span:last-child { bottom: 0; }

.chapter { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .7s var(--ease), visibility 0s linear .7s; }
.chapter.on { opacity: 1; visibility: visible; transition: opacity .7s var(--ease), visibility 0s; }
.chapter.on a, .chapter.on button { pointer-events: auto; }
.chapter-hero .container { padding-top: var(--header-h); }
.chapter-hero .container > * { max-width: 660px; }
.chapter-side .container > *, .chapter-end .container > * { transform: translateY(26px); transition: transform .9s var(--ease); }
.chapter-side.on .container > *, .chapter-end.on .container > * { transform: none; }
.chapter-side .container > *:nth-child(2) { transition-delay: .06s; } .chapter-side .container > *:nth-child(3) { transition-delay: .12s; }
.chapter-side { align-items: flex-end; padding-bottom: 16vh; }
.ch-num { font: 700 12px var(--font-head); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
.ch-num::before { content: ""; width: 34px; height: 1px; background: var(--gold); }
.chapter h2 { font-size: clamp(42px, 6.6vw, 98px); font-weight: 900; letter-spacing: -.045em; line-height: .95; margin-bottom: 16px; }
.chapter-side p:not(.ch-num) { font-size: clamp(16px, 1.4vw, 20px); color: rgba(233, 229, 220, .8); max-width: 440px; }
.chapter-end { justify-content: center; text-align: center; }
.chapter-end .ch-num { justify-content: center; }
.chapter-end .ch-num::before { display: none; }
.chapter-end h2 { margin-bottom: 30px; }
.story-rail { position: absolute; right: 28px; top: 50%; height: 34vh; width: 2px; transform: translateY(-50%); background: rgba(255, 255, 255, .12); z-index: 3; }
.rail-fill { position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--p) * 100%); background: var(--gold); }
.story-rail i { position: absolute; left: 50%; top: calc(var(--at) * 100%); width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #0a0b0d; border: 1.5px solid rgba(255, 255, 255, .35); }
.story-hint { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 12px; font: 600 12px var(--font-head); letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .7); opacity: calc(1 - clamp(0, var(--p) * 30, 1)); white-space: nowrap; }
.scroll-cue-inline { position: relative; width: 20px; height: 32px; border: 1.5px solid rgba(255, 255, 255, .5); border-radius: 12px; }
.scroll-cue-inline span { position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); animation: cue 1.8s var(--ease) infinite; }
@media (max-width: 860px) {
  .story-scrim { background: linear-gradient(180deg, rgba(10, 11, 13, .6) 0%, rgba(10, 11, 13, .1) 30%, rgba(10, 11, 13, .55) 55%, rgba(10, 11, 13, .95) 85%); }
  .chapter-hero { align-items: flex-end; padding-bottom: 90px; }
  .chapter-side { padding-bottom: 12vh; }
  .story-rail { right: 12px; height: 26vh; }
  .story-hint { bottom: 18px; font-size: 10px; }
}

/* ---------- chapter cuts with a gold curtain ---------- */
.chapter-cut { position: relative; overflow: hidden; padding: 70px 0 64px; background: var(--bg); border-top: 1px solid var(--line-d); }
.chapter-cut .container { display: flex; align-items: baseline; gap: 26px; }
.cut-num { font: 900 clamp(70px, 11vw, 170px) / .8 var(--font-head); letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1.2px rgba(213, 166, 74, .7); }
.cut-title { font: 800 clamp(22px, 3vw, 40px) var(--font-head); letter-spacing: -.02em; color: #f6f2e9; }
.chapter-cut .container > * { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease) .45s, transform .9s var(--ease) .45s; }
.chapter-cut.in .container > * { opacity: 1; transform: none; }
.chapter-cut.in .cut-title { transition-delay: .6s; }
.cut-curtain { position: absolute; inset: 0; z-index: 2; background: linear-gradient(90deg, #b8862f, var(--gold), #e8c47a); transform: scaleX(0); transform-origin: 0 50%; }
.chapter-cut.in .cut-curtain { animation: curtain 1.1s cubic-bezier(.77, 0, .18, 1) forwards; }
@keyframes curtain { 0% { transform: scaleX(0); transform-origin: 0 50%; } 49% { transform: scaleX(1); transform-origin: 0 50%; } 51% { transform: scaleX(1); transform-origin: 100% 50%; } 100% { transform: scaleX(0); transform-origin: 100% 50%; } }

/* typewriter */
[data-type].typing::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 4px; background: var(--gold); vertical-align: -2px; animation: caret .7s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- services: list + live 3D ---------- */
.svc-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(30px, 5vw, 70px); align-items: start; }
.svc-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line-d); }
.svc-row { position: relative; display: grid; grid-template-columns: 56px 1fr 34px; gap: 14px; padding: 24px 6px; border-top: 1px solid var(--line-d); cursor: pointer; outline: none; transition: background-color .4s; }
.svc-row::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%; background: var(--gold); transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--ease); }
.svc-row.active::before, .svc-row:focus-visible::before { transform: scaleX(1); }
.svc-n { font: 800 13px var(--font-head); letter-spacing: .15em; color: var(--muted-d); padding-top: 8px; transition: color .3s; }
.svc-row h3 { font-size: clamp(21px, 2.1vw, 28px); margin: 0; transition: color .35s, transform .5s var(--ease); }
.svc-row p { margin: 0; max-height: 0; opacity: 0; overflow: hidden; color: var(--muted-d); font-size: 15.5px; transition: max-height .6s var(--ease), opacity .4s, margin .4s; }
.svc-row .link-more { max-height: 0; opacity: 0; overflow: hidden; display: inline-flex; transition: max-height .6s var(--ease), opacity .4s .1s; color: var(--gold-2); }
.svc-row.active p { max-height: 120px; opacity: 1; margin: 10px 0 12px; }
.svc-row.active .link-more { max-height: 40px; opacity: 1; }
.svc-row.active h3 { color: var(--gold); transform: translateX(6px); }
.svc-row.active .svc-n { color: var(--gold); }
.svc-ico { width: 24px; height: 24px; color: var(--muted-d); margin-top: 6px; transition: color .3s, transform .5s var(--ease); }
.svc-row.active .svc-ico { color: var(--gold); transform: rotate(-12deg) scale(1.1); }
.svc-viewer { position: sticky; top: calc(var(--header-h) + 24px); }
.svc-stage { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-lg); overflow: hidden; background: radial-gradient(circle at 50% 60%, #1f2430, #0c0e12 70%); border: 1px solid var(--line-d); }
.svc-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 80px rgba(0, 0, 0, .6); }
#services-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.svc-caption { display: flex; align-items: center; gap: 10px; margin: 14px 4px 0; font: 600 12px var(--font-head); letter-spacing: .18em; text-transform: uppercase; color: var(--muted-d); }
.svc-caption .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: pulse 2s infinite; }
.svc-float { position: fixed; left: 0; top: 0; z-index: 60; width: 260px; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.8); transition: opacity .3s, transform .4s var(--ease); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8); }
.svc-float.show { opacity: 1; }
.svc-float img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 960px) {
  .svc-layout { grid-template-columns: 1fr; }
  .svc-viewer { position: relative; top: 0; order: -1; max-width: 520px; width: 100%; margin: 0 auto; }
  .svc-float { display: none; }
}

/* ---------- before / after ---------- */
.ba { background: radial-gradient(ellipse 60% 60% at 50% 100%, rgba(213, 166, 74, .08), transparent 60%), var(--bg); }
.ba-head { margin-inline: auto; text-align: center; }
.ba-head .eyebrow { justify-content: center; }
.ba-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-d); box-shadow: 0 50px 100px -50px rgba(0, 0, 0, .9); user-select: none; background: var(--surface); }
.ba-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--gold); z-index: 2; pointer-events: none; }
.ba-handle::before { content: ""; position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: rgba(10, 11, 13, .7); border: 2px solid var(--gold); backdrop-filter: blur(6px); }
.ba-handle .ico { position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--gold); z-index: 1; }
.ba-handle .ico:first-child { right: 6px; } .ba-handle .ico:last-child { left: 6px; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; z-index: 3; margin: 0; }
.ba-tag { position: absolute; top: 18px; z-index: 2; padding: 7px 14px; border-radius: 999px; font: 700 12px var(--font-head); letter-spacing: .18em; text-transform: uppercase; background: rgba(10, 11, 13, .65); backdrop-filter: blur(6px); color: #fff; }
.ba-tag-l { left: 18px; } .ba-tag-r { right: 18px; color: var(--gold-2); }
.ba-note { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--muted-d); }
@media (max-width: 640px) { .ba-frame { aspect-ratio: 4 / 3; } }

/* ---------- craft: the printed building ---------- */
.craft { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; isolation: isolate; background: var(--bg-2) var(--pat-grid); }
.craft #scene { z-index: -3; }
.craft-scrim { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(10, 11, 13, .9) 0%, rgba(10, 11, 13, .55) 30%, transparent 58%), linear-gradient(180deg, rgba(10, 11, 13, .6), transparent 25%, transparent 80%, rgba(10, 11, 13, .8)); }
.craft-copy { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
.craft-copy > * { max-width: 520px; }
.craft-copy p:not(.eyebrow) { color: rgba(233, 229, 220, .8); font-size: 18px; }
.craft-hint { bottom: 40px; }
@media (max-width: 860px) { .craft-scrim { background: linear-gradient(180deg, rgba(10, 11, 13, .85) 0%, rgba(10, 11, 13, .2) 45%, rgba(10, 11, 13, .6) 100%); } .craft-copy { justify-content: flex-start; padding-top: calc(var(--header-h) + 30px); } }

/* ---------- dark components ---------- */
.anatomy { background: radial-gradient(ellipse 70% 60% at 70% 45%, #1a2131, var(--bg) 70%); }
.anatomy-progress span { background: var(--gold); }
.why-item { background: rgba(255, 255, 255, .025); border-color: var(--line-d); }
.process .step-n { background: var(--surface); box-shadow: 0 0 0 8px var(--bg), 0 0 0 9px rgba(213, 166, 74, .35); }
.step p { color: var(--muted-d); }
.projects-scroll { background: var(--bg-2); }
.score-card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border-top-color: var(--gold); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9); border: 1px solid var(--line-d); border-top: 3px solid var(--gold); }
.score { color: #f6f2e9; }
.score small, .score-meta { color: var(--muted-d); }
.bar { background: rgba(255, 255, 255, .07); }
.review { background: var(--surface); border-color: var(--line-d); }
.review p { color: var(--text-d); }
.review cite { color: #f6f2e9; }
.review small { color: var(--muted-d); }
.review-feature { background: linear-gradient(135deg, rgba(213, 166, 74, .16), rgba(213, 166, 74, .04)), var(--surface); border-color: rgba(213, 166, 74, .35); }
.avatar { background: linear-gradient(145deg, #2a2f3a, #14171d); }
.cta-bg::after { background: linear-gradient(90deg, rgba(10, 11, 13, .95) 0%, rgba(10, 11, 13, .75) 45%, rgba(10, 11, 13, .3)); }
.cta-band::after { opacity: .8; }
/* contact */
.info-ico { background: var(--surface); color: var(--gold); border: 1px solid var(--line-d); }
.info-list strong, .info-list a { color: #f6f2e9; }
.info-list a:hover { color: var(--gold-2); }
[data-site].is-placeholder { color: var(--gold-2) !important; }
.perks li { background: rgba(213, 166, 74, .1); color: var(--gold-2); }
.map { background: var(--surface); border-color: var(--line-d); }
.map-ph { background: linear-gradient(135deg, var(--surface), var(--bg-2)); color: var(--muted-d); }
.map iframe { filter: grayscale(.6) invert(.9) hue-rotate(180deg) brightness(.9) contrast(.9); }
.form-card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border-color: var(--line-d); box-shadow: 0 50px 100px -50px rgba(0, 0, 0, .9); }
.form-card h3 { color: #f6f2e9; }
.form-note { color: var(--muted-d); }
.field label { color: var(--text-d); }
.field input, .field select, .field textarea { background: #0c0e12; color: var(--text-d); border-color: var(--line-d); }
.field input::placeholder, .field textarea::placeholder { color: #5f5c56; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(255, 255, 255, .18); }
.field input:focus, .field select:focus, .field textarea:focus { background: #0f1116; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(213, 166, 74, .14); }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23D5A64A' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.field select option { background: #14171d; color: #e9e5dc; }
.field.invalid input, .field.invalid select, .field.invalid textarea { background: #1c1012; border-color: #d9534f; }
.error { color: #ff8a80; }
.form-status.ok { background: rgba(46, 139, 87, .15); color: #8fe0b0; }
.form-status.warn { background: rgba(213, 166, 74, .12); color: var(--gold-2); }
.form-status.err { background: rgba(217, 83, 79, .15); color: #ff9e98; }
.site-footer { background: #060708; border-top: 1px solid var(--line-d); }
.mobile-bar { background: rgba(10, 11, 13, .9); border: 1px solid var(--line-d); }
.cursor-ring { border-color: rgba(213, 166, 74, .8); }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .story { height: auto; } .story-stage { position: relative; }
  .chapter:not(.chapter-hero) { display: none; }
  .chapter-cut .container > * { opacity: 1; transform: none; } .cut-curtain { display: none; }
  .svc-row p, .svc-row .link-more { max-height: none; opacity: 1; }
}
