/* Casa das Cinco Portadas — site de demonstração da Cradle Studio.
   Um só tipo de letra, um fundo, uma tinta. As cinco cores são as das portadas. */

:root {
  --bg: #133621;
  --surface: #1a4429;
  --ink: #f4d96c;
  --muted: #c4b771;
  --accent-ink: #133621;

  --amarelo: #e0a526;
  --azul: #2f62c4;
  --verde: #8fb08a;
  --rosa: #e3a3a0;
  --vermelho: #9c2f2b;
  --sea: #6f9fb0;
  --sand: #e8d9a8;

  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.25rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --step-head: clamp(2rem, 1.3rem + 2.1vw, 3.25rem);

  --gap: 12px;
  --pad: clamp(24px, 5vw, 72px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "STIX Two Text", "Times New Roman", serif;
  font-size: var(--step-body);
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }

h1, h2 {
  font-weight: 400;
  font-size: var(--step-head);
  line-height: 1.1;
  letter-spacing: -0.026em;
  text-wrap: balance;
}
h3 { font-size: var(--step-lead); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }

/* Língua: os dois textos estão na página, mostra-se um. */
html[data-lang="pt"] [data-l="en"],
html[data-lang="en"] [data-l="pt"] { display: none; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Faixa de demonstração ---------- */
.demo-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px;
  background: var(--ink); color: var(--accent-ink);
  font-size: var(--step-small);
}
.demo-bar p { font-weight: 600; }
.lang { display: flex; gap: 4px; flex: none; }
.lang__short { display: none; }
@media (max-width: 520px) {
  .demo-bar { padding: 8px 16px; }
  .lang__full { display: none; }
  .lang__short { display: inline; }
}
.lang button {
  border: 0; background: transparent; color: var(--accent-ink);
  padding: 6px 10px; cursor: pointer; min-height: 32px;
  transition: background-color 200ms ease, color 200ms ease;
}
.lang button[aria-pressed="true"] { background: var(--accent-ink); color: var(--ink); }
.lang button:hover { background: var(--surface); color: var(--ink); }

/* ---------- Palco fixo e coluna de leitura ---------- */
.split { display: grid; grid-template-columns: 1fr; gap: var(--gap); padding: var(--gap); }
.stage { position: relative; height: 48svh; min-height: 280px; overflow: hidden; background: var(--surface); }
.stage__img, .stage picture { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Sem JavaScript vê-se só a primeira fotografia; o esbatimento entre fotografias existe apenas com script. */
.stage__img { object-fit: cover; }
html.js .stage__img { opacity: 0; transition: opacity 1400ms ease; }
html.js .stage__img.is-on { opacity: 1; }
.stage__img:not([data-key="facade"]) { display: none; }
.stage__caption {
  position: absolute; left: 0; bottom: 0; z-index: 2;
  padding: 8px 14px; background: var(--bg); color: var(--ink);
  font-size: var(--step-small);
}
.col { min-width: 0; }

@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; align-items: start; }
  .stage-track { order: 2; position: sticky; top: var(--gap); }
  .stage { height: calc(100svh - 2 * var(--gap)); }
  html.js .stage__img:not([data-key="facade"]) { display: block; }
  .stage__img.is-on { animation: drift 26s ease-in-out infinite alternate; }
}
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06); } }

/* ---------- Primeiro ecrã: o cartão com as cinco portadas ---------- */
.hero {
  position: relative; z-index: 1;
  background: var(--surface);
  display: flex; flex-direction: column;
}
.shutters { display: flex; gap: 10px; height: 44px; padding: 0 10px; background: var(--bg); }
.shutter { flex: 1; display: flex; gap: 4px; position: relative; text-decoration: none; }
.shutter i { flex: 1; background: var(--c); transition: transform 500ms var(--ease-out); }
.shutter i:first-of-type { transform-origin: left center; }
.shutter i:last-of-type { transform-origin: right center; }
.shutter:hover i, .shutter:focus-visible i, .shutter.is-current i { transform: scaleX(0.42); }
.shutter:active i { transform: scaleX(0.3); }

