/* =====================
   CSS VARIABLES & RESET
   ===================== */
:root {
  --bg: #f5f4f0;
  --fg: #1a1a1a;
  --fg-soft: #555;
  --fg-xsoft: #999;
  --accent: #1a1a1a;
  --white: #ffffff;
  --paper: #faf9f6;
  --border: rgba(0,0,0,0.1);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

/* =====================
   INTRO SCREEN
   ===================== */
#intro {
  position: fixed;
  inset: 0;
  background: #0d0d0d;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease, visibility 1s ease;
}

#intro.fade-out {
  opacity: 0;
  visibility: hidden;
}

.intro-content {
  text-align: center;
}

.intro-names {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 4.5rem);
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.08em;
  opacity: 0;
  animation: fadeInUp 1.2s ease 0.5s forwards;
}

.intro-names span {
  font-style: italic;
  color: #aaa;
  margin: 0 0.3em;
}

.intro-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 2.5vw, 0.85rem);
  color: #666;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 1rem;
  opacity: 0;
  animation: fadeInUp 1s ease 1.5s forwards;
}

/* =====================
   MAIN (hidden initially)
   ===================== */
#main {
  opacity: 0;
  transition: opacity 1s ease;
}

#main.visible {
  opacity: 1;
}

#main.hidden {
  pointer-events: none;
}

/* =====================
   HERO SECTION
   ===================== */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.hero-inner {
  max-width: 700px;
  width: 100%;
}

.typing-phrase {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  font-style: italic;
  font-weight: 300;
  color: var(--fg);
  min-height: 3.5rem;
  margin-bottom: 3rem;
  line-height: 1.4;
}

.typing-phrase::after {
  content: '|';
  animation: blink 0.8s step-end infinite;
  margin-left: 2px;
}

.typing-phrase.done::after {
  display: none;
}

.counter-label {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 2vw, 0.78rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg-xsoft);
  margin-bottom: 1.2rem;
}

.counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.counter-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.counter-item span {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
}

.counter-item small {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-xsoft);
  margin-top: 0.4rem;
}

.counter-sep {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--fg-xsoft);
  margin-bottom: 1.2rem;
  align-self: flex-start;
  margin-top: 0.4rem;
}

/* =====================
   GALLERY SECTION
   ===================== */
.gallery-section {
  padding: clamp(3rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem);
  text-align: center;
}

.section-label {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3.5vw, 1.6rem);
  font-style: italic;
  color: var(--fg-soft);
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
  font-weight: 300;
}

.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  max-width: 900px;
  margin: 0 auto;
}

.polaroid {
  background: var(--white);
  padding: 10px 10px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1), 0 1px 4px rgba(0,0,0,0.06);
  transform: rotate(var(--rot, -2deg));
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.polaroid:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  z-index: 10;
  position: relative;
}

.polaroid-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #e8e6e0;
}

/* placeholder when no real image */
.polaroid-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #e8e6e0 0%, #d4d1c8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.polaroid-caption {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--fg-xsoft);
  text-align: center;
  margin-top: 0.6rem;
  text-transform: uppercase;
}

.section-after {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-style: italic;
  color: var(--fg-soft);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.8;
}

/* =====================
   VIDEO SECTION
   ===================== */
.video-section {
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 3rem);
  text-align: center;
}

.video-label {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-style: italic;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.video-sublabel {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 2vw, 0.78rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-xsoft);
  margin-bottom: 2rem;
}

.video-wrapper {
  max-width: 700px;
  margin: 0 auto;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}

.video-wrapper video {
  width: 100%;
  display: block;
  background: #111;
}

/* =====================
   CONTRACT SECTION
   ===================== */
.contract-section {
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 3rem);
  text-align: center;
  padding-bottom: clamp(5rem, 12vw, 8rem);
}

.contract-hint {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-style: italic;
  color: var(--fg-xsoft);
  margin-bottom: 1.5rem;
}

.contract-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2rem;
  border: 1px solid var(--fg);
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background 0.3s ease, color 0.3s ease;
}

.contract-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.contract-arrow {
  transition: transform 0.3s ease;
}

.contract-btn:hover .contract-arrow {
  transform: translateX(4px);
}

/* =====================
   REVEAL ANIMATION
   ===================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================
   CONTRATO PAGE
   ===================== */
.contrato-page {
  background: var(--bg);
  min-height: 100svh;
}

.contrato-main {
  padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.contrato-doc {
  background: var(--paper);
  max-width: 720px;
  width: 100%;
  padding: clamp(2rem, 6vw, 4rem);
  box-shadow: 0 8px 60px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  border-top: 3px solid var(--fg);
}

.contrato-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-xsoft);
  margin-bottom: 1.2rem;
}

.contrato-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: 1.5rem;
}

.contrato-divider {
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

.contrato-clause-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg-xsoft);
  margin-top: 2rem;
  margin-bottom: 0.7rem;
}

.contrato-text {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--fg-soft);
  line-height: 1.8;
}

.contrato-list {
  list-style: none;
  margin: 0.8rem 0;
  padding: 0;
}

.contrato-list li {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--fg-soft);
  line-height: 1.8;
  padding-left: 1.2rem;
  position: relative;
}

.contrato-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--fg-xsoft);
}

.contrato-assinar {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-xsoft);
  text-align: center;
  margin-bottom: 2rem;
  margin-top: 1rem;
}

.contrato-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* ACEITO button */
.btn-aceito {
  background: var(--fg);
  color: var(--white);
  border: none;
  padding: 1.2rem 3rem;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3vw, 1.3rem);
  letter-spacing: 0.2em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.2s ease, transform 0.2s ease;
  min-width: 220px;
}

.btn-aceito:hover {
  background: #333;
  transform: scale(1.03);
}

.btn-sub {
  font-size: clamp(0.55rem, 1.5vw, 0.68rem);
  letter-spacing: 0.15em;
  color: #aaa;
  font-weight: 300;
}

/* pulse state */
.btn-aceito.pulse {
  animation: pulse-aceito 0.6s ease infinite alternate;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  background: #1a1a1a;
}

/* NAO button */
.btn-nao {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-soft);
  padding: 0.7rem 1.8rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  position: relative;
}

.btn-nao:hover {
  border-color: #ccc;
  color: var(--fg-xsoft);
}

/* =====================
   THANKS OVERLAY
   ===================== */
#thanksOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

#thanksOverlay.hidden {
  display: none;
}

.thanks-box {
  background: var(--paper);
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
  max-width: 420px;
  width: 100%;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.thanks-emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.thanks-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 300;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.thanks-sub {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-style: italic;
  color: var(--fg-soft);
  margin-bottom: 1rem;
}

.thanks-hearts {
  font-size: 1.5rem;
  letter-spacing: 0.3rem;
}

/* CONFETTI CANVAS */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
}

/* =====================
   KEYFRAMES
   ===================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse-aceito {
  from { transform: scale(1); box-shadow: 0 0 0 0 rgba(26,26,26,0.3); }
  to   { transform: scale(1.06); box-shadow: 0 0 0 16px rgba(26,26,26,0); }
}

/* =====================
   RESPONSIVE TWEAKS
   ===================== */
@media (max-width: 480px) {
  .counter {
    gap: 0.3rem;
  }
  .counter-sep {
    font-size: 1.4rem;
  }
  .polaroid-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contrato-doc {
    border-radius: 0;
  }
  .btn-aceito {
    width: 100%;
  }
}