/* ==========================================================================
   Candieiro Experience · base
   Direção: a luz do candeeiro conduz a apresentação. Noite quente no
   resto-bar, manhã clara no hotel, a luz de volta no encerramento.
   Tipografia: Bodoni Moda (títulos, números) + Jost (texto e interface).
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Paleta provisória do brief (não é a identidade oficial) */
  --preto: #0C0C0B;
  --carvao: #151412;
  --carvao-2: #1D1B18;
  --carvao-3: #272420;
  --ambar: #C99343;
  --dourado: #E7BE78;
  --creme: #F5EDE0;

  /* Texto e linhas sobre o escuro */
  --texto: #F5EDE0;
  --texto-suave: #BDB2A2;
  --texto-fraco: #9A9082;
  --linha: rgba(231, 190, 120, 0.16);
  --linha-forte: rgba(231, 190, 120, 0.4);

  /* Capítulo do hotel, sobre o claro */
  --manha: #F5EDE0;
  --manha-2: #ECE2D2;
  --manha-3: #FBF7F0;
  --tinta: #1F1C18;
  --tinta-suave: #5C5348;
  --ambar-tinta: #7A5219;
  --linha-clara: rgba(31, 28, 24, 0.14);

  /* Tipografia */
  --f-display: "Bodoni Moda", "Bodoni 72", Didot, "Times New Roman", serif;
  --f-texto: "Jost", "Futura", "Avenir Next", "Century Gothic", system-ui, sans-serif;

  --t-hero: clamp(2.7rem, 11.4vw, 10.75rem);
  --t-1: clamp(2.15rem, 4.9vw, 4.5rem);
  --t-2: clamp(1.6rem, 2.7vw, 2.35rem);
  --t-3: clamp(1.18rem, 1.55vw, 1.4rem);
  --t-lead: clamp(1.06rem, 1.3vw, 1.25rem);
  --t-base: 1.0625rem;
  --t-small: 0.9375rem;
  --t-micro: 0.8125rem;

  /* Espaço e forma */
  --gutter: clamp(16px, 5vw, 72px);
  --wrap: 1280px;
  --section-pad: clamp(88px, 13vh, 168px);
  --hud-h: 72px;
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 24px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- reset enxuto ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--carvao);
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: var(--t-base);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 0.2em; }
[hidden] { display: none !important; }

::selection { background: var(--dourado); color: var(--preto); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--dourado);
  outline-offset: 3px;
  border-radius: 6px;
}
.scene--light :focus-visible,
.eco__panel--light :focus-visible,
.sheet :focus-visible { outline-color: var(--ambar-tinta); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: fixed;
  z-index: 100;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: max(16px, env(safe-area-inset-left, 0px));
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--dourado);
  color: var(--preto);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip:focus-visible { transform: translateY(0); }

.noscript {
  padding: 40px max(16px, env(safe-area-inset-left, 0px));
  text-align: center;
  color: var(--texto);
}

/* ---------- moldura de conteúdo ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ---------- tipografia comum ---------- */
.scene__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--t-1);
  line-height: 1.04;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.lead {
  font-size: var(--t-lead);
  line-height: 1.62;
  color: var(--texto-suave);
  max-width: 56ch;
  text-wrap: pretty;
}
.scene--light .lead { color: var(--tinta-suave); }

/* Palavras divididas para a revelação dos títulos */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.w > span { display: inline-block; will-change: transform; }

/* ---------- selo de conteúdo ilustrativo ---------- */
.badge {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.65em;
  font-size: var(--t-micro);
  line-height: 1.45;
  color: var(--texto-suave);
  max-width: 46ch;
}
.badge::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 0.38em;
  border-radius: 50%;
  border: 1px solid var(--dourado);
  box-shadow: 0 0 10px rgba(231, 190, 120, 0.4);
}
.scene--light .badge { color: var(--tinta-suave); }
.scene--light .badge::before { border-color: var(--ambar-tinta); box-shadow: none; }

/* ---------- botões ---------- */
.btn {
  --mx: 50%;
  --my: 50%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  min-height: 52px;
  padding: 0 1.75em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--dourado);
  color: var(--preto);
  font-family: var(--f-texto);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease),
              background-color 0.3s, color 0.3s, border-color 0.3s;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(160px circle at var(--mx) var(--my), rgba(255, 247, 228, 0.9), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s;
}
.btn:hover::before { opacity: 1; }
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px -14px rgba(231, 190, 120, 0.7);
}
.btn:active { transform: translateY(0) scale(0.98); }

.btn--ghost {
  background: transparent;
  color: var(--texto);
  border-color: var(--linha-forte);
}
.btn--ghost::before {
  background: radial-gradient(160px circle at var(--mx) var(--my), rgba(231, 190, 120, 0.22), transparent 62%);
}
.btn--ghost:hover { box-shadow: 0 0 0 1px rgba(231, 190, 120, 0.25); }

.btn--small { min-height: 42px; padding: 0 1.25em; font-size: 0.9rem; }

.btn__spark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  transition: box-shadow 0.45s var(--ease);
}
.btn:hover .btn__spark { box-shadow: 0 0 0 5px rgba(12, 12, 11, 0.12); }

.scene--light .btn { background: var(--tinta); color: var(--manha); }
.scene--light .btn::before {
  background: radial-gradient(160px circle at var(--mx) var(--my), rgba(231, 190, 120, 0.5), transparent 62%);
}
.scene--light .btn:hover { box-shadow: 0 14px 40px -16px rgba(60, 40, 10, 0.55); }
.scene--light .btn--ghost {
  background: transparent;
  color: var(--tinta);
  border-color: rgba(31, 28, 24, 0.28);
}

