
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cream: #f8f1eb;
  --paper: #fffaf5;
  --rose: #b77f79;
  --deep-rose: #815b59;
  --ink: #594a47;
  --muted: #a58d85;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 15%, #f3dfdc 0, transparent 32%),
    radial-gradient(circle at 85% 80%, #eadbd2 0, transparent 35%),
    var(--cream);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  overflow-x: hidden;
}

button {
  font: inherit;
}

.background-decoration {
  position: fixed;
  color: #c99d96;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.decoration-one {
  top: 12%;
  left: 7%;
  font-size: 42px;
  transform: rotate(-15deg);
}

.decoration-two {
  right: 8%;
  top: 25%;
  font-size: 35px;
}

.decoration-three {
  bottom: 12%;
  left: 12%;
  font-size: 30px;
}

.book-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 45px 18px;
}

/* COVER PAGE */

.cover-screen {
  width: 100%;
  max-width: 480px;
  text-align: center;
  animation: appear 1s ease;
}

.cover-card {
  position: relative;
  min-height: 610px;
  padding: 55px 28px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #e8d3ca;
  border-radius: 5px 18px 18px 5px;
  background:
    linear-gradient(90deg, #e9d5ca 0, #f9eee5 5%, #fff9f1 18%, #f8eee5 100%);
  box-shadow: 12px 18px 40px #795b4c24, inset 5px 0 12px #b9948020;
}

.cover-card::before,
.cover-card::after {
  content: "";
  position: absolute;
  border: 1px solid #d9b9ad;
  pointer-events: none;
}

.cover-card::before {
  inset: 15px;
}

.cover-card::after {
  inset: 21px;
  border-color: #ead8cf;
}

.cover-top,
.cover-small,
.cover-bottom,
.cover-flower,
.cover-heart,
.cover-line,
.cover-card h1,
.open-button {
  position: relative;
  z-index: 1;
}

.cover-top {
  position: absolute;
  top: 65px;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
}

.cover-flower {
  font-size: 34px;
  color: var(--rose);
  margin-bottom: 22px;
}

.cover-small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.cover-card h1 {
  margin-top: 18px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-size: clamp(55px, 12vw, 76px);
  line-height: 0.95;
  color: var(--deep-rose);
}

.cover-card h1 span {
  font-style: italic;
}

.cover-heart {
  color: var(--rose);
  font-size: 31px;
  margin-top: 25px;
}

.cover-line {
  width: 65px;
  height: 1px;
  background: #cba59b;
  margin: 22px 0;
}

.cover-bottom {
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--muted);
}

.open-button {
  margin-top: 45px;
  padding: 13px 24px;
  border: 1px solid #b98780;
  background: #a97570;
  color: white;
  border-radius: 30px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: 0.3s ease;
}

.open-button span {
  margin-left: 10px;
}

.open-button:hover {
  background: #805a57;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px #805a572c;
}

.cover-note {
  margin-top: 20px;
  font-family: "Cormorant Garamond", serif;
  font-size: 19px;
  color: var(--deep-rose);
  font-style: italic;
}

/* BOOK PAGES */

.book-screen {
  width: 100%;
  max-width: 760px;
  animation: appear 0.8s ease;
}

.hidden {
  display: none !important;
}

.book-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto 15px;
  max-width: 680px;
  padding: 0 5px;
}

.heading-label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 3px;
}

.heading-heart {
  color: var(--rose);
  font-size: 21px;
}

.book {
  padding: 12px;
  background: #e8d8ce;
  border-radius: 5px 14px 14px 5px;
  box-shadow: 12px 16px 35px #765b4c26;
}

.page {
  position: relative;
  min-height: 580px;
  padding: 55px clamp(25px, 7vw, 70px);
  background:
    linear-gradient(90deg, #f0e4d9 0, #fffaf5 3%, #fffaf5 100%);
  border: 1px solid #eadbd0;
  border-radius: 3px 10px 10px 3px;
  overflow: hidden;
  animation: pageIn 0.45s ease;
}

.page::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 1px;
  background: #eadbd5;
  opacity: 0.7;
}

.page-number {
  text-align: center;
  color: #b99b91;
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  margin-bottom: 25px;
}

.page-title {
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(31px, 6vw, 43px);
  font-weight: 400;
  color: var(--deep-rose);
  margin-bottom: 30px;
}

.page-title em {
  font-weight: 400;
}

.page-divider {
  text-align: center;
  color: #c18c83;
  letter-spacing: 8px;
  font-size: 14px;
  margin: 22px 0;
}

.letter-text p {
  font-family: "Cormorant Garamond", serif;
  color: #62514d;
  font-size: clamp(17px, 2.5vw, 20px);
  line-height: 1.75;
  margin-bottom: 17px;
}

.letter-text p:last-child {
  margin-bottom: 0;
}

.closing-page {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.closing-page .closing-words {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(24px, 5vw, 36px);
  color: var(--deep-rose);
  line-height: 1.5;
  max-width: 440px;
}

.closing-flower {
  color: var(--rose);
  font-size: 34px;
  margin: 25px 0;
}

.closing-signature {
  font-family: "Great Vibes", cursive;
  font-size: 43px;
  color: #a36f6a;
}

/* NAVIGATION */

.book-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 680px;
  margin: 20px auto 15px;
}

.page-button {
  border: 1px solid #d6b8ae;
  background: #fffaf5;
  color: var(--deep-rose);
  padding: 12px 17px;
  border-radius: 30px;
  font-size: 11px;
  cursor: pointer;
  transition: 0.25s ease;
}

.page-button:hover:not(:disabled) {
  background: #a97570;
  color: white;
  border-color: #a97570;
}

.page-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-count {
  color: #9c8179;
  font-family: "Cormorant Garamond", serif;
  font-size: 17px;
  white-space: nowrap;
}

.progress-track {
  width: 100%;
  max-width: 680px;
  height: 3px;
  background: #e7d7ce;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: #ad7973;
  transition: width 0.4s ease;
}

.little-footer {
  text-align: center;
  color: #ad9188;
  font-size: 8px;
  letter-spacing: 2px;
  margin-top: 18px;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 520px) {
  .book-wrapper {
    padding: 25px 12px;
  }

  .cover-card {
    min-height: 560px;
  }

  .page {
    min-height: 600px;
    padding: 42px 25px 40px 34px;
  }

  .page::before {
    left: 16px;
  }

  .book-controls {
    gap: 7px;
  }

  .page-button {
    padding: 11px 12px;
    font-size: 10px;
  }
}
