:root {
  --cream: #f3efe6;
  --paper: #fbf8f1;
  --stone: #5c5148;
  --ink: #3b332c;
  --sage: #7d8068;
  --line: #ddd5c6;
  --gold: #d39f42;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "freight-big-pro", "Playfair Display", Georgia, serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
}

main {
  flex: 1 0 auto;
  padding-top: 129px;
  background: var(--cream);
}

@media (max-width: 1284px) {
  main {
    padding-top: 97px;
  }
}

h1,
h2,
p {
  margin: 0;
}

/* ---------- Hero ---------- */
.NotesHero {
  position: relative;
  overflow: hidden;
  padding: 72px 24px 120px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(211, 159, 66, 0.1), transparent 60%),
    var(--cream);
}

.NotesHero_kicker {
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.78rem;
  color: var(--stone);
}

.NotesHero h1 {
  font-weight: 300;
  font-size: clamp(2.2rem, 4.4vw, 3.3rem);
  line-height: 1.1;
  color: var(--ink);
}

.NotesHero h1 em {
  display: block;
  font-family: "Parisienne", cursive;
  font-style: normal;
  font-size: 1.2em;
  color: var(--stone);
}

.NotesHero_lead {
  max-width: 560px;
  margin: 22px auto 0;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--stone);
}

.NotesHero_flower {
  position: absolute;
  top: 40px;
  width: 170px;
  height: 190px;
  object-fit: cover;
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
}

.NotesHero_flower--left {
  left: max(16px, calc(50% - 520px));
  transform: scaleX(-1) rotate(-12deg);
}

.NotesHero_flower--right {
  right: max(16px, calc(50% - 520px));
  transform: rotate(-12deg);
}

/* Torn paper edge into the board below */
.NotesHero_tear {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 70px;
  background-color: #ebe4d6;
  -webkit-mask-image: url(../images/ripped-bg-3.png);
  mask-image: url(../images/ripped-bg-3.png);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center bottom;
  mask-position: center bottom;
}

/* ---------- Board ---------- */
.NotesBoard {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  align-items: start;
  gap: 48px;
  padding: 56px min(6vw, 80px) 96px;
  /* soft linen texture */
  background-color: #ebe4d6;
  background-image:
    radial-gradient(rgba(92, 81, 72, 0.08) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 18px 18px, 18px 18px;
  background-position: 0 0, 9px 9px;
}

/* ---------- Form card ---------- */
.NoteForm {
  position: sticky;
  top: 150px;
  padding: 36px 28px 28px;
  background: var(--paper);
  border-radius: 6px;
  box-shadow:
    0 1px 2px rgba(60, 45, 30, 0.08),
    0 18px 40px rgba(60, 45, 30, 0.12);
  transform: rotate(-1deg);
}

.NoteForm_tape,
.Note::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 96px;
  height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(233, 214, 170, 0.75);
  box-shadow: 0 1px 2px rgba(60, 45, 30, 0.12);
}

.NoteForm h2 {
  font-family: "Parisienne", cursive;
  font-weight: 400;
  font-size: 2.1rem;
  line-height: 1.2;
  color: var(--stone);
  text-align: center;
}

.NoteForm_hint {
  margin: 6px 0 22px;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  color: var(--stone);
}

.NoteForm_field {
  position: relative;
  display: block;
  margin-bottom: 16px;
}

.NoteForm_field > span {
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--stone);
}

.NoteForm_field input,
.NoteForm_field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.NoteForm_field input:focus,
.NoteForm_field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(211, 159, 66, 0.18);
}

.NoteForm_count {
  display: block;
  margin-top: 4px;
  text-align: right;
  font-size: 0.78rem;
  color: #9a8f80;
}

.NoteForm_button {
  width: 100%;
  min-height: 3.2rem;
  border: 1px solid #c99434;
  border-radius: 30px;
  cursor: pointer;
  font-family: "freight-big-pro", serif;
  font-style: italic;
  font-size: 18px;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(120, 80, 20, 0.35);
  /* same gold gradient as the home "Confirme sua presença" button */
  background-image: linear-gradient(
    120deg,
    #b7862f 0%,
    #e9c770 35%,
    #d39f42 55%,
    #f3dc93 75%,
    #b7862f 100%
  );
  background-size: 200% 100%;
  background-position: 0% 50%;
  transition: background-position 0.4s, box-shadow 0.25s;
}

