/* ================= HERO ================= */
.hero {
  background: var(--gradient-hero);
  padding: 4rem 0 6rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-inner { display: grid; grid-template-columns: 1fr; gap: 2rem; }

/* Book container */
.book {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  position: relative;
  perspective: 2400px;
  max-width: 1180px;
  margin: 0 auto;
  filter: drop-shadow(0 30px 40px rgba(20, 40, 30, .25));
}

/* Pages share the book look */
.page {
  position: relative;
  background: var(--card);
  padding: 3.5rem 3rem;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  backface-visibility: hidden;
  transform-origin: center left;
}
.page-left {
  border-radius: 1.25rem 0 0 1.25rem;
  /* curved outer edge */
  box-shadow:
    inset 30px 0 40px -30px rgba(0,0,0,.15),
    inset -8px 0 20px -12px rgba(0,0,0,.18);
  border-right: 1px solid rgba(0,0,0,.05);
}
.page-right {
  border-radius: 0 1.25rem 1.25rem 0;
  box-shadow:
    inset -30px 0 40px -30px rgba(0,0,0,.15),
    inset 8px 0 20px -12px rgba(0,0,0,.18);
  border-left: 1px solid rgba(0,0,0,.05);
  overflow: hidden;
  padding: 0;
}

/* Spine */
.spine {
  position: absolute;
  top: -6px; bottom: -6px;
  left: 50%;
  width: 14px;
  transform: translateX(-50%);
  background: linear-gradient(90deg,
    rgba(0,0,0,.18) 0%,
    rgba(0,0,0,.05) 20%,
    rgba(255,255,255,.35) 50%,
    rgba(0,0,0,.05) 80%,
    rgba(0,0,0,.18) 100%);
  z-index: 5;
  pointer-events: none;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0,0,0,.2);
}

/* Opening animation: right page swings from closed */
.book.closed .page-right { transform: rotateY(0deg); }
.book.opening .page-right {
  animation: openRight 1400ms cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes openRight {
  0%   { transform: rotateY(-90deg); opacity: .4; }
  60%  { transform: rotateY(4deg);   opacity: 1; }
  100% { transform: rotateY(0deg);   opacity: 1; }
}
.page-right { transform: rotateY(0deg); transform-origin: left center; }

/* Left page content */
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.6rem;
  color: var(--primary-dark);
  letter-spacing: -.02em;
  margin-bottom: 2rem;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: .55rem;
  background: var(--primary); color: var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--gold) 30%, transparent);
}
.eyebrow {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--gold); font-weight: 700; margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--foreground);
  letter-spacing: -.02em;
}
.hero h1 .accent { color: var(--primary); }
.hero p.lead {
  margin-top: 1.25rem;
  font-size: 1.05rem;
  color: var(--muted-foreground);
  max-width: 42ch;
}
.cta-row { margin-top: 2rem; display: flex; gap: .75rem; flex-wrap: wrap; }

/* Right page photograph */
.photo {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(20,40,30,.15), rgba(20,40,30,.55)),
    url("/static/img/library-hero.jpg") center/cover no-repeat,
    radial-gradient(circle at 30% 30%, oklch(0.5 0.08 150), oklch(0.3 0.05 150));
  display: flex; align-items: flex-end; padding: 2rem;
}

/* Floating loan card on top of the photo */
.floating-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-elevated);
  padding: 1rem 1.15rem;
  width: 100%; max-width: 340px;
  margin-left: auto; margin-right: 0;
  animation: floaty 4s ease-in-out infinite;
}
@keyframes floaty {
  0%,100% { transform: translateY(0) }
  50%     { transform: translateY(-6px) }
}
.floating-card .tag {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--success);
  background: color-mix(in oklab, var(--success) 12%, transparent);
  border-radius: 999px; padding: .2rem .6rem;
}
.floating-card h4 {
  margin: .6rem 0 .15rem; font-size: 1rem; font-weight: 700;
}
.floating-card .meta { font-size: .78rem; color: var(--muted-foreground); }
.floating-card .row { display:flex; justify-content: space-between; margin-top:.65rem; font-size:.8rem; }
.floating-card .row b { color: var(--foreground); font-weight: 600; }

/* Book ribbon top */
.ribbon {
  position: absolute; top: -14px; left: 2.4rem;
  width: 26px; height: 60px;
  background: var(--gold);
  border-radius: 3px;
  box-shadow: 0 6px 10px rgba(0,0,0,.15);
  z-index: 6;
}
.ribbon::after {
  content: ""; position: absolute; bottom: -10px; left: 0;
  border-left: 13px solid var(--gold);
  border-right: 13px solid var(--gold);
  border-bottom: 10px solid transparent;
}

/* Sections */
.section { padding: 5rem 0; }
.section-title { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.section-sub { color: var(--muted-foreground); margin-top: .75rem; max-width: 60ch; }
.feature-grid {
  display: grid; gap: 1.25rem; margin-top: 3rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.feature {
  padding: 1.5rem; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.feature .icon {
  width: 42px; height: 42px; border-radius: .55rem;
  background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: .9rem;
}
.feature h3 { font-size: 1.05rem; }

/* CTA banner */
.cta-banner {
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius-2xl);
  padding: 3.5rem 3rem;
  display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: center;
  box-shadow: var(--shadow-elevated);
}
.cta-banner .gold { color: var(--gold); }

/* Footer */
.footer {
  padding: 3rem 0; border-top: 1px solid var(--border);
  color: var(--muted-foreground); font-size: .875rem;
}

/* Responsive */
@media (max-width: 900px) {
  .book { grid-template-columns: 1fr; }
  .page { min-height: auto; padding: 2.5rem 1.75rem; }
  .page-left { border-radius: 1.25rem 1.25rem 0 0; }
  .page-right { border-radius: 0 0 1.25rem 1.25rem; min-height: 380px; }
  .spine { display: none; }
  .ribbon { left: 1.5rem; }
  .cta-banner { grid-template-columns: 1fr; padding: 2.25rem 1.75rem; }
}