/* =========================================================================
   RE WEBFOLIO v2 — "artistic / 3D re-skin"  ·  design system + layout
   Step 1: static, no JS. See DESIGN-SYSTEM.md for the rationale.
   Fonts loaded via <link> for now — self-host in assets/fonts/ before deploy.
   ========================================================================= */

/* ---- tokens ------------------------------------------------------------- */
/* Light warm editorial — "fotografia de produto". See PROMPT.md (adapted
   "Playroom"). Var names kept from the dark draft; values inverted, so the
   ground tokens (--ink*) are now warm paper and the text tokens (--bone*) are
   charcoal. --amber* now carries dessaturated terracotta. */
:root{
  color-scheme: light;

  /* ground — warm white paper / aluminium */
  --ink:        #f4efe6;   /* page base */
  --ink-2:      #efe7da;   /* raised surfaces, screen wells */
  --ink-3:      #e5dbc9;   /* hover / inset */

  /* text — charcoal */
  --bone:       #2b2724;
  --bone-dim:   rgba(43,39,36,.68);
  --bone-faint: rgba(43,39,36,.44);

  /* accents — dessaturated */
  --amber:      #c8794f;   /* terracotta — action, single accent */
  --amber-deep: #a85f39;
  --azo:        #3f7fae;   /* azulejo blue — links, rim */
  --azo-deep:   #2f5f86;
  --sage:       #8a9a82;   /* soft green — third module accent */

  /* lines */
  --line:        rgba(43,39,36,.13);
  --line-strong: rgba(43,39,36,.26);
  --focus:       #a85f39;

  /* metrics */
  --maxw:   1200px;
  --gutter: clamp(20px, 4vw, 72px);
  --rhythm: clamp(84px, 12vh, 168px);
  --stack:  clamp(18px, 2.6vw, 32px);

  --ff-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --ff-ui:      "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ff-mono:    "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- reset ------------------------------------------------------------- */
*, *::before, *::after{ box-sizing: border-box; }
[hidden]{ display: none !important; }
/* no `scroll-behavior: smooth` — it fights Lenis + ScrollTrigger's scroll setter.
   reduced-motion block below forces `scroll-behavior: auto` explicitly. */
html{ -webkit-text-size-adjust: 100%; }
body{
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font: 400 16px/1.6 var(--ff-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;   /* `clip`, not `hidden` — `hidden` makes body a scroll container and breaks ScrollTrigger pinning */
}
img, svg, video{ max-width: 100%; display: block; }
a{ color: inherit; }
h1, h2, h3, p, ul, ol, figure{ margin: 0; }
ul, ol{ padding: 0; list-style: none; }
:focus-visible{ outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

/* ---- type helpers ---------------------------------------------------- */
.display{
  font-family: var(--ff-display);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: #231f1c;
}
.eyebrow{
  font: 500 11px/1 var(--ff-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before{
  content: "";
  width: 26px; height: 1px;
  background: currentColor;
  opacity: .7;
}
.lede{
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.62;
  color: var(--bone-dim);
  max-width: 54ch;
}
.muted{ color: var(--bone-faint); }

/* ---- layout -------------------------------------------------------- */
.wrap{
  width: min(var(--maxw), 100% - var(--gutter) * 2);
  margin-inline: auto;
}
.section{ padding-block: var(--rhythm); position: relative; }
.section + .section{ border-top: 1px solid var(--line); }
.stack{ display: flex; flex-direction: column; gap: var(--stack); align-items: flex-start; }
.stack > *{ max-width: min(680px, 100%); }

.two-col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.two-col--rev .col-visual{ order: -1; }

/* ---- buttons ------------------------------------------------------- */
.btn{
  --_bg: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--_bg);
  color: var(--bone);
  font: 700 13.5px/1 var(--ff-ui);
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn--primary{
  --_bg: var(--amber);
  color: #fbf7f0;
  box-shadow: 0 14px 34px rgba(200,121,79,.28);
}
.btn--primary:hover{ --_bg: var(--amber-deep); transform: translateY(-2px); box-shadow: 0 18px 42px rgba(200,121,79,.4); }
.btn--ghost{
  border-color: var(--line-strong);
  background: rgba(244,239,228,.05);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.btn--ghost:hover{ border-color: var(--azo); background: rgba(63,127,174,.14); transform: translateY(-2px); }
.btn-row{ display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* ---- header ------------------------------------------------------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand{
  font: 800 13px/1 var(--ff-ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand .mark{
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font: 800 10px/1 var(--ff-ui);
  color: var(--amber);
}
.site-nav{ display: flex; gap: clamp(16px, 2.4vw, 34px); align-items: center; }
.site-nav a{
  font: 600 12px/1 var(--ff-ui);
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--bone-dim);
  position: relative;
  padding-block: 6px;
}
.site-nav a::after{
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.site-nav a:hover{ color: var(--bone); }
.site-nav a:hover::after{ transform: scaleX(1); }
.lang{ font: 500 11px/1 var(--ff-mono); letter-spacing: 0.16em; color: var(--bone-faint); }

/* header sits over the full-bleed hero video until you scroll past it */
.site-header{ transition: background .3s ease, border-color .3s ease; }
.site-header--over{ background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-header--over .brand,
.site-header--over .site-nav a,
.site-header--over .lang{ color: #fdfaf3; }
.site-header--over .site-nav a{ color: rgba(253,250,243,.82); }
.site-header--over .site-nav a:hover{ color: #fff; }
.site-header--over .brand .mark{ border-color: rgba(253,250,243,.5); color: #f0b58d; }

/* ---- hero — full-bleed video, copy on a cinematic scrim ---------- */
.hero{
  position: relative;
  isolation: isolate;
  min-height: min(100svh, 920px);
  display: flex;
  align-items: flex-end;
  padding-block: clamp(120px, 20vh, 220px) clamp(64px, 12vh, 128px);
  overflow: hidden;
  color: #fbf7ef;
}
.hero .wrap{ position: relative; z-index: 2; }
.hero-copy{ max-width: min(640px, 100%); }
.hero-copy .display{ font-size: clamp(34px, 5.6vw, 68px); }
.hero--video .display{ color: #fdfaf3; text-shadow: 0 2px 30px rgba(20,15,10,.35); }
.hero--video .lede{ color: rgba(253,250,243,.86); }
.hero--video .eyebrow{ color: #f0b58d; }
.hero--video .btn--ghost{ border-color: rgba(253,250,243,.42); color: #fdfaf3; background: rgba(20,15,10,.14); }
.hero--video .btn--ghost:hover{ border-color: #fff; background: rgba(253,250,243,.16); }
.hero--video .hero-alt a{ color: rgba(253,250,243,.8); }
.hero--video .hero-alt a:hover{ color: #f0b58d; }
.hero--video .scroll-cue{ color: rgba(253,250,243,.6); }
.hero--video .scroll-cue span{ background: linear-gradient(rgba(253,250,243,.6), transparent); }

.hero-media{
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  transform: scale(1);
  transition: transform 1s cubic-bezier(.4,0,.2,1), filter 1s ease;
}
.hero-video{
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  display: block;
  filter: saturate(1.06) contrast(1.03) brightness(.98);
}
.hero-media-scrim{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(92deg, rgba(22,16,11,.9) 0%, rgba(22,16,11,.66) 34%, rgba(22,16,11,.28) 58%, rgba(22,16,11,0) 82%),
    linear-gradient(0deg, rgba(22,16,11,.78) 0%, rgba(22,16,11,.22) 36%, transparent 62%),
    linear-gradient(180deg, rgba(22,16,11,.42) 0%, transparent 22%),
    radial-gradient(130% 80% at 78% 8%, rgba(200,121,79,.14), transparent 55%);
  transition: background .9s ease;
}
.hero-cap{
  position: absolute;
  right: var(--gutter); bottom: clamp(20px, 4vh, 40px);
  z-index: 2;
  font: 500 10px/1 var(--ff-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(253,250,243,.72);
  text-shadow: 0 1px 8px rgba(20,15,10,.6);
}
.hero-media.is-pushing{ transform: scale(1.09); filter: contrast(1.05) saturate(1.04); }
.hero-media.is-pushing .hero-media-scrim{
  background: linear-gradient(0deg, rgba(18,13,9,.72), rgba(18,13,9,.5));
}


.scroll-cue{
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font: 500 9px/1 var(--ff-mono);
  letter-spacing: 0.24em;
  color: var(--bone-faint);
  z-index: 2;
}
.scroll-cue span{ width: 1px; height: 42px; background: linear-gradient(var(--bone-faint), transparent); position: relative; overflow: hidden; }
.scroll-cue span::after{ content: ""; position: absolute; left: 0; top: -50%; width: 100%; height: 50%; background: var(--amber); animation: cueDrop 1.8s ease-in-out infinite; }
@keyframes cueDrop{ 0%{ top: -50%; } 60%,100%{ top: 100%; } }

/* ---- "O Estúdio" ------------------------------------------------- */
.studio-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
  width: 100%;
  max-width: none;
}
.studio-item{ padding-top: 16px; border-top: 2px solid var(--line-strong); transition: border-color .2s ease; }
.studio-item:hover{ border-top-color: var(--amber); }
.studio-item .n{ font: 700 12px/1 var(--ff-mono); letter-spacing: 0.16em; color: var(--amber); }
.studio-item h3{ font: 800 15.5px/1.3 var(--ff-ui); margin: 12px 0 7px; }
.studio-item p{ font-size: 13.5px; line-height: 1.6; color: var(--bone-dim); }

.medallion-wrap{ position: relative; display: grid; place-items: center; min-height: 260px; }
.medallion-wrap::before{
  content: "";
  position: absolute;
  width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,121,79,.10), transparent 68%);
}
.medallion{ position: relative; width: 108%; max-width: 480px; color: var(--amber); opacity: .92; }
.medallion .ring{ fill: none; stroke: currentColor; stroke-width: 1.4; }
.medallion .petal{ fill: none; stroke: var(--azo); stroke-width: 1.4; opacity: .9; }
@keyframes medSpin{ to{ transform: rotate(360deg); } }
.medallion g{ transform-origin: 50% 50%; animation: medSpin 80s linear infinite; }

/* ---- Portfólio ----------------------------------------------------- */
.work-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.6vw, 32px);
  width: 100%;
  max-width: none;
}
.work-card{
  display: block;
  text-decoration: none;
  padding: 14px 14px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbf7ef, var(--ink));
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 24px rgba(43,39,36,.05);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), border-color .22s ease, box-shadow .22s ease;
}
.work-card:hover{ transform: translateY(-6px); border-color: var(--line-strong); box-shadow: 0 28px 56px rgba(43,39,36,.18); }
.work-card .thumb{
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
  border: 1px solid var(--line);
  background: linear-gradient(148deg, var(--art-a, #d8c4a8) 0%, var(--art-b, #b9a07f) 100%);
}
.work-card .thumb::before{           /* crisp geometric motif */
  content: "";
  position: absolute; inset: 0;
  background:
    /* bold circle, top-right */
    radial-gradient(circle at 78% 30%, var(--art-c, #fff) 0 20%, transparent 20.5%),
    /* hard diagonal band */
    linear-gradient(122deg, transparent 0 52%, rgba(255,255,255,.16) 52% 56%, transparent 56%),
    /* fine pinstripe texture */
    repeating-linear-gradient(122deg, rgba(23,19,15,.05) 0 1px, transparent 1px 9px);
}
.work-card .thumb::after{            /* base shadow line for depth */
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 34%;
  background: linear-gradient(180deg, transparent, rgba(23,19,15,.22));
}
.work-card[data-art="1"] .thumb{ --art-a:#3f7fae; --art-b:#2c5476; --art-c:rgba(255,255,255,.34); }
.work-card[data-art="2"] .thumb{ --art-a:#e7dcc6; --art-b:#c4ac89; --art-c:rgba(200,121,79,.55); }
.work-card[data-art="3"] .thumb{ --art-a:#c8794f; --art-b:#9a5330; --art-c:rgba(255,236,205,.5); }
.work-card[data-art="4"] .thumb{ --art-a:#8a9a82; --art-b:#63745b; --art-c:rgba(255,255,255,.32); }
.work-card[data-art="5"] .thumb{ --art-a:#cabda4; --art-b:#9c8a70; --art-c:rgba(63,127,174,.5); }
.work-card[data-art="6"] .thumb{ --art-a:#caa25f; --art-b:#8f6435; --art-c:rgba(63,127,174,.42); }
.work-card .thumb-n{
  position: absolute; left: 12px; bottom: 10px;
  font: 700 11px/1 var(--ff-mono); letter-spacing: .16em;
  color: #fbf7f0; opacity: .82;
  text-shadow: 0 1px 4px rgba(23,19,15,.4);
}
.work-card .k{ font: 700 10px/1 var(--ff-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); }
.work-card h3{
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font: 800 15.5px/1.3 var(--ff-ui); margin: 9px 0 6px; color: var(--bone);
}
.work-card .work-go{ font: 400 14px/1 var(--ff-ui); color: var(--bone-faint); transition: transform .2s ease, color .2s ease; }
.work-card:hover .work-go{ transform: translate(3px, -3px); color: var(--amber); }
.work-card p{ font-size: 12.5px; line-height: 1.55; color: var(--bone-dim); }

/* ---- demo viva --------------------------------------------------- */
.demo-frame{
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 20px;
  background:
    radial-gradient(90% 60% at 80% 0%, rgba(63,127,174,.14), transparent 60%),
    var(--ink-2);
  display: grid;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(23,19,15,.14);
}
.dmock{ border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--ink); display: flex; flex-direction: column; gap: 9px; }
.dmock-tag{ font: 700 9px/1 var(--ff-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--bone-faint); }
.dmock-line{ height: 9px; border-radius: 5px; background: var(--line-strong); width: 100%; }
.dmock-line.short{ width: 58%; }
.dmock-note{ font: 500 10.5px/1 var(--ff-mono); letter-spacing: .08em; color: var(--bone-faint); text-decoration: line-through; }
.dmock--before{ opacity: .68; }
.dmock-swap{
  display: flex; align-items: center; gap: 10px;
  font: 700 10px/1 var(--ff-mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--amber);
  padding-left: 2px;
}
.dmock-swap span{ flex: 1; height: 1px; background: linear-gradient(90deg, var(--amber), transparent); }
.dmock--after{ border-color: rgba(200,121,79,.4); box-shadow: 0 10px 30px rgba(200,121,79,.12); }
.dmock-hero{ height: 46px; border-radius: 8px; background: linear-gradient(120deg, #efe7d9, #ddceb6); }
.dmock-accent{ height: 8px; width: 40%; border-radius: 5px; background: var(--amber); }
.dmock-cards{ display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.dmock-cards i{ height: 30px; border-radius: 6px; background: var(--ink-3); border: 1px solid var(--line); }

/* ---- Imobiliário ---------------------------------------------------- */
.re .display{ font-size: clamp(28px, 4.2vw, 46px); }
.re-points{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 3vw, 32px);
  width: 100%;
  max-width: 780px;
}
.re-points li{ padding-top: 16px; border-top: 1px solid rgba(200,121,79,.4); }
.re-points .n{ font: 700 10px/1 var(--ff-mono); letter-spacing: 0.16em; color: var(--amber); }
.re-points b{ display: block; font: 800 13px/1.3 var(--ff-ui); margin: 8px 0 5px; }
.re-points span{ display: block; font-size: 12.5px; line-height: 1.55; color: var(--bone-dim); }
.re-micro{ font: 500 11px/1.5 var(--ff-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--bone-faint); }

/* ---- fecho / contacto -------------------------------------------- */
.close-cta{ align-items: center; text-align: center; }
.close-cta > *{ margin-inline: auto; }
.close-cta .display{ font-size: clamp(30px, 4.6vw, 54px); }
.contact-lines{ display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; font: 500 12px/1 var(--ff-mono); letter-spacing: 0.08em; color: var(--bone-dim); }
.contact-lines a{ text-decoration: none; }
.contact-lines a:hover{ color: var(--amber); }

/* ---- footer ----------------------------------------------------- */
.site-footer{ border-top: 1px solid var(--line); padding-block: clamp(48px, 8vh, 90px); }
.site-footer .wrap{ display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-end; }
.site-footer .fnote{ font: 500 11px/1.6 var(--ff-mono); letter-spacing: 0.1em; color: var(--bone-faint); text-transform: uppercase; }
.site-footer nav{ display: flex; flex-wrap: wrap; gap: 16px 24px; }
.site-footer nav a{ font: 600 12px/1 var(--ff-ui); color: var(--bone-dim); text-decoration: none; }
.site-footer nav a:hover{ color: var(--bone); }

/* ---- reveal (JS adds .in later; CSS keeps content visible if JS never runs) */
.reveal{ opacity: 1; }

/* ---- responsive ----------------------------------------------------- */
@media (max-width: 900px){
  .two-col{ grid-template-columns: 1fr; gap: clamp(28px, 8vw, 48px); }
  .two-col--rev .col-visual{ order: 0; }
  .studio-grid, .work-grid, .re-points{ grid-template-columns: 1fr; }
  .re-points li:last-child{ border-bottom: 1px solid rgba(200,121,79,.4); }
  .site-nav{ display: none; }
  .hero-copy .btn-row .btn{ flex: 1; justify-content: center; }
}
@media (max-width: 520px){
  .work-grid{ gap: 14px; }
  .btn{ padding: 15px 26px; }
}

.hero-alt{ margin: 4px 0 0; font: 500 12px/1.5 var(--ff-mono); letter-spacing: .04em; }
.hero-alt a{ color: var(--ink-dim, var(--bone-dim)); text-decoration: underline; text-underline-offset: 3px; }
.hero-alt a:hover{ color: var(--amber); }

/* ---- POWER ON transition: letterbox + dim ---------------------- */
.letterbox{
  position: fixed;
  left: 0; right: 0;
  height: 0;
  background: #17130f;
  z-index: 60;
  pointer-events: none;
  transition: height .5s ease;
}
.letterbox--top{ top: 0; }
.letterbox--bottom{ bottom: 0; }
body.is-powering .letterbox,
body.is-powered .letterbox{ height: 8vh; }
body.is-powering{ overflow: hidden; }

/* ---- collection reveal (dark -> light) ------------------------- */
.collection{
  background:
    linear-gradient(180deg, #17130f 0%, var(--ink) 46%);
  animation: collReveal .9s ease both;
}
@keyframes collReveal{ from{ opacity: 0; } to{ opacity: 1; } }

.module-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
  width: 100%;
  max-width: none;
}
.module-card{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 22px 20px 24px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent, var(--amber));
  border-radius: 12px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  transition: transform .2s ease, box-shadow .2s ease;
}
.module-card:hover{ transform: translateY(-4px); box-shadow: 0 22px 48px rgba(43,39,36,.14); }
.module-card[data-accent="azo"]{ --accent: var(--azo); }
.module-card[data-accent="terra"]{ --accent: var(--amber); }
.module-card[data-accent="sage"]{ --accent: var(--sage); }
.module-card .module-k{ font: 700 10px/1 var(--ff-mono); letter-spacing: .18em; color: var(--accent); }
.module-card h3{ font: 800 17px/1.2 var(--ff-ui); }
.module-card p{ font-size: 13px; line-height: 1.55; color: var(--bone-dim); }
.module-card .btn{ margin-top: 6px; padding: 12px 22px; }

/* ---- demo overlay ------------------------------------------------ */
.demo-overlay{
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vw, 48px);
  background: rgba(23,19,15,.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.demo-overlay-panel{
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 40px 90px rgba(23,19,15,.35);
}
.demo-overlay-head{
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.demo-overlay-head h3{ font: 800 15px/1 var(--ff-ui); letter-spacing: .01em; }
.demo-overlay-close{
  border: 1px solid var(--line-strong);
  background: var(--ink-2);
  color: var(--bone);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.demo-overlay-close:hover{ border-color: var(--amber); color: var(--amber); }
.demo-overlay-body{ padding: 20px; }
body.demo-open{ overflow: hidden; }

/* ---- demo internals ------------------------------------------- */
.demo-help{ margin: 0 0 16px; font-size: 12.5px; line-height: 1.55; color: var(--bone-dim); }
.demo-body{ display: flex; flex-direction: column; gap: 16px; }
.demo-body--split{ display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.demo-grid-2{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.demo-controls{ display: flex; flex-direction: column; gap: 12px; }
.demo-controls label{ display: flex; flex-direction: column; gap: 5px; font: 600 11px/1 var(--ff-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--bone-dim); }
.demo-controls input, .demo-controls select{
  font: 500 14px/1.4 var(--ff-ui);
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--ink-2);
  color: var(--bone);
}
.demo-controls input:focus, .demo-controls select:focus{ outline: 2px solid var(--focus); outline-offset: 1px; }
.demo-row{ flex-direction: row !important; align-items: center; gap: 10px !important; }
.demo-actions{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.btn--sm{ padding: 8px 14px; font-size: 12px; }
.demo-stat, .demo-muted{ font: 500 12px/1.5 var(--ff-mono); color: var(--bone-faint); margin: 6px 0 0; }
.demo-preview{
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.demo-preview-bar{ height: 8px; width: 60px; border-radius: 4px; background: var(--accent-c, var(--azo)); }
.demo-preview[data-accent="azo"]{ --accent-c: var(--azo); }
.demo-preview[data-accent="terra"]{ --accent-c: var(--amber); }
.demo-preview[data-accent="sage"]{ --accent-c: var(--sage); }
.demo-preview h4{ font: 700 20px/1.15 var(--ff-display); color: #231f1c; }
.demo-preview p{ font-size: 13px; line-height: 1.5; color: var(--bone-dim); }
.demo-preview-cta{ align-self: flex-start; font: 700 11px/1 var(--ff-ui); letter-spacing: .04em; padding: 9px 16px; border-radius: 999px; background: var(--accent-c, var(--azo)); color: #fbf7f0; }
.demo-card{ border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
.demo-k{ font: 600 10px/1 var(--ff-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-faint); }
.demo-big{ font: 700 30px/1 var(--ff-display); color: #231f1c; }
.demo-pill{ align-self: flex-start; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--ink); color: var(--bone-dim); font: 700 12px/1 var(--ff-ui); cursor: pointer; }
.demo-pill.is-on{ background: rgba(138,154,130,.2); border-color: var(--sage); color: var(--bone); }
.demo-queue{ display: flex; flex-direction: column; gap: 8px; }
.demo-req{ display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--bone); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.demo-flow{ display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.demo-node{ flex: 1; min-width: 84px; text-align: center; padding: 12px 8px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--ink-2); font: 600 11px/1.2 var(--ff-mono); letter-spacing: .04em; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.demo-node.is-live{ background: rgba(200,121,79,.16); border-color: var(--amber); transform: translateY(-2px); }
.demo-node.is-done{ border-color: var(--sage); }
.demo-wire{ flex: 0 0 16px; height: 2px; background: var(--line-strong); }
.demo-log{ list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font: 500 11.5px/1.5 var(--ff-mono); color: var(--bone-dim); }

@media (max-width: 640px){
  .demo-body--split, .demo-grid-2{ grid-template-columns: 1fr; }
}

/* ---- reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .hero-media, .hero-media.is-pushing{ transform: none; transition: none; }
  .medallion g{ animation: none; }
  .scroll-cue span::after{ display: none; }
  .letterbox{ display: none; }
  .collection{ animation: none; background: var(--ink); }
}

@media (max-width: 900px){
  .module-grid{ grid-template-columns: 1fr; }
}

/* =========================================================================
   POLISH PASS (2026-09-09) — section rhythm, painterly detail, finish
   ========================================================================= */

::selection{ background: rgba(200,121,79,.26); color: #231f1c; }
html{ scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar{ width: 11px; height: 11px; }
::-webkit-scrollbar-thumb{ background: var(--line-strong); border-radius: 8px; border: 3px solid var(--ink); }
::-webkit-scrollbar-track{ background: transparent; }

/* ---- section scaffolding --------------------------------------------- */
.section{ overflow: clip; }
.section-tag{
  position: absolute;
  top: clamp(20px, 4vh, 44px);
  right: var(--gutter);
  font: 500 10px/1 var(--ff-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--bone-faint);
  z-index: 3;
}
.section-tag::before{
  content: ""; display: inline-block;
  width: 22px; height: 1px; margin-right: 10px; vertical-align: middle;
  background: var(--amber); opacity: .8;
}
.section--panel{
  background:
    radial-gradient(140% 90% at 50% 0%, rgba(255,255,255,.6), transparent 60%),
    var(--ink-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -1px 0 var(--line);
}
.section--dark{
  background: linear-gradient(180deg, #211c17, #17130f);
  color: #e9e0d0;
}
.section--dark .display{ color: #f6efe0; }
.section--dark .lede{ color: rgba(233,224,208,.72); }
.section--dark .eyebrow{ color: #e0a765; }
.section--dark .section-tag{ color: rgba(233,224,208,.45); }
.section--dark .btn--ghost{ border-color: rgba(233,224,208,.28); color: #e9e0d0; }
.section--dark .btn--ghost:hover{ border-color: var(--azo); background: rgba(63,127,174,.22); }
.section + .section--dark, .section--dark + .section{ border-top: 0; }

/* a touch more air + a bright hairline under section headings via eyebrow */
.eyebrow{ letter-spacing: .24em; }
.lede{ font-size: clamp(16px, 1.35vw, 18.5px); }

/* ---- Imobiliário layout + villa scene ------------------------------- */
.re-top{ margin-bottom: clamp(36px, 6vw, 68px); align-items: stretch; }
.re-top .stack{ justify-content: center; }
.re .re-points{ max-width: none; }
.villa{
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(43,39,36,.16);
  background: #d9c8a9;
}
.villa-sky{ position: absolute; inset: 0 0 34% 0; background: linear-gradient(180deg, #6f5a7d, #d98f52 62%, #ffcf8c); }
.villa-sun{ position: absolute; right: 18%; top: 16%; width: 62px; height: 62px; border-radius: 50%; background: #ffe9c4; box-shadow: 0 0 46px 20px rgba(255,207,140,.5); }
.villa-pool{ position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: linear-gradient(180deg, #4f7f96, #35586c); box-shadow: inset 0 3px 0 rgba(255,255,255,.25); }
.villa-house{ position: absolute; left: 12%; bottom: 30%; width: 60%; height: 40%; background: linear-gradient(180deg, #efe7d8, #ddceb6); border: 1px solid rgba(43,39,36,.18); }
.villa-roof{ position: absolute; left: 8%; bottom: 68%; width: 68%; height: 12%; background: #c06a3f; clip-path: polygon(6% 100%, 50% 0, 94% 100%); }
.villa-door{ position: absolute; left: 24%; bottom: 30%; width: 9%; height: 20%; background: #7c5a3f; }
.villa-win{ position: absolute; left: 46%; bottom: 46%; width: 18%; height: 14%; background: #2b3a44; box-shadow: 8px 0 0 #2b3a44, -26px 0 0 #2b3a44; }
.villa-palm{ position: absolute; right: 12%; bottom: 30%; width: 4px; height: 26%; background: #6b5330; }
.villa-palm::before{ content: ""; position: absolute; left: -18px; top: -10px; width: 40px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 50% 100%, #6c7d64, #55684f); }

/* ---- footer skyline ------------------------------------------------- */
.site-footer{ position: relative; }
.footer-skyline{ position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 52px; fill: var(--line-strong); opacity: .5; }
.site-footer .wrap{ position: relative; padding-top: 26px; }

/* ---- responsive polish -------------------------------------------- */
@media (max-width: 900px){
  .section-tag{ position: static; display: block; margin: 0 0 22px; }
  .villa{ aspect-ratio: 16 / 10; }
  .medallion-wrap{ min-height: 200px; }
  .medallion{ max-width: 340px; }
}

@media (prefers-reduced-motion: reduce){
  .work-card:hover{ transform: none; }
  .work-card:hover .work-go{ transform: none; }
}

/* =========================================================================
   SCROLLYTELLING — FASE 2 (animatic técnico)
   Pinned WebGL canvas + one 0->1 timeline scrubbed by scroll + 5 overlays.
   NOT final art. Debug markers + FPS meter visible on purpose.
   ========================================================================= */
.rs{
  position: relative;
  /* 460svh deixava, depois do fim da narrativa, mais de uma altura de ecra de
     pista sem acontecimento nenhum — medido no percurso real: o passo y=6731
     era agua a escorrer sobre nada, sem uma linha para ler. Encurtar a pista e
     o que o pedido manda fazer quando nao ha evolucao visual que a justifique:
     a entrega passa a acontecer com a Estacao 04 ja a entrar no plano.
     Depois de a cauda morta desaparecer (o pin passou a acabar em
     `bottom top`), a pista voltou a poder ser longa: com 372svh a visita
     interior — que ocupa 22% da narrativa — cabia em pouco mais de um ecra de
     scroll e passava sem se ler. O comprimento agora paga espaco por espaco,
     nao vazio. */
  /* 605svh = a tabela do roteiro (5.15 viewports de narrativa, ver `PESOS`
     em `scroll/chapters.js`) mais a cauda de 0.9 viewports do `CAUDA_VP`.
     Era 520svh, que dava 4.30 de narrativa: a visita CABIA no tecto de
     5.0-5.5 do roteiro, o que faltava era cada beat ter o seu tempo. A pista
     cresce 0.85 viewports e esse acréscimo vai todo para o interior e para o
     clímax — a chegada exterior encolhe de 2.39 para 1.40 apesar de a pista
     ser maior. */
  /* 640svh desde 2026-10-08: +0.35 do mergulho (ver `PESOS`). */
  height: 640svh;                 /* svh throughout so the pin end doesn't drift
                                     when mobile URL chrome collapses */
  background: linear-gradient(180deg, #f4efe6, #ece4d5);
}
/* No telemovel a mesma pista de 520svh dava OUTRA visita, nao a mesma mais
   pequena: medido no percurso real a 390x844 (passos de 422px), a casa inteira
   — porta, atrio, estar, jantar, saida, quintal — cabia em tres ecras, e a
   sala de jantar passava num unico gesto. A pista aqui e a sequencia de 48
   fotogramas: alongar nao acrescenta fotogramas, da a cada um o seu ecra, que
   e o tempo de leitura que o pedido exige. */
@media (max-width: 820px){
  .rs{ height: 960svh; }   /* +0.35 vp do mergulho, proporcional (2026-10-08) */
}
.rs-stage{
  height: 100svh;
  /* `hidden` primeiro, `clip` a seguir: quem suporta `clip` fica com ele, quem
     nao suporta ignora a segunda linha e fica como estava. Mesma tecnica ja
     usada no `html{overflow-x:clip}` deste projecto.

     Porque nao pode ser `hidden` aqui: `hidden` RECORTA mas continua a criar
     um contentor de scroll. Medido a 1280x720 com a cena montada,
     `clientHeight 720` contra `scrollHeight 982` — 262px de conteudo por
     baixo do corte, e o palco scrollavel por programa ou por foco sem barra
     nenhuma a denuncia-lo. Quando o browser desloca esse contentor para
     manter alcancavel o botao que acabou de ficar `inert` na troca de
     capitulos, `stage.scrollTop` fica em 262 e la fica: o palco continua
     fixado em 0..720 mas o canvas e o poster passam a -262..458, e o que
     sobra em baixo e a faixa escura reportada. Nao ha scroll de PAGINA
     envolvido, por isso uma varredura que so observe `scrollY` da zero e o
     `ScrollTrigger.refresh()` nao muda nada.
     `clip` recorta exactamente na mesma e NAO cria contentor de scroll:
     `scrollTop` deixa de poder ser diferente de 0. */
  overflow: hidden;
  overflow: clip;
  position: relative;             /* ScrollTrigger swaps this to fixed while pinned */
  isolation: isolate;
}
.rs-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
.rs-overlays{
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;           /* JS re-enables the active chapter */
  display: block;
}
/* Each chapter gets its OWN composition (per feedback) — not five slides
   stacked at one spot.  JS drives opacity + a small translateY; position and
   width are per data-ch below. */
.rs-chapter{
  position: absolute;
  left: var(--gutter);
  bottom: clamp(48px, 11vh, 120px);
  width: clamp(300px, 35vw, 460px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(12px, 1.6vw, 20px);
  opacity: 0;
  will-change: opacity, transform, filter;   /* JS drives an opacity+y+blur crossfade */
}
/* very subtle localized lift for text contrast — NOT a panel, does not darken
   the scene, feathers out well before the pool / house */
.rs-chapter::before{
  content: "";
  position: absolute;
  inset: -18px -80px -22px -34px;
  z-index: -1;
  background: radial-gradient(90% 120% at 6% 78%, rgba(244,239,228,.44) 0%, rgba(244,239,228,.16) 44%, rgba(244,239,228,0) 74%);
}
.rs-chapter .eyebrow{ color: var(--amber-deep); }
.rs-chapter .display{
  font-size: clamp(23px, 2.5vw, 34px);   /* small enough that the 2 title lines never orphan "em web" */
  color: #201c19;
  text-shadow: 0 1px 10px rgba(244,239,228,.42);   /* one soft lift, no hard outline */
}
.rs-chapter .rs-complement{
  font: 500 11.5px/1.6 var(--ff-mono);
  letter-spacing: .03em;
  color: var(--bone-dim);
  max-width: 40ch;
}
.rs-chapter .rs-indicators{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font: 600 9.5px/1 var(--ff-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.rs-chapter .btn-row{ pointer-events: auto; }

/* per-chapter placement (desktop) */
.rs-chapter[data-ch="1"]{ bottom: clamp(48px, 11vh, 120px); }                    /* left / low, clear of the pool */
.rs-chapter[data-ch="2"]{ bottom: auto; top: 34%; }                             /* rises to follow the wireframe */
.rs-chapter[data-ch="3"]{ bottom: auto; top: clamp(96px, 15vh, 150px); width: clamp(280px, 30vw, 400px); }  /* top-left, centre/right reserved for the UI */
.rs-chapter[data-ch="4"]{ left: auto; right: var(--gutter); align-items: flex-end; text-align: right; width: clamp(260px, 26vw, 360px); }
.rs-chapter[data-ch="4"] .rs-complement{ text-align: right; }
.rs-chapter[data-ch="4"] .rs-complement,
.rs-chapter[data-ch="4"] .display{ margin-left: auto; }
/* Ch.5 — closing shot. Copy lives lower-LEFT so it never sits on the pool /
   jacuzzi / façade; house + pool own the rest of the frame (camera does the
   negative-space work). No beige panel, no heavy title shadow. */
.rs-chapter[data-ch="5"]{ left: var(--gutter); right: auto; margin-inline: 0; align-items: flex-start; text-align: left; width: clamp(300px, 32vw, 440px); bottom: clamp(78px, 15vh, 156px); }
.rs-chapter[data-ch="5"] .display{ max-width: 24ch; text-shadow: 0 1px 8px rgba(244,239,228,.3); }
.rs-chapter[data-ch="5"] .rs-complement{ max-width: 34ch; }
.rs-chapter[data-ch="5"] .btn-row{ flex-wrap: nowrap; align-items: stretch; gap: 12px; }
.rs-chapter[data-ch="5"] .btn-row .btn{ flex: 0 0 auto; display: inline-flex; align-items: center; }
.rs-chapter[data-ch="3"]::before{ inset: -18px -34px -22px -34px; }
.rs-chapter[data-ch="4"]::before{ background: radial-gradient(90% 120% at 94% 78%, rgba(244,239,228,.44) 0%, rgba(244,239,228,.16) 44%, rgba(244,239,228,0) 74%); }
/* deliberately feather-only, no readable rectangle */
.rs-chapter[data-ch="5"]::before{ inset: -14px -46px -20px -30px; background: radial-gradient(120% 140% at 12% 80%, rgba(244,239,228,.20) 0%, rgba(244,239,228,.07) 46%, rgba(244,239,228,0) 72%); }

/* neutralise the ghost CTA inside the scene — no azulejo-blue (not in the
   final scene palette); keep it lighter than the primary */
.rs-chapter .btn--ghost{ border-color: var(--line-strong); color: var(--bone); background: rgba(246,241,231,.86); }
.rs-chapter .btn--ghost:hover{ border-color: var(--bone-dim); background: rgba(246,241,231,.96); transform: translateY(-2px); }

/* Ch.3 — hierarchy of the future real-estate interface (wireframe only, Fase 3
   builds the real UI).  Sits in the right ~32vw with 5vw / 15vh margins; height
   follows its content.  The left rule + tick read it as tethered to the
   façade / ArchitecturalLines, not a floating dashboard window. */
.rs-ui{
  position: absolute;
  right: 4vw;
  top: 14vh;
  width: min(33vw, 400px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8vw, 11px);
  padding-left: 16px;
  border-left: 1px solid rgba(43,39,36,.32);
  opacity: 0;                     /* JS fades it with Ch.3 */
  pointer-events: none;
}
.rs-ui::before{                   /* connector tick toward the façade */
  content: "";
  position: absolute;
  left: -22px;
  top: 46%;
  width: 22px;
  height: 1px;
  background: rgba(43,39,36,.3);
}
.rs-ui-block{
  border: 1px solid rgba(43,39,36,.34);
  border-radius: 4px;
  background: rgba(244,239,228,.14);
  display: flex;
  align-items: flex-end;
  padding: 8px 10px;
}
.rs-ui-block span{
  font: 600 8.5px/1.1 var(--ff-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(43,39,36,.66);
}
.rs-ui-row{ display: flex; gap: clamp(7px, 0.9vw, 13px); }
.rs-ui-row .rs-ui-block{ flex: 1; }
.rs-ui-photo{ aspect-ratio: 16 / 11; align-items: flex-start; }
.rs-ui-plan{ aspect-ratio: 4 / 3; }
.rs-ui-loc{ aspect-ratio: 4 / 3; }
.rs-ui-specs{ min-height: 44px; }
.rs-ui-avail{ min-height: 30px; }
.rs-ui-cta{
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-color: rgba(200,121,79,.6);
  background: rgba(200,121,79,.1);
}
.rs-ui-cta span{ color: var(--amber-deep); }

/* "Imóvel · Experiência · Sistema" tracker — JS pins it just above the active
   chapter so it reads as a kicker on the copy, not a detached top HUD */
.rs-hud{
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 3;
  font: 500 9.5px/1 var(--ff-mono);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--bone-faint);
  opacity: 0;
  pointer-events: none;
}
.rs-fps, .rs-debug{
  position: absolute;
  right: var(--gutter);
  z-index: 4;
  font: 500 10px/1.4 var(--ff-mono);
  letter-spacing: .08em;
  color: var(--amber-deep);
  background: rgba(244,239,228,.72);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  pointer-events: none;             /* readouts never intercept a CTA tap */
}
.rs-fps{ top: clamp(84px, 12vh, 120px); }
.rs-debug{
  top: calc(clamp(84px, 12vh, 120px) + 30px);
  color: var(--bone-dim);
  white-space: pre;                 /* Fase 2.1: multi-line readout (pos / tgt / fov / spd / rig) */
  text-align: right;
  font-size: 9px;
  line-height: 1.5;
  max-width: 46vw;
}

.rs--noscene .rs-canvas{ display: none; }
.rs--noscene .rs-stage{ background: linear-gradient(180deg, #f4efe6, #e5dbc9); }

/* reduced motion — no pin, chapters stacked, canvas a short static still */
.rs--static{ height: auto; }
.rs--static .rs-stage{ height: auto; position: static; overflow: visible; }
.rs--static .rs-canvas{ position: static; height: 56svh; }
.rs--static .rs-overlays{ position: static; }
.rs--static .rs-chapter{
  position: static;
  width: min(600px, 100%);
  opacity: 1 !important;
  transform: none !important;
  margin-block: clamp(40px, 8vh, 88px);
}
.rs--static .rs-hud, .rs--static .rs-fps, .rs--static .rs-debug, .rs--static .rs-ui{ display: none; }

@media (max-width: 900px){
  /* mobile = composition test only. All chapters left-aligned with real side
     margins; vertical position varies per chapter; smaller H1; UI slot hidden. */
  .rs-chapter,
  .rs-chapter[data-ch="1"],
  .rs-chapter[data-ch="2"],
  .rs-chapter[data-ch="3"],
  .rs-chapter[data-ch="4"],
  .rs-chapter[data-ch="5"]{
    left: var(--gutter);
    right: var(--gutter);
    width: auto;
    align-items: flex-start;
    text-align: left;
    margin-inline: 0;
  }
  .rs-chapter{ bottom: clamp(28px, 8vh, 72px); top: auto; }
  .rs-chapter .display{ font-size: clamp(20px, 5.6vw, 26px); }
  .rs-chapter .rs-complement{ max-width: 34ch; }
  /* Ch.2 / Ch.3 / Ch.4 text sit in the TOP margin (haze) so the portrait
     framing keeps the house + pool in the lower ~65% without the copy on them */
  .rs-chapter[data-ch="2"]{ top: clamp(120px, 17vh, 190px); bottom: auto; }
  .rs-chapter[data-ch="3"]{ top: clamp(140px, 20vh, 210px); bottom: auto; }
  .rs-chapter[data-ch="4"]{ top: clamp(120px, 17vh, 190px); bottom: auto; }
  /* Ch.5 keeps CTAs at the bottom but they STACK on mobile (no overflow) */
  .rs-chapter[data-ch="5"]{ bottom: clamp(48px, 13vh, 132px); }
  .rs-chapter[data-ch="5"] .btn-row{ flex-wrap: wrap; width: 100%; }
  .rs-chapter[data-ch="5"] .btn-row .btn{ flex: 1 1 100%; justify-content: center; }
  .rs-chapter[data-ch="4"] .rs-complement,
  .rs-chapter[data-ch="4"] .display{ margin-left: 0; text-align: left; }
  .rs-chapter[data-ch="5"]{ bottom: clamp(40px, 12vh, 120px); }
  .rs-ui{ display: none; }
  /* debug badges to the BOTTOM-right on mobile so the multi-line readout can't
     collide with the top-anchored Ch.2/Ch.3 copy (Fase 2.1) */
  .rs-fps{ top: auto; bottom: 84px; }
  .rs-debug{ top: auto; bottom: 12px; max-width: 58vw; font-size: 8.5px; }
}

@media (prefers-reduced-motion: reduce){
  .rs{ height: auto; }
}

/* 2026-10-21: no telemóvel as secções do fim têm cada uma o seu padding
   (80px em cima e em baixo), e somados davam buracos de 160 a 230px entre um
   botão e a etiqueta da secção seguinte. `main #id` para ganhar às regras
   próprias de cada secção, carregadas depois. */
@media (max-width: 640px) {
  main #agentes, main #imobiliario { padding-top: 56px; padding-bottom: 48px; }
  main #contacto.contacto-postal { padding-top: 56px; }
}
