/* ============================================
   THE SHADOW — Mike Dyson
   Custom styles layered over Tailwind
   Palette derived from book cover artwork
   ============================================ */

:root {
  /* Light mode (cream + copper + teal — daytime book cover top) */
  --bg:          #f6efe4;
  --bg-alt:      #ecdfca;
  --bg-section:  #ffffff;
  --text:        #1f2a2f;
  --text-muted:  #5c6a70;
  --accent:      #b87a4e;   /* copper "MIKE DYSON" terracotta */
  --accent-hov:  #a3683d;
  --gold:        #d99c5b;
  --teal-deep:   #2d3a3f;
  --border:      rgba(45, 58, 63, 0.12);
  --shadow-soft: 0 10px 40px rgba(31, 42, 47, 0.10);
  --shadow-strong: 0 30px 80px rgba(31, 42, 47, 0.25);

  --amazon:      #ff9900;
  --amazon-hov:  #e88a00;

  --hero-grad-top:    rgba(20, 29, 33, 0.55);
  --hero-grad-mid:    rgba(20, 29, 33, 0.20);
  --hero-grad-bot:    rgba(20, 29, 33, 0.75);
}

[data-theme="dark"] {
  /* Dark mode (deep teal + warm gold — book cover at twilight) */
  --bg:          #0f1619;
  --bg-alt:      #182328;
  --bg-section:  #131c20;
  --text:        #f3eadc;
  --text-muted:  #98a6ac;
  --accent:      #e0a766;
  --accent-hov:  #f0b876;
  --gold:        #f4a958;
  --teal-deep:   #0a1114;
  --border:      rgba(243, 234, 220, 0.10);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 30px 80px rgba(0, 0, 0, 0.6);

  --hero-grad-top:    rgba(10, 17, 20, 0.7);
  --hero-grad-mid:    rgba(10, 17, 20, 0.3);
  --hero-grad-bot:    rgba(10, 17, 20, 0.9);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.6s ease, color 0.6s ease;
}

::selection { background: var(--accent); color: #fff; }

/* ============ TYPOGRAPHY ============ */
.brand { color: var(--text); }
.accent-text { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.font-serif { letter-spacing: -0.01em; }
.eyebrow { color: var(--accent); font-weight: 500; }

/* ============ NAV ============ */
#nav {
  background: transparent;
  color: #f3eadc;
}
#nav.scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
#nav .brand { color: inherit; }

.nav-link {
  position: relative;
  color: inherit;
  opacity: 0.85;
  transition: opacity 0.3s, color 0.3s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.4s ease;
}
.nav-link:hover { opacity: 1; }
.nav-link:hover::after { width: 100%; }

.theme-btn {
  position: relative;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.7;
  transition: opacity 0.3s, transform 0.3s, background 0.3s;
}
.theme-btn:hover { opacity: 1; transform: rotate(15deg); background: color-mix(in srgb, currentColor 8%, transparent); }
.theme-btn .icon-sun { display: none; }
.theme-btn .icon-moon { display: block; }
[data-theme="dark"] .theme-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-btn .icon-moon { display: none; }

.audio-btn:hover { transform: none; }
.audio-btn .icon-sound-on { display: none; }
.audio-btn .icon-sound-off { display: block; }
.audio-btn.is-playing .icon-sound-on { display: block; }
.audio-btn.is-playing .icon-sound-off { display: none; }
.audio-btn.needs-unlock {
  animation: audioPulse 1.8s ease-in-out infinite;
  opacity: 1;
}
.audio-btn.needs-unlock::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.5;
  animation: audioRing 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes audioPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes audioRing {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ============ BUTTONS ============ */
.btn-amazon, .btn-amazon-lg {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: linear-gradient(180deg, #ffb84d 0%, #ff9900 100%);
  color: #1f2a2f;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
  box-shadow: 0 6px 20px rgba(255, 153, 0, 0.35);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.btn-amazon { padding: 0.55rem 1.2rem; font-size: 0.85rem; }
.btn-amazon-lg { padding: 0.95rem 2rem; font-size: 0.95rem; }
.btn-amazon:hover, .btn-amazon-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 153, 0, 0.45);
  filter: brightness(1.05);
}

.btn-ghost {
  display: inline-flex; align-items: center;
  padding: 0.9rem 1.8rem;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
  transition: all 0.3s ease;
  letter-spacing: 0.04em;
}
.btn-ghost:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.link {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.3s;
}
.link:hover { color: var(--accent); }

.social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.social:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-image: url("img/pUZI0.jpg");
  background-size: cover;
  background-position: center 55%;
  transform: scale(1.05);
  animation: heroZoom 18s ease-out forwards;
  will-change: transform;
}
@keyframes heroZoom {
  to { transform: scale(1.0); }
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      var(--hero-grad-top) 0%,
      var(--hero-grad-mid) 40%,
      var(--hero-grad-bot) 100%);
  pointer-events: none;
  z-index: 2;
}

