:root {
  --wine-950: #15040a;
  --wine-900: #260813;
  --wine-800: #3d0d1f;
  --wine-700: #651730;
  --marsala: #8e3349;
  --rose: #d995a7;
  --cream: #fff2e3;
  --blush: #fff8f6;
  --gold: #d7b46a;
  --gold-soft: #f2dca6;
  --ink: #fff8f6;
  --muted: rgba(255, 242, 227, 0.72);
  --glass: rgba(61, 13, 31, 0.46);
  --glass-strong: rgba(91, 23, 43, 0.66);
  --line: rgba(242, 220, 166, 0.52);
  --shadow: 0 28px 80px rgba(10, 0, 5, 0.34);
  --radius: 8px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at top left, #5b1730 0, transparent 32rem),
    linear-gradient(145deg, var(--wine-950), #210812 46%, #09030a);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#space-canvas {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

.ambient-glow {
  position: fixed;
  z-index: -2;
  width: 38vw;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(22px);
  opacity: 0.22;
}

.ambient-glow-one {
  top: 8vh;
  right: 5vw;
  background: radial-gradient(circle, var(--gold-soft), transparent 68%);
}

.ambient-glow-two {
  bottom: 4vh;
  left: 4vw;
  background: radial-gradient(circle, var(--rose), transparent 66%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  backdrop-filter: blur(18px);
}

.brand,
.header-actions,
.hero-actions,
.form-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 700;
}

.brand-mark {
  width: 16px;
  aspect-ratio: 1;
  border: 1px solid var(--gold-soft);
  border-radius: 50%;
  box-shadow: 0 0 26px var(--gold), inset 0 0 10px rgba(255, 255, 255, 0.35);
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 42px;
  border: 1px solid rgba(255, 242, 227, 0.2);
  border-radius: var(--radius);
  padding: 0 1rem;
  color: var(--ink);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease,
    box-shadow 180ms ease;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-button {
  background: linear-gradient(135deg, var(--marsala), var(--wine-700) 56%, #b38238);
  box-shadow: 0 14px 34px rgba(101, 23, 48, 0.34);
  font-weight: 700;
}

.ghost-button {
  background: rgba(255, 248, 246, 0.08);
  backdrop-filter: blur(14px);
}

.danger-button {
  background: rgba(142, 51, 73, 0.18);
  border-color: rgba(217, 149, 167, 0.35);
}

.icon-button {
  width: 42px;
  padding: 0;
  background: rgba(255, 248, 246, 0.08);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.icon-button:hover {
  transform: translateY(-2px);
  border-color: rgba(242, 220, 166, 0.72);
  box-shadow: 0 16px 42px rgba(10, 0, 5, 0.28);
}

.large {
  min-height: 50px;
  padding: 0 1.25rem;
}

.small {
  min-height: 36px;
  padding: 0 0.8rem;
  font-size: 0.9rem;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-section {
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
  padding: 48px 0 92px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
.memory-counter strong {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.94;
}

h1 {
  max-width: 820px;
  font-size: clamp(3.1rem, 8vw, 7.4rem);
}

h2 {
  font-size: clamp(2.25rem, 5vw, 4.4rem);
}

h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  line-height: 1;
}

.hero-subtitle {
  max-width: 640px;
  margin: 1.35rem 0 1.8rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.22rem);
}

.memory-counter {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 260px);
  aspect-ratio: 1;
  justify-self: end;
  border: 1px solid rgba(242, 220, 166, 0.36);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 246, 0.12), rgba(61, 13, 31, 0.2));
  box-shadow: inset 0 0 52px rgba(242, 220, 166, 0.12), var(--shadow);
  text-align: center;
}

.memory-counter::before,
.memory-counter::after,
.empty-orbit {
  content: "";
  position: absolute;
  border: 1px solid rgba(242, 220, 166, 0.24);
  border-radius: 50%;
}

.memory-counter::before {
  inset: -18px;
  transform: rotate(-16deg) scaleY(0.72);
}

.memory-counter::after {
  inset: 28px;
  border-color: rgba(217, 149, 167, 0.3);
}

.counter-label,
.counter-caption {
  color: var(--muted);
  font-size: 0.86rem;
}

.memory-counter strong {
  display: block;
  color: var(--gold-soft);
  font-size: 5.4rem;
}

.section-heading {
  margin-bottom: 2rem;
}

.timeline-section,
.album-section,
.album-only-section,
.retrospective-section {
  padding: 42px 0 96px;
}

.empty-state {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  padding: clamp(2rem, 6vw, 5rem);
  border: 1px solid rgba(242, 220, 166, 0.22);
  border-radius: var(--radius);
  background: rgba(21, 4, 10, 0.42);
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}

.empty-state p {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.empty-orbit {
  inset: auto;
  width: 168px;
  aspect-ratio: 1;
  opacity: 0.3;
}

.timeline {
  position: relative;
  display: grid;
  gap: 3.2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 50%;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(180deg, transparent, var(--line), var(--rose), var(--line), transparent);
  box-shadow: 0 0 24px rgba(242, 220, 166, 0.46);
  transform: translateX(-50%);
  animation: pulseLine 4.5s ease-in-out infinite;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr);
  align-items: center;
  gap: 0;
}

.timeline-item:nth-child(even) .timeline-media {
  grid-column: 3;
}

.timeline-item:nth-child(even) .memory-card {
  grid-column: 1;
  grid-row: 1;
}

.timeline-media,
.memory-card,
.retro-metrics article,
.modal-panel {
  border: 1px solid rgba(255, 242, 227, 0.17);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 248, 246, 0.1), rgba(61, 13, 31, 0.48));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.timeline-media {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.timeline-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 500ms ease;
}

.timeline-media:hover img {
  transform: scale(1.075);
}

.timeline-dot {
  grid-column: 2;
  justify-self: center;
  width: 22px;
  aspect-ratio: 1;
  border: 3px solid var(--cream);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 8px rgba(101, 23, 48, 0.44), 0 0 32px rgba(242, 220, 166, 0.9);
  z-index: 1;
}

.memory-card {
  padding: clamp(1.2rem, 2.4vw, 2rem);
}

.album-section {
  scroll-margin-top: 110px;
}

.album-page {
  min-height: calc(100vh - 84px);
}

.album-hero {
  max-width: 820px;
  padding: clamp(3.5rem, 8vw, 7rem) 0 2rem;
}

.album-hero h1 {
  max-width: 820px;
  font-size: clamp(3rem, 7vw, 6.5rem);
}

.album-only-section {
  position: relative;
  padding-top: 1rem;
}

.album-empty {
  display: grid;
  gap: 0.65rem;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border: 1px solid rgba(242, 220, 166, 0.2);
  border-radius: var(--radius);
  background: rgba(21, 4, 10, 0.36);
  color: var(--muted);
  text-align: center;
}

.album-empty h3,
.album-empty p {
  margin: 0;
}

.memory-card time {
  display: inline-flex;
  margin-bottom: 0.7rem;
  color: var(--gold-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.memory-text {
  margin: 0.9rem 0 1rem;
  color: var(--muted);
}

blockquote {
  margin: 0 0 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--gold);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.1;
}

blockquote:empty {
  display: none;
}

.retro-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.retro-metrics article {
  min-height: 128px;
  padding: 1.1rem;
}

.retro-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.retro-metrics strong {
  display: block;
  margin-top: 0.65rem;
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1;
}

.retro-gallery-shell {
  overflow: hidden;
  border: 1px solid rgba(242, 220, 166, 0.2);
  border-radius: var(--radius);
  background: rgba(21, 4, 10, 0.36);
}

.retro-gallery {
  display: flex;
  gap: 1rem;
  min-height: 220px;
  padding: 1rem;
  animation: galleryDrift 28s linear infinite;
}

.retro-gallery:empty::before {
  content: "As fotos da retrospectiva aparecem aqui.";
  display: grid;
  place-items: center;
  width: 100%;
  color: var(--muted);
}

.retro-gallery img {
  flex: 0 0 min(280px, 76vw);
  width: min(280px, 76vw);
  height: 210px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

.retro-final {
  margin: 1.3rem auto 0;
  max-width: 760px;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.7rem);
  line-height: 1;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 3, 10, 0.78);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  padding: clamp(1rem, 3vw, 1.6rem);
  transform: translateY(18px) scale(0.98);
  transition: transform 180ms ease;
}

.modal.is-open .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.memory-form {
  display: grid;
  gap: 1rem;
}

.memory-form label {
  display: grid;
  gap: 0.45rem;
}

.memory-form span,
.upload-field small {
  color: var(--muted);
  font-size: 0.9rem;
}

.memory-form input,
.memory-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 242, 227, 0.22);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  color: var(--ink);
  background: rgba(255, 248, 246, 0.08);
  outline: none;
}

