:root {
  --night-deep: #150f1f;
  --night: #1e1630;
  --night-soft: #2a1f42;
  --gold: #d9a860;
  --gold-soft: #e8c88f;
  --rose: #c9847a;
  --cream: #f3ead9;
  --cream-dim: #cbbfae;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--night-deep);
  color: var(--cream);
  font-family: 'Cormorant Garamond', serif;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#hearts {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  transition: opacity 1.8s ease;
}

#hearts.boost {
  opacity: 0.9;
}

section {
  position: relative;
  z-index: 1;
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: radial-gradient(ellipse at 50% 20%, rgba(217, 168, 96, 0.12), transparent 60%);
}

.hero-inner { max-width: 900px; }

.eyebrow {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--gold-soft);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 1.2s ease 0.2s forwards;
}

.title {
  font-family: 'Italiana', serif;
  font-weight: 400;
  line-height: 0.95;
  font-size: clamp(3.5rem, 12vw, 8.5rem);
  text-transform: lowercase;
}

.title .line {
  display: block;
  opacity: 0;
  animation: fadeUp 1.4s ease forwards;
}

.title .line:nth-child(1) { animation-delay: 0.5s; }
.title .line.accent {
  color: var(--gold);
  animation-delay: 0.9s;
  font-style: italic;
}

.subtitle {
  margin-top: 2rem;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--cream-dim);
  font-style: italic;
  opacity: 0;
  animation: fadeUp 1.4s ease 1.4s forwards;
}

.scroll-hint {
  margin-top: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  animation: fadeUp 1.4s ease 1.9s forwards;
}

.scroll-hint span {
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--gold), transparent);
  animation: scrollLine 2.2s ease-in-out infinite;
}

.scroll-hint p {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

@keyframes scrollLine {
  0%, 100% { transform: scaleY(1); opacity: 0.4; }
  50% { transform: scaleY(1.4); opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- COUNTER ---------- */
.counter-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, var(--night-deep), var(--night) 40%, var(--night-deep));
  overflow: hidden;
}

.counter-section::before,
.counter-section::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.counter-section::before {
  width: 420px;
  height: 420px;
  top: 10%;
  left: 8%;
  background: radial-gradient(circle, rgba(126, 224, 214, 0.14), transparent 70%);
  animation: driftGlow 14s ease-in-out infinite;
}

.counter-section::after {
  width: 460px;
  height: 460px;
  bottom: 5%;
  right: 6%;
  background: radial-gradient(circle, rgba(217, 168, 96, 0.14), transparent 70%);
  animation: driftGlow 16s ease-in-out infinite reverse;
}

@keyframes driftGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.15); }
}

.counter-ornament {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
  z-index: 1;
}

.counter-ornament span {
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.counter-ornament span:last-child {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.counter-ornament .gem {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background: var(--gold);
  box-shadow: 0 0 12px 2px rgba(217, 168, 96, 0.6);
}

.counter-label {
  font-family: 'Italiana', serif;
  text-transform: lowercase;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--gold-soft);
  margin-bottom: 3.5rem;
  letter-spacing: 0.03em;
  z-index: 1;
  position: relative;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.7rem, 2vw, 1.6rem);
  max-width: 1150px;
  width: 100%;
  z-index: 1;
  position: relative;
}

.counter-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.1rem, 2.5vw, 1.9rem) 0.4rem;
  position: relative;
  border-radius: 10px;
  border: 1px solid rgba(217, 168, 96, 0.22);
  background: linear-gradient(180deg, rgba(243, 234, 217, 0.045), rgba(243, 234, 217, 0.015));
  backdrop-filter: blur(3px);
  overflow: hidden;
  transition: border-color 0.4s ease, transform 0.4s ease;
}

.counter-unit::before {
  content: '';
  position: absolute;
  inset: 50%;
  width: 220%;
  height: 220%;
  margin-left: -110%;
  margin-top: -110%;
  border-radius: 50%;
  background: conic-gradient(transparent 0%, rgba(126, 224, 214, 0.55) 5%, transparent 14%, transparent 50%, rgba(217, 168, 96, 0.55) 59%, transparent 68%, transparent 100%);
  animation: ringSpin 7s linear infinite;
  opacity: 0.55;
  pointer-events: none;
  mix-blend-mode: screen;
}

.counter-unit {
  --mask-inset: 1px;
}

