/* =========================================================
   BARKER PUBLISHING HOUSE — Home v2 (page-specific)
   "Modern Literary House × Quiet-Luxury Minimalism"
   Loaded ONLY on the homepage, AFTER main.css + golden.css.
   Shared tokens/zones/archetypes live in golden.css.
   ========================================================= */

/* ---------- 1 · Hero — asymmetric luxury, real floating cover ---------- */
#hero {
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(72% 90% at 6% 2%, rgba(219, 162, 49, 0.12), transparent 55%),
    radial-gradient(58% 72% at 100% 100%, rgba(30, 42, 72, 0.06), transparent 62%),
    var(--paper-50);
}
#hero-gradient-layer { opacity: 0.7; }
.hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: clamp(2.5rem, 5.5vw, 5.5rem); align-items: center; }
.hero-eyebrow { margin-bottom: 2rem; }

/* Kinetic headline: manual masked lines */
.hero-title {
  font-size: clamp(2.7rem, 5.3vw, 4.9rem);
  line-height: 1.02; letter-spacing: -0.03em; font-weight: 330;
  white-space: nowrap; /* manual .line breaks control the rag */
}
.hero-title em { color: var(--ember-600); }
.hero-title .line { display: block; overflow: hidden; padding-block: 0.06em; }
.hero-title .line > .line-inner { display: inline-block; will-change: transform; }

/* "self-published": gold italic with an underline that draws itself in */
.strike-wrap { position: relative; white-space: nowrap; font-style: italic; }
.strike-wrap em { color: var(--ember-600); }
.strike-wrap .strike {
  position: absolute; left: 0; right: 0.06em; bottom: 0.02em; height: 0.055em;
  background: linear-gradient(90deg, var(--ember-400), var(--ember-600));
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left center;
}

/* giant ghost year behind the hero */
.hero-ghost {
  position: absolute; z-index: 0; right: -2%; bottom: -4%;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(8rem, 22vw, 21rem); line-height: 0.8; letter-spacing: -0.04em;
  color: transparent; -webkit-text-stroke: 1px rgba(204,138,27,0.16);
  pointer-events: none; user-select: none; white-space: nowrap;
}

/* microproof as a hairline pill row */
.hero-microproof {
  border-top: 1px solid var(--line-soft);
  padding-top: 1.5rem; margin-top: 3rem;
  max-width: 46ch;
}
.hero-stars { color: var(--ember-500); }

/* Hero visual: framed plate + floating real cover + proof chip.
   NB: main.css's `.hero-visual img` (spec 0,1,1) is greedy — these
   overrides use `.hero-visual img.<class>` (0,2,1) so they win. */
.hero-visual { perspective: 1100px; }
.hero-visual::before {
  background: radial-gradient(closest-side, rgba(219, 162, 49, 0.18), transparent 72%);
}
.hero-visual::after { border-color: var(--ember-300); opacity: 0.5; border-radius: 16px; }
.hero-visual img.hero-plate {
  position: relative; z-index: 1;
  width: 100%; aspect-ratio: 4 / 4.6; object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-lift);
  will-change: transform;
}
.hero-float {
  position: absolute; z-index: 3;
  left: -7%; bottom: -8%; width: 41%;
  will-change: transform;
}
.hero-visual img.hero-float-cover {
  width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 28px 62px -22px rgba(19, 27, 47, 0.6), 0 2px 6px rgba(19,27,47,0.22);
  transform: rotate(-4deg);
  transition: transform var(--t-med) var(--ease-out);
  background: #fff; border: 3px solid #fff;
}
.hero-float:hover img.hero-float-cover { transform: rotate(-2deg) translateY(-6px); }
.hero-cover-tag {
  margin-top: 0.7rem; transform: rotate(-4deg); transform-origin: left top;
  font-size: 0.66rem; letter-spacing: 0.03em; color: var(--text-muted); line-height: 1.4;
}
.hero-cover-tag b { color: var(--text-strong); font-weight: 600; font-size: 0.72rem; }
.hero-proof-chip {
  position: absolute; z-index: 4; top: 6%; right: 2%;
  display: flex; align-items: center; gap: 0.7rem;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(8px) saturate(1.2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  padding: 0.6rem 1.1rem 0.6rem 0.7rem;
  box-shadow: var(--shadow-soft);
}
.hero-proof-chip .chip-star { color: var(--ember-500); font-size: 1.15rem; }
.hero-proof-chip .chip-num { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-strong); line-height: 1; }
.hero-proof-chip .chip-label { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }

/* ---------- 2 · Intro loader (home only, once per session) ---------- */
#loader {
  position: fixed; inset: 0; z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem;
  background: linear-gradient(150deg, #1E2A48 0%, #131B2F 100%);
  transform: translateY(0);
}
#loader img { height: 74px; width: auto; }
#loader .loader-line {
  font-family: var(--font-display); font-style: italic; font-weight: 340;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: #D6DCEA; letter-spacing: 0.01em;
  overflow: hidden;
}
#loader .loader-count {
  font-family: var(--font-body); font-size: 0.7rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--ember-300);
}
#loader .loader-rule { width: 120px; height: 1px; background: rgba(219,162,49,0.5); transform-origin: left; }
html.is-loading { overflow: hidden; }

