/* ═══════════════════════════════════════════════════════════
   LUCATERO SOLUTIONS — bright daytime, real-estate-grade
   Warm neutrals + one confident gold accent.
   Palette (provisional until brand files are supplied):
   cream #F6F1E7 · paper #FBF8F1 · greige #E8E0D0
   charcoal ink #2B2723 · gold #D9A63A · deep gold #8A6415
   ═══════════════════════════════════════════════════════════ */

:root {
  --cream: #f6f1e7;
  --paper: #fbf8f1;
  --greige: #e8e0d0;
  --ink: #2b2723;
  --ink-soft: #554b3f;
  --gold: #d9a63a;
  --gold-deep: #8a6415;
  --gold-soft: #e6c477;
  --white: #ffffff;
  --panel: rgba(251, 248, 241, 0.94);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --shadow-soft: 0 10px 40px -16px rgba(63, 51, 30, 0.28);
  --shadow-lift: 0 22px 50px -20px rgba(63, 51, 30, 0.38);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }
html.reduced-motion { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2 { font-family: var(--serif); font-weight: 560; line-height: 1.08; letter-spacing: -0.015em; color: var(--ink); }
h1 em, h2 em, .finale-title em { font-style: italic; font-weight: 420; color: var(--gold-deep); }

a { color: inherit; }

/* ─── Skip link ─── */
.skip-link {
  position: fixed; top: -4rem; left: 1rem; z-index: 200;
  background: var(--gold-deep); color: var(--white);
  padding: 0.7rem 1.2rem; border-radius: 6px;
  font-weight: 600; text-decoration: none; transition: top 0.2s;
}
.skip-link:focus-visible { top: 1rem; }

:where(a, button, select, input, textarea, summary):focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─── Intro (construction-line brand threshold, daylight) ─── */
#intro {
  position: fixed; inset: 0; z-index: 150;
  display: grid; place-content: center; gap: 1.4rem;
  background: var(--cream);
  transition: opacity 0.9s ease, visibility 0.9s;
}
#intro.done { opacity: 0; visibility: hidden; }
.intro-mark { width: 108px; height: 108px; margin-inline: auto; }
.intro-line, .intro-l {
  stroke: var(--gold-deep); stroke-width: 2.5; fill: none;
  stroke-dasharray: 420; stroke-dashoffset: 420;
}
.intro-word {
  font-family: var(--serif); font-size: 1.05rem; letter-spacing: 0.34em;
  text-transform: uppercase; color: var(--ink); opacity: 0;
  text-align: center;
}
.js #intro .intro-line { animation: draw 1.6s ease forwards 0.2s; }
.js #intro .intro-l    { animation: draw 1.2s ease forwards 1.0s; }
.js #intro .intro-word { animation: fadeup 0.8s ease forwards 1.6s; }
@keyframes draw   { to { stroke-dashoffset: 0; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
html:not(.js) #intro { display: none; }
@media (prefers-reduced-motion: reduce) { #intro { display: none; } }

/* ─── Stage ─── */
#scene {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100vh; height: 100dvh;
  display: block;
}
#vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 66%, rgba(63, 51, 30, 0.16) 100%);
}
body.static #scene, body.static #vignette { display: none; }

/* ─── Header (sticky, condenses on scroll) ─── */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 2.4rem);
  transition: padding 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
#site-header.condensed {
  padding-top: 0.55rem; padding-bottom: 0.55rem;
  background: var(--panel);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px -12px rgba(63, 51, 30, 0.35);
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand-mark {
  display: grid; place-content: center;
  width: 2.1rem; height: 2.1rem; border-radius: 8px;
  background: var(--gold); color: var(--ink);
  font-family: var(--serif); font-weight: 560; font-size: 1.25rem;
}
.brand-name { font-family: var(--serif); font-size: 1.12rem; letter-spacing: 0.02em; color: var(--ink); }
.brand-name em { font-style: italic; color: var(--gold-deep); }

