/* ===================================================================
   Kevin Hartman — Author Site
   Dark, cinematic, literary-thriller aesthetic
   =================================================================== */

:root {
  --bg:        #0a0b0d;
  --bg-soft:   #111317;
  --bg-card:   #15181d;
  --ink:       #e8e4dc;   /* warm off-white text */
  --ink-muted: #9a958c;
  --gold:      #c5a35a;   /* refined gold accent */
  --gold-soft: #d8bd7e;
  --line:      rgba(197, 163, 90, 0.22);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans:  "Jost", system-ui, -apple-system, sans-serif;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.section { padding: clamp(4.5rem, 10vw, 8rem) 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 1rem;
}

.section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  font-style: italic;
  color: var(--gold-soft);
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

p { margin-bottom: 1.1rem; }
.muted { color: var(--ink-muted); font-size: 0.95rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.95rem 2.1rem;
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  background: transparent;
  cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), transform 0.3s var(--ease);
}
.btn:hover { background: var(--gold); color: #14110a; }
.btn--ghost { border-color: var(--line); color: var(--ink-muted); }
.btn--ghost:hover { background: transparent; border-color: var(--gold); color: var(--gold-soft); }
.btn--buy { background: var(--gold); color: #14110a; border-color: var(--gold); }
.btn--buy:hover { background: var(--gold-soft); border-color: var(--gold-soft); color: #14110a; }

/* ===================================================================
   HEADER / NAV
   =================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
  transition: padding 0.4s var(--ease);
}
.scrolled .nav { padding-top: 1rem; padding-bottom: 1rem; }

.brand {
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: 2.4rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.35s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 26px; height: 2px; background: var(--ink); transition: transform 0.35s var(--ease), opacity 0.3s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================================================================
   HERO
   =================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  text-align: center;
  /* Atmospheric layered gradient stands in for a cinematic photo until you add one */
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(197,163,90,0.10), transparent 55%),
    radial-gradient(100% 100% at 50% 120%, rgba(40,52,74,0.45), transparent 60%),
    linear-gradient(180deg, #0d0f13 0%, #0a0b0d 55%, #08090b 100%);
}
.hero__overlay {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.hero__content { position: relative; z-index: 2; width: 100%; }

.hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  margin: 0.5rem 0 1.2rem;
  text-shadow: 0 4px 40px rgba(0,0,0,0.6);
}
.hero__byline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
}
.hero__release {
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 2rem 0 2.2rem;
}

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(1.2rem, 5vw, 3rem);
}
.countdown__unit { display: flex; flex-direction: column; align-items: center; }
.countdown__num {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.countdown__label {
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.6rem;
}

.scroll-cue {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  color: var(--gold);
  z-index: 2;
  animation: bob 2.2s var(--ease) infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ===================================================================
   THE BOOK
   =================================================================== */
.book { background: var(--bg-soft); }
.book__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.book__cover { position: relative; aspect-ratio: 2 / 3; }
.book__cover img,
.cover-placeholder {
  width: 100%; height: 100%;
  border-radius: 2px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.6), 0 0 0 1px var(--line);
  object-fit: cover;
}
.cover-placeholder {
  display: none; /* shown by JS onerror only if the cover image fails to load */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  text-align: center;
  padding: 2rem;
  background:
    radial-gradient(80% 60% at 50% 30%, rgba(197,163,90,0.10), transparent),
    linear-gradient(160deg, #1a1d23, #0e1014);
}
.cover-placeholder__title {
  font-family: var(--serif);
  font-size: 1.7rem;
  color: var(--gold-soft);
  line-height: 1.2;
}
.cover-placeholder__note {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.book__meta {
  list-style: none;
  margin: 2rem 0;
  border-top: 1px solid var(--line);
}
.book__meta li {
  display: flex;
  gap: 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.book__meta span {
  min-width: 90px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  padding-top: 3px;
}
.book__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }

/* --- More books in the list --- */
.book-more {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding-top: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line);
  text-align: center;
}
.book-more__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: clamp(2rem, 5vw, 3rem);
}
.book-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.4rem, 3vw, 2.2rem);
  text-align: left;
}
.book-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 1.6rem;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.book-card:hover { transform: translateY(-5px); background: #1a1e24; }
.book-card__cover { position: relative; aspect-ratio: 2 / 3; }
.book-card__cover img,
.book-card .cover-placeholder {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.5), 0 0 0 1px var(--line);
}
.cover-placeholder--sm { padding: 1rem; }
.cover-placeholder--sm .cover-placeholder__title { font-size: 1.05rem; }
.cover-placeholder--sm .cover-placeholder__note { font-size: 0.56rem; }
.book-card__body { display: flex; flex-direction: column; }
.book-card__tag {
  font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold);
}
.book-card__name {
  font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin: 0.4rem 0 0.6rem;
}
.book-card__desc { font-size: 0.92rem; color: var(--ink-muted); margin-bottom: 1.1rem; }
.book-card__status {
  align-self: flex-start;
  margin-top: auto;
  font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-soft);
  border: 1px solid var(--line);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
}
.book-more__note { margin-top: 2rem; }

