:root {
  --bg: #fff8f4;
  --paper: #ffffff;
  --text: #2f2420;
  --muted: #7f6b64;
  --accent: #c87562;
  --accent-dark: #9d4e42;
  --soft: #f6ded6;
  --line: rgba(47, 36, 32, 0.12);
  --shadow: 0 24px 70px rgba(101, 61, 46, 0.16);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 95px;
}

body {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* LOADER */

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff8f4, #f6ded6);
  transition:
    opacity 0.7s ease,
    visibility 0.7s ease;
}

.loader.hide {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader-card {
  width: min(88%, 380px);
  padding: 36px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(12px);
}

.book-loader {
  position: relative;
  width: 90px;
  height: 70px;
  margin: 0 auto 20px;
  perspective: 500px;
}

.book-loader span {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transform-origin: left;
  animation: page 1.2s infinite ease-in-out;
}

.book-loader span:nth-child(2) {
  animation-delay: 0.18s;
}

.book-loader span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes page {
  0%,
  100% {
    transform: rotateY(0);
  }

  50% {
    transform: rotateY(-55deg);
  }
}

.loader h1,
.brand,
.hero h1,
.section h2,
.modal-info h2 {
  font-family: "Playfair Display", serif;
}

.loader h1 {
  font-size: 34px;
}

.loader p {
  margin: 8px 0 22px;
  color: var(--muted);
}

.loader-line {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0c8be;
}

.loader-line i {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: loadline 2.2s linear forwards;
}

@keyframes loadline {
  to {
    width: 100%;
  }
}

main {
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.page-hidden {
  opacity: 0;
  transform: translateY(10px);
}

.page-visible {
  opacity: 1;
  transform: none;
}

/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  padding: 0 6%;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 248, 244, 0.84);
  backdrop-filter: blur(16px);
}

.brand {
  font-size: 27px;
  font-weight: 700;
}

.brand span {
  color: var(--accent);
}

nav {
  display: flex;
  gap: 28px;
  color: var(--muted);
  font-weight: 600;
}

nav a {
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--accent-dark);
}

.nav-cta {
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: white;
  font-weight: 700;
}

.menu-btn {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
}

/* HERO */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 70px;
  min-height: calc(100vh - 78px);
  padding: 70px 6%;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  opacity: 0.65;
  filter: blur(25px);
  pointer-events: none;
}

.glow-one {
  top: 60px;
  left: -80px;
  width: 320px;
  height: 320px;
  background: #f3c2b4;
}

.glow-two {
  right: 5%;
  bottom: 8%;
  width: 240px;
  height: 240px;
  background: #d3e5e1;
}

.hero-content,
.hero-visual {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(44px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 650px;
  margin: 26px 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.btn:hover {
  transform: translateY(-3px);
}

.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 14px 35px rgba(200, 117, 98, 0.3);
}

.secondary {
  border-color: var(--line);
  background: white;
  color: var(--text);
}

.hero-actions,
.contact-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.trust-row div {
  padding: 16px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
}

.trust-row strong {
  display: block;
}

.trust-row span {
  color: var(--muted);
  font-size: 13px;
}

.hero-visual {
  min-height: 540px;
}

.hero-books {
  position: absolute;
  inset: 70px 0 0 40px;
}

.hero-book-item {
  position: absolute;
  width: 250px;
  overflow: hidden;
  border-radius: 10px;
  background: white;
  box-shadow: 0 28px 65px rgba(47, 36, 32, 0.25);
}

.hero-book-item img {
  width: 100%;
  height: 370px;
  object-fit: cover;
}

.hero-book-first {
  top: 25px;
  left: 15px;
  z-index: 2;
  transform: rotate(-9deg);
}

.hero-book-second {
  top: 65px;
  left: 210px;
  z-index: 3;
  transform: rotate(8deg);
}

.floating-card {
  position: absolute;
  z-index: 5;
  max-width: 240px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow);
  color: var(--muted);
  font-weight: 700;
}

.card-a {
  top: 15px;
  left: 5px;
}

.card-b {
  right: 0;
  bottom: 40px;
}

/* SECTIONS */

.section {
  padding: 90px 6%;
}

.section-head {
  max-width: 760px;
  margin: 0 auto 46px;
  text-align: center;
}

.section h2 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.05;
}

.section-head p {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.7;
}

/* BOOKS */

.books-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 420px));
  justify-content: center;
  gap: 34px;
}