.site-nav { display: flex; gap: clamp(0.8rem, 2vw, 1.6rem); }
.site-nav a {
  text-decoration: none; font-weight: 600; font-size: 0.92rem;
  color: var(--ink-soft); padding: 0.4rem 0.2rem;
  border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover { color: var(--gold-deep); border-color: var(--gold); }
@media (max-width: 1080px) { .site-nav { display: none; } }

.header-actions { display: flex; align-items: center; gap: 0.9rem; }
.header-phone {
  display: inline-flex; align-items: center; gap: 0.45rem;
  text-decoration: none; font-weight: 600; font-size: 0.95rem;
  color: var(--ink);
}
.header-phone:hover { color: var(--gold-deep); }

/* language toggle — EN | ES segmented control */
.lang-toggle {
  display: inline-flex; border: 1.5px solid rgba(43, 39, 35, 0.35);
  border-radius: 999px; overflow: hidden; background: var(--paper);
}
.lang-toggle button {
  border: none; background: transparent; cursor: pointer;
  font: 600 0.8rem var(--sans); letter-spacing: 0.06em;
  color: var(--ink-soft); padding: 0.42rem 0.75rem; min-height: 32px;
  transition: background 0.2s, color 0.2s;
}
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.lang-toggle button:not([aria-pressed="true"]):hover { color: var(--gold-deep); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.65rem 1.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  border-radius: 8px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn:active { transform: scale(0.97); }
a, button, summary { -webkit-tap-highlight-color: rgba(217, 166, 58, 0.25); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-soft); }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(43, 39, 35, 0.4); }
.btn-ghost:hover { border-color: var(--gold-deep); color: var(--gold-deep); }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ─── Waypoints ─── */
#waypoints {
  position: fixed; right: clamp(0.6rem, 2vw, 1.4rem); top: 50%; z-index: 90;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.35rem;
}
#waypoints a { position: relative; display: grid; place-content: center; width: 28px; height: 28px; text-decoration: none; }
#waypoints a span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(43, 39, 35, 0.3);
  transition: background 0.25s, transform 0.25s;
}
#waypoints a.active span { background: var(--gold-deep); transform: scale(1.5); }
#waypoints a:hover span { background: var(--gold-deep); }
#waypoints a::after {
  content: attr(data-label);
  position: absolute; right: 2.2rem; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: 0.75rem; letter-spacing: 0.08em; font-weight: 600;
  color: var(--ink); background: var(--paper);
  padding: 0.25rem 0.6rem; border-radius: 4px; box-shadow: var(--shadow-soft);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
#waypoints a:hover::after, #waypoints a:focus-visible::after { opacity: 1; }
@media (max-width: 760px) { #waypoints { display: none; } }

/* ─── Chapters ─── */
main { position: relative; z-index: 10; }

.chapter {
  position: relative;
  min-height: 175vh;
  display: flex; align-items: center;
  padding: 22vh clamp(1.2rem, 6vw, 5rem);
  pointer-events: none;
}
.chapter > * { pointer-events: auto; }

#hero { min-height: 150vh; align-items: flex-start; padding-top: 0; }

/* the finale is tall so the closing camera settle gets scroll room */
#contact { min-height: 230vh; display: block; padding-top: 0; padding-bottom: 0; }
#contact .finale-inner { position: sticky; top: 13vh; margin-inline: auto; }
body.static #contact, html:not(.js) #contact { min-height: 100vh; }

.kicker {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--gold-deep);
  margin-bottom: 0.9rem;
}

/* Hero — copy sits on a soft cream scrim so it never fights the scene */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; width: 100%; max-width: 62rem; margin-inline: auto;
  padding-top: 3rem;
}
.hero::before {
  content: ""; position: absolute; inset: 6vh 0 8vh;
  background: radial-gradient(ellipse 95% 52% at center,
    rgba(251, 248, 241, 0.88) 0%,
    rgba(251, 248, 241, 0.66) 42%,
    rgba(251, 248, 241, 0) 80%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero h1 { font-size: clamp(2.8rem, 9vw, 6.4rem); margin-bottom: 1.4rem; }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--ink-soft); max-width: 36rem; }
.hero .lede { margin-bottom: 2.4rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; margin-top: 0.5rem; }
.panel .cta-row { justify-content: flex-start; }

