:root {
  --paper: #f4ead8;
  --paper-soft: #fffaf0;
  --ink: #1d1d1d;
  --muted: #6f665b;
  --navy: #102241;
  --navy-soft: #1c355e;
  --red: #bd2d32;
  --red-dark: #9f2025;
  --line: rgba(29, 29, 29, 0.13);
  --shadow: 0 24px 80px rgba(16, 34, 65, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

#top,
#reader,
#about,
#share {
  scroll-margin-top: 96px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 34, 65, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 34, 65, 0.035) 1px, transparent 1px),
    var(--paper-soft);
  background-size: 44px 44px;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@keyframes coverFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(-8px, -10px, 0) scale(1.015);
  }
}

@keyframes softPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(189, 45, 50, 0.26);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(189, 45, 50, 0);
  }
}

@keyframes lineTravel {
  from {
    transform: translateX(-100%);
  }

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

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

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 250, 240, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  color: var(--paper-soft);
  background: var(--red);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  animation: softPulse 3.4s ease-in-out infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 2vw, 28px);
  color: var(--navy);
  font-size: 0.94rem;
  font-weight: 700;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.text-link:hover,
.text-link:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--red);
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(880px, 88svh);
  display: flex;
  align-items: center;
  padding: clamp(64px, 10vw, 120px) clamp(22px, 5vw, 76px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-background {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("assets/book-cover-front.jpeg");
  background-position: 82% 42%;
  background-size: min(780px, 72vw) auto;
  background-repeat: no-repeat;
  animation: coverFloat 9s ease-in-out infinite;
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(
      90deg,
      rgba(255, 250, 240, 0.98) 0%,
      rgba(255, 250, 240, 0.93) 43%,
      rgba(255, 250, 240, 0.28) 72%,
      rgba(16, 34, 65, 0.12) 100%
    ),
    radial-gradient(circle at 74% 48%, rgba(255, 250, 240, 0) 0, rgba(255, 250, 240, 0.38) 74%);
}

.hero-content {
  width: min(660px, 100%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 12ch;
  margin: 0;
  color: var(--navy);
  font-size: clamp(3.25rem, 8.4vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.subtitle {
  margin: 22px 0 0;
  color: var(--red-dark);
  font-size: clamp(1.35rem, 3vw, 2.3rem);
  font-weight: 800;
}

.hero-copy {
  max-width: 54ch;
  margin: 20px 0 0;
  color: #36302a;
  font-size: clamp(1.06rem, 1.8vw, 1.28rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 20px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  color: #fffaf0;
  background: var(--red);
  box-shadow: 0 12px 32px rgba(189, 45, 50, 0.28);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--red-dark);
}

.button-secondary {
  color: var(--navy);
  background: rgba(255, 250, 240, 0.74);
  border-color: rgba(16, 34, 65, 0.2);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--red);
  box-shadow: 0 12px 30px rgba(16, 34, 65, 0.12);
}

.author-line {
  margin: 22px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.book-strip {
  display: grid;
  grid-template-columns: minmax(98px, 180px) minmax(0, 1fr) minmax(98px, 180px);
  align-items: center;
  gap: clamp(18px, 5vw, 56px);
  width: min(1160px, calc(100% - 36px));
  margin: -52px auto 0;
  padding: clamp(18px, 3vw, 28px);
  background: var(--paper-soft);
  border: 1px solid rgba(16, 34, 65, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: riseIn 680ms ease both;
}

.book-strip img {
  aspect-ratio: 2 / 3;
  width: 100%;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(16, 34, 65, 0.18);
}

.book-strip h2,
.section-heading h2,
.about-copy h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.book-strip p:not(.section-kicker) {
  max-width: 62ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.reader-section,
.about-section,
.comments-section,
.share-section {
  width: min(1180px, calc(100% - 36px));
  margin: clamp(58px, 9vw, 112px) auto;
}

.reader-section,
.about-section,
.comments-section {
  animation: riseIn 680ms ease both;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  font-weight: 800;
}

.text-link {
  color: var(--navy);
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

.reader-frame {
  height: min(820px, 82svh);
  min-height: 580px;
  overflow: hidden;
  background: #ebe2d3;
  border: 1px solid rgba(16, 34, 65, 0.18);
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(16, 34, 65, 0.18);
}

.reader-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ebe2d3;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(220px, 400px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 82px);
  padding: clamp(26px, 5vw, 62px);
  background:
    linear-gradient(90deg, rgba(189, 45, 50, 0.08), transparent 38%),
    var(--paper);
  border: 1px solid rgba(16, 34, 65, 0.13);
  border-radius: 8px;
}

.about-art img {
  width: min(100%, 380px);
  margin-inline: auto;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.about-copy p {
  max-width: 68ch;
  color: #40382f;
  font-size: 1.06rem;
}

.callout {
  padding-left: 18px;
  border-left: 4px solid var(--red);
  color: var(--red-dark) !important;
  font-size: clamp(1.18rem, 2vw, 1.45rem) !important;
  font-weight: 900;
}

.author-block {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid rgba(16, 34, 65, 0.16);
}

.author-block h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.45rem, 2.7vw, 2.2rem);
  letter-spacing: 0;
}

.comments-section {
  padding: clamp(26px, 5vw, 58px);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.72), rgba(244, 234, 216, 0.72)),
    var(--paper-soft);
  border: 1px solid rgba(16, 34, 65, 0.13);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(16, 34, 65, 0.1);
}

.comments-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(20px, 4vw, 34px);
}

.comments-heading h2 {
  max-width: 14ch;
  margin: 0;
  color: var(--navy);
  font-size: clamp(2.1rem, 4.6vw, 4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.comments-rotator {
  position: relative;
  max-width: 920px;
  min-height: 260px;
  margin-inline: auto;
}

.comment-card {
  position: absolute;
  inset: 0;
  display: none;
  align-content: center;
  min-height: 240px;
  margin: 0;
  padding: 22px 24px 22px 78px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(0.985);
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid rgba(16, 34, 65, 0.13);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(16, 34, 65, 0.09);
}

.comment-card.is-active {
  display: grid;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  animation: commentEnter 520ms ease both;
}

@keyframes commentEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }

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

.comment-card::before {
  content: attr(data-comment-number);
  position: absolute;
  top: 22px;
  left: 22px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--paper-soft);
  background: var(--navy);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.comment-card blockquote {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #40382f;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.48;
}

.comment-card blockquote p {
  margin: 0 0 12px;
}

.comment-card blockquote p:last-child {
  margin-bottom: 0;
}

.comment-card figcaption {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  color: var(--red-dark);
  font-size: 0.96rem;
  font-weight: 900;
}

.featured-comment {
  background:
    linear-gradient(135deg, rgba(189, 45, 50, 0.1), transparent 48%),
    var(--paper);
}

.comments-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.comments-dots span {
  width: 8px;
  height: 8px;
  background: rgba(16, 34, 65, 0.24);
  border-radius: 999px;
  transition:
    width 240ms ease,
    background 240ms ease;
}

.comments-dots span.is-active {
  width: 28px;
  background: var(--red);
}

.share-section {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(340px, 0.82fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: clamp(26px, 5vw, 58px);
  background:
    linear-gradient(120deg, rgba(16, 34, 65, 0.07), transparent 32%),
    linear-gradient(315deg, rgba(189, 45, 50, 0.08), transparent 46%),
    var(--paper-soft);
  border: 1px solid rgba(16, 34, 65, 0.13);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(16, 34, 65, 0.12);
  animation: riseIn 720ms ease both;
}

.share-section::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: lineTravel 4.8s ease-in-out infinite;
}

.share-copy h2 {
  max-width: 13ch;
  margin: 0;
  color: var(--navy);
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.share-copy p:not(.section-kicker) {
  max-width: 52ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.share-panel {
  display: grid;
  gap: 14px;
}

.social-card {
  position: relative;
  overflow: hidden;
  padding: clamp(16px, 3vw, 24px);
  background: rgba(255, 250, 240, 0.82);
  border: 1px solid rgba(16, 34, 65, 0.14);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(16, 34, 65, 0.1);
}

.social-card {
  animation: riseIn 760ms 90ms ease both;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.social-link {
  display: grid;
  place-items: center;
  gap: 9px;
  min-height: 116px;
  padding: 12px 8px;
  color: var(--navy);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(244, 234, 216, 0.7)),
    var(--paper);
  border: 1px solid rgba(16, 34, 65, 0.14);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.social-link img {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(16, 34, 65, 0.18);
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.social-link:hover,
.social-link:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(189, 45, 50, 0.42);
  box-shadow: 0 18px 34px rgba(16, 34, 65, 0.16);
}

.social-link:hover img,
.social-link:focus-visible img {
  transform: translateY(-2px) rotate(-2deg) scale(1.05);
}

.copy-feedback {
  min-height: 1.28em;
  margin: 12px 0 0;
  color: var(--red-dark);
  font-size: 0.92rem;
  font-weight: 800;
}

.hero-copy-feedback {
  margin-top: 14px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(18px, 4vw, 56px);
  color: rgba(255, 250, 240, 0.9);
  background: var(--navy);
}

.site-footer p {
  margin: 0;
  font-weight: 800;
}

.site-footer .copyright {
  margin-top: 6px;
  color: rgba(255, 250, 240, 0.72);
  font-size: 0.92rem;
  font-weight: 600;
}

.site-footer a {
  font-weight: 800;
  text-decoration: none;
}

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

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: 86svh;
    align-items: start;
    padding-top: 86px;
  }

  .hero-background {
    background-position: 50% 100%;
    background-size: min(430px, 88vw) auto;
    opacity: 0.48;
  }

  .hero::before {
    background:
      linear-gradient(
        180deg,
        rgba(255, 250, 240, 0.99) 0%,
        rgba(255, 250, 240, 0.92) 52%,
        rgba(255, 250, 240, 0.38) 100%
      );
  }

  h1 {
    max-width: 10ch;
    font-size: clamp(3.2rem, 14vw, 5.8rem);
  }

  .book-strip {
    grid-template-columns: 92px 1fr;
    margin-top: -34px;
  }

  .book-strip img:last-child {
    display: none;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .reader-actions {
    justify-content: flex-start;
  }

  .reader-frame {
    min-height: 520px;
    height: 74svh;
  }

  .about-section {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .comments-heading {
    align-items: start;
    flex-direction: column;
  }

  .share-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: 0.92rem;
  }

  .nav-links {
    gap: 10px;
    font-size: 0.86rem;
  }

  .hero {
    padding-inline: 18px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .book-strip {
    grid-template-columns: 1fr;
  }

  .book-strip img {
    width: min(190px, 64vw);
    margin-inline: auto;
  }

  .reader-section,
  .about-section,
  .comments-section,
  .share-section {
    width: min(100% - 24px, 1180px);
  }

  .reader-frame {
    min-height: 470px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .comments-rotator {
    min-height: 360px;
  }

  .comment-card {
    padding: 70px 18px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