/* ---------- 3 · The Shelf — real cover marquee (signature) ---------- */
.shelf { position: relative; z-index: 2; overflow: hidden; }
.shelf-head { text-align: center; max-width: 640px; margin-inline: auto; margin-bottom: clamp(2.4rem, 4vw, 3.4rem); }
.shelf-head h2 { margin-top: 1.2rem; }
.shelf-viewport { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.shelf-track { display: flex; gap: clamp(1.1rem, 2vw, 1.8rem); width: max-content; will-change: transform; }
.shelf-track.css-fallback { animation: shelf-scroll 64s linear infinite; }
.shelf:hover .shelf-track.css-fallback { animation-play-state: paused; }
@keyframes shelf-scroll { to { transform: translateX(-50%); } }
.shelf-book {
  position: relative; flex: 0 0 auto;
  height: clamp(200px, 26vw, 288px); aspect-ratio: 2 / 3;
  border-radius: 4px; overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(19, 27, 47, 0.5), 0 1px 3px rgba(19,27,47,0.18);
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med);
  background: var(--paper-200);
  will-change: transform;
}
.shelf-book img { width: 100%; height: 100%; object-fit: cover; }
.shelf-book::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,0.28) 0%, transparent 22%);
  pointer-events: none;
}
.shelf-book:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 30px 60px -20px rgba(19,27,47,0.6); }

/* ---------- 4 · Services — art-directed bento + tilt + ghost numbers ---------- */
.services-grid { gap: 1.1rem; }
.service-card { border-radius: 8px; box-shadow: 0 1px 2px rgba(30,35,51,0.04), 0 18px 40px -26px rgba(30,35,51,0.22); will-change: transform; transform-style: preserve-3d; }
.service-card::before { background: linear-gradient(90deg, var(--ember-500), var(--ember-300)); height: 2px; }
.service-card.span-2 {
  background:
    linear-gradient(180deg, var(--paper-0), var(--gallery));
}
.service-num { color: var(--ember-500); font-size: 0.82rem; letter-spacing: 0.16em; }
.service-price { font-weight: 400; }
.service-card::after {
  content: attr(data-ghost);
  position: absolute; right: 0.4rem; bottom: -0.9rem;
  font-family: var(--font-display); font-weight: 500;
  font-size: 5.4rem; line-height: 1; letter-spacing: -0.03em;
  color: transparent; -webkit-text-stroke: 1px rgba(204,138,27,0.18);
  pointer-events: none;
}

/* ---------- 5 · Testimonials — magazine layout (home) ---------- */
.quotes-lead {
  display: grid; grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.quotes-cover { position: relative; justify-self: center; max-width: 300px; width: 100%; }
.quotes-cover img {
  width: 100%; border-radius: 5px;
  box-shadow: 0 34px 70px -26px rgba(19,27,47,0.55), 0 2px 8px rgba(19,27,47,0.2);
  transform: rotate(-3deg);
}
.quotes-cover::after {
  content: ""; position: absolute; inset: 14px -16px -16px 16px;
  border: 1px solid var(--ember-300); border-radius: 6px; z-index: -1; opacity: 0.6;
}
.quotes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.qcard {
  display: flex; flex-direction: column; gap: 1.1rem;
  padding: clamp(1.6rem, 2.4vw, 2.1rem);
  background: var(--paper-0); border: 1px solid var(--line-soft); border-radius: 8px;
  box-shadow: 0 1px 2px rgba(30,35,51,0.04), 0 16px 36px -26px rgba(30,35,51,0.2);
}
.qcard-stars { color: var(--ember-500); font-size: 0.9rem; letter-spacing: 0.14em; }
.qcard blockquote { font-family: var(--font-display); font-style: italic; font-size: 1.08rem; line-height: 1.5; color: var(--text-strong); }
.qcard-meta { display: flex; align-items: center; gap: 0.8rem; margin-top: auto; }
.qcard-meta img { width: 40px; height: 54px; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 14px -6px rgba(19,27,47,0.4); }
.qcard-name { font-weight: 600; font-size: 0.92rem; color: var(--text-strong); }
.qcard-role { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- 6 · Responsive (home) ---------- */
@media (max-width: 960px) {
  .quotes-lead { grid-template-columns: 1fr; gap: 2.2rem; }
  .quotes-cover { max-width: 220px; }
  .quotes-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero-title { max-width: 100%; }
  .hero-ghost { font-size: clamp(6rem, 26vw, 12rem); bottom: -2%; }
  .hero-visual img.hero-plate { aspect-ratio: 4 / 3.3; }
  .hero-visual { max-width: 560px; margin-inline: auto; }
  .hero-float { width: 30%; left: 1%; bottom: -7%; }
  .hero-cover-tag { display: none; }
  .hero-proof-chip { right: 3%; }
}
@media (max-width: 560px) {
  .hero-float { width: 34%; }
  .shelf-book { height: 168px; }
  .hero-proof-chip { display: none; } /* collides with CTAs at phone widths */
  .service-card::after { font-size: 3.6rem; }
  .hero-title { font-size: clamp(1.8rem, 8.5vw, 2.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .shelf-track, .shelf-track.css-fallback { animation: none !important; }
  .hero-float-cover, .quotes-cover img { transform: none !important; }
  #loader { display: none !important; }
  html.is-loading { overflow: auto; }
  .strike-wrap .strike { transform: scaleX(1); }
}