.scroll-cue {
  position: absolute; bottom: 3rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  font-size: 0.75rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink); font-weight: 700;
}
.scroll-cue > span:last-child {
  background: rgba(251, 248, 241, 0.85); border-radius: 999px; padding: 0.3rem 0.9rem;
}
.scroll-line { width: 1.5px; height: 3.2rem; background: linear-gradient(var(--gold-deep), transparent); display: block; }
.js .scroll-line { animation: cue 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0%, 100% { transform: scaleY(0.35); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .js .scroll-line { animation: none; } }

/* Panels — bright paper cards over the sunlit scene */
.panel {
  width: min(30rem, 100%);
  padding: clamp(1.8rem, 4vw, 2.8rem);
  border-radius: var(--radius);
  border: 1px solid rgba(138, 100, 21, 0.16);
  background: var(--panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
}
.panel h2 { font-size: clamp(1.8rem, 3.8vw, 2.6rem); margin-bottom: 1rem; }
.panel p { color: var(--ink-soft); }
.section-intro { max-width: 40rem; margin-bottom: 1.6rem; }
.panel-wide { width: min(50rem, 100%); margin-inline: auto; }
.panel-hint { margin-top: 1.3rem; font-size: 0.84rem; color: var(--ink-soft); font-style: italic; }

/* Placeholder chips — visible flags for content the owner still owes */
.chip {
  display: inline-block;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #7a4a08; background: #fdedc9; border: 1px solid #e9c983;
  border-radius: 999px; padding: 0.15rem 0.6rem; margin-bottom: 0.5rem;
}

/* Stat strip (social proof) with animated counters */
.stat-strip {
  list-style: none; margin-top: 1.6rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1px; background: rgba(138, 100, 21, 0.18);
  border: 1px solid rgba(138, 100, 21, 0.18); border-radius: 10px; overflow: hidden;
}
.stat { background: var(--paper); padding: 1.3rem 1.2rem; display: flex; flex-direction: column; gap: 0.15rem; }
.stat-num { font-family: var(--serif); font-size: 1.9rem; font-weight: 560; color: var(--gold-deep); line-height: 1.1; }
.stat-label { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.45; }
.stat.is-placeholder { background: #fbf4e2; }

/* Stories carousel (scroll-snap, swipeable + buttons) */
.carousel { position: relative; display: flex; align-items: stretch; gap: 0.6rem; }
.car-track {
  list-style: none; display: flex; gap: 1rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0.4rem 0.2rem 1rem; margin: 0; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--gold) transparent;
}
.story-card {
  flex: 0 0 min(21rem, 82%); scroll-snap-align: start;
  background: var(--paper); border: 1px solid rgba(138, 100, 21, 0.16);
  border-radius: var(--radius); padding: 1.4rem;
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 0.9rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.story-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.story-card blockquote { font-family: var(--serif); font-size: 1.02rem; font-style: italic; color: var(--ink); line-height: 1.55; }
.story-card footer { display: flex; align-items: center; gap: 0.7rem; margin-top: auto; }
.avatar {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; flex: none;
  display: grid; place-content: center;
  background: var(--greige); color: var(--ink-soft);
  font-family: var(--serif); font-size: 1.2rem;
}
.story-meta { display: flex; flex-direction: column; font-size: 0.86rem; line-height: 1.4; }
.story-meta strong { color: var(--ink); }
.story-meta span { color: var(--ink-soft); }
.story-result { font-size: 0.84rem; color: var(--gold-deep); font-weight: 600; border-top: 1px dashed rgba(138, 100, 21, 0.3); padding-top: 0.7rem; }
.car-btn {
  align-self: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid rgba(43, 39, 35, 0.3); background: var(--paper);
  color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.car-btn:hover { background: var(--gold); border-color: var(--gold); }
@media (max-width: 640px) { .car-btn { display: none; } } /* swipe on touch */

/* How it works — numbered steps */
.steps {
  list-style: none; counter-reset: step;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem; margin-top: 1.6rem;
}
.steps li {
  counter-increment: step;
  background: var(--paper); border: 1px solid rgba(138, 100, 21, 0.16);
  border-radius: var(--radius); padding: 1.3rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.steps li:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--serif); font-style: italic; font-size: 1.6rem;
  color: var(--gold); line-height: 1;
}
.steps strong { font-size: 1.02rem; color: var(--ink); }
.steps span { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.55; }

/* Work / portfolio grid with photo-placeholder frames */
.work-grid {
  list-style: none;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 1.1rem; margin-top: 1.4rem;
}
.work-card {
  background: var(--paper); border: 1px solid rgba(138, 100, 21, 0.16);
  border-radius: var(--radius); padding: 0.9rem 0.9rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.45rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.work-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.ph-frame {
  aspect-ratio: 4 / 3; border-radius: 8px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(138, 100, 21, 0.07) 14px 28px),
    var(--greige);
  border: 1.5px dashed rgba(138, 100, 21, 0.35);
  margin-bottom: 0.4rem;
}
.work-card strong { font-size: 1rem; color: var(--ink); }
.work-card > span:not(.chip) { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5; }

/* Service catalog */
.catalog {
  list-style: none; margin: 1.4rem 0 0.4rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1px; background: rgba(138, 100, 21, 0.18);
  border: 1px solid rgba(138, 100, 21, 0.18); border-radius: 10px; overflow: hidden;
}
.catalog li {
  background: var(--paper);
  padding: 0.85rem 1rem; font-size: 0.92rem; letter-spacing: 0.02em; color: var(--ink);
  counter-increment: cat;
  display: flex; gap: 0.7rem; align-items: baseline;
}
.catalog li::before {
  content: counter(cat, decimal-leading-zero);
  font-family: var(--serif); font-style: italic; color: var(--gold-deep); font-size: 0.85rem;
}

/* Expertise points */
.points {
  list-style: none; margin-top: 1.6rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}
.points li {
  background: var(--paper); border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.3rem;
  box-shadow: var(--shadow-soft);
}
.points strong { color: var(--ink); }
.points span { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.55; }

/* About / bio */
.bio { display: flex; gap: 1.4rem; align-items: flex-start; margin-top: 1.2rem; flex-wrap: wrap; }
.bio-photo {
  flex: none; width: 9rem; height: 9rem; border-radius: 12px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(138, 100, 21, 0.07) 14px 28px),
    var(--greige);
  border: 1.5px dashed rgba(138, 100, 21, 0.35);
  display: grid; place-content: center; text-align: center; padding: 0.5rem;
}
.bio > div { flex: 1; min-width: 15rem; }
.bio-name { margin-bottom: 0.6rem; }
.bio-name strong { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); display: block; margin-top: 0.3rem; }

.secondary-cta {
  margin-top: 1.8rem; padding: 1.3rem 1.4rem;
  background: #f2e9d4; border: 1px solid rgba(138, 100, 21, 0.25);
  border-radius: var(--radius);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem;
}
.secondary-cta strong { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); }
.secondary-cta > span { color: var(--ink-soft); font-size: 0.92rem; flex: 1 1 16rem; }
.secondary-cta .btn { flex: none; }

