/* styles.css */
:root {
  --bg: #0f1012;
  --bg-deep: #151517;
  --card: rgba(25, 26, 30, 0.72);
  --card-strong: rgba(35, 36, 42, 0.85);
  --text: #f4f1ea;
  --muted: #b8b1a7;
  --rose: #d9a18b;
  --amber: #f1b35b;
  --glow: rgba(241, 179, 91, 0.22);
  --ring: rgba(241, 179, 91, 0.55);
  --max-width: 1120px;

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 28px;
  --space-6: 36px;
  --space-7: 48px;

  --r-lg: 26px;
  --r-md: 22px;
  --r-sm: 18px;

  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.35);
  --shadow-hero: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 20px var(--glow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(217, 161, 139, 0.18), transparent 45%),
    radial-gradient(circle at 20% 20%, rgba(241, 179, 91, 0.14), transparent 50%),
    linear-gradient(180deg, #0d0e10 0%, #17171b 60%, #121215 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  transform: translateY(-140%);
  transition: transform 0.2s ease;
  z-index: 999;
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 12, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  place-items: center;
  height: 44px;
  width: 44px;
  border-radius: 14px;
  font-family: "Fraunces", serif;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(217, 161, 139, 0.4), rgba(241, 179, 91, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-name {
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 22px;
  font-size: 0.95rem;
}

.nav a {
  color: var(--muted);
  transition: color 0.2s ease;
  padding: 8px 10px;
  border-radius: 999px;
}

.nav a:hover {
  color: var(--text);
}

.nav a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.btn-primary {
  background: linear-gradient(135deg, #d4a08b, #f1b35b);
  color: #1a1612;
  box-shadow: 0 12px 30px rgba(241, 179, 91, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(241, 179, 91, 0.28);
}

.btn-ghost {
  border-color: rgba(217, 161, 139, 0.6);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: rgba(241, 179, 91, 0.8);
  box-shadow: 0 10px 25px rgba(217, 161, 139, 0.18);
}

main section {
  padding: 96px 0;
}

.books {
  padding: 20px 0;
}

.books .section-head {
  margin-bottom: 10px;
}

.books .section-head h2 {
  font-size: clamp(1.4rem, 2vw, 1.8rem);
}

.books .section-head p {
  font-size: 0.9rem;
}

.books .book-track {
  gap: 10px;
  padding: 0 0 8px;
}

.books .book-card {
  flex: 0 0 clamp(140px, 18vw, 190px);
  max-width: clamp(140px, 18vw, 190px);
}

.books .book-card h3 {
  font-size: 1rem;
}

.books .book-meta {
  font-size: 0.8rem;
}

.books .book-content {
  padding: 12px;
  gap: 6px;
}

.books .book-card img {
  padding: 6px;
  max-height: 220px;
}

@media (prefers-reduced-motion: no-preference) {
  main section {
    animation: fadeIn 0.75s ease both;
  }

  main section:nth-of-type(2) { animation-delay: 0.06s; }
  main section:nth-of-type(3) { animation-delay: 0.12s; }
  main section:nth-of-type(4) { animation-delay: 0.18s; }
  main section:nth-of-type(5) { animation-delay: 0.24s; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  padding-top: 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
  align-items: center;
}

.hero-text h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--rose);
  font-weight: 500;
  margin-bottom: 18px;
}

.hero-description {
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 28px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.meta-label {
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 4px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  color: var(--amber);
  margin-bottom: 14px;
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-card {
  background: var(--card-strong);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-hero);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.hero-card-details {
  padding-top: 8px;
}

.hero-card-title {
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
}

.hero-card-sub {
  color: var(--muted);
  margin-top: 6px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.section-head h2 {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 3vw, 2.6rem);
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--muted);
}

.carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.carousel-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.carousel-viewport:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  border-radius: 18px;
}

.carousel-viewport::-webkit-scrollbar {
  height: 6px;
}

.carousel-viewport::-webkit-scrollbar-thumb {
  background: rgba(241, 179, 91, 0.35);
  border-radius: 999px;
}

.book-track {
  display: flex;
  gap: 24px;
  padding: 8px 4px 24px;
}

.book-card {
  background: var(--card);
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  min-width: clamp(220px, 28vw, 280px);
  scroll-snap-align: start;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.book-card:hover {
  transform: translateY(-2px);
  border-color: rgba(241, 179, 91, 0.22);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.42);
}

.book-card:focus-within {
  border-color: rgba(241, 179, 91, 0.32);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.42), 0 0 0 4px rgba(241, 179, 91, 0.18);
}

.book-card.featured {
  box-shadow: 0 20px 50px rgba(241, 179, 91, 0.2);
  border-color: rgba(241, 179, 91, 0.3);
}

.book-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.book-card h3 {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  line-height: 1.2;
}

.book-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.text-link {
  color: var(--amber);
  font-weight: 600;
  align-self: flex-start;
  padding: 6px 0;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  border-radius: 10px;
  padding: 6px 10px;
  margin-left: -10px;
}

.text-link.muted {
  color: rgba(241, 179, 91, 0.6);
}

.carousel-btn {
  height: 44px;
  width: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(20, 20, 24, 0.85);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, border 0.2s ease, opacity 0.2s ease;
}

.carousel-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(241, 179, 91, 0.6);
}

.carousel-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.carousel-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.media-shell {
  background: var(--card);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
  padding-top: 56.25%;
}

.media-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  font-family: "Fraunces", serif;
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--rose);
  background: linear-gradient(120deg, rgba(217, 161, 139, 0.18), rgba(15, 16, 18, 0.64));
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 36px;
  align-items: center;
}

.about-card {
  background: var(--card);
  border-radius: 24px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
}

.about-text h2 {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 3vw, 2.6rem);
  margin-bottom: 16px;
}

.about-bio p {
  color: var(--muted);
  margin-bottom: 16px;
}

.about-text .tagline {
  color: var(--rose);
}

.about-meta {
  color: var(--amber);
  font-weight: 500;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--card-strong);
  border-radius: var(--r-lg);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4), 0 0 20px rgba(217, 161, 139, 0.2);
}

.contact-details {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.site-footer {
  padding: 30px 0 50px;
  color: var(--muted);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
}

/* Local gradient placeholder (no external images) */
.media-img {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
}

.media-img::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(241, 179, 91, 0.22), transparent 55%),
    radial-gradient(circle at 70% 80%, rgba(217, 161, 139, 0.22), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.2));
}

.media-img img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
}

.hero-card .media-img {
  width: clamp(160px, 32vw, 240px);
  margin: 0 auto 16px;
}

.hero-card .media-img img {
  border-radius: 18px;
  width: 100%;
  height: auto;
  max-height: none;
  margin-bottom: 0;
}

/* covers/headshot sizing */
.book-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: rgba(10, 10, 12, 0.55);
  padding: 14px;
}

.headshot {
  border-radius: 20px;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }

  .nav-wrap {
    flex-wrap: wrap;
  }

  .carousel {
    grid-template-columns: 1fr;
  }

  .carousel-btn {
    display: none;
  }
}

@media (max-width: 720px) {
  .hero {
    padding-top: 60px;
  }

  .contact-card {
    padding: 28px;
  }
}

@media (max-width: 540px) {
  .brand-sub {
    display: none;
  }

  .btn-primary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