.NoteForm_button:hover,
.NoteForm_button:focus-visible {
  background-position: 100% 50%;
  box-shadow: 0 6px 18px rgba(211, 159, 66, 0.35);
}

.NoteForm_button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.NoteForm_status {
  min-height: 1.4em;
  margin-top: 12px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--stone);
}

.NoteForm_status[data-state="ok"] {
  color: #5f7a4e;
}

.NoteForm_status[data-state="error"] {
  color: #a5433b;
}

/* ---------- Wall ---------- */
.NotesWall_header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.NotesWall_title {
  font-family: "Parisienne", cursive;
  font-size: 2.2rem;
  line-height: 1.2;
  color: var(--stone);
}

.NotesWall_count {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--stone);
}

/* Masonry-like board using columns */
.NotesWall_list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 3 240px;
  column-gap: 28px;
}

.Note {
  --note-bg: #fbf3e4;
  --note-tilt: -1.5deg;
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 14px 0 30px;
  padding: 30px 24px 20px;
  break-inside: avoid;
  background: var(--note-bg);
  border-radius: 4px 4px 18px 4px;
  box-shadow:
    0 1px 2px rgba(60, 45, 30, 0.08),
    0 12px 26px rgba(60, 45, 30, 0.12);
  transform: rotate(var(--note-tilt));
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.Note:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow:
    0 2px 4px rgba(60, 45, 30, 0.08),
    0 20px 36px rgba(60, 45, 30, 0.16);
}

/* Pastel papers from the wedding palette, each slightly tilted */
.Note:nth-child(5n + 1) {
  --note-bg: #fbf3e4;
  --note-tilt: -1.5deg;
}

.Note:nth-child(5n + 2) {
  --note-bg: #f6e4e2;
  --note-tilt: 1.2deg;
}

.Note:nth-child(5n + 3) {
  --note-bg: #e8ebdc;
  --note-tilt: -0.8deg;
}

.Note:nth-child(5n + 4) {
  --note-bg: #e4ebf1;
  --note-tilt: 1.6deg;
}

.Note:nth-child(5n + 5) {
  --note-bg: #f4ead6;
  --note-tilt: -1.1deg;
}

.Note:nth-child(even)::before {
  transform: translateX(-50%) rotate(4deg);
}

.Note_message {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.Note_footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(92, 81, 72, 0.25);
}

.Note_name {
  font-family: "Parisienne", cursive;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--stone);
  overflow-wrap: anywhere;
}

.Note_date {
  flex: none;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  color: #9a8f80;
}

.Note.is-new {
  animation: note-pop 0.6s ease;
}

@keyframes note-pop {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96) rotate(var(--note-tilt));
  }
  to {
    opacity: 1;
    transform: rotate(var(--note-tilt));
  }
}

/* ---------- Pagination ---------- */
.NotesPagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.NotesPagination[hidden] {
  display: none;
}

.NotesPage {
  min-width: 42px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  font-family: "freight-big-pro", serif;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.NotesPage:hover:not([disabled]) {
  border-color: var(--gold);
}

.NotesPage.is-active {
  border-color: #c99434;
  color: #fff;
  background-image: linear-gradient(120deg, #b7862f, #e9c770 50%, #d39f42);
}

.NotesPage[disabled] {
  opacity: 0.45;
  cursor: default;
}

.NotesWall_empty {
  padding: 48px 24px;
  text-align: center;
  font-family: "Parisienne", cursive;
  font-size: 1.8rem;
  color: var(--stone);
}

/* ---------- Tablet & phone ---------- */
@media (max-width: 900px) {
  .NotesHero {
    padding: 56px 24px 100px;
  }

  .NotesHero_flower {
    top: 12px;
    width: 96px;
    height: 108px;
    opacity: 0.4;
  }

  .NotesBoard {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 20px 72px;
  }

  .NoteForm {
    position: relative;
    top: 0;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .NotesWall_list {
    columns: 2 220px;
    column-gap: 20px;
  }
}

@media (max-width: 600px) {
  .NotesHero_lead {
    font-size: 1rem;
  }

  .NotesWall_header {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
  }

  .NotesWall_list {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .Note,
  .Note.is-new {
    transition: none;
    animation: none;
  }
}
