/* =========================================================================
   M.C. Perry Author Website - Global Styles
   Dark, elegant, fantasy-romance visual style.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Inter:wght@300;400;500&display=swap');

/* --- CSS Variables / Theming --- */
:root {
  /* Colors - Custom Palette Matched to Author Photo */
  --bg-dark: #1A151D;       /* Warm plum-black */
  --bg-deep-plum: #4E3559;  /* Hoodie purple */
  --bg-burgundy: #9C4F69;   /* Banner mauve/rose */
  --bg-midnight: #160f18;   /* Deepest ambient dark */
  --bg-charcoal: #2A202D;   /* Dark warm grey-purple */
  --bg-panel: rgba(42, 32, 45, 0.85); /* For cards */

  --text-primary: #f8f1f4;  /* Soft pinkish-ivory */
  --text-muted: #d9c4d2;    /* Dusty lilac */
  
  --accent-gold: #C25979;   /* Warm peachy-gold from banner text */
  --accent-gold-hover: #D96B8D;
  --accent-silver: #E0E0E0;

  /* Typography */
  --font-heading: 'Cinzel', serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing & Sizes */
  --container-width: 1200px;
  --header-height: 80px;

  /* Transitions & Effects */
  --transition-fast: 0.2s ease-in-out;
  --transition-smooth: 0.3s ease;
  --shadow-elegant: 0 10px 30px rgba(0, 0, 0, 0.5);
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
}

/* --- Base Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

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

.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
}

/* --- Utilities --- */
.section-padding {
  padding: 8rem 0;
}

section + section {
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.text-center {
  text-align: center;
}

.text-accent {
  color: var(--accent-gold);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 1rem 2rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-smooth);
  border: 1px solid transparent;
  background-color: transparent;
}

.btn-primary {
  background-color: var(--accent-gold);
  color: #000;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.btn-outline {
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
}

.btn-outline:hover {
  background-color: var(--accent-gold);
  color: #000;
}

.btn-kickstarter {
  background-color: #05CE78;
  color: #fff;
  border-color: #05CE78;
}

.btn-kickstarter:hover {
  background-color: transparent;
  color: #05CE78;
  border-color: #05CE78;
  box-shadow: 0 0 15px rgba(5, 206, 120, 0.3);
}

/* --- Announcement Bar --- */
.announcement-bar {
  background-color: var(--accent-gold);
  color: #000;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-family: var(--font-body);
  letter-spacing: 0.5px;
}

.announcement-bar a {
  color: #000;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-weight: 600;
}

.announcement-bar a:hover {
  text-decoration: underline;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #000;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

/* --- Header / Navigation --- */
header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  transition: background-color var(--transition-smooth), backdrop-filter var(--transition-smooth);
}

/* Sticky Class added via JS */
header.scrolled {
  background-color: rgba(15, 16, 20, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo a {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-primary);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}

/* Hover underline effect */
.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-gold);
  transition: width var(--transition-smooth);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
}

/* --- Hero Sections --- */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  position: relative;
  background-image: linear-gradient(to bottom, rgba(15, 16, 20, 0.85), rgba(15, 16, 20, 1));
  padding-top: calc(var(--header-height) + 2rem);
  padding-bottom: 4rem;
  overflow: hidden;
}

/* Placeholder for actual hero image background */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://images.unsplash.com/photo-1549646633-e1f40d7c7eb9?auto=format&fit=crop&q=80&w=2000');
  background-size: cover;
  background-position: center;
  z-index: -1;
  opacity: 0.3;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
  width: 100%;
  margin-top: 2rem;
}