.book-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: white;
  box-shadow: 0 18px 50px rgba(101, 61, 46, 0.09);
  cursor: pointer;
  outline: none;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.book-card:hover,
.book-card:focus-visible {
  border-color: rgba(200, 117, 98, 0.4);
  box-shadow: var(--shadow);
  transform: translateY(-10px);
}

.book-cover-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 430px;
  padding: 25px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, #fff9f7, transparent 55%),
    linear-gradient(145deg, #f4ded7, #eee8e4);
}

.book-cover-image img {
  width: auto;
  max-width: 100%;
  height: 380px;
  border-radius: 4px;
  object-fit: contain;
  box-shadow: 0 20px 35px rgba(47, 36, 32, 0.25);
  transition: transform 0.35s ease;
}

.book-card:hover .book-cover-image img {
  transform: scale(1.025);
}

.book-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(47, 36, 32, 0.88);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.book-info {
  padding: 22px 5px 7px;
}

.book-series {
  display: block;
  margin-bottom: 9px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.book-info h3 {
  font-family: "Playfair Display", serif;
  font-size: 27px;
  line-height: 1.15;
}

.book-info p {
  margin: 10px 0 18px;
  color: var(--muted);
}

.book-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.book-price-row strong {
  color: var(--accent-dark);
  font-size: 23px;
}

.book-price-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* AUTHOR */

.author-card {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  align-items: stretch;
  gap: 64px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: white;
  box-shadow: var(--shadow);
}

.author-photo-column {
  position: relative;
  min-width: 0;
}

.author-photo-sticky {
  position: sticky;
  top: 110px;
}

.author-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  background: var(--soft);
  object-fit: cover;
  object-position: center;
  box-shadow: 0 24px 60px rgba(101, 61, 46, 0.2);
}

.author-photo-info {
  position: relative;
  width: calc(100% - 28px);
  margin: -38px auto 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(101, 61, 46, 0.14);
  backdrop-filter: blur(14px);
}

.author-photo-info strong {
  display: block;
  margin-bottom: 5px;
  font-family: "Playfair Display", serif;
  font-size: 22px;
}

.author-photo-info span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.author-content {
  min-width: 0;
  padding: 10px 0;
}

.author-content h2 {
  margin-bottom: 26px;
}

.author-content p {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.95;
}

.author-content p strong {
  color: var(--text);
  font-weight: 700;
}

.author-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 34px;
}

.author-highlights div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
}

.author-highlights strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 22px;
}

.author-highlights span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* FEATURES */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding-top: 20px;
}

.feature,
.comment {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  box-shadow: 0 18px 45px rgba(101, 61, 46, 0.08);
}

.feature > span {
  font-size: 34px;
}

.feature h3 {
  margin: 16px 0 10px;
}

.feature p,
.comment {
  color: var(--muted);
  line-height: 1.7;
}

/* COMMENTS */

.comment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.comment b {
  display: block;
  margin-top: 18px;
  color: var(--text);
}

/* CONTACT */

.contact-box {
  padding: 58px 28px;
  border: 1px solid var(--line);
  border-radius: 38px;
  background: linear-gradient(145deg, #fff, #f7ded7);
  box-shadow: var(--shadow);
  text-align: center;
}

.contact-box p {
  max-width: 760px;
  margin: 18px auto 28px;
  color: var(--muted);
  line-height: 1.8;
}

.contact-actions {
  justify-content: center;
}

/* MODAL */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(47, 36, 32, 0.58);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 34px;
  width: min(1020px, 100%);
  max-height: 92vh;
  padding: 28px;
  overflow-y: auto;
  border-radius: 34px;
  background: white;
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.28);
  animation: pop 0.35s ease;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.close-modal {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #f5e7e2;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal-book {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 540px;
  padding: 28px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, #fff8f4, transparent 50%),
    linear-gradient(145deg, #f1ddd7, #e6e4df);
}

.modal-book img {
  width: auto;
  max-width: 100%;
  max-height: 490px;
  border-radius: 4px;
  object-fit: contain;
  box-shadow: 0 24px 50px rgba(47, 36, 32, 0.28);
}

.modal-info {
  padding: 22px 8px;
}

.modal-info h2 {
  padding-right: 45px;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.05;
}

.modal-summary {
  max-height: 270px;
  margin: 20px 0;
  padding-right: 10px;
  overflow-y: auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-line;
}

.modal-summary::-webkit-scrollbar {
  width: 7px;
}

.modal-summary::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--soft);
}