.memory-form input:focus,
.memory-form textarea:focus {
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 4px rgba(242, 220, 166, 0.12);
}

.image-preview {
  display: none;
  width: 100%;
  max-height: 260px;
  border-radius: var(--radius);
  object-fit: cover;
}

.image-preview.has-image {
  display: block;
}

.form-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  max-width: min(380px, calc(100% - 32px));
  border: 1px solid rgba(242, 220, 166, 0.35);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  color: var(--ink);
  background: rgba(61, 13, 31, 0.88);
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 640ms ease, transform 640ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulseLine {
  50% {
    filter: brightness(1.25);
  }
}

@keyframes galleryDrift {
  0% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(min(0px, calc(100vw - 900px)));
  }

  100% {
    transform: translateX(0);
  }
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero-section {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 40px;
  }

  .memory-counter {
    justify-self: start;
    width: 220px;
  }

  .timeline::before {
    left: 18px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 1rem;
  }

  .timeline-item .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .timeline-item .timeline-media,
  .timeline-item:nth-child(even) .timeline-media {
    grid-column: 2;
    grid-row: 1;
  }

  .timeline-item .memory-card,
  .timeline-item:nth-child(even) .memory-card {
    grid-column: 2;
    grid-row: 2;
  }

  .retro-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 560px) {
  main,
  .site-header {
    width: min(100% - 24px, 1180px);
  }

  .header-actions,
  .hero-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions button,
  .hero-actions button,
  .form-actions button {
    width: 100%;
  }

  h1 {
    font-size: clamp(2.7rem, 17vw, 4.4rem);
  }

  .retro-metrics {
    grid-template-columns: 1fr;
  }

  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