.hero-text {
  max-width: 600px;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--accent-gold);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.hero-headline {
  font-size: 3.5rem;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.hero-subheadline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.6;
  max-width: 90%;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Book Stack Visual Effect */
.book-stack {
  position: relative;
  width: 320px;
  height: 480px;
}

.book-stack-img {
  position: absolute;
  width: 280px;
  border-radius: var(--border-radius-sm);
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
  border: 1px solid rgba(212,175,55,0.3);
  transition: transform var(--transition-smooth);
}

.img-back {
  top: 0;
  right: 0;
  transform: scale(0.85) translateX(30px) rotate(5deg);
  opacity: 0.6;
  z-index: 1;
}

.img-middle {
  top: 10%;
  right: 15%;
  transform: scale(0.9) translateX(15px) rotate(-2deg);
  opacity: 0.8;
  z-index: 2;
}

.img-front {
  top: 20%;
  right: 30%;
  transform: scale(1) rotate(0deg);
  z-index: 3;
  border: 1px solid var(--accent-gold);
}

.book-stack:hover .img-front {
  transform: scale(1.05) translateY(-10px);
}
.book-stack:hover .img-middle {
  transform: scale(0.95) translateX(25px) rotate(-5deg);
}
.book-stack:hover .img-back {
  transform: scale(0.85) translateX(50px) rotate(10deg);
}

.hero-minimal {
  min-height: 50vh;
  display: flex;
  align-items: center;
  text-align: center;
  background: linear-gradient(to bottom, var(--bg-deep-plum), var(--bg-dark));
  padding-top: var(--header-height);
}

.hero-content {
  max-width: 800px;
}

.tagline {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--accent-gold);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

/* --- Book Cards / Grids --- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.card {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
}

.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-bottom: 2px solid var(--accent-gold);
}

.card-content {
  padding: 2rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-meta {
  color: var(--accent-gold);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* --- Specific Sections --- */
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 1rem;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background-color: var(--accent-gold);
}

/* About author snippet */
.author-bio-snippet {
  border-left: 2px solid var(--accent-gold);
  padding-left: 2rem;
  margin: 2rem 0;
}

/* --- Footer --- */
footer {
  margin-top: auto;
  background-color: var(--bg-charcoal);
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.social-icon:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- Series Hero Typography --- */
.series-hero-h1 {
  font-size: 3.8rem;
  color: var(--text-primary);
  font-family: var(--font-heading);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.series-hero-h2 {
  font-size: 1.7rem;
  color: #c25979;
  font-family: var(--font-heading);
  margin: 0 auto 1.5rem auto;
  line-height: 1.5;
  max-width: 1100px;
  font-weight: normal;
}

.series-hero-tagline {
  color: var(--text-primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
  display: block;
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

/* --- Responsive Layout --- */
@media (max-width: 900px) {
  h1, .hero-headline { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  
  .grid-2, .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  
  .hero-text {
    margin: 0 auto;
  }
  
  .hero-subheadline {
    margin: 0 auto 2.5rem auto;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  .book-stack {
    margin: 0 auto;
    height: 400px;
  }
  
  .img-back { right: -10%; }
  .img-front { right: 20%; }
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
    margin-left: auto;
  }
  
  .nav-links {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: var(--bg-dark);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: right var(--transition-smooth);
    gap: 3rem;
  }
  
  .nav-links.active {
    right: 0;
  }
  
  .nav-links a {
    font-size: 1.2rem;
  }

  .hero-content {
    text-align: center;
  }

  .series-hero-h1 {
    font-size: 2.2rem;
  }
  
  .series-hero-h2 {
    font-size: 1.2rem;
  }
  
  .series-hero-tagline {
    font-size: 0.85rem;
  }

  .btn-group, .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 15, 0.95);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-smooth);
}
.video-modal.active {
    display: flex;
    opacity: 1;
}
.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    background: var(--bg-charcoal);
    border-radius: var(--border-radius-md);
    padding: 10px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.9);
    border: 1px solid var(--accent-gold);
}
.video-modal-content video {
    width: 100%;
    border-radius: 4px;
    display: block;
}
.close-modal {
    position: absolute;
    top: -50px;
    right: 0;
    color: var(--text-primary);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.close-modal:hover {
    color: var(--accent-gold);
}