.price-row {
  display: flex;
  justify-content: space-between;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.price-row strong {
  color: var(--accent-dark);
  font-size: 21px;
}

.option-group {
  margin: 18px 0;
}

.option-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

.choice-row {
  display: flex;
  gap: 10px;
}

.choice {
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.choice.active {
  border-color: var(--text);
  background: var(--text);
  color: white;
}

textarea {
  width: 100%;
  min-height: 92px;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  color: var(--text);
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 117, 98, 0.12);
}

small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

/* FOOTER */

footer {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

footer p {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
}

.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.footer-credit::before {
  content: "•";
  margin-right: 3px;
  color: var(--accent);
}

.footer-credit a {
  position: relative;
  color: var(--accent-dark);
  font-weight: 800;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.footer-credit a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -3px;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.footer-credit a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.footer-credit a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* REVEAL ANIMATION */

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

.reveal.show {
  opacity: 1;
  transform: none;
}

/* TABLET */

@media (max-width: 960px) {
  nav,
  .nav-cta {
    display: none;
  }

  .menu-btn {
    display: block;
  }

  .site-header.open nav {
    position: absolute;
    top: 78px;
    right: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px 6%;
    border-bottom: 1px solid var(--line);
    background: white;
    box-shadow: 0 20px 40px rgba(47, 36, 32, 0.08);
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 60px;
  }

  .hero-visual {
    min-height: 500px;
  }

  .hero-books {
    left: 50%;
    width: 520px;
    transform: translateX(-50%);
  }

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

  .author-card {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .author-photo-column {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }

  .author-photo-sticky {
    position: relative;
    top: auto;
  }

  .author-highlights {
    grid-template-columns: repeat(3, 1fr);
  }

  .features,
  .comment-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .modal-book {
    min-height: 460px;
  }
}

/* MOBILE */

@media (max-width: 680px) {
  .site-header {
    height: 70px;
    padding: 0 5%;
  }

  .site-header.open nav {
    top: 70px;
  }

  .brand {
    font-size: 23px;
  }

  .hero,
  .section {
    padding-right: 5%;
    padding-left: 5%;
  }

  .hero {
    min-height: auto;
    padding-top: 55px;
    padding-bottom: 45px;
  }

  .hero h1 {
    font-size: 43px;
  }

  .hero p {
    font-size: 16px;
  }

  .hero-actions .btn,
  .contact-actions .btn,
  .modal-actions .btn {
    width: 100%;
  }

  .trust-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .trust-row div {
    text-align: center;
  }

  .hero-visual {
    min-height: 400px;
  }

  .hero-books {
    top: 30px;
    left: 50%;
    width: 340px;
  }

  .hero-book-item {
    width: 180px;
  }

  .hero-book-item img {
    height: 270px;
  }

  .hero-book-first {
    top: 10px;
    left: 10px;
  }

  .hero-book-second {
    top: 55px;
    left: 145px;
  }

  .floating-card {
    display: none;
  }

  .section {
    padding-top: 65px;
    padding-bottom: 65px;
  }

  .books-grid {
    grid-template-columns: 1fr;
  }

  .book-cover-image {
    min-height: 390px;
  }

  .book-cover-image img {
    height: 340px;
  }

  .author-card {
    gap: 32px;
    padding: 20px;
    border-radius: 26px;
  }

  .author-photo {
    border-radius: 22px;
  }

  .author-photo-info {
    width: calc(100% - 20px);
    margin-top: -34px;
  }

  .author-content p {
    font-size: 15px;
    line-height: 1.85;
  }

  .author-highlights {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 10px;
  }

  .modal-content {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px;
    border-radius: 24px;
  }

  .modal-book {
    min-height: 380px;
  }

  .modal-book img {
    max-height: 340px;
  }

  .modal-info {
    padding: 10px 3px;
  }

  .modal-info h2 {
    font-size: 35px;
  }

  .modal-summary {
    max-height: none;
    overflow: visible;
  }

  .choice-row {
    flex-direction: column;
  }

  .choice {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .hero-books {
    width: 300px;
  }

  .hero-book-item {
    width: 160px;
  }

  .hero-book-item img {
    height: 240px;
  }

  .hero-book-second {
    left: 125px;
  }

  .hero-visual {
    min-height: 355px;
  }
}

/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}