.counter-unit::before {
  -webkit-mask: radial-gradient(closest-side, transparent calc(50% - 24px), #fff calc(50% - 22px), #fff calc(50% - 20px), transparent calc(50% - 18px));
  mask: radial-gradient(closest-side, transparent calc(50% - 24px), #fff calc(50% - 22px), #fff calc(50% - 20px), transparent calc(50% - 18px));
}

@keyframes ringSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.counter-unit:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 168, 96, 0.4);
}

.num {
  font-family: 'Italiana', serif;
  font-size: clamp(1.7rem, 5vw, 3.4rem);
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  display: inline-block;
  text-shadow: 0 0 16px rgba(126, 224, 214, 0.18);
}

.num.tick {
  animation: numTick 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes numTick {
  0% { transform: translateY(-40%); opacity: 0.2; filter: blur(3px); }
  60% { transform: translateY(6%); opacity: 1; filter: blur(0); }
  100% { transform: translateY(0); }
}

.counter-unit.seconds .num {
  color: var(--gold);
  text-shadow: 0 0 22px rgba(217, 168, 96, 0.65);
}

.counter-unit.seconds {
  border-color: rgba(217, 168, 96, 0.4);
}

.unit {
  margin-top: 0.6rem;
  font-size: clamp(0.6rem, 1.4vw, 0.85rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.counter-footnote {
  margin-top: 3.2rem;
  font-style: italic;
  color: var(--cream-dim);
  font-size: 1.05rem;
  z-index: 1;
  position: relative;
}

@media (max-width: 720px) {
  .counter-grid { grid-template-columns: repeat(3, 1fr); }
  .counter-unit.seconds { grid-column: span 3; }
}

/* ---------- STORY / ÁLBUM ---------- */
.story {
  padding: 7rem 1.5rem 8rem;
  background: var(--night);
  overflow: hidden;
}

.story-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 6rem;
}

.section-eyebrow {
  font-style: italic;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--rose);
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Italiana', serif;
  text-transform: lowercase;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  margin-bottom: 1.4rem;
}

.story-lead {
  font-size: 1.15rem;
  color: var(--cream-dim);
  font-style: italic;
  line-height: 1.6;
}

.story-list {
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 10vw, 8rem);
  max-width: 1100px;
  margin: 0 auto;
}

.story-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1s cubic-bezier(0.2, 0.7, 0.3, 1), transform 1s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.story-item.in-view {
  opacity: 1;
  transform: translateY(0);
}

.story-item.reverse {
  direction: rtl;
}
.story-item.reverse > * { direction: ltr; }

.story-photo {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.7);
  border: 1px solid rgba(217, 168, 96, 0.25);
  transform: scale(0.92) rotate(var(--tilt, -1.5deg));
  transition: transform 0.6s ease;
  clip-path: polygon(0% 0%, 0% 0%, 4% 8%, 0% 15%, 3% 30%, 0% 50%, 4% 68%, 0% 85%, 2% 100%, 0% 100%);
  transition: clip-path 1.1s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s ease;
}

.story-item.in-view .story-photo {
  transform: scale(1) rotate(var(--tilt, -1.5deg));
  clip-path: polygon(0% 0%, 100% 0%, 96% 8%, 100% 15%, 97% 30%, 100% 50%, 96% 68%, 100% 85%, 98% 100%, 0% 100%);
}

.story-photo:hover {
  transform: scale(1.03) rotate(0deg) !important;
}

.story-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92) contrast(1.02);
  transition: filter 0.4s ease;
}

.story-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(21, 15, 31, 0.55));
  pointer-events: none;
}

/* hextech energy sweep — revela como uma runa se acendendo */
.story-photo::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -60%;
  width: 45%;
  height: 140%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(126, 224, 214, 0.05) 30%,
    rgba(217, 168, 96, 0.75) 48%,
    rgba(126, 224, 214, 0.55) 56%,
    transparent 100%
  );
  transform: translateX(0) rotate(8deg);
  opacity: 0;
  mix-blend-mode: screen;
}

.story-item.in-view .story-photo::before {
  animation: hextechSweep 1.3s cubic-bezier(0.22, 1, 0.36, 1) 0.05s 1;
}

@keyframes hextechSweep {
  0% { transform: translateX(0) rotate(8deg); opacity: 0; }
  12% { opacity: 1; }
  70% { opacity: 0.9; }
  100% { transform: translateX(340%) rotate(8deg); opacity: 0; }
}

.story-photo {
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.7), 0 0 0 rgba(126, 224, 214, 0);
}