/* Link de texto com sublinhado que acende */
.text-link {
  background: none;
  border: 0;
  padding: 0 0 2px;
  color: inherit;
  font-size: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}
.text-link:hover { color: var(--dourado); }
.scene--light .text-link:hover { color: var(--ambar-tinta); }

/* ---------- HUD: marca, cena atual e menu ---------- */
.hud {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
  padding-bottom: 14px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  color: var(--texto);
  pointer-events: none;
  transition: color 0.5s var(--ease);
}
.hud::before {
  content: "";
  position: absolute;
  inset: 0 0 -28px 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(12, 12, 11, 0.94) 0%, rgba(12, 12, 11, 0.84) 58%, rgba(12, 12, 11, 0) 100%);
  transition: opacity 0.5s;
  pointer-events: none;
}
.hud::after {
  content: "";
  position: absolute;
  inset: 0 0 -28px 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(245, 237, 224, 0.96) 0%, rgba(245, 237, 224, 0.86) 58%, rgba(245, 237, 224, 0) 100%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
html[data-tone="light"] .hud { color: var(--tinta); }
html[data-tone="light"] .hud::before { opacity: 0; }
html[data-tone="light"] .hud::after { opacity: 1; }

.hud a,
.hud button { pointer-events: auto; }

.hud__brand {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.hud__brand-soft { color: var(--dourado); transition: color 0.5s; }
html[data-tone="light"] .hud__brand-soft { color: var(--ambar-tinta); }

.hud__right { display: flex; align-items: center; gap: 18px; min-width: 0; }

.hud__scene {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  font-size: var(--t-micro);
  letter-spacing: 0.02em;
}
.hud__count {
  font-variant-numeric: tabular-nums;
  color: var(--dourado);
  white-space: nowrap;
  transition: color 0.5s;
}
html[data-tone="light"] .hud__count { color: var(--ambar-tinta); }
.hud__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud__menu {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--linha-forte);
  border-radius: 999px;
  background: rgba(12, 12, 11, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  transition: background-color 0.5s, border-color 0.5s;
}
.hud__menu:hover { border-color: var(--dourado); }
html[data-tone="light"] .hud__menu {
  border-color: rgba(31, 28, 24, 0.26);
  background: rgba(245, 237, 224, 0.55);
}
.hud__menu-lines { display: grid; gap: 4px; width: 16px; }
.hud__menu-lines i { display: block; height: 1px; background: currentColor; }
.hud__menu-lines i:last-child { width: 60%; }

/* Indicador de progresso */
.progress {
  position: fixed;
  z-index: 45;
  top: 0;
  left: 0;
  right: 0;
  padding-top: env(safe-area-inset-top, 0px);
  pointer-events: none;
}
.progress__bar {
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--ambar), var(--dourado));
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
}

/* ---------- menu de cenas ---------- */
.menu {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(460px, 100%);
}
.menu__scrim {
  border: 0;
  padding: 0;
  background: rgba(12, 12, 11, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.menu__panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  padding-top: calc(env(safe-area-inset-top, 0px) + 22px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  padding-left: 32px;
  padding-right: max(32px, env(safe-area-inset-right, 0px));
  background: var(--carvao-2);
  color: var(--texto);
  border-left: 1px solid var(--linha);
}
.menu__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.menu__title { font-family: var(--f-display); font-size: 1.6rem; font-weight: 500; }
.menu__close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--linha-forte);
  border-radius: 50%;
  background: none;
}
.menu__close:hover { border-color: var(--dourado); }
.menu__list { display: grid; border-top: 1px solid var(--linha); }
.menu__link {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 13px 0;
  border-bottom: 1px solid var(--linha);
  color: var(--texto-suave);
  text-decoration: none;
  transition: color 0.3s, padding-left 0.45s var(--ease);
}
.menu__link:hover { color: var(--texto); padding-left: 8px; }
.menu__link[aria-current="step"] { color: var(--texto); }
.menu__num {
  font-family: var(--f-display);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--texto-fraco);
}
.menu__link[aria-current="step"] .menu__num { color: var(--dourado); }
.menu__label { font-size: 1.05rem; }

.motion-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 16px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--linha);
  border-radius: var(--r-m);
  background: rgba(245, 237, 224, 0.02);
  text-align: left;
}
.motion-toggle__label { font-size: 0.98rem; }
.motion-toggle__hint { grid-column: 1; font-size: var(--t-micro); color: var(--texto-fraco); }
.motion-toggle__switch {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--carvao-3);
  border: 1px solid var(--linha-forte);
  transition: background-color 0.3s;
}
.motion-toggle__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--texto-suave);
  transition: transform 0.35s var(--ease), background-color 0.3s;
}
.motion-toggle[aria-pressed="true"] .motion-toggle__switch { background: rgba(231, 190, 120, 0.25); }
.motion-toggle[aria-pressed="true"] .motion-toggle__switch::after {
  transform: translateX(20px);
  background: var(--dourado);
}
.menu__keys { font-size: var(--t-micro); color: var(--texto-fraco); }

/* ---------- telas pequenas ---------- */
@media (max-width: 699px) {
  :root { --hud-h: 64px; }
  .hud { padding-top: calc(env(safe-area-inset-top, 0px) + 10px); padding-bottom: 10px; }
  .hud__brand { font-size: 0.86rem; letter-spacing: 0.12em; }
  .hud__brand-soft { display: none; }
  .hud__name { display: none; }
  .hud__right { gap: 12px; }
  .menu { grid-template-columns: 1fr; }
  .menu__scrim { display: none; }
  .menu__panel { padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); border-left: 0; }
}
