/* ══════════════════════════════════════
   RESET & VARIÁVEIS
══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --parchment: #f2ead8;
  --ink:       #2c1f0e;
  --gold:      #a07830;
  --gold-lt:   #c9a45a;
  --rust:      #8b3a2a;
  --paper:     #faf5e6;
  --shadow:    rgba(0, 0, 0, 0.12);
  --cream:     #f5f0e8;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--parchment);
  font-family: 'EB Garamond', serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(180,140,80,.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(120,80,40,.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════
   NAVBAR
══════════════════════════════════════ */
nav {
  width: 100%;
  background: var(--parchment);
  padding: 0 clamp(20px, 5vw, 60px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(160,120,48,.25);
  box-shadow: 0 2px 20px rgba(44,31,14,.06);
}

.nav-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 9px 0 7px;
  border-bottom: 1px solid rgba(160,120,48,.13);
  font-style: italic;
  font-size: clamp(.65rem, 1.5vw, .77rem);
  letter-spacing: .16em;
  color: var(--gold);
  flex-wrap: wrap;
}
.nav-top span { opacity: .55; font-style: normal; }

.nav-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 0;
  gap: 16px;
}

.logo { display: flex; flex-direction: column; line-height: 1; flex-shrink: 0; }
.logo-main {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--ink);
}
.logo-sub {
  font-size: clamp(.55rem, 1.2vw, .67rem);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 4px;
}

/* hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(160,120,48,.3);
  color: var(--gold);
  font-size: 1.1rem;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 2px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  flex-wrap: wrap;
}
.nav-links li a {
  display: block;
  padding: 6px clamp(10px, 2vw, 20px);
  font-size: clamp(.68rem, 1.3vw, .8rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  transition: color .25s;
  white-space: nowrap;
}
.nav-links li a::after {
  content: '';
  position: absolute;
  left: clamp(10px, 2vw, 20px);
  right: clamp(10px, 2vw, 20px);
  bottom: -2px;
  height: 1px;
  background: var(--rust);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.nav-links li a:hover { color: var(--rust); }
.nav-links li a:hover::after { transform: scaleX(1); }
.nav-links li + li { border-left: 1px solid rgba(160,120,48,.2); }

.nav-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--gold-lt);
  font-style: italic;
  font-size: .75rem;
}
.nav-rule::before, .nav-rule::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160,120,48,.35), transparent);
}

/* ── Mobile nav ── */
@media (max-width: 700px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 8px 0 16px;
    gap: 0;
  }
  .nav-links.open { display: flex; }

  .nav-links li + li { border-left: none; border-top: 1px solid rgba(160,120,48,.12); }
  .nav-links li a { padding: 12px 4px; font-size: .8rem; }
  .nav-links li a::after { left: 4px; right: 4px; }

  .nav-top { font-size: .62rem; gap: 8px; }
  .nav-rule { display: none; }
}

/* ══════════════════════════════════════
   ENVELOPE SECTION
══════════════════════════════════════ */
.envelope-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 8vh, 80px) 24px clamp(60px, 10vh, 100px);
  min-height: 80vh;
}

/* hint text */
.hint {
  position:absolute;
  bottom: clamp(20px, 4vh, 48px);
  font-size: clamp(.75rem, 2vw, .85rem);
  letter-spacing: .18em;
  color: #b8a98a;
  font-weight: 300;
  font-style: italic;
  opacity: 1;
  transition: opacity 0.5s ease;
  font-family: 'Cormorant Garamond', serif;
}
.hint.hidden { opacity: 0; }

/* ── Scene container — scales with viewport ── */
.scene {
  position: relative;
  /* fluid width: max 420px, min 260px */
  width: min(420px, 88vw);
  /* height proportional to width via aspect-ratio */
  aspect-ratio: 420 / 520;
  cursor: pointer;
  z-index: 1;
}

/* ── Envelope fechado ── */
.envelope-closed {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.envelope-closed img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 32px var(--shadow));
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), filter 0.3s ease;
}
.scene:hover .envelope-closed img {
  transform: translateY(-4px) scale(1.02);
  filter: drop-shadow(0 20px 40px rgba(0,0,0,.18));
}

/* ── Envelope aberto + carta ── */
.envelope-open-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
}

.envelope-open-img {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 32px var(--shadow));
  transform: scale(0.88);
  opacity: 0;
  transition: none;
  z-index: 1;
}

/* carta sobe por cima do envelope */
.card-reveal {
  position: absolute;
  bottom: 28%;          /* posição final: acima da boca do envelope */
  left: 50%;
  transform: translateX(-50%) translateY(60%) scale(0.92);
  width: 68%;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  opacity: 0;
  transition: none;
  z-index: 2;
}
.card-reveal img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Estado: aberto ── */
.scene.opened .envelope-closed {
  opacity: 0;
  pointer-events: none;
}
.scene.opened .envelope-open-wrapper {
  opacity: 1;
  pointer-events: auto;
}
.scene.opened .envelope-open-img {
  animation: envAppear 0.55s cubic-bezier(.22,1,.36,1) 0.05s forwards;
}
.scene.opened .card-reveal {
  animation: cardRise 0.7s cubic-bezier(.22,1,.36,1) 0.45s forwards;
}

@keyframes envAppear {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

@keyframes cardRise {
  from { transform: translateX(-50%) translateY(60%)  scale(0.92); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0)    scale(1);    opacity: 1; }
}

/* ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  width: 10px; height: 10px;
  background: rgba(201,169,110,.35);
  transform: scale(0);
  animation: rippleOut 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}
@keyframes rippleOut { to { transform: scale(60); opacity: 0; } }

/* ══════════════════════════════════════
   TIMELINE SECTION
══════════════════════════════════════ */
.timeline-section {
  padding: clamp(48px, 8vh, 80px) clamp(16px, 4vw, 32px) clamp(60px, 10vh, 100px);
  position: relative;
  z-index: 1;
}

/* divider between sections */
.timeline-section::before {
  content: '';
  display: block;
  width: min(400px, 80%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160,120,48,.3), transparent);
  margin: 0 auto clamp(48px, 8vh, 80px);
}

.section-header {
  text-align: center;
  margin-bottom: clamp(40px, 7vh, 72px);
}
.eyebrow {
  font-size: clamp(.64rem, 1.5vw, .72rem);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.4rem, 4vw, 2.8rem);
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 14px;
}
.header-rule {
  width: 80px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-lt), transparent);
  margin: 0 auto;
}

/* ── Timeline spine ── */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold-lt) 8%, var(--gold-lt) 92%, transparent);
}

/* ── Event — desktop: alternating left/right ── */
.event {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  align-items: start;
  margin-bottom: clamp(32px, 5vh, 52px);
  cursor: pointer;
}

.event-node {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4px;
  position: relative;
  z-index: 2;
}
.seal {
  width: clamp(34px, 5vw, 42px);
  height: clamp(34px, 5vw, 42px);
  border-radius: 50%;
  background: var(--rust);
  border: 3px solid var(--parchment);
  box-shadow: 0 0 0 1px var(--rust), 0 4px 16px rgba(139,58,42,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(.8rem, 1.5vw, 1rem);
  flex-shrink: 0;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
}
.event:hover .seal {
  transform: scale(1.15);
  box-shadow: 0 0 0 1px var(--rust), 0 8px 24px rgba(139,58,42,.4);
}

.event-content {
  padding: clamp(16px, 3vw, 24px) clamp(16px, 3vw, 28px);
  background: var(--paper);
  border: 1px solid rgba(160,120,48,.15);
  box-shadow: 2px 4px 20px rgba(0,0,0,.07);
  position: relative;
  transition: transform .3s ease, box-shadow .3s ease;
}
.event:hover .event-content {
  transform: translateY(-3px);
  box-shadow: 4px 10px 32px rgba(0,0,0,.12);
}

/* arrow pointing to spine */
.event-content::after {
  content: '';
  position: absolute;
  top: 14px;
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* odd: content left */
.event:nth-child(odd) .event-content  { grid-column: 1; grid-row: 1; }
.event:nth-child(odd) .event-content::after { right: -8px; border-left: 8px solid var(--paper); }
.event:nth-child(odd) .event-node     { grid-column: 2; grid-row: 1; }

/* even: content right */
.event:nth-child(even) .event-content { grid-column: 3; grid-row: 1; }
.event:nth-child(even) .event-content::after { left: -8px; border-right: 8px solid var(--paper); }
.event:nth-child(even) .event-node    { grid-column: 2; grid-row: 1; }

.event-year {
  font-size: clamp(.6rem, 1.2vw, .68rem);
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.event-title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(.9rem, 2vw, 1.08rem);
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.3;
}
.event-body {
  font-size: clamp(.8rem, 1.5vw, .88rem);
  line-height: 1.7;
  color: #5a4030;
}

/* expandable */
.event-extra {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s ease, opacity .35s ease;
  opacity: 0;
}
.event.open .event-extra { max-height: 200px; opacity: 1; }
.event-extra p {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(160,120,48,.15);
  font-style: italic;
  font-size: clamp(.78rem, 1.4vw, .85rem);
  color: rgba(44,31,14,.55);
  line-height: 1.7;
}
.event-tap {
  margin-top: 10px;
  font-size: .65rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--rust);
  opacity: .6;
}
.event.open .event-tap { display: none; }

.section-note {
  text-align: center;
  margin-top: 20px;
  font-style: italic;
  font-size: clamp(.8rem, 1.5vw, .88rem);
  color: rgba(44,31,14,.4);
}

/* ══════════════════════════════════════
   TIMELINE MOBILE — coluna única
══════════════════════════════════════ */
@media (max-width: 600px) {
  /* spine moves to the left */
  .timeline::before {
    left: 20px;
    transform: none;
  }

  /* all events: single column, content always to the right of spine */
  .event {
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto;
    margin-bottom: 28px;
  }

  .event:nth-child(odd) .event-node,
  .event:nth-child(even) .event-node {
    grid-column: 1; grid-row: 1;
  }

  .event:nth-child(odd) .event-content,
  .event:nth-child(even) .event-content {
    grid-column: 2; grid-row: 1;
  }

  /* arrow always points left */
  .event:nth-child(odd) .event-content::after,
  .event:nth-child(even) .event-content::after {
    left: -8px; right: auto;
    border-right: 8px solid var(--paper);
    border-left: none;
  }
}


.btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Espaçamento entre o ícone e o texto */
    background-color: #f8efd5;
    color: #333;
    text-decoration: none;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    transition: background-color 0.3s, box-shadow 0.3s;
}

/* Efeito ao passar o mouse */
.btn-link:hover {
    background-color:  #f2ead8;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.icone {
    width: 24px;
    height: 24px;
    width: 30px;
    height: 30px;
    object-fit: cover; /* Garante que a imagem não fique distorcida */
    border-radius: 50%;
}