/* Clickable card (links to an external book site) */
.book-card--link { cursor: pointer; color: inherit; }
.book-card--link:hover { border-color: var(--gold); }
.book-card__status--link {
  color: var(--gold-soft);
  border-color: var(--gold);
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
.book-card--link:hover .book-card__status--link {
  background: var(--gold);
  color: #14110a;
}

/* ===================================================================
   BOOKSHELF (horizontal scroller)
   =================================================================== */
.bookshelf { background: var(--bg); }
.bookshelf__lead { color: var(--ink-muted); max-width: 560px; }

.bookshelf__viewport {
  position: relative;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.shelf-track {
  display: flex;
  gap: clamp(1.4rem, 3vw, 2.4rem);
  /* center the books when they fit, but scroll from the start when they overflow */
  justify-content: safe center;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
}
.shelf-track::-webkit-scrollbar { display: none; }

.shelf-item {
  flex: 0 0 auto;
  width: clamp(210px, 26vw, 270px);
  scroll-snap-align: center;
  color: inherit;
  transition: transform 0.45s var(--ease);
}
.shelf-item:hover { transform: translateY(-10px); }

.shelf-item__cover {
  position: relative;
  aspect-ratio: 2 / 3;
  margin-bottom: 1.1rem;
}
.shelf-item__cover img,
.shelf-item .cover-placeholder {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 22px 45px rgba(0,0,0,0.6), 0 0 0 1px var(--line);
  transition: box-shadow 0.45s var(--ease);
}
.shelf-item:hover .shelf-item__cover img,
.shelf-item:hover .shelf-item .cover-placeholder {
  box-shadow: 0 32px 60px rgba(0,0,0,0.72), 0 0 0 1px var(--gold);
}
/* soft grounding shadow so each book "sits" on the shelf */
.shelf-item__cover::after {
  content: "";
  position: absolute;
  left: 6%; right: 6%; bottom: -14px;
  height: 18px;
  background: radial-gradient(closest-side, rgba(0,0,0,0.6), transparent);
  filter: blur(2px);
}
.shelf-item__title {
  display: block;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.2;
}
.shelf-item__meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.shelf-arrow {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  z-index: 5;
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10, 11, 13, 0.82);
  backdrop-filter: blur(6px);
  color: var(--gold-soft);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.shelf-arrow:hover { background: var(--gold); color: #14110a; border-color: var(--gold); }
.shelf-arrow--prev { left: clamp(0.25rem, 1.5vw, 0.75rem); }
.shelf-arrow--next { right: clamp(0.25rem, 1.5vw, 0.75rem); }
.shelf-arrow.is-disabled { opacity: 0; pointer-events: none; }

/* ===================================================================
   ABOUT
   =================================================================== */
.about { background: var(--bg); }
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: start;
}
.about__photo { aspect-ratio: 3 / 2; }
.about__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 50px rgba(0,0,0,0.5);
}
.photo-placeholder {
  width: 100%; height: 100%;
  display: none; /* shown by JS onerror only if the photo fails to load */
  align-items: center; justify-content: center;
  background: linear-gradient(160deg, #15181d, #0d0f13);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.photo-placeholder span {
  font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-muted);
}

/* ===================================================================
   NEWS
   =================================================================== */
.news { background: var(--bg-soft); }
.news__list { display: grid; gap: 1.2rem; margin-top: 2.5rem; }
.news__item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  padding: 1.8rem 2rem;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.news__item:hover { transform: translateX(6px); background: #1a1e24; }
.news__item time {
  font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold);
}
.news__item h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; margin: 0.5rem 0; }
.news__item p { margin: 0; color: var(--ink-muted); }

/* ===================================================================
   NEWSLETTER
   =================================================================== */
.newsletter {
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(197,163,90,0.08), transparent 60%),
    var(--bg);
  text-align: center;
}
.newsletter__inner { max-width: 620px; margin: 0 auto; }
.newsletter__form {
  display: flex;
  gap: 0.8rem;
  margin-top: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}
.newsletter__form input {
  flex: 1 1 260px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.95rem 1.2rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.newsletter__form input:focus { outline: none; border-color: var(--gold); }
.newsletter__form input::placeholder { color: var(--ink-muted); }
.newsletter__note { margin-top: 1.2rem; font-size: 0.9rem; color: var(--gold-soft); min-height: 1.2em; }

/* ===================================================================
   FOOTER
   =================================================================== */
.site-footer { background: #08090b; border-top: 1px solid var(--line); padding: 3rem 0; }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; text-align: center; }
.footer__links { display: flex; gap: 1.8rem; flex-wrap: wrap; justify-content: center; }
.footer__links a {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-muted);
  transition: color 0.3s var(--ease);
}
.footer__links a:hover { color: var(--gold); }
.footer__copy { font-size: 0.8rem; color: var(--ink-muted); margin: 0; }

/* ===================================================================
   SCROLL REVEAL
   =================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 820px) {
  .nav-toggle { display: flex; z-index: 110; }
  .nav-links {
    position: fixed;
    inset: 0 0 0 30%;
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    padding: 2rem;
    background: rgba(10, 11, 13, 0.97);
    backdrop-filter: blur(14px);
    transform: translateX(100%);
    transition: transform 0.45s var(--ease);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 0.9rem; }

  .book__grid, .about__grid { grid-template-columns: 1fr; }
  .book-cards { grid-template-columns: 1fr; }
  .book__cover { max-width: 340px; margin: 0 auto; }
  .about__photo { max-width: 480px; margin: 0 auto; }
  .countdown { gap: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
