/* =====================================================
   JACK WORRILL
   BOOK PAGE STYLES
===================================================== */

/* =====================================================
   ROOT VARIABLES
===================================================== */

:root {
  --cream: #ead7b6;
  --light: #f4eee3;

  --dark: #111;
  --black: #080808;

  --gold: #c6a15c;

  --text: #171513;
  --muted: #665f55;

  --serif: "Cormorant Garamond", serif;
  --display: "Playfair Display", serif;
  --sans: "Inter", sans-serif;
}

/* =====================================================
   RESET
===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--cream);

  color: var(--text);

  font-family: var(--sans);

  line-height: 1.5;

  overflow-x: hidden;
}

a {
  text-decoration: none;

  color: inherit;
}

img {
  display: block;

  max-width: 100%;

  height: auto;
}

button,
input,
textarea {
  font: inherit;
}

/* =====================================================
   ACCESSIBILITY
===================================================== */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);

  outline-offset: 5px;
}

::selection {
  background: var(--gold);

  color: var(--black);
}

/* =====================================================
   NAVIGATION
===================================================== */

.site-nav {
  position: fixed;

  top: 0;
  left: 0;

  width: 100%;

  height: 85px;

  padding: 0 7%;

  display: flex;

  justify-content: space-between;

  align-items: center;

  z-index: 1000;

  color: white;

  background: rgba(0, 0, 0, 0.35);

  backdrop-filter: blur(8px);

  -webkit-backdrop-filter: blur(8px);

  transition:
    height 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease;
}

/* Navigation after scrolling */

.site-nav.scrolled {
  height: 72px;

  background: rgba(8, 8, 8, 0.94);

  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

.brand {
  font-family: var(--display);

  font-size: 1.3rem;

  font-weight: 600;

  letter-spacing: 4px;

  white-space: nowrap;
}

nav {
  display: flex;

  align-items: center;

  gap: 35px;
}

nav a {
  font-family: var(--serif);

  font-size: 1.1rem;

  position: relative;

  transition: color 0.3s ease;
}

nav a::after {
  content: "";

  position: absolute;

  bottom: -7px;

  left: 0;

  width: 0;

  height: 1px;

  background: var(--gold);

  transition: width 0.3s ease;
}

nav a:hover {
  color: var(--gold);
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

nav a.active {
  color: var(--gold);
}

/* =====================================================
   MOBILE MENU BUTTON
===================================================== */

.menu-toggle {
  display: none;

  width: 42px;

  height: 42px;

  padding: 5px;

  border: 0;

  background: transparent;

  cursor: pointer;

  z-index: 1001;
}

.menu-toggle span {
  display: block;

  width: 27px;

  height: 1px;

  background: white;

  margin: 6px auto;

  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

/* =====================================================
   HERO
===================================================== */

.book-hero {
  position: relative;

  min-height: 75vh;

  display: flex;

  align-items: center;

  justify-content: center;

  text-align: center;

  color: white;

  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.8)),
    url("../assets/hero.jpg") center center / cover no-repeat;
}

.book-hero-content {
  position: relative;

  z-index: 2;

  width: 100%;

  max-width: 1100px;

  padding: 120px 20px 70px;
}

.book-hero-content p {
  color: var(--gold);

  letter-spacing: 5px;

  font-size: 0.7rem;

  font-weight: 500;

  margin-bottom: 30px;
}

.book-hero h1 {
  font-family: var(--serif);

  font-size: clamp(5rem, 13vw, 10rem);

  font-weight: 300;

  line-height: 0.8;

  letter-spacing: -2px;
}

.book-hero h2 {
  font-family: var(--serif);

  font-weight: 400;

  font-size: 1.5rem;

  line-height: 1.4;

  margin-top: 30px;
}

/* =====================================================
   BOOK DETAILS
===================================================== */

.book-details {
  max-width: 1200px;

  margin: auto;

  padding: 140px 7%;

  display: grid;

  grid-template-columns:
    minmax(0, 0.8fr)
    minmax(0, 1.2fr);

  align-items: center;

  gap: 100px;
}

.cover {
  max-width: 420px;

  width: 100%;

  margin: auto;
}

.cover img {
  width: 100%;

  height: auto;

  box-shadow: 15px 25px 50px rgba(40, 30, 20, 0.3);

  transition:
    transform 0.5s ease,
    box-shadow 0.5s ease;
}

.cover:hover img {
  transform: translateY(-5px);

  box-shadow: 18px 32px 60px rgba(40, 30, 20, 0.35);
}

.synopsis {
  min-width: 0;
}

.synopsis > span {
  display: inline-block;

  color: #92733f;

  font-size: 0.7rem;

  font-weight: 500;

  letter-spacing: 4px;
}

.synopsis h2 {
  font-family: var(--serif);

  font-size: clamp(3.2rem, 6vw, 5.5rem);

  line-height: 0.9;

  font-weight: 400;

  margin-top: 25px;
}

.line {
  width: 60px;

  height: 1px;

  background: var(--gold);

  margin: 30px 0;
}

.synopsis p {
  font-family: var(--serif);

  font-size: 1.2rem;

  line-height: 1.8;

  color: #554d43;

  margin-bottom: 20px;

  max-width: 700px;
}

/* =====================================================
   BOOK BUTTON
===================================================== */

.book-button {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  margin-top: 20px;

  padding: 16px 28px;

  background: #171513;

  color: white;

  font-size: 0.7rem;

  font-weight: 500;

  letter-spacing: 2px;

  border: 1px solid #171513;

  transition:
    background 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease,
    border-color 0.3s ease;
}

.book-button:hover {
  background: var(--gold);

  border-color: var(--gold);

  color: #111;

  transform: translateY(-3px);
}

.book-button:active {
  transform: translateY(0);
}

/* =====================================================
   QUOTE
===================================================== */

.book-quote {
  padding: 130px 20px;

  background: #161412;

  color: var(--cream);

  text-align: center;
}

.book-quote p {
  font-family: var(--serif);

  font-size: clamp(2.5rem, 6vw, 5rem);

  font-style: italic;

  line-height: 1.05;

  max-width: 1000px;

  margin: auto;
}

.book-quote span {
  display: block;

  margin-top: 25px;

  color: var(--gold);

  letter-spacing: 2px;

  font-family: var(--sans);

  font-size: 0.8rem;
}

/* =====================================================
   BUY SECTION
===================================================== */

.buy-section {
  padding: 130px 20px;

  text-align: center;

  background: var(--cream);
}

.buy-section h2 {
  font-family: var(--serif);

  font-size: clamp(3rem, 6vw, 4rem);

  font-weight: 400;

  line-height: 1;
}

.buy-section p {
  margin: 20px 0;

  color: #665f55;

  font-family: var(--serif);

  font-size: 1.2rem;
}

/* =====================================================
   FOOTER
===================================================== */

footer {
  background: var(--black);

  color: white;

  text-align: center;

  padding: 70px 20px;
}

.footer-brand {
  font-family: var(--display);

  letter-spacing: 5px;

  font-size: 1.4rem;

  font-weight: 600;
}

footer p {
  color: #888;

  margin-top: 15px;
}

.footer-links {
  display: flex;

  justify-content: center;

  align-items: center;

  flex-wrap: wrap;

  gap: 25px;

  margin-top: 30px;
}

.footer-links a {
  color: #aaa;

  font-family: var(--serif);

  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--gold);
}

