:root {
  --cream: #f4eadf;
  --paper: #fff8f2;
  --ink: #4a372f;
  --soft: #7b675c;
  --muted: #9b8172;
  --rose: #9f5e50;
  --line: rgba(74, 55, 47, 0.22);

  --serif: 'Bodoni Moda', serif;
  --italic: 'Cormorant Garamond', serif;
  --small: 'Marcellus', serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #d8c8b8;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.55), transparent 34%),
    linear-gradient(135deg, #d7c6b6, #efe2d4);
  color: var(--ink);
  font-family: var(--small);
  overflow-x: hidden;
}

/* APP SHELL */

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--cream);
  box-shadow: 0 0 60px rgba(74, 55, 47, 0.18);
  position: relative;
  overflow: hidden;
}

/* MUSIC */

.music-btn {
  position: fixed;
  right: max(16px, calc((100vw - 430px) / 2 + 16px));
  bottom: 18px;
  z-index: 80;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(74, 55, 47, 0.18);
  background: rgba(245, 235, 224, 0.76);
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
  backdrop-filter: blur(7px);
}

.music-btn.active {
  background: var(--rose);
  color: #fff8ef;
}

/* SECTIONS */

.app-section {
  min-height: auto;
  position: relative;
  display: block;
  padding: 64px 22px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-section {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 54px 22px 44px;
}

.compact-section {
  padding-top: 52px;
  padding-bottom: 52px;
}

.app-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 248, 242, 0.025);
  pointer-events: none;
}

/* CONTENT */

.home-content,
.letter-content,
.page-content,
.form-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  text-align: center;
}

/* TEXT */

.overline {
  font-family: var(--small);
  font-size: 0.62rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--soft);
  line-height: 1.8;
}

.page-title {
  font-family: var(--serif);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 2.05rem;
  color: var(--ink);
  margin: 10px 0 20px;
}

.soft-text,
.letter-text {
  font-family: var(--italic);
  font-style: italic;
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.62;
}

/* HOME */

.couple-names {
  margin: 22px 0 16px;
}

.name {
  font-family: var(--serif);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.105em;
  color: #50352e;
  line-height: 1;
  font-size: 3.15rem;
}

.and-text {
  display: block;
  margin: 8px 0;
  font-family: var(--italic);
  font-style: italic;
  font-size: 1.24rem;
  color: var(--muted);
}

.date-line,
.place-line {
  font-family: var(--small);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--soft);
}

.date-line {
  font-size: 0.78rem;
  margin-top: 20px;
}

.place-line {
  font-size: 0.68rem;
  margin-top: 7px;
}

.open-letter,
.next-link {
  display: inline-block;
  margin-top: 28px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--small);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.open-letter::after,
.next-link::after {
  content: "↓";
  display: block;
  margin-top: 7px;
  font-size: 1rem;
  color: var(--muted);
}

/* LETTER */

.letter-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.05rem;
  color: var(--ink);
  margin: 14px 0 20px;
}

.letter-text {
  margin-bottom: 14px;
}

.signature {
  margin-top: 22px;
  font-family: var(--italic);
  font-style: italic;
  font-size: 1.42rem;
  color: var(--ink);
}

/* DETAILS */

.details-list {
  width: 100%;
  margin: 0 auto 24px;
}

.detail {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.detail:last-child {
  border-bottom: none;
}

.detail span {
  display: block;
  margin-bottom: 7px;
  font-family: var(--small);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
  color: var(--ink);
}

.detail p {
  font-family: var(--italic);
  font-style: italic;
  font-size: 1rem;
  color: var(--soft);
}

/* BUTTON */

.paper-btn {
  display: inline-block;
  width: 100%;
  border: 1px solid rgba(74, 55, 47, 0.24);
  background: transparent;
  color: var(--ink);
  padding: 13px 24px;
  text-decoration: none;
  font-family: var(--small);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.65rem;
  cursor: pointer;
  transition: 0.35s ease;
}

.paper-btn:hover {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff8ef;
}

/* GALLERY */

.story-content {
  max-width: 340px;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 292px;
  margin: 22px auto 0;
}

.gallery img {
  width: 100%;
  height: 188px;
  object-fit: cover;
  padding: 6px;
  background: rgba(250, 241, 230, 0.86);
  box-shadow: 0 8px 20px rgba(67, 48, 35, 0.12);
}

/* FORMS */

form {
  margin-top: 18px;
}

input,
select,
textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(74, 55, 47, 0.32);
  background: transparent;
  color: var(--ink);
  padding: 11px 4px;
  margin-bottom: 11px;
  font-family: var(--italic);
  font-size: 1rem;
  outline: none;
}

textarea {
  min-height: 76px;
  resize: none;
}

input::placeholder,
textarea::placeholder,
select {
  color: rgba(74, 55, 47, 0.7);
}

.success-message {
  display: none;
  margin-top: 16px;
  font-family: var(--italic);
  font-style: italic;
  color: var(--soft);
}

.success-message.show {
  display: block;
}

/* GUESTBOOK */

.messages-list {
  margin-top: 20px;
  text-align: left;
}

.message-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.message-card strong {
  font-family: var(--small);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.7rem;
}

.message-card p {
  margin-top: 7px;
  font-family: var(--italic);
  font-style: italic;
  color: var(--soft);
}

/* FOOTER */

footer {
  background: #e9ddcf;
  padding: 20px 15px;
  text-align: center;
  color: var(--soft);
  font-family: var(--small);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

footer a {
  color: var(--ink);
  text-decoration: none;
}

/* ANIMATIONS */

.name-left {
  opacity: 0;
  transform: translateX(-38px);
  animation: slideLeft 1.25s ease forwards 0.45s;
}

.name-right {
  opacity: 0;
  transform: translateX(38px);
  animation: slideRight 1.25s ease forwards 0.65s;
}

.and-text {
  opacity: 0;
  animation: softAppear 1s ease forwards 0.85s;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: softUp 1s ease forwards 0.25s;
}

.reveal-delay {
  opacity: 0;
  transform: translateY(14px);
  animation: softUp 1s ease forwards 1.05s;
}

body.loaded {
  animation: bodyFade 0.8s ease both;
}

@keyframes bodyFade {
  from { opacity: 0.96; }
  to { opacity: 1; }
}

@keyframes slideLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes softAppear {
  to {
    opacity: 1;
  }
}

@keyframes softUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SMALL PHONES */

@media (max-width: 360px) {
  .app-section {
    padding-left: 17px;
    padding-right: 17px;
  }

  .name {
    font-size: 2.8rem;
  }

  .page-title,
  .letter-title {
    font-size: 1.85rem;
  }
}