/* ==========================================================================
   R.S. Breed — Author Site
   Palette drawn from The Whitstrand Silence cover art.
   Glassmorphic dark UI · Mystery aesthetic · A4-clean typography
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------ */
:root {
  --bg-deep:       #111418;
  --bg-panel:      rgba(20, 24, 30, 0.65);
  --bg-glass:      rgba(30, 36, 44, 0.55);
  --glass-border:  rgba(200, 195, 180, 0.12);
  --glass-blur:    20px;

  --text-cream:    #e8dcc8;
  --text-body:     #c4b8a4;
  --text-muted:    #8a8070;
  --accent-amber:  #c9a84c;
  --accent-hover:  #dfc06a;
  --accent-green:  #6a7a5a;

  --font-serif:    'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:     'Source Sans 3', 'Segoe UI', system-ui, sans-serif;

  --max-w:         1100px;
  --nav-h:         64px;
  --radius:        12px;
  --radius-sm:     8px;
}

/* --- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

/* page background — blurred cover art */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('img/bg-dark.webp') center / cover no-repeat;
  z-index: -1;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-amber); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

/* --- Typography -------------------------------------------------------- */
h1, h2, h3 { font-family: var(--font-serif); color: var(--text-cream); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: .6em; }
h3 { font-size: 1.25rem; margin-bottom: .4em; }
p + p { margin-top: 1em; }

/* --- Utility ----------------------------------------------------------- */
.container  { width: 90%; max-width: var(--max-w); margin-inline: auto; }
.sr-only    { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center{ text-align: center; }

/* --- Glass panel ------------------------------------------------------- */
.glass {
  background: var(--bg-glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  padding-inline: 5%;
  background: rgba(17, 20, 24, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-cream);
  letter-spacing: .04em;
  white-space: nowrap;
}

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

.nav-links a {
  color: var(--text-body);
  font-size: .95rem;
  letter-spacing: .03em;
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--accent-amber);
  transition: width .25s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text-cream); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* Hamburger */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; margin-left: auto; }
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text-cream);
  margin: 5px 0;
  transition: transform .3s, opacity .3s;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) 5% 4rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 3rem;
  max-width: var(--max-w);
  width: 100%;
}

.hero-cover {
  flex: 0 0 auto;
  width: 300px;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 80px rgba(201,168,76,.08);
  transition: transform .4s;
}
.hero-cover:hover { transform: translateY(-6px) scale(1.02); }

.hero-text { flex: 1; }

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: .8rem;
  margin-bottom: 1.5rem;
}

.hero-blurb {
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 2rem;
}

/* CTA buttons */
.btn {
  display: inline-block;
  padding: .75rem 1.8rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .03em;
  transition: background .2s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent-amber);
  color: var(--bg-deep);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--bg-deep); }

.btn-ghost {
  border: 1px solid var(--glass-border);
  color: var(--text-cream);
  margin-left: .75rem;
}
.btn-ghost:hover { border-color: var(--accent-amber); color: var(--accent-amber); }

/* ==========================================================================
   Section shared
   ========================================================================== */
.section {
  padding: 5rem 5%;
}
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title .divider {
  display: block;
  width: 60px; height: 1px;
  background: var(--accent-amber);
  margin: 1rem auto 0;
}

/* ==========================================================================
   Featured book (home page)
   ========================================================================== */
.featured-book {
  display: flex;
  gap: 2.5rem;
  padding: 2.5rem;
  max-width: var(--max-w);
  margin-inline: auto;
  align-items: flex-start;
}

.featured-book-cover {
  flex: 0 0 280px;
  width: 280px;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.55), 0 0 80px rgba(201,168,76,.06);
  transition: transform .4s;
}
.featured-book-cover:hover { transform: translateY(-4px) scale(1.01); }

.featured-book-info { flex: 1; }
.featured-book-info h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--text-cream);
  margin-bottom: .8rem;
}
.featured-book-info p {
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 560px;
}
.featured-book-info p + p { margin-top: .8em; }
.featured-book-info .buy-links { margin-top: 1.5rem; }
.featured-book-info .buy-links a {
  font-size: .9rem;
  padding: .5rem 1.1rem;
}

/* ==========================================================================
   Book cards (books page grid)
   ========================================================================== */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.book-card {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  transition: transform .3s, box-shadow .3s;
}
.book-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.4); }

.book-card-cover {
  flex: 0 0 160px;
  width: 160px;
  height: auto;
  aspect-ratio: 5 / 8;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
}

.book-card-info { flex: 1; display: flex; flex-direction: column; }
.book-card-info h3 { font-size: 1.15rem; }
.book-card-series {
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .4rem;
}
.book-card-blurb {
  font-size: .9rem;
  line-height: 1.6;
  flex: 1;
}

/* Buy links row */
.buy-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}
.buy-links a {
  font-size: .8rem;
  padding: .4rem .9rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-cream);
  transition: border-color .2s, color .2s;
}
.buy-links a:hover { border-color: var(--accent-amber); color: var(--accent-amber); }

/* ==========================================================================
   About page
   ========================================================================== */
.about-layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  max-width: var(--max-w);
  margin-inline: auto;
}

.about-photo-wrap {
  flex: 0 0 280px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}

.about-text { flex: 1; }
.about-text p + p { margin-top: 1.2em; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: 2.5rem 5%;
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
  margin-top: 4rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent-amber); }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet — 768 */
@media (max-width: 768px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-cover { width: 220px; }
  .hero-blurb { margin-inline: auto; }

  .book-grid { grid-template-columns: 1fr; }

  .featured-book { flex-direction: column; align-items: center; text-align: center; }
  .featured-book-cover { flex: 0 0 auto; width: 220px; }
  .featured-book-info p { margin-inline: auto; }

  .about-layout { flex-direction: column; align-items: center; text-align: center; }
  .about-photo-wrap { flex: 0 0 auto; width: 200px; }
}

/* Mobile — 600 : hamburger breakpoint */
@media (max-width: 600px) {
  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    width: 260px;
    height: calc(100vh - var(--nav-h));
    flex-direction: column;
    gap: 0;
    padding: 1.5rem 2rem;
    background: rgba(17, 20, 24, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--glass-border);
    transform: translateX(100%);
    transition: transform .3s ease;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links li { padding: .75rem 0; border-bottom: 1px solid var(--glass-border); }

  /* Hamburger animation */
  .nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 3rem); }
  .hero-cover { width: 180px; }

  .featured-book { padding: 1.5rem; gap: 1.5rem; }
  .featured-book-cover { width: 180px; }

  .book-card { flex-direction: column; align-items: center; text-align: center; }
  .book-card-cover { flex: 0 0 auto; width: 160px; height: auto; }
}
