/* Cabanna · Poltrona Uaupés — protótipo */
:root {
  /* brand (from the Cabanna logo) */
  --green: #1c4533;
  --green-deep: #0f2219;
  --terra: #9d4e2d;
  --ochre: #c87726;
  --sand: #d0af7a;

  /* story grounds, one per act */
  --g-hero: #0f2219;
  --g-paper: #eeede8;
  --g-blueprint: #12223a;
  --g-workshop: #1b1d1c;
  --g-day: #d9d2c4;

  /* configurator */
  --ground: #ebeae6;
  --surface: #f6f5f2;
  --ink: #15281f;
  --ink-2: #435349;
  --line: #c9cbc4;
  --accent: #6b7a3c;       /* follows the chosen rope */
  --accent-ink: #ffffff;

  --font: "Archivo", system-ui, sans-serif;
  --hand: "Caveat", cursive;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(16px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--g-hero); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--sand); color: var(--green-deep); }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; height: auto; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; align-items: center; gap: 28px;
  padding: 18px var(--gutter);
  color: var(--hdr-ink, #f2efe6);
  transition: color .5s var(--ease-out), background-color .4s var(--ease-out);
}
.hdr.is-solid { background: var(--surface); color: var(--ink); --hdr-ink: var(--ink) !important; box-shadow: 0 1px 0 var(--line); }
.hdr__logo { display: block; width: 150px; line-height: 0; }
.hdr__logo svg, .ftr__brand svg { width: 100%; height: auto; fill: currentColor; }
.hdr__logo .cls-4, .ftr__brand .cls-4 { fill: currentColor; }
.hdr__nav { display: flex; gap: 24px; margin-left: auto; font-size: 14px; letter-spacing: .02em; }
.hdr__nav a { text-decoration: none; opacity: .8; transition: opacity .2s; }
.hdr__nav a:hover { opacity: 1; }
.hdr__cta {
  font-size: 14px; font-weight: 600; text-decoration: none;
  padding: 10px 16px; border: 1px solid currentColor; border-radius: 999px;
  transition: background-color .25s, color .25s;
}
.hdr__cta:hover { background: var(--hdr-ink, #f2efe6); color: var(--hdr-bg, var(--green-deep)); }
@media (max-width: 720px) {
  .hdr { gap: 12px; padding-top: 14px; }
  .hdr__logo { width: 116px; }
  .hdr__nav { display: none; }
  .hdr__cta { margin-left: auto; padding: 8px 12px; font-size: 13px; }
}

/* ---------- story ---------- */
.story { position: relative; height: 900vh; }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: var(--g-hero); color: #f2efe6;
}
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 2; }
.stage__word {
  position: absolute; inset: 0; z-index: 1; display: grid; place-items: center;
  pointer-events: none; overflow: hidden;
}
.stage__word span {
  font-weight: 900; font-variation-settings: "wdth" 62;
  font-size: clamp(120px, 31vw, 560px); line-height: .8; letter-spacing: -0.02em;
  color: var(--sand); transform: translateY(-4%);
  white-space: nowrap;
}
.stage__dims { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.dim {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 13px; font-weight: 600; letter-spacing: .04em; color: #9fd0ff;
  background: var(--g-blueprint); padding: 2px 6px; border-radius: 3px;
  font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0;
}
.dim small { font-weight: 400; opacity: .75; margin-left: 4px; }

.stage__loader, .cfg__loader {
  position: absolute; inset: 0; z-index: 5; display: flex; gap: 12px;
  align-items: center; justify-content: center; font-size: 14px; letter-spacing: .02em;
  transition: opacity .6s var(--ease-out);
}
.is-ready .stage__loader, .cfg.is-ready .cfg__loader { opacity: 0; pointer-events: none; }
.ring {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

/* acts: overlays on the sticky stage, choreographed by GSAP */
.act {
  position: absolute; z-index: 4; max-width: 400px;
  opacity: 0; visibility: hidden;
}
.act p { margin: 0 0 14px; font-size: 17px; line-height: 1.55; max-width: 36ch; }
.act__title {
  margin: 0 0 14px; font-weight: 800; font-variation-settings: "wdth" 80;
  font-size: clamp(34px, 4.4vw, 60px); line-height: .98; letter-spacing: -0.02em;
  text-wrap: balance;
}
.act--left  { left: var(--gutter); top: 50%; transform: translateY(-50%); }
.act--right { right: var(--gutter); top: 50%; transform: translateY(-50%); }
.act--hero {
  left: var(--gutter); bottom: clamp(28px, 6vh, 64px); max-width: none;
  opacity: 1; visibility: visible;
}
.act--hero .act__title { font-size: clamp(22px, 2.2vw, 30px); font-variation-settings: "wdth" 100; font-weight: 700; margin: 0 0 4px; }
.act__by { margin: 0 !important; opacity: .8; font-size: 15px !important; }
.act__hint {
  margin: 18px 0 0 !important; font-size: 13px !important; letter-spacing: .03em;
  opacity: .7; display: flex; align-items: center; gap: 10px;
}
.act__hint::after {
  content: ""; width: 1px; height: 28px; background: currentColor;
  animation: hint 2.2s var(--ease-out) infinite; transform-origin: top;
}
@keyframes hint { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.act__note {
  font-family: var(--hand); font-size: 30px !important; line-height: 1.1;
  color: #5d5a52; transform: rotate(-3deg); margin-top: 18px !important;
}
.act--final { max-width: 460px; }
.act--final .act__title { color: var(--green-deep); font-size: clamp(40px, 6vw, 88px); }

[data-act="sketch"] { color: #23251f; }
[data-act="cad"] { color: #dbe9ff; }
[data-act="cushion"] { color: #f2efe6; }

.photo { margin: 18px 0 0; width: 220px; }
.photo img { aspect-ratio: 4/5; object-fit: cover; border-radius: 4px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.6); }
.slot { margin: 18px 0 0; width: 220px; }
.slot__frame {
  aspect-ratio: 4/5; display: grid; place-items: center; text-align: center; padding: 14px;
  border: 1px dashed rgba(242,239,230,.45); border-radius: 4px;
  font-size: 13px; letter-spacing: .04em; color: rgba(242,239,230,.75);
  background: rgba(255,255,255,.03);
}
.slot figcaption, .photo figcaption { font-size: 12px; opacity: .6; margin-top: 8px; }

.progress {
  position: absolute; z-index: 4; right: var(--gutter); bottom: 28px;
  display: flex; gap: 18px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  opacity: 0; color: currentColor;
}
.progress span { opacity: .35; transition: opacity .3s; }
.progress span.on { opacity: 1; }

@media (max-width: 720px) {
  .act--left, .act--right {
    left: var(--gutter); right: var(--gutter); top: auto; bottom: 26px; transform: none; max-width: none;
  }
  .act p { font-size: 15px; }
  .act__title { font-size: 32px; }
  .photo, .slot { width: 120px; position: absolute; right: 0; top: -150px; margin: 0; }
  .slot figcaption, .photo figcaption { display: none; }
  .act__note { display: none; }
  .progress { display: none; }
}

/* ---------- place (full-bleed photo) ---------- */
.place { position: relative; background: var(--g-day); }
.place::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(to top, rgba(10,20,14,.55), transparent); pointer-events: none; }
.place img { width: 100%; height: min(100vh, 66vw); object-fit: cover; }
.place__cap {
  position: absolute; left: var(--gutter); bottom: 24px; margin: 0;
  color: #fff; font-size: 15px; z-index: 1; background: rgba(10,20,14,.62); padding: 6px 10px; border-radius: 4px;
}

/* ---------- configurator ---------- */
.cfg {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  background: var(--ground); color: var(--ink); min-height: 100vh;
}
.cfg__stage { position: sticky; top: 0; height: 100vh; height: 100svh; }
.cfg__stage canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.cfg__stage canvas:active { cursor: grabbing; }
.cfg__loader { color: var(--ink-2); }
.cfg__drag, .cfg__disclaimer {
  position: absolute; left: var(--gutter); margin: 0; font-size: 12px; letter-spacing: .04em; color: var(--ink-2);
}
.cfg__drag { bottom: 44px; }
.cfg__disclaimer { bottom: 22px; }

.cfg__panel {
  background: var(--surface); padding: 112px clamp(20px, 3vw, 44px) 56px;
  border-left: 1px solid var(--line);
}
.cfg__title {
  margin: 0 0 6px; font-weight: 800; font-variation-settings: "wdth" 80;
  font-size: clamp(40px, 4vw, 60px); line-height: .95; letter-spacing: -0.02em;
}
.cfg__lede { margin: 0 0 36px; color: var(--ink-2); }

.grp { margin: 0 0 32px; border: 0; padding: 0; }
.grp__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grp__label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.grp__value { font-size: 14px; color: var(--ink-2); text-align: right; }
.grp__fam { font-size: 12px; color: var(--ink-2); margin: 14px 0 8px; letter-spacing: .04em; }
.sw { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.sw button {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%;
  background: var(--c) center/cover no-repeat; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.sw button:hover { transform: scale(1.08); }
.sw button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.sw button.is-loading::after {
  content: ""; position: absolute; inset: 30%; border-radius: 50%;
  border: 2px solid #fff; border-right-color: transparent; animation: spin .8s linear infinite;
}

.specs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 12px;
  margin: 8px 0 36px; padding: 22px 0 0; border-top: 1px solid var(--line);
}
.specs dt { font-size: 12px; color: var(--ink-2); letter-spacing: .04em; }
.specs dd { margin: 2px 0 0; font-weight: 600; font-size: 17px; }

.cfg__actions { display: grid; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 999px;
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .25s, color .25s, box-shadow .25s;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--ink); color: #fff; border: 0; box-shadow: 0 10px 24px -14px rgba(21,40,31,.7); }
.btn--primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--ghost[disabled] { opacity: .5; cursor: progress; }
.btn--light { background: var(--green-deep); color: #f2efe6; border: 0; margin-top: 6px; }
.btn--light:hover { background: var(--terra); }
.cfg__ar-msg { font-size: 14px; color: var(--ink-2); margin: 14px 0 0; }

@media (max-width: 900px) {
  .cfg { grid-template-columns: 1fr; }
  .cfg__stage { position: relative; height: 62vh; height: 62svh; }
  .cfg__panel { padding-top: 36px; border-left: 0; border-top: 1px solid var(--line); padding-bottom: 120px; }
  .cfg__actions {
    position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    margin: 0 -4px; z-index: 5;
  }
  .specs { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- footer ---------- */
.ftr {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 28px;
  padding: 56px var(--gutter) 32px; background: var(--green-deep); color: #e6e2d6; font-size: 15px;
}
.ftr__brand { width: 180px; color: #f2efe6; }
.ftr__col { display: flex; flex-direction: column; gap: 6px; }
.ftr__col p { margin: 0; }
.ftr__col a { text-decoration: none; }
.ftr__col a:hover { text-decoration: underline; }
.ftr__legal { grid-column: 1 / -1; margin: 24px 0 0; font-size: 12px; opacity: .6; }
@media (max-width: 720px) { .ftr { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .act__hint::after, .ring { animation: none; }
}