.hero__body { padding: 40px var(--pad) 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; flex: 1; }
.wordmark { font-style: italic; font-size: var(--step-lead); letter-spacing: -0.01em; }
.hero h1 { max-width: 13em; }
.lead { max-width: 36ch; color: var(--ink); }
.hero__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; margin-top: 20px; font-size: var(--step-small); }
.hero__links a { text-underline-offset: 4px; padding: 6px 0; transition: color 200ms ease; }
.hero__links a:hover { color: #fff3b8; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 12px 28px;
  background: var(--ink); color: var(--accent-ink);
  border: 0; cursor: pointer; text-decoration: none; font-weight: 600;
  transition: transform 200ms var(--ease-out), background-color 200ms ease;
}
.btn:hover { background: #fff3b8; }
.btn:active { transform: scale(0.97); }
.btn--quiet { background: var(--surface); color: var(--ink); }
.btn--quiet:hover { background: #235534; }
.btn--paper { background: var(--ink); color: var(--accent-ink); }

@media (min-width: 900px) {
  .hero { min-height: calc(100svh - 2 * var(--gap) - 52px); }
  .shutters { height: 56px; gap: 14px; padding: 0 14px; }
  .hero__body { justify-content: center; padding-top: 56px; gap: 24px; }
  .hero__links { margin-top: auto; padding-top: 32px; }
}

/* ---------- Secções da coluna ---------- */
.section { padding: clamp(72px, 12vw, 150px) var(--pad) 0; }
.section > div > h2, .section > h2 { margin-bottom: 20px; }
.note { max-width: 46ch; color: var(--muted); }

/* Quartos */
.room-list { margin-top: 40px; }
.room h3 { font-size: inherit; letter-spacing: 0; }
.room__head {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 16px;
  width: 100%; min-height: 62px; padding: 8px 0;
  background: transparent; border: 0; cursor: pointer; text-align: left;
  font-size: var(--step-lead); font-weight: 400; color: var(--muted);
  transition: color 200ms ease;
}
.room__head:hover, .room.is-open .room__head, .room.is-active .room__head { color: var(--ink); }
.swatch { width: 28px; height: 36px; background: var(--c); transition: transform 400ms var(--ease-out); transform-origin: left center; }
.room__head:hover .swatch, .room.is-open .swatch { transform: scaleX(0.5); }
.room__price { font-size: var(--step-body); white-space: nowrap; font-variant-numeric: tabular-nums; }
.room__panel { display: none; padding: 4px 0 36px 44px; max-width: 46ch; }
.room.is-open .room__panel { display: block; animation: rise 500ms var(--ease-out); }
.room__photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; margin-bottom: 20px; }
.facts { margin: 16px 0 20px; color: var(--muted); }
.facts li + li { margin-top: 4px; }
.link-action { font-weight: 600; text-underline-offset: 5px; text-decoration-thickness: 2px; transition: color 200ms ease; }
.link-action:hover { color: #fff3b8; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (min-width: 900px) {
  html.js .room__photo { display: none; }
}

/* Reserva direta: o único campo de cor cheia na coluna */
.direct { background: var(--ink); color: var(--accent-ink); margin-top: clamp(72px, 12vw, 150px); padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(48px, 7vw, 88px); }
.direct h2 { position: sticky; top: 0; z-index: 1; background: var(--ink); padding: 14px 0; margin-bottom: 28px; }
.direct__row { max-width: 40ch; }
.direct__row + .direct__row { margin-top: clamp(40px, 6vw, 72px); }
.direct__row h3 { margin-bottom: 10px; }
.direct__photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 24px; }
.direct ::selection { background: var(--accent-ink); color: var(--ink); }
.direct :focus-visible { outline-color: var(--accent-ink); }
@media (min-width: 900px) {
  .direct__photo { display: none; }
  .direct__row:nth-child(even) { margin-left: auto; }
}