/* ============ HERO FOG / NEBLINA ============ */
.hero-fog {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
  mix-blend-mode: screen;
}
.fog-layer {
  position: absolute;
  inset: -25% -10%;
  display: block;
  filter: blur(50px);
  opacity: 0.55;
  will-change: transform;
}
.fog-1 {
  background:
    radial-gradient(ellipse 55% 30% at 25% 75%, rgba(255,235,205,0.55), transparent 65%),
    radial-gradient(ellipse 45% 25% at 75% 70%, rgba(255,220,180,0.45), transparent 65%),
    radial-gradient(ellipse 70% 25% at 50% 88%, rgba(255,245,225,0.40), transparent 70%);
  animation: fogDrift1 38s ease-in-out infinite alternate;
}
.fog-2 {
  background:
    radial-gradient(ellipse 50% 20% at 70% 55%, rgba(240,230,215,0.45), transparent 70%),
    radial-gradient(ellipse 40% 18% at 20% 50%, rgba(220,210,200,0.35), transparent 70%),
    radial-gradient(ellipse 80% 20% at 50% 65%, rgba(255,240,220,0.30), transparent 75%);
  animation: fogDrift2 54s ease-in-out infinite alternate;
  opacity: 0.45;
  filter: blur(70px);
}
.fog-3 {
  background:
    radial-gradient(ellipse 65% 22% at 50% 95%, rgba(255,250,240,0.55), transparent 75%),
    radial-gradient(ellipse 35% 15% at 15% 80%, rgba(255,225,190,0.40), transparent 70%),
    radial-gradient(ellipse 35% 15% at 85% 82%, rgba(255,225,190,0.40), transparent 70%);
  animation: fogDrift3 28s ease-in-out infinite alternate;
  opacity: 0.65;
  filter: blur(35px);
}
@keyframes fogDrift1 {
  0%   { transform: translate3d(-4%, 1%, 0) scale(1.05); }
  100% { transform: translate3d(5%, -2%, 0) scale(1.15); }
}
@keyframes fogDrift2 {
  0%   { transform: translate3d(6%, -1%, 0) scale(1.1); }
  100% { transform: translate3d(-5%, 2%, 0) scale(1.2); }
}
@keyframes fogDrift3 {
  0%   { transform: translate3d(-2%, 2%, 0) scale(1); }
  100% { transform: translate3d(3%, -1%, 0) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .fog-layer { animation: none; }
}
.hero h1, .hero p, .hero .eyebrow { color: #f3eadc; }
.hero .accent-text { color: var(--teal-deep); }
.hero .eyebrow { color: var(--teal-deep); }

.divider {
  width: 60px; height: 1px;
  background: var(--gold);
  opacity: 0.7;
}

/* ============ PHRASE ROTATOR ============ */
.phrase-rotator {
  display: grid;
  place-items: center;
}
.phrase-rotator .phrase {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  text-align: center;
}
.phrase-rotator .phrase-active { opacity: 1; }

/* ============ HERO DARK CYCLE ============ */
.hero-dark-bg {
  position: absolute; inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 3s ease;
}
.hero-bg,
.hero-fog,
.hero-overlay,
.hero .eyebrow,
.hero .phrase-rotator,
.hero .scroll-cue {
  transition: opacity 3s ease;
}
.hero h1 { transition: color 3s ease; }
.hero.is-dark .hero-bg,
.hero.is-dark .hero-fog,
.hero.is-dark .hero-overlay,
.hero.is-dark .eyebrow,
.hero.is-dark .phrase-rotator,
.hero.is-dark .scroll-cue {
  opacity: 0;
}
.hero.is-dark .hero-dark-bg { opacity: 1; }
.hero.is-dark h1 { color: var(--gold); }

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #f3eadc;
  opacity: 0.85;
  transition: opacity 0.3s, transform 0.3s;
}
.scroll-cue:hover { opacity: 1; transform: translateY(2px); }
.scroll-cue-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
}
.scroll-cue-arrow {
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(8px); opacity: 1; }
}

