/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #1a1a1a;
  background: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Hero (fixed for parallax) ---------- */
.hero {
  position: fixed;
  inset: 0;
  height: 100vh;
  width: 100%;
  z-index: 0;
  overflow: hidden;
  /* Placeholder nature background — swap URL for final asset */
  background:
    linear-gradient(rgba(0,0,0,0.0), rgba(0,0,0,0.0)),
    url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?auto=format&fit=crop&w=2000&q=80')
      center / cover no-repeat,
    linear-gradient(135deg, #2c5364, #203a43, #0f2027);
  background-color: #1a2a2f;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.45) 100%);
}

.hero__inner {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

.hero__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  color: #fff;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  letter-spacing: 0.02em;
  margin: 0;
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
}

.hero__scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 12px;
}
.hero__scroll-cue span {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 8px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  animation: scrollCue 1.8s ease-in-out infinite;
}
@keyframes scrollCue {
  0%   { opacity: 0; transform: translate(-50%, 0); }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 14px); }
}

/* Spacer the height of the viewport so content begins below the fixed hero */
.hero-spacer {
  height: 100vh;
}

/* ---------- Tagline ribbon ---------- */
.tagline-ribbon {
  position: relative;
  z-index: 1;
  background: #2a2a2a;
  text-align: center;
  padding: 0 24px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tagline-ribbon span {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #b0b0b0;
}

/* ---------- Content (scrolls up over hero) ---------- */
.content {
  position: relative;
  z-index: 1;
  background: #ffffff;
  /* Soft top edge as it crosses the hero */
  box-shadow: 0 -20px 60px rgba(0,0,0,0.15);
}

/* ---------- Sections ---------- */
.section {
  padding: 96px 0;
  border-bottom: 1px solid #f0f0f0;
}
.section:last-of-type { border-bottom: none; }

.section--intro {
  text-align: center;
  padding-top: 120px;
}

.eyebrow {
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.78rem;
  color: #888;
  margin: 0 0 18px;
}

.section__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 18px;
  letter-spacing: 0.01em;
}

.section__heading {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  margin: 0 0 40px;
  letter-spacing: 0.01em;
}

.lede {
  max-width: 620px;
  margin: 0 auto;
  color: #555;
  font-size: 1.05rem;
}

/* ---------- Books ---------- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
}

.book-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: start;
}

.book-card__cover {
  width: 140px;
  height: 210px;
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  overflow: hidden;
  flex-shrink: 0;
}
.book-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-card__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 6px;
}
.book-card__meta {
  color: #888;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0 0 12px;
}
.book-card__desc {
  color: #555;
  margin: 0;
}

/* ---------- Reviews ---------- */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}
.review {
  margin: 0;
  padding: 28px 28px;
  background: #fafafa;
  border-left: 3px solid #2c3e50;
}
.review p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-style: italic;
  color: #2a2a2a;
  margin: 0 0 14px;
  line-height: 1.5;
}
.review cite {
  font-style: normal;
  font-size: 0.85rem;
  color: #777;
  letter-spacing: 0.05em;
}

/* ---------- Buy ---------- */
.buy-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.buy-link {
  display: inline-block;
  padding: 14px 26px;
  border: 1px solid #1a1a1a;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  transition: background 0.2s ease, color 0.2s ease;
}
.buy-link:hover {
  background: #1a1a1a;
  color: #fff;
}

/* ---------- Media ---------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.media-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  min-height: 96px;
  border: 1px solid #eaeaea;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.media-card:hover {
  border-color: #1a1a1a;
  transform: translateY(-2px);
}
.media-card__pfp {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.media-card__id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.media-card__name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  line-height: 1.2;
  color: #1a1a1a;
}
.media-card__handle {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-card__icon {
  position: absolute;
  right: -14px;
  bottom: -18px;
  width: 96px;
  height: 96px;
  fill: #ededed;
  pointer-events: none;
  z-index: 0;
  transition: fill 0.2s ease;
}
.media-card:hover .media-card__icon {
  fill: #e2e2e2;
}

/* ---------- Book-binding spine ---------- */
.spine {
  --spine-width: 44px;
  --bio-width: 320px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: calc(var(--spine-width) + var(--bio-width));
  z-index: 50;
  display: flex;
  background: #111;
  /* Off-screen entirely until intro is reached */
  transform: translateX(-100%);
  transition:
    transform 0.9s var(--ease),
    opacity 0.5s ease;
  pointer-events: none;
}
/* Visible state: bio is hidden off-screen left, spine sits flush at left edge */
.spine.is-visible {
  transform: translateX(calc(-1 * var(--bio-width)));
  pointer-events: auto;
}
/* Hover: slide out the rest so bio is exposed to the left of the spine */
.spine.is-visible:hover,
.spine.is-visible:focus-within {
  transform: translateX(0);
  transition-duration: 0.5s;
}

.spine__bio {
  width: var(--bio-width);
  height: 100%;
  background: #1a1a1a;
  color: #d8d8d8;
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid #000;
}
.spine__bio-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin: 0 0 22px;
  background: #2a2a2a;
  filter: grayscale(100%) contrast(1.05);
}
.spine__bio-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.4rem;
  margin: 0 0 18px;
  color: #fff;
  letter-spacing: 0.02em;
}
.spine__bio-text {
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
  color: #bdbdbd;
}

.spine__inner {
  width: var(--spine-width);
  height: 100%;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spine__text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #fff;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .spine {
    --spine-width: 34px;
    --bio-width: 240px;
  }
  .spine__text { font-size: 0.78rem; letter-spacing: 0.25em; }
  .spine__bio { padding: 32px 22px; }
  .spine__bio-photo { margin-bottom: 16px; }
  .spine__bio-name { font-size: 1.15rem; }
  .spine__bio-text { font-size: 0.85rem; }
}

/* ---------- Bio section (in-flow) ---------- */
.section--bio {
  background: #1a1a1a;
  color: #d8d8d8;
  border-bottom: none;
}
.bio-section__inner {
  display: flex;
  align-items: center;
  gap: 64px;
}
.bio-section__text {
  flex: 1 1 0;
  max-width: 560px;
}
.bio-section__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.78rem;
  color: #888;
  margin: 0 0 18px;
}
.bio-section__name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  margin: 0 0 28px;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.bio-section__body {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #cfcfcf;
  margin: 0 0 18px;
}
.bio-section__body:last-child { margin-bottom: 0; }
.bio-section__photo {
  flex: 0 0 auto;
  width: clamp(280px, 30vw, 420px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.05);
  background: #2a2a2a;
}

/* Fade the fixed spine out while the bio section is on screen */
.spine.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .bio-section__inner {
    flex-direction: column;
    gap: 32px;
    align-items: flex-start;
  }
  .bio-section__photo { width: 220px; }
  .bio-section__name { font-size: 1.8rem; }
  .bio-section__body { font-size: 0.92rem; }
}

/* ---------- Footer ---------- */
.footer {
  background: #111;
  color: #ccc;
  padding: 48px 0;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer__name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  margin: 0;
  color: #fff;
}
.footer__copy {
  margin: 0;
  font-size: 0.85rem;
  color: #888;
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 640px) {
  .section { padding: 72px 0; }
  .book-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}