.story-item.in-view .story-photo {
  animation: hextechRim 1.4s ease 0.1s 1;
}

@keyframes hextechRim {
  0% { box-shadow: 0 40px 90px -30px rgba(0,0,0,0.7), 0 0 0 rgba(126, 224, 214, 0); }
  45% { box-shadow: 0 40px 90px -30px rgba(0,0,0,0.7), 0 0 34px 3px rgba(126, 224, 214, 0.45), 0 0 60px 6px rgba(217, 168, 96, 0.25); }
  100% { box-shadow: 0 40px 90px -30px rgba(0,0,0,0.7), 0 0 0 rgba(126, 224, 214, 0); }
}

.story-number {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  font-family: 'Italiana', serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--cream);
  background: rgba(21, 15, 31, 0.55);
  border: 1px solid rgba(217, 168, 96, 0.4);
  padding: 0.35rem 0.7rem;
  border-radius: 30px;
  backdrop-filter: blur(4px);
}

.story-text {
  text-align: left;
  padding: 0 0.5rem;
}

.story-tag {
  font-style: italic;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--gold-soft);
  margin-bottom: 1rem;
  display: block;
}

.story-caption {
  font-family: 'Italiana', serif;
  text-transform: lowercase;
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  line-height: 1.25;
  color: var(--cream);
}

.story-caption .highlight {
  color: var(--rose);
  font-style: italic;
}

@media (max-width: 780px) {
  .story-item,
  .story-item.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    text-align: left;
  }
  .story-photo {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }
  .story-text { padding: 0; text-align: center; }
}

/* ---------- CLOSING ---------- */
.closing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, rgba(201, 132, 122, 0.12), transparent 65%), var(--night-deep);
}

.closing-frame {
  max-width: 680px;
  position: relative;
  z-index: 2;
}

.closing-glyph {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  font-size: min(60vw, 620px);
  line-height: 1;
  color: var(--rose);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  filter: blur(2px);
  animation: glyphIdle 6s ease-in-out infinite;
}

.closing.in-view .closing-glyph {
  animation: glyphBloom 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards, glyphIdle 6s ease-in-out 2.4s infinite;
}

@keyframes glyphBloom {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); filter: blur(10px); }
  55% { opacity: 0.16; filter: blur(1px); }
  100% { opacity: 0.09; transform: translate(-50%, -50%) scale(1); filter: blur(2px); }
}

@keyframes glyphIdle {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.06); }
}

.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.closing.in-view .reveal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.closing.in-view .closing-eyebrow.reveal { transition-delay: 0.05s; }
.closing.in-view .closing-title.reveal { transition-delay: 0.18s; }
.closing.in-view .closing-text.reveal { transition-delay: 0.36s; }
.closing.in-view .closing-wish.reveal { transition-delay: 0.5s; }
.closing.in-view .closing-signature.reveal { transition-delay: 0.66s; }
.closing.in-view .closing-hearts.reveal { transition-delay: 0.8s; }

.closing-eyebrow {
  font-style: italic;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--gold-soft);
  margin-bottom: 1.2rem;
}

.closing-title {
  font-family: 'Italiana', serif;
  text-transform: lowercase;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 1.2;
  color: var(--cream);
  margin-bottom: 1.8rem;
}

.closing.in-view .closing-title {
  animation: titleGlow 3.4s ease 1.1s 1;
}

@keyframes titleGlow {
  0%, 100% { text-shadow: none; }
  30% { text-shadow: 0 0 26px rgba(217, 168, 96, 0.55), 0 0 46px rgba(201, 132, 122, 0.35); }
}

.closing-text {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--cream-dim);
  line-height: 1.7;
  margin-bottom: 2.2rem;
}

.closing-wish span {
  color: var(--gold);
  font-style: italic;
  font-weight: 600;
  text-shadow: 0 0 22px rgba(217, 168, 96, 0.5);
}

.closing-signature {
  font-family: 'Italiana', serif;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--rose);
  margin-bottom: 2rem;
}

.closing-hearts {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  font-size: 1.4rem;
}

.closing-hearts span {
  color: var(--rose);
  display: inline-block;
  animation: heartbeat 2.2s ease-in-out infinite;
  opacity: 0.85;
}

.closing-hearts span:nth-child(2) { animation-delay: 0.3s; }
.closing-hearts span:nth-child(3) { animation-delay: 0.6s; }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
}