/* Finale */
.finale-inner {
  width: 100%; max-width: 46rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1.2rem;
  background: var(--panel); border: 1px solid rgba(138, 100, 21, 0.16);
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-lift);
}
.brand-mark-lg { width: 3.6rem; height: 3.6rem; font-size: 2.1rem; border-radius: 10px; display: grid; place-content: center; }
.finale-title { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.finale-meta { font-style: normal; font-size: 0.92rem; line-height: 1.9; color: var(--ink-soft); }
.finale-note { display: inline-block; margin-top: 0.5rem; font-size: 0.85rem; border-top: 1px solid rgba(138, 100, 21, 0.3); padding-top: 0.6rem; }

/* ─── Post-tour sections (FAQ + final close) ─── */
.post {
  position: relative; z-index: 10;
  background: var(--cream);
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.2rem, 6vw, 5rem);
}
.post-inner { max-width: 46rem; margin-inline: auto; }
.post h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 1.4rem; }

#faq { border-top: 1px solid rgba(138, 100, 21, 0.2); }
.faq-list { display: grid; gap: 0.8rem; }
.faq-list details {
  background: var(--paper); border: 1px solid rgba(138, 100, 21, 0.16);
  border-radius: 10px; padding: 0 1.2rem;
  box-shadow: var(--shadow-soft);
}
.faq-list summary {
  cursor: pointer; list-style: none;
  font-weight: 600; font-size: 1.02rem; color: var(--ink);
  padding: 1.05rem 2rem 1.05rem 0;
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%);
  font-family: var(--serif); font-size: 1.4rem; color: var(--gold-deep);
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-list details p { color: var(--ink-soft); padding-bottom: 1.15rem; font-size: 0.95rem; }