/* Formulário */
.form { margin-top: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide, .total, .form__actions, .form__notice { grid-column: 1 / -1; }
.field label { font-size: var(--step-small); color: var(--muted); }
.field input, .field select {
  width: 100%; min-height: 52px; padding: 10px 14px;
  background: var(--surface); border: 2px solid var(--surface); border-radius: 0;
  color: var(--ink); color-scheme: dark;
  transition: border-color 200ms ease;
}
.field input:hover, .field select:hover { border-color: var(--muted); }
.field input:focus-visible, .field select:focus-visible { border-color: var(--ink); outline: 0; }
.field input[aria-invalid="true"] { border-color: var(--rosa); }
.total { background: var(--surface); padding: 20px 22px; }
.total__sum { font-size: var(--step-lead); font-variant-numeric: tabular-nums; }
.total__detail { color: var(--muted); margin-top: 6px; }
.total__detail:empty { display: none; }
.form__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.form__actions .btn { flex: 1 1 200px; }
.form__notice { background: var(--ink); color: var(--accent-ink); padding: 18px 22px; }

/* Carta */
.letter__sheet { max-width: 34em; }
.letter__sheet p + p { margin-top: 1em; }
.sign { font-style: italic; font-size: var(--step-lead); margin-top: 1.4em !important; }

/* Onde fica */
.map { margin-top: 36px; max-width: 600px; }
.map svg { width: 100%; font-family: inherit; }
.where__photo { margin-top: var(--gap); width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.near { margin-top: 32px; max-width: 600px; }
.near li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; font-size: var(--step-lead); }
.near li span:last-child { color: var(--muted); font-size: var(--step-body); white-space: nowrap; align-self: center; }
.near li > span:first-child { color: var(--ink); }
@media (min-width: 900px) { .where__photo { display: none; } }

/* Perguntas */
.basics { font-size: var(--step-lead); }
.basics li + li { margin-top: 6px; }
.qa { margin-top: 44px; max-width: 34em; }
.qa details + details { margin-top: 26px; }
.qa summary {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  min-height: 44px; cursor: pointer; list-style: none;
  font-size: var(--step-lead); transition: color 200ms ease;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform 300ms var(--ease-out);
}
.qa details[open] summary::after { transform: rotate(-135deg); }
.qa summary:hover { color: #fff3b8; }
.qa details p { color: var(--muted); padding: 8px 40px 0 0; }
.faq { padding-bottom: clamp(72px, 12vw, 150px); }
.faq__photo { margin-top: 48px; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
@media (min-width: 900px) { .faq__photo { display: none; } }

/* ---------- Fecho a toda a largura ---------- */
.closing { position: relative; background: var(--surface); }
.closing__img { width: 100%; height: 62svh; object-fit: cover; object-position: 30% 50%; }
.closing__text { padding: 40px calc(var(--gap) + 12px) 56px; }
.closing__text p { margin-top: 16px; max-width: 34ch; }
.closing__text p:last-child { margin-top: 28px; }
@media (min-width: 900px) {
  .closing { margin-top: var(--gap); }
  .closing__img { height: 90svh; filter: brightness(0.72); }
  .closing__text {
    position: absolute; right: 0; bottom: 12%; width: 42%;
    padding: 0 var(--pad) 0 0; color: var(--ink);
  }
}

/* ---------- Rodapé ---------- */
.foot { background: var(--bg); }
.foot__stripe { display: flex; height: 8px; }
.foot__stripe i { flex: 1; background: var(--c); }
.foot__grid { display: grid; gap: 24px; padding: 40px calc(var(--gap) + 12px) 48px; font-size: var(--step-small); }
.foot__grid p { max-width: 52ch; }
.foot__demo strong { font-weight: 600; }
.foot__credits { color: var(--muted); }
@media (min-width: 900px) {
  .foot__grid { grid-template-columns: 1fr 1.3fr 1.3fr; gap: 40px; }
}

/* ---------- Entradas ---------- */
html.js [data-reveal] > * { opacity: 0; transform: translateY(22px); transition: opacity 700ms ease, transform 900ms var(--ease-out); }
html.js [data-reveal].is-in > * { opacity: 1; transform: none; }
html.js [data-reveal].is-in > *:nth-child(2) { transition-delay: 80ms; }
html.js [data-reveal].is-in > *:nth-child(3) { transition-delay: 160ms; }
html.js [data-reveal].is-in > *:nth-child(4) { transition-delay: 240ms; }
html.js [data-reveal].is-in > *:nth-child(5) { transition-delay: 320ms; }
html.js [data-reveal].is-in > *:nth-child(n + 6) { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] > * { opacity: 1; transform: none; transition: none; }
  .stage__img { transition: none; }
  .stage__img.is-on { animation: none; }
  .shutter i, .swatch, .btn { transition: none; }
  .room.is-open .room__panel { animation: none; }
}

/* Tablet: a coluna é larga, a secção da reserva direta passa a duas colunas. */
@media (min-width: 600px) and (max-width: 899px) {
  .direct__rows { display: grid; grid-template-columns: 1fr 1fr; gap: 48px 40px; }
  .direct__row + .direct__row { margin-top: 0; }
  .direct__row { max-width: none; }
  .form, .near, .map { max-width: none; }
  .room__panel { max-width: none; display: none; }
  .room.is-open .room__panel { display: grid; grid-template-columns: 240px 1fr; column-gap: 28px; }
  .room.is-open .room__panel > .room__photo { grid-row: 1 / span 3; margin-bottom: 0; }
}