/* ============ REVEAL ANIMATIONS ============ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ BOOK SHOWCASE ============ */
.book-showcase {
  background: var(--bg-alt);
  position: relative;
}
[data-theme="dark"] .book-showcase {
  background: var(--bg-section);
}
.book-showcase::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(217, 156, 91, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(184, 122, 78, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.book-stage {
  display: flex;
  justify-content: center;
}
.book-mockup {
  position: relative;
  width: min(420px, 90%);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 25px 35px rgba(0,0,0,0.25));
}
.book-mockup:hover {
  transform: translateY(-8px) scale(1.02);
}
.book-mockup img {
  width: 100%;
  height: auto;
  display: block;
}
[data-theme="dark"] .book-mockup {
  filter: drop-shadow(0 25px 45px rgba(0,0,0,0.6));
}

/* ============ SCRIPTURE PARALLAX ============ */
.scripture {
  position: relative;
  overflow: hidden;
}
.scripture-bg {
  position: absolute; inset: -10%;
  background-image: url("img/pUZI0.jpg");
  background-size: cover;
  background-position: center 30%;
  background-attachment: fixed;
  filter: brightness(0.45) saturate(1.1);
}
[data-theme="dark"] .scripture-bg {
  filter: brightness(0.30) saturate(1.05);
}
.scripture::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    var(--bg) 0%,
    transparent 15%,
    transparent 85%,
    var(--bg) 100%);
  z-index: 1;
  pointer-events: none;
}
.scripture blockquote, .scripture .eyebrow {
  color: #f3eadc;
  text-shadow: 0 2px 30px rgba(0,0,0,0.6);
}
.scripture .eyebrow { color: var(--gold); }

/* ============ ABOUT ============ */
.about {
  background: var(--bg);
}
.author-photo {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.author-photo::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  transform: translate(12px, 12px);
  z-index: -1;
}
.author-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* ============ CONTACT ============ */
.contact {
  background: var(--bg-alt);
  position: relative;
}
[data-theme="dark"] .contact {
  background: var(--bg-section);
}
.form-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.form-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0.25rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.3s, background 0.3s;
}
.form-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.form-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
textarea.form-input { resize: vertical; min-height: 120px; }

/* ============ FOOTER ============ */
.footer {
  background: var(--teal-deep);
  color: #c3cdd2;
  border-top: 1px solid var(--border);
}
[data-theme="dark"] .footer {
  background: #060b0d;
}
.footer .brand { color: #f3eadc; }
.footer .text-muted { color: #8b969b; }
.footer .link { color: #f3eadc; }
.footer .social { border-color: rgba(243,234,220,0.18); color: #c3cdd2; }
.footer .social:hover { color: var(--gold); border-color: var(--gold); }

/* ============ RESPONSIVE TWEAKS ============ */
@media (max-width: 640px) {
  .hero h1 { font-size: 3.5rem; }
  .scripture-bg { background-attachment: scroll; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero-bg { animation: none; }
  .reveal, .reveal-up { opacity: 1; transform: none; }
}