.final-close { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.final-meta { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.9; }

/* ─── Reveal animation (JS enhances; default = visible) ─── */
.js .panel, .js .finale-inner, .js .post-inner {
  opacity: 0; transform: translateY(34px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.js .panel.in-view, .js .finale-inner.in-view, .js .post-inner.in-view { opacity: 1; transform: none; }
/* staggered card entrances inside revealed panels */
.js .in-view :is(.story-card, .steps li, .work-card, .points li, .stat) { animation: cardin 0.7s ease backwards; }
.js .in-view :is(.story-card, .steps li, .work-card, .points li, .stat):nth-child(2) { animation-delay: 0.08s; }
.js .in-view :is(.story-card, .steps li, .work-card, .points li, .stat):nth-child(3) { animation-delay: 0.16s; }
.js .in-view :is(.story-card, .steps li, .work-card, .points li, .stat):nth-child(4) { animation-delay: 0.24s; }
.js .in-view :is(.story-card, .steps li, .work-card, .points li, .stat):nth-child(5) { animation-delay: 0.32s; }
.js .in-view :is(.story-card, .steps li, .work-card, .points li, .stat):nth-child(6) { animation-delay: 0.4s; }
@keyframes cardin { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .js .panel, .js .finale-inner, .js .post-inner { opacity: 1; transform: none; transition: none; }
  .js .in-view :is(.story-card, .steps li, .work-card, .points li, .stat) { animation: none; }
}
.js.reduced-motion .panel, .js.reduced-motion .finale-inner, .js.reduced-motion .post-inner { opacity: 1; transform: none; transition: none; }
.js.reduced-motion .in-view :is(.story-card, .steps li, .work-card, .points li, .stat) { animation: none; }

/* ─── Hotspots ─── */
#hotspot-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.hotspot { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }
.hotspot[hidden] { display: none; }
.hotspot-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  display: grid; place-content: center;
}
.hotspot-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(251, 248, 241, 0.9); border: 1.5px solid var(--gold-deep);
  color: var(--gold-deep); font-size: 15px; line-height: 1;
  display: grid; place-content: center;
  transition: transform 0.2s, background 0.2s;
}
.js:not(.reduced-motion) .hotspot-dot { animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(138, 100, 21, 0.4); } 55% { box-shadow: 0 0 0 9px rgba(138, 100, 21, 0); } }
.hotspot-btn:hover .hotspot-dot, .hotspot-btn[aria-expanded="true"] .hotspot-dot {
  background: var(--gold-deep); color: var(--cream); transform: scale(1.12); animation: none;
}
.hotspot-card {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  width: 15.5rem; padding: 0.9rem 1rem;
  background: var(--paper); border: 1px solid rgba(138, 100, 21, 0.3);
  border-radius: 8px; box-shadow: var(--shadow-lift);
  font-size: 0.84rem; line-height: 1.5; color: var(--ink-soft); text-align: left;
}
.hotspot-card h3 { font-family: var(--serif); font-size: 1rem; color: var(--gold-deep); margin-bottom: 0.3rem; }
.hotspot.flip .hotspot-card { bottom: auto; top: calc(100% + 10px); }
.hotspot.edge-l .hotspot-card { left: 0; transform: none; }
.hotspot.edge-r .hotspot-card { left: auto; right: 0; transform: none; }

/* ─── Estimate dialog ─── */
#estimate-dialog {
  border: 1px solid rgba(138, 100, 21, 0.3); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  width: min(26rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem); overflow-y: auto; /* on-screen keyboards */
  padding: 0; margin: auto;
  box-shadow: var(--shadow-lift);
}
#estimate-dialog::backdrop { background: rgba(43, 39, 35, 0.45); backdrop-filter: blur(3px); }
#estimate-form { padding: clamp(1.4rem, 4vw, 2rem); display: grid; gap: 1rem; position: relative; }
#estimate-form h2 { font-size: 1.6rem; }
.dialog-sub { font-size: 0.92rem; color: var(--ink-soft); margin-top: -0.5rem; }
.dialog-close {
  position: absolute; top: 0.8rem; right: 0.8rem;
  width: 40px; height: 40px; border-radius: 50%;
  background: transparent; border: 1px solid rgba(43, 39, 35, 0.3);
  color: var(--ink); font-size: 1.3rem; cursor: pointer;
}
.dialog-close:hover { border-color: var(--gold-deep); color: var(--gold-deep); }
.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink);
  background: var(--white);
  border: 1.5px solid rgba(43, 39, 35, 0.3);
  border-radius: 8px; padding: 0.65rem 0.8rem; min-height: 44px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold-deep); outline: none; }
