/* Mobile first (~375px), depois scale com min-width */

:root {
  --bg: #0d0d0d;
  --bg-card: #1a1a1a;
  --text: #f0f0f0;
  --text-muted: #a0a0a0;
  --accent: #c9a227;
  --radius: 16px;
  --radius-sm: 12px;
  --tap-min: 44px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --max-line: 65ch;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

body.home-page {
  overflow: hidden;
  overflow-x: hidden;
  height: 100vh;
  height: 100dvh;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.home-page #app {
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

/* Header: título centralizado, voltar à esquerda */
.header {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--tap-min);
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.back-btn {
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0 0.5rem;
  font-size: 1rem;
  color: var(--accent);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  justify-self: start;
}

.back-btn:hover,
.back-btn:focus-visible {
  background: rgba(201, 162, 39, 0.15);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.back-btn[hidden] {
  visibility: hidden;
  pointer-events: none;
}

.title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  grid-column: 2;
}

/* Hamburger: menu de navegação */
.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0.5rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  justify-self: end;
  grid-column: 3;
}

.menu-btn:hover,
.menu-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.menu-btn-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* Overlay do menu */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.nav-overlay.nav-overlay-open {
  opacity: 1;
  visibility: visible;
}

.nav-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  min-width: 260px;
  max-width: 90vw;
}

.nav-link {
  display: block;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: #222;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-link-locked {
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.nav-link-locked:hover,
.nav-link-locked:focus-visible {
  color: var(--text);
  background: #222;
}

.icon-lock {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M18 11h-1V7c0-2.8-2.2-5-5-5S7 4.2 7 7v4H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm-6 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3-6H9V7c0-1.7 1.3-3 3-3s3 1.3 3 3v4z'/%3E%3C/svg%3E") no-repeat center;
  mask-size: contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M18 11h-1V7c0-2.8-2.2-5-5-5S7 4.2 7 7v4H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm-6 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3-6H9V7c0-1.7 1.3-3 3-3s3 1.3 3 3v4z'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask-size: contain;
  flex-shrink: 0;
}

/* Modal Contrato */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  cursor: pointer;
}

.modal-box {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.75rem;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  color: var(--text);
}

.modal-text {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.modal-close {
  width: 100%;
  min-height: var(--tap-min);
  padding: 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.modal-close:hover,
.modal-close:focus-visible {
  filter: brightness(1.1);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Main */
.main {
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 2;
  padding: 1rem;
  padding-bottom: 2rem;
}

.main:has(.view-home) {
  padding: 0.5rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: hidden;
}

.view {
  max-width: 600px;
  margin: 0 auto;
}

.view[hidden] {
  display: none !important;
}

/* Home: tudo dentro da viewport, sem scroll */
.view-home {
  position: relative;
  max-width: none;
  width: 100%;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.home-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  gap: 10px;
  background: var(--bg);
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .home-bg {
    gap: 6px;
  }
}

.home-bg-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 480px) {
  .home-bg-col {
    gap: 6px;
  }
}

.home-bg-col.col-up {
  animation: colMoveUp 60s linear infinite;
}

.home-bg-col.col-down {
  animation: colMoveDown 60s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .home-bg-col.col-up,
  .home-bg-col.col-down {
    animation: none;
  }
}

@keyframes colMoveUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@keyframes colMoveDown {
  0% { transform: translateY(-50%); }
  100% { transform: translateY(0); }
}

.home-bg-photo {
  width: 100%;
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
}

@media (max-width: 480px) {
  .home-bg-photo {
    border-radius: 4px;
  }
}

.home-bg-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: var(--bg);
  opacity: 0.82;
  pointer-events: none;
}

/* Mobile: carrossel com safe area para não ficar em cima do gesto/notch */
@media (max-width: 480px) {
  .home-carousel-wrap {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }
}

/* Carrossel embaixo: responsivo, arrastar para trocar; pontos fixos no rodapé */
.home-carousel-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100vw;
  flex-shrink: 0;
  padding: 0.5rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  box-sizing: border-box;
}

