/* =====================================================
   JACK WORRILL
   HOME PAGE STYLES
===================================================== */

:root {
  --black: #090909;
  --dark: #111111;
  --cream: #eadcc5;
  --light: #f5efe5;
  --gold: #c7a56a;
  --muted: #aaa39a;

  --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;
  scroll-padding-top: 90px;
}

body {
  background: var(--black);
  color: var(--light);

  font-family: var(--sans);

  line-height: 1.5;

  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;

  max-width: 100%;
  height: auto;
}

/* Keyboard accessibility */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* =====================================================
   NAVIGATION
===================================================== */

.site-nav {
  position: fixed;

  top: 0;
  left: 0;

  width: 100%;
  height: 88px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 6%;

  z-index: 1000;

  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), transparent);

  transition:
    height 0.4s ease,
    background 0.4s ease,
    backdrop-filter 0.4s ease;
}

.site-nav.scrolled {
  height: 72px;

  background: rgba(8, 8, 8, 0.94);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  font-family: var(--display);

  font-size: 1.35rem;
  font-weight: 600;

  letter-spacing: 4px;

  white-space: nowrap;
}

.nav-links {
  display: flex;

  align-items: center;

  gap: 38px;
}

.nav-links a {
  position: relative;

  font-family: var(--serif);

  font-size: 1.1rem;

  color: #ddd;

  transition: color 0.3s ease;
}

.nav-links a::after {
  content: "";

  position: absolute;

  left: 0;
  bottom: -8px;

  width: 0;
  height: 1px;

  background: var(--gold);

  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: white;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* =====================================================
   MOBILE MENU BUTTON
===================================================== */

.menu-toggle {
  display: none;

  padding: 8px;

  border: 0;

  background: transparent;

  cursor: pointer;
}

.menu-toggle span {
  display: block;

  width: 28px;
  height: 1px;

  background: white;

  margin: 6px;

  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

/* =====================================================
   HERO
===================================================== */

.hero {
  position: relative;

  min-height: 100vh;

  display: flex;
  align-items: center;

  overflow: hidden;

  isolation: isolate;
}

.hero-background {
  position: absolute;

  inset: 0;

  z-index: -3;

  background: url("../assets/hero.jpg") center center / cover no-repeat;

  transform: scale(1.03);

  animation: heroZoom 14s ease-out forwards;
}

@keyframes heroZoom {
  from {
    transform: scale(1.08);
  }

  to {
    transform: scale(1);
  }
}

.hero-overlay {
  position: absolute;

  inset: 0;

  z-index: -2;

  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.88),
    rgba(0, 0, 0, 0.45),
    rgba(0, 0, 0, 0.15)
  );
}

.hero-content {
  position: relative;

  z-index: 2;

  max-width: 850px;

  padding: 150px 8% 100px;
}

.eyebrow,
.section-label {
  color: var(--gold);

  font-size: 0.72rem;

  letter-spacing: 4px;

  font-weight: 500;

  margin-bottom: 25px;
}

.hero h1 {
  font-family: var(--serif);

  font-size: clamp(4rem, 8vw, 8rem);

  font-weight: 300;

  line-height: 0.85;

  margin-bottom: 40px;
}

.hero h1 span {
  display: block;

  color: var(--cream);

  font-style: italic;
}

.hero-content > p:not(.eyebrow) {
  max-width: 570px;

  color: #d2d2d2;

  font-size: 1rem;

  line-height: 1.9;

  margin-bottom: 40px;
}

/* =====================================================
   HERO BUTTONS
===================================================== */

.hero-buttons {
  display: flex;

  gap: 18px;

  flex-wrap: wrap;
}

.btn {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  min-height: 52px;

  padding: 0 30px;

  font-size: 0.75rem;

  letter-spacing: 2px;

  text-transform: uppercase;

  transition:
    background 0.35s ease,
    color 0.35s ease,
    transform 0.35s ease,
    border-color 0.35s ease;
}

.primary-btn {
  background: var(--gold);

  color: #111;
}

