/* =========================================================
   Jeremy Mason — Poet & Author
   Color palette: warm tan/light brown backgrounds
   Accents: deep red outlines and buttons
   ========================================================= */

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

:root {
  --bg:         #f2e8d9;
  --bg-mid:     #e8d9c4;
  --bg-section: #ddd0b8;
  --brown-dark: #3d1f0d;
  --brown-mid:  #6b3a22;
  --brown-soft: #8c5c3a;
  --tan:        #c49a6c;
  --tan-light:  #d4b48a;
  --red:        #8b1a1a;
  --red-light:  #b02020;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Montserrat', Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--brown-dark);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── UTILITIES ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.center { text-align: center; }
.section-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}
.section-label.center { text-align: center; }

h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--brown-dark);
  line-height: 1.15;
  margin-bottom: 32px;
}

/* ── NAVIGATION ── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  transition: background 0.4s, box-shadow 0.4s;
}
#navbar.scrolled {
  background: rgba(242, 232, 217, 0.97);
  box-shadow: 0 1px 0 rgba(139, 26, 26, 0.3);
  backdrop-filter: blur(8px);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: var(--cream);
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  transition: color 0.3s;
}
#navbar.scrolled .nav-logo { color: var(--brown-dark); text-shadow: none; }
#navbar.scrolled .nav-logo:hover { color: var(--red); }
.nav-logo:hover { color: var(--tan-light); }
.nav-links {
  list-style: none;
  display: flex;
  gap: 40px;
}
.nav-links a {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  position: relative;
  transition: color 0.3s;
}
#navbar.scrolled .nav-links a { color: var(--brown-mid); text-shadow: none; }
#navbar.scrolled .nav-links a:hover { color: var(--red); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--red-light);
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--tan-light); }
.nav-links a:hover::after { width: 100%; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--cream);
  transition: 0.3s;
}
#navbar.scrolled .nav-toggle span { background: var(--brown-dark); }

/* ── HERO ── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #1a0f0a;
}
.hero-bg {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: auto;
  max-width: 75%;
  object-fit: contain;
  object-position: right top;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(101, 55, 20, 0.97) 0%,
    rgba(80, 38, 10, 0.88) 38%,
    rgba(40, 18, 5, 0.4) 65%,
    rgba(14, 6, 2, 0.0) 100%
  );
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 60px 100px;
  max-width: 600px;
}
.hero-tagline {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #e84040;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
  margin-bottom: 16px;
}
.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 700;
  line-height: 0.95;
  color: #f5ece0;
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tan-light);
  margin-bottom: 36px;
  opacity: 0.85;
}
.btn-primary {
  display: inline-block;
  padding: 14px 36px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #f5ece0;
  text-decoration: none;
  background: var(--red);
  border: 1px solid var(--red);
  transition: background 0.3s, color 0.3s;
}
.btn-primary:hover {
  background: var(--red-light);
  border-color: var(--red-light);
  color: #f5ece0;
}
.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  right: 40px;
  z-index: 2;
}
.hero-scroll-hint span {
  display: block;
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--tan));
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.1); }
}

/* ── ABOUT ── */
.about {
  background: var(--bg);
  padding: 120px 0;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: start;
}
.about-image-wrap {
  position: relative;
}
.about-img-border {
  position: relative;
  display: inline-block;
}
.about-img-border::before {
  content: '';
  position: absolute;
  top: -14px;
  left: -14px;
  right: 14px;
  bottom: 14px;
  border: 1px solid var(--red);
  pointer-events: none;
  z-index: 0;
}
.about-img-border img {
  position: relative;
  z-index: 1;
  width: 100%;
  display: block;
  filter: grayscale(15%) contrast(1.05);
}
.about-text h2 { margin-bottom: 28px; }
.about-text p {
  font-size: 0.95rem;
  color: var(--brown-mid);
  margin-bottom: 20px;
  line-height: 1.8;
}
.about-text em {
  color: var(--red);
  font-style: italic;
}

