/* ============================================================
   LEVON BOOKS — STYLESHEET
   Colors, type, and spacing follow the Levon Books Brand
   Manual (2026, Kev Studio). Do not introduce new colors.
   ============================================================ */

/* ---------- Brand fonts (loaded locally) ---------- */
@font-face {
  font-family: "Recoleta";
  src: url("../assets/fonts/Recoleta-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Recoleta";
  src: url("../assets/fonts/Recoleta-Medium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Recoleta";
  src: url("../assets/fonts/Recoleta-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../assets/fonts/DMSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../assets/fonts/DMSans-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../assets/fonts/DMSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Sarina";
  src: url("../assets/fonts/Sarina-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

/* ---------- Brand tokens ---------- */
:root {
  --wine: #230508;        /* dominant foundation */
  --red: #740718;         /* accents & highlights */
  --white-1: #f2ede4;     /* spacious backgrounds / fonts */
  --white-warm: #dbd2cc;  /* warm backgrounds / type */
  --blue: #8492ce;        /* occasional accents only */
  --black: #121212;

  --serif: "Recoleta", "Iowan Old Style", Georgia, serif;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --script: "Sarina", cursive;
  --mono: "Courier New", Courier, monospace;

  --measure: 34em;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Single ink opacity for EVERY illustration on the page (hero +
     collection) so they all read as one consistent hand-drawn weight. */
  --ink: 0.9;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--wine);
  background-image: url("../assets/backgrounds/bg-wine.jpg");
  background-size: 1400px auto;
  color: var(--white-1);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
a { color: inherit; }

::selection { background: var(--red); color: var(--white-1); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-center {
  text-align: center;
  padding: 2rem;
  z-index: 3;
}

.hero-logo {
  width: clamp(170px, 22vw, 250px);
  height: auto;
  margin-inline: auto;
  filter: drop-shadow(0 18px 45px rgba(0, 0, 0, 0.45));
  animation: heroLogoIn 1.6s var(--ease-out) both;
}

.hero-tagline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  letter-spacing: 0.02em;
  color: var(--white-warm);
  margin: 1.75rem 0 0;
  animation: heroFadeUp 1.4s 0.5s var(--ease-out) both;
}

/* sketched readers
   All illustrations share ONE ink opacity (--ink) so they read as a
   single hand-drawn set. The fade-in animation settles each element
   back to --ink rather than to full opacity. */
.hero-sketch {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  opacity: var(--ink);
}
.hero-sketch--left {
  left: clamp(1rem, 7vw, 9rem);
  bottom: -2%;
  width: clamp(150px, 20vw, 320px);
  animation: heroSketchIn 1.8s 0.7s var(--ease-out) both;
}
.hero-sketch--right {
  right: clamp(1rem, 6vw, 8rem);
  top: 9%;
  width: clamp(110px, 14vw, 230px);
  animation: heroSketchIn 1.8s 0.9s var(--ease-out) both;
}
.hero-sketch--tl {
  left: clamp(1rem, 5vw, 6rem);
  top: 7%;
  width: clamp(100px, 13vw, 210px);
  animation: heroSketchIn 1.8s 1.1s var(--ease-out) both;
}
.hero-sketch--br {
  right: clamp(1rem, 8vw, 10rem);
  bottom: -2%;
  width: clamp(110px, 14vw, 230px);
  animation: heroSketchIn 1.8s 1.3s var(--ease-out) both;
}
.hero-sketch--books {
  left: 26%;
  top: 9%;
  width: clamp(80px, 9vw, 160px);
  animation: heroSketchIn 1.8s 1.5s var(--ease-out) both;
}

@keyframes heroLogoIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
/* settles to the shared ink opacity, not to full white */
@keyframes heroSketchIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: var(--ink); transform: none; }
}
/* ============================================================
   COLLECTION
   ============================================================ */
.collection {
  position: relative;
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1.25rem, 5vw, 4rem) clamp(2rem, 4vw, 3.5rem);
  max-width: 1240px;
  margin-inline: auto;
}
.collection-head {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.collection-heading {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.08;
  margin: 0;
}
/* script second line, echoing the brand manual's
   "Thoughtfully curated" headline treatment */
.collection-subheading {
  display: block;
  font-family: var(--script);
  font-weight: 400;
  font-size: 0.58em;
  text-transform: lowercase;
  color: var(--red);
  filter: brightness(1.9);
  margin-top: 0.08em;
}
/* ---------- the 4×5 grid ---------- */
.book-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.6rem, 3vw, 2.6rem) clamp(1.2rem, 2.4vw, 2rem);
}

.book {
  opacity: 0;
  transform: translateY(30px);
}
.book.is-visible {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
  transition-delay: var(--stagger, 0ms);
}

.book-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 3px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 12px 28px -12px rgba(0, 0, 0, 0.55);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
}
.book-cover img,
.book-cover svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.book:hover .book-cover,
.book:focus-within .book-cover {
  transform: translateY(-7px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 26px 44px -14px rgba(0, 0, 0, 0.7);
}

.book-meta {
  padding: 0.9rem 0.15rem 0;
}
.book-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.02rem;
  line-height: 1.28;
  margin: 0;
  color: var(--white-1);
}
.book-author {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white-warm);
  opacity: 0.85;
  margin: 0.3rem 0 0;
}
.book-flag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--blue);
  margin-top: 0.45rem;
}

/* ============================================================
   FOOTER — the two sketches flank the footer content at the
   same vertical level, so the page ends compactly.
   ============================================================ */
.footer {
  position: relative;
  padding: clamp(3.5rem, 7vw, 5.5rem) 1.5rem clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
}
/* the centered footer content sits above the flanking sketches */
.footer-logo,
.footer-links,
.footer-copyright {
  position: relative;
  z-index: 2;
}
.footer-sketch {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  opacity: var(--ink);
  pointer-events: none;
}
/* both sketches share the SAME height, so their line weight matches */
.footer-sketch img {
  height: clamp(150px, 17vw, 215px);
  width: auto;
}
.footer-sketch--left { left: clamp(-1rem, 0.5vw, 2rem); }
.footer-sketch--right { right: clamp(-1rem, -0.5vw, 0rem); }

.footer-logo {
  width: clamp(150px, 16vw, 200px);
  margin-inline: auto;
  opacity: 0.95;
}
.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin-top: 2rem;
  font-family: var(--sans);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-links a {
  text-decoration: none;
  color: var(--white-warm);
  padding: 0.4rem 0.2rem;
  transition: color 0.25s ease;
}
.footer-links a:hover,
.footer-links a:focus-visible { color: var(--white-1); }
.footer-dot {
  color: var(--red);
  filter: brightness(1.8);
  font-size: 0.5rem;
}
.footer-copyright {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--white-warm);
  opacity: 0.55;
  margin: 2rem 0 0;
}

/* ============================================================
   SCROLL REVEAL (non-grid sections)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-sketch--books { display: none; }
  .footer-sketch { display: none; }
}

@media (max-width: 640px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem 1.1rem;
  }
  .hero-sketch--right { display: none; }
  .hero-sketch--tl { display: none; }
  .hero-sketch--left { display: none; }
  .hero-sketch--br {
    right: 4%;
    bottom: -1%;
    width: 140px;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-logo,
  .hero-tagline,
  .hero-sketch,
  .hero-scroll { animation: none; }
  .hero-scroll-diamond { animation: none; }
  .book, .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