.primary-btn:hover {
  background: white;

  transform: translateY(-3px);
}

.secondary-btn {
  border: 1px solid rgba(255, 255, 255, 0.5);

  color: white;
}

.secondary-btn:hover {
  background: white;

  color: #111;

  border-color: white;
}

/* =====================================================
   SCROLL INDICATOR
===================================================== */

.scroll-indicator {
  position: absolute;

  bottom: 35px;
  left: 8%;

  display: flex;

  align-items: center;

  gap: 15px;

  font-size: 0.62rem;

  letter-spacing: 3px;

  color: #bbb;

  transition: color 0.3s ease;
}

.scroll-indicator:hover {
  color: white;
}

.scroll-indicator i {
  display: block;

  width: 45px;
  height: 1px;

  background: var(--gold);
}

/* =====================================================
   WELCOME
===================================================== */

.welcome {
  padding: 150px 8%;

  background: var(--cream);

  color: #171513;

  text-align: center;
}

.section-container {
  max-width: 800px;

  margin: auto;
}

.welcome h2,
.author-info h2,
.home-cta h2 {
  font-family: var(--serif);

  font-size: clamp(3rem, 6vw, 5.5rem);

  font-weight: 300;

  line-height: 0.95;
}

.welcome h2 em,
.author-info h2 em,
.home-cta h2 em {
  display: block;

  color: #8d6c38;

  font-style: italic;
}

.divider {
  width: 60px;
  height: 1px;

  background: var(--gold);

  margin: 35px auto;
}

.welcome .section-label {
  color: #8d6c38;
}

.welcome p:not(.section-label) {
  font-family: var(--serif);

  font-size: 1.3rem;

  line-height: 1.8;

  color: #514b43;
}

/* =====================================================
   FEATURED BOOK
===================================================== */

.featured-book {
  padding: 150px 8%;

  background: #111;
}

.book-wrapper {
  max-width: 1200px;

  margin: auto;

  display: grid;

  grid-template-columns: 0.8fr 1fr;

  align-items: center;

  gap: 100px;
}

.book-image {
  position: relative;

  max-width: 400px;

  margin: auto;
}

.book-image img {
  position: relative;

  z-index: 2;

  width: 100%;

  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
}

.book-shadow {
  position: absolute;

  inset: 15% -10% -10%;

  background: rgba(199, 165, 106, 0.15);

  filter: blur(50px);

  pointer-events: none;
}

.book-info h2 {
  font-family: var(--serif);

  font-size: clamp(4rem, 7vw, 7rem);

  font-weight: 300;

  line-height: 0.8;

  color: var(--cream);
}

.book-info h3 {
  font-family: var(--serif);

  font-size: 1.4rem;

  font-weight: 400;

  margin-top: 25px;

  color: var(--gold);
}

.book-info .divider {
  margin: 30px 0;
}

.book-info p:not(.section-label) {
  max-width: 550px;

  color: #b9b9b9;

  line-height: 1.9;

  margin-bottom: 25px;
}

.text-link {
  display: inline-flex;

  gap: 18px;

  color: var(--gold);

  font-size: 0.75rem;

  letter-spacing: 2px;

  text-transform: uppercase;

  margin-top: 15px;

  transition: color 0.3s ease;
}

.text-link:hover {
  color: white;
}

.text-link span {
  transition: transform 0.3s ease;
}

.text-link:hover span {
  transform: translateX(7px);
}

/* =====================================================
   AUTHOR SECTION
===================================================== */

.author-section {
  display: grid;

  grid-template-columns: 1fr 1fr;

  background: #e8ddcc;

  color: #181614;
}

.author-image {
  min-height: 650px;

  overflow: hidden;
}

.author-image img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.author-info {
  display: flex;

  flex-direction: column;

  justify-content: center;

  padding: 100px 12%;
}

.author-info .section-label {
  color: #8d6c38;
}

.author-info h2 {
  margin-bottom: 35px;
}

.author-info p:not(.section-label) {
  max-width: 520px;

  font-family: var(--serif);

  font-size: 1.25rem;

  line-height: 1.8;

  color: #59534b;

  margin-bottom: 25px;
}

/* =====================================================
   CALL TO ACTION
===================================================== */

.home-cta {
  padding: 150px 8%;

  text-align: center;

  background:
    linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.9)),
    url("../assets/hero.jpg") center / cover no-repeat;

  background-attachment: fixed;
}

.home-cta .section-label {
  margin-bottom: 25px;
}

.home-cta h2 {
  margin-bottom: 45px;
}

.home-cta h2 em {
  color: var(--gold);
}

.home-cta .btn {
  display: inline-flex;
}

/* =====================================================
   FOOTER
===================================================== */

footer {
  background: #080808;

  text-align: center;

  padding: 70px 20px 30px;
}

.footer-brand {
  font-family: var(--display);

  font-size: 1.5rem;

  letter-spacing: 5px;
}

footer > .footer-inner > p {
  color: #888;

  margin: 15px 0 35px;
}

.footer-links {
  display: flex;

  justify-content: center;

  gap: 25px;

  flex-wrap: wrap;

  margin-bottom: 40px;
}

.footer-links a {
  color: #999;

  font-size: 0.75rem;

  letter-spacing: 1px;

  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--gold);
}

.copyright {
  border-top: 1px solid #222;

  padding-top: 25px;

  font-size: 0.7rem !important;

  color: #666 !important;
}

/* =====================================================
   TABLET
===================================================== */

@media (max-width: 900px) {
  .nav-links {
    position: fixed;

    top: 0;
    right: -100%;

    width: min(320px, 85%);

    height: 100vh;

    background: #0b0b0b;

    flex-direction: column;

    justify-content: center;

    gap: 30px;

    transition: right 0.4s ease;

    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.3);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 1.4rem;
  }

  .menu-toggle {
    display: block;

    position: relative;

    z-index: 1001;
  }

  .book-wrapper {
    grid-template-columns: 1fr;

    gap: 70px;
  }

  .book-info {
    text-align: center;
  }

  .book-info .divider {
    margin-left: auto;
    margin-right: auto;
  }

  .book-info p:not(.section-label) {
    margin-left: auto;
    margin-right: auto;
  }

  .author-section {
    grid-template-columns: 1fr;
  }

  .author-image {
    min-height: 500px;
  }
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 600px) {
  .site-nav {
    height: 75px;

    padding: 0 5%;
  }

  .site-nav.scrolled {
    height: 68px;
  }

  .brand {
    font-size: 1rem;

    letter-spacing: 3px;
  }

  .hero {
    min-height: 100svh;
  }

  .hero-content {
    padding: 140px 7% 110px;
  }

  .hero h1 {
    font-size: clamp(3.5rem, 16vw, 5rem);

    line-height: 0.88;
  }

  .hero-content > p:not(.eyebrow) {
    font-size: 0.95rem;

    line-height: 1.8;
  }

  .hero-buttons {
    flex-direction: column;

    align-items: stretch;

    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .scroll-indicator {
    left: 7%;

    bottom: 25px;
  }

  .welcome,
  .featured-book,
  .home-cta {
    padding: 100px 7%;
  }

  .welcome h2,
  .author-info h2,
  .home-cta h2 {
    font-size: clamp(3rem, 14vw, 4.5rem);
  }

  .welcome p:not(.section-label) {
    font-size: 1.15rem;
  }

  .book-info h2 {
    font-size: clamp(4rem, 18vw, 6rem);
  }

  .book-info h3 {
    font-size: 1.2rem;
  }

  .author-info {
    padding: 80px 8%;
  }

  .author-image {
    min-height: 400px;
  }

  .author-info p:not(.section-label) {
    font-size: 1.15rem;
  }

  .home-cta {
    background-attachment: scroll;
  }

  .footer-links {
    flex-direction: column;

    gap: 15px;
  }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-background {
    animation: none;

    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;

    scroll-behavior: auto !important;
  }
}