.home-carousel-track {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
  scroll-padding-inline: 1rem;
  scrollbar-width: none;
  box-sizing: border-box;
}

.home-carousel-track::-webkit-scrollbar {
  display: none;
}

.home-carousel-slide {
  flex: 0 0 260px;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  min-height: 100px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  box-sizing: border-box;
}

.home-carousel-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.25rem 0 0;
  margin-top: 0;
}

.home-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: background 0.2s;
}

.home-carousel-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

/* Cards do carrossel: mesmo tamanho sempre */
.card-carousel {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}

.card-carousel .card-title {
  font-size: 1rem;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.card-carousel .card-sub {
  font-size: 0.8rem;
  line-height: 1.4;
}

.card-carousel.card-locked {
  color: var(--text-muted);
  border-style: dashed;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

.card-carousel.card-locked:hover,
.card-carousel.card-locked:focus-visible {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(201, 162, 39, 0.08);
}

.card-locked .card-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-locked .icon-lock {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .card-carousel {
    padding: 1.1rem 1.25rem;
  }
  .card-carousel .card-title {
    font-size: 1.05rem;
  }
}

.card {
  display: block;
  min-height: var(--tap-min);
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
  color: inherit;
  text-decoration: none;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, border-color 0.2s;
}

.card:hover,
.card:focus-visible {
  background: #222;
  border-color: rgba(201, 162, 39, 0.3);
}

.card-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.card-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Lightbox (compartilhado) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.95);
  padding: 1rem;
  overflow: auto;
}

.lightbox-close {
  align-self: flex-end;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-counter {
  align-self: center;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

.lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  position: relative;
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  margin-top: -28px;
  width: 56px;
  height: 56px;
  padding: 0;
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  color: var(--text);
  background: rgba(26, 26, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}


.lightbox-prev:hover,
.lightbox-prev:focus-visible,
.lightbox-next:hover,
.lightbox-next:focus-visible {
  background: rgba(201, 162, 39, 0.25);
  border-color: rgba(201, 162, 39, 0.5);
  color: var(--accent);
  outline: none;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-img {
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  object-fit: contain;
}

.lightbox-caption {
  margin-top: 1rem;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: var(--max-line);
  margin-left: auto;
  margin-right: auto;
}

/* Carta */
.carta-body {
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: pre-line;
  max-width: var(--max-line);
  margin: 0 auto;
}

.carta-body p {
  margin: 0 0 1rem 0;
}

/* Timeline */
.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-title {
  margin: 0 0 0.75rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
}

.timeline-text {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.timeline-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.timeline-photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

/* Storytelling */
.story-block {
  margin-bottom: 2.5rem;
}

.story-block img {
  width: 100%;
  border-radius: var(--radius);
  margin: 1rem 0;
  display: block;
}

.story-block .highlight {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--accent);
  margin: 1rem 0;
  padding-left: 0.5rem;
  border-left: 3px solid var(--accent);
}

/* Frases (slides) */
.frases-container {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.frase-slide {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.frase-slide.active {
  display: flex;
}

.frase-slide img {
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.frase-slide .text {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.5;
}

.frase-nav {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.frase-nav button {
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0 1rem;
  font-size: 1rem;
  color: var(--accent);
  background: var(--bg-card);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.frase-nav button:hover,
.frase-nav button:focus-visible {
  background: rgba(201, 162, 39, 0.15);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.frase-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Galeria grid responsivo */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.galeria-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.galeria-caption {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (min-width: 600px) {
  .galeria-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet+ */
@media (min-width: 600px) {
  .main {
    padding: 1.5rem 2rem;
  }
  .view-home {
    gap: 1rem;
  }
  .card {
    padding: 1.25rem 1.5rem;
  }
  .card-title {
    font-size: 1.2rem;
  }
}