.copyright {
  font-size: 0.7rem;

  margin-top: 40px;
}

/* =====================================================
   SCROLL REVEAL
===================================================== */

.scroll-reveal {
  opacity: 0;

  transform: translateY(30px);

  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.scroll-reveal.visible {
  opacity: 1;

  transform: translateY(0);
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 900px) {
  .site-nav {
    height: 75px;

    padding: 0 6%;
  }

  .site-nav.scrolled {
    height: 68px;
  }

  nav {
    position: fixed;

    right: -100%;

    top: 0;

    width: min(80%, 400px);

    height: 100vh;

    padding: 100px 30px;

    background: #0a0a0a;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    gap: 30px;

    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);

    transition: right 0.4s ease;
  }

  nav.open {
    right: 0;
  }

  nav a {
    font-size: 1.4rem;
  }

  .menu-toggle {
    display: block;
  }

  /* Hamburger → X */

  nav.open ~ .menu-toggle span:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  nav.open ~ .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  nav.open ~ .menu-toggle span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .book-details {
    grid-template-columns: 1fr;

    gap: 70px;

    padding: 110px 7%;
  }

  .cover {
    max-width: 450px;
  }

  .synopsis {
    text-align: center;
  }

  .synopsis h2 {
    max-width: 850px;

    margin-left: auto;
    margin-right: auto;
  }

  .line {
    margin-left: auto;

    margin-right: auto;
  }

  .synopsis p {
    margin-left: auto;

    margin-right: auto;
  }
}

/* =====================================================
   TABLET
===================================================== */

@media (max-width: 700px) {
  .book-hero {
    min-height: 70vh;
  }

  .book-hero-content {
    padding: 110px 20px 70px;
  }

  .book-hero h1 {
    font-size: clamp(4.5rem, 17vw, 7rem);
  }

  .book-hero h2 {
    font-size: 1.3rem;

    max-width: 600px;

    margin-left: auto;

    margin-right: auto;
  }

  .book-details {
    padding: 90px 7%;
  }

  .book-quote {
    padding: 100px 7%;
  }

  .buy-section {
    padding: 100px 7%;
  }
}

/* =====================================================
   SMALL MOBILE
===================================================== */

@media (max-width: 480px) {
  .site-nav {
    padding: 0 5%;
  }

  .brand {
    font-size: 0.95rem;

    letter-spacing: 3px;
  }

  nav {
    width: 100%;
  }

  .book-hero {
    min-height: 65vh;
  }

  .book-hero-content {
    padding: 100px 15px 60px;
  }

  .book-hero-content p {
    font-size: 0.6rem;

    letter-spacing: 3px;

    margin-bottom: 22px;
  }

  .book-hero h1 {
    font-size: clamp(4rem, 20vw, 6rem);
  }

  .book-hero h2 {
    font-size: 1.1rem;

    margin-top: 22px;
  }

  .book-details {
    padding: 75px 6%;

    gap: 55px;
  }

  .synopsis > span {
    font-size: 0.62rem;

    letter-spacing: 3px;
  }

  .synopsis h2 {
    font-size: clamp(3rem, 14vw, 4.5rem);
  }

  .synopsis p {
    font-size: 1.1rem;

    line-height: 1.7;
  }

  .book-button {
    width: 100%;

    padding: 16px 20px;
  }

  .book-quote {
    padding: 85px 6%;
  }

  .book-quote p {
    font-size: clamp(2.4rem, 12vw, 3.5rem);
  }

  .buy-section {
    padding: 85px 6%;
  }

  .buy-section h2 {
    font-size: 3rem;
  }

  .footer-links {
    gap: 15px;
  }
}

/* =====================================================
   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;

    scroll-behavior: auto !important;
  }

  .scroll-reveal {
    opacity: 1;

    transform: none;
  }
}