/* ── BOOKS ── */
.books {
  background: var(--bg-mid);
  padding: 120px 0;
  border-top: 1px solid rgba(139, 26, 26, 0.3);
  border-bottom: 1px solid rgba(139, 26, 26, 0.3);
}
.books h2 { margin-bottom: 64px; }
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.book-card {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(196, 154, 108, 0.3);
  padding: 48px 36px;
  position: relative;
  transition: background 0.3s, border-color 0.3s;
}
.book-card:hover {
  background: rgba(255, 255, 255, 0.45);
  border-color: var(--red);
}
.book-card.featured {
  border-color: rgba(139, 26, 26, 0.5);
  background: rgba(255, 255, 255, 0.35);
}
.book-cover {
  margin-bottom: 24px;
  border: 2px solid rgba(139, 26, 26, 0.2);
  transition: border-color 0.3s;
}
.book-card:hover .book-cover { border-color: var(--red); }
.book-cover img {
  width: 100%;
  display: block;
  object-fit: cover;
}
.book-info h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--brown-dark);
  line-height: 1.3;
  margin-bottom: 16px;
}
.book-info p {
  font-size: 0.875rem;
  color: var(--brown-mid);
  line-height: 1.7;
  margin-bottom: 28px;
}
.book-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-buy {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  text-decoration: none;
  border: 1px solid var(--red);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.btn-buy:hover {
  background: var(--red);
  color: #f5ece0;
  border-color: var(--red);
}

/* ── GALLERY STRIP ── */
.gallery {
  overflow: hidden;
  height: 420px;
}
.gallery-track {
  display: flex;
  height: 100%;
}
.gallery-track img {
  flex: 1;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(20%) contrast(1.08);
  transition: filter 0.4s, flex 0.4s;
}
.gallery-track img:hover {
  flex: 1.6;
  filter: grayscale(0%) contrast(1);
}

/* ── INSTAGRAM SECTION ── */
.insta-section {
  background: var(--bg-section);
  padding: 120px 0;
  border-top: 1px solid rgba(139, 26, 26, 0.2);
}
.insta-section h2 { margin-bottom: 48px; }
.insta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}
.insta-card {
  cursor: pointer;
  border: 1px solid rgba(139, 26, 26, 0.25);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}
.insta-card:hover {
  border-color: var(--red);
  transform: translateY(-4px);
}
.insta-thumb {
  position: relative;
  background: #1a0f0a;
  aspect-ratio: 9/16;
  overflow: hidden;
}
.insta-video-inline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.insta-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 15, 10, 0.35);
  transition: background 0.2s;
}
.insta-card:hover .insta-play-overlay { background: rgba(26, 15, 10, 0.2); }
.insta-play-btn {
  width: 64px;
  height: 64px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5ece0;
  transition: background 0.3s, transform 0.3s;
}
.insta-card:hover .insta-play-btn {
  background: var(--red-light);
  transform: scale(1.1);
}
.insta-play-btn svg {
  width: 28px;
  height: 28px;
  margin-left: 4px;
}
.insta-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.2);
}
.insta-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 0.1s linear;
}
.insta-follow-card {
  position: absolute;
  inset: 0;
  background: rgba(26, 15, 10, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  padding: 32px;
}
.insta-follow-card[hidden] { display: none; }
.insta-follow-card p {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: #f5ece0;
  font-style: italic;
  line-height: 1.4;
}

/* ── CONNECT ── */
.connect {
  background: var(--bg);
  padding: 120px 0;
}
.connect-inner h2 { margin-bottom: 60px; }
.social-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 48px;
  border: 1px solid rgba(139, 26, 26, 0.25);
  color: var(--brown-dark);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
  min-width: 180px;
}
.social-card:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--red);
  color: var(--red);
}
.social-card svg {
  width: 28px;
  height: 28px;
  stroke: var(--brown-soft);
  transition: stroke 0.3s;
}
.social-card:hover svg { stroke: var(--red); }
.social-card span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.social-card small {
  font-size: 0.78rem;
  color: var(--brown-soft);
}

/* ── FOOTER ── */
.footer {
  background: var(--bg-section);
  border-top: 1px solid rgba(139, 26, 26, 0.3);
  padding: 48px 24px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.footer-credit {
  font-family: 'Dancing Script', cursive;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brown-soft);
  letter-spacing: 0.05em;
}
.footer-copy {
  font-size: 0.75rem;
  color: var(--brown-soft);
  letter-spacing: 0.05em;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about-image-wrap {
    max-width: 460px;
    margin: 0 auto;
  }
  .books-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .insta-grid { grid-template-columns: 1fr; max-width: 360px; margin-left: auto; margin-right: auto; }
  .gallery { height: 260px; }
}

@media (max-width: 640px) {
  .hero-bg { max-width: 100%; width: 100%; object-position: center top; opacity: 0.5; }
  .hero-overlay {
    background: linear-gradient(
      to bottom,
      rgba(14, 6, 2, 0.4) 0%,
      rgba(14, 6, 2, 0.7) 60%,
      rgba(14, 6, 2, 0.97) 100%
    );
  }
  .hero-content { padding: 0 24px 64px; }
  .about, .books, .connect { padding: 80px 0; }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(242, 232, 217, 0.98);
    padding: 16px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li a {
    display: block;
    padding: 14px 24px;
  }
  .nav-toggle { display: flex; }
  .social-card { min-width: 140px; padding: 32px 32px; }
  .book-card { padding: 36px 24px; }
  .gallery { height: 220px; }
  .gallery-track img:hover { flex: 1; }
}