.field.invalid input, .field.invalid textarea { border-color: #b3492c; }
.field-error { color: #a03c20; font-size: 0.8rem; }
.compose { display: grid; gap: 0.7rem; border-top: 1px solid rgba(138, 100, 21, 0.3); padding-top: 1rem; }
.compose-note { font-size: 0.78rem; color: var(--ink-soft); }
#compose-preview {
  white-space: pre-wrap; font: 0.8rem/1.5 var(--sans); color: var(--ink);
  background: var(--greige); border-radius: 8px; padding: 0.7rem;
}

/* ═══ Static fallback (no WebGL / reduced motion / JS off) ═══ */
html:not(.js) body, body.static { background: var(--cream); }
html:not(.js) .chapter, body.static .chapter { min-height: 100vh; pointer-events: auto; }
html:not(.js) .chapter, body.static .chapter,
html:not(.js) #hero, body.static #hero { padding-top: 8rem; padding-bottom: 4rem; }
html:not(.js) #hero, body.static #hero { min-height: 100vh; }

body.static .chapter::before, html:not(.js) .chapter::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
}
body.static .chapter:nth-child(odd)::before, html:not(.js) .chapter:nth-child(odd)::before {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 255, 255, 0.7), transparent 60%),
    linear-gradient(#f6f1e7, #ece3d0);
}
body.static .chapter:nth-child(even)::before, html:not(.js) .chapter:nth-child(even)::before {
  background:
    radial-gradient(ellipse at 50% 110%, rgba(217, 166, 58, 0.14), transparent 55%),
    linear-gradient(#f2ecdf, #e8e0d0);
}
body.static .chapter::after, html:not(.js) .chapter::after {
  content: attr(data-chapter);
  position: absolute; right: 4vw; bottom: 2vh; z-index: -1;
  font-family: var(--serif); font-style: italic; font-size: clamp(8rem, 24vw, 18rem);
  line-height: 1; opacity: 0.06; pointer-events: none;
}
body.static #hotspot-layer { display: none; }

/* ─── Mobile action bar — thumb-reachable Call + Estimate ─── */
#mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  display: none; gap: 0.6rem;
  padding: 0.6rem clamp(0.8rem, 3vw, 1rem) calc(0.6rem + env(safe-area-inset-bottom, 0px));
  background: rgba(251, 248, 241, 0.97);
  border-top: 1px solid rgba(138, 100, 21, 0.22);
  box-shadow: 0 -8px 24px -12px rgba(63, 51, 30, 0.35);
}
#mobile-bar .btn { flex: 1; }
#mobile-bar .btn-ghost { flex: 0.7; background: var(--paper); }

/* QA helper (?debug&hideui): view the 3D stage unobstructed */
body.qa-hideui #site-header, body.qa-hideui main, body.qa-hideui #waypoints,
body.qa-hideui #vignette, body.qa-hideui #hotspot-layer, body.qa-hideui .post,
body.qa-hideui #mobile-bar, body.qa-hideui .skip-link { visibility: hidden; }

/* ─── Responsive ─── */
@media (max-width: 760px) {
  .brand-name { display: none; }
  .header-phone span { display: none; }
  .header-phone { min-width: 44px; min-height: 44px; justify-content: center; }
  .header-actions { gap: 0.5rem; }
  .header-actions [data-estimate] { display: none; } /* the bottom bar owns the CTA */
  #mobile-bar { display: flex; }
  /* shorter chapters = a brisker tour under a thumb */
  .chapter { min-height: 135vh; padding-inline: 1rem; align-items: flex-end; padding-bottom: 14vh; }
  #hero { align-items: flex-start; min-height: 140vh; }
  #contact { min-height: 200vh; }
  .panel { width: 100%; }
  .hero h1 { font-size: clamp(2.6rem, 13vw, 4rem); }
  .hero .cta-row [data-estimate] { display: none; } /* bar covers it above the fold */
  .scroll-cue { bottom: 6.2rem; }
  .hotspot-card { width: min(15.5rem, calc(100vw - 2rem)); }
  .bio-photo { width: 100%; height: 10rem; }
  .post:last-child { padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); }
}

/* phones & tablets: backdrop blur is a GPU tax with a live canvas behind —
   swap frosted panels for near-opaque paper */
@media (max-width: 760px), (pointer: coarse) {
  .panel, .finale-inner, #site-header.condensed, #estimate-dialog::backdrop {
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .panel, .finale-inner { background: rgba(251, 248, 241, 0.97); }
}
