/* =====================================================
   VARQ — Storefront Styles
   Palette: warm white / deep maroon / blackish green / brass
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,500&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --paper:      #FAF7F2;
  --paper-dim:  #F1EBE1;
  --ink:        #211A16;
  --ink-soft:   #55483F;
  --maroon:     #6B1421;
  --maroon-dark:#4A0D17;
  --maroon-glow:#8C2233;
  --green:      #16261C;
  --green-soft: #223A2A;
  --brass:      #C9A15C;
  --brass-soft: #E4CFA0;
  --line:       rgba(33,26,22,0.12);

  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 3px;
  --shadow-book: 0 18px 40px -12px rgba(22,38,28,0.35), 0 4px 10px -4px rgba(107,20,33,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 3px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------------- NAV ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,247,242,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--maroon);
  letter-spacing: 0.01em;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.brand img { height: 58px; display: block; }
@media (max-width: 560px) {
  .brand img { height: 44px; }
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: 15px;
}
.nav-links a {
  position: relative;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--maroon);
  transition: width 0.25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  padding: 9px 20px;
  background: var(--maroon);
  color: var(--paper) !important;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
}
.nav-cta:hover { background: var(--maroon-dark); transform: translateY(-1px); }
.nav-cta::after { display: none; }

/* ---------------- HERO — angled book stack ---------------- */
.hero {
  position: relative;
  padding: 88px 0 100px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 900px 500px at 82% 8%, rgba(107,20,33,0.06), transparent),
    radial-gradient(ellipse 700px 500px at 10% 100%, rgba(22,38,28,0.05), transparent);
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--maroon);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 54px;
  line-height: 1.08;
  font-weight: 600;
  color: var(--green);
  max-width: 9.5em;
}
.hero h1 em { font-style: italic; color: var(--maroon); }
.hero p {
  margin-top: 22px;
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 38ch;
}
.hero-actions { margin-top: 34px; display: flex; gap: 16px; align-items: center; }
.btn-primary {
  padding: 14px 30px;
  background: var(--maroon);
  color: var(--paper);
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 15px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-block;
}
.btn-primary:hover {
  background: var(--maroon-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(107,20,33,0.45);
}
.btn-ghost {
  padding: 14px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.btn-ghost:hover { border-color: var(--green); background: rgba(22,38,28,0.04); }

/* Book stack visual */
.book-stack {
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stack-book {
  position: absolute;
  width: 178px;
  height: 262px;
  border-radius: 2px 6px 6px 2px;
  box-shadow: var(--shadow-book);
  background-size: cover;
  background-position: center;
  transition: transform 0.45s cubic-bezier(.2,.8,.2,1);
  border: 1px solid rgba(0,0,0,0.08);
}
.stack-book::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 10px;
  background: linear-gradient(90deg, rgba(0,0,0,0.28), transparent);
}
.book-1 { background-color: var(--maroon); transform: rotate(-9deg) translate(-70px, 10px); z-index: 1; }
.book-2 { background-color: var(--green); transform: rotate(-2deg) translate(0, -20px); z-index: 2; }
.book-3 { background-color: var(--brass-soft); transform: rotate(8deg) translate(68px, 16px); z-index: 1; }
.book-stack:hover .book-1 { transform: rotate(-14deg) translate(-84px, 4px); }
.book-stack:hover .book-2 { transform: rotate(0deg) translate(0, -32px); }
.book-stack:hover .book-3 { transform: rotate(13deg) translate(82px, 10px); }
.stack-book .title-plate {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  padding: 18px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: rgba(255,255,255,0.92);
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.35));
}
.book-3 .title-plate { color: var(--ink); background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.12)); }

/* ---------------- SECTIONS ---------------- */
.section { padding: 80px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--green);
}
.section-head a { font-size: 14px; color: var(--maroon); }

/* ---------------- NOVEL GRID ---------------- */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 34px 28px;
}
.novel-card { position: relative; }
.novel-cover {
  aspect-ratio: 2/3;
  border-radius: 2px 5px 5px 2px;
  background: var(--paper-dim);
  background-size: cover;
  background-position: center;
  box-shadow: 0 10px 22px -10px rgba(22,38,28,0.3);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s ease;
}
.novel-cover::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
  background: linear-gradient(90deg, rgba(0,0,0,0.25), transparent);
}
.novel-card:hover .novel-cover {
  transform: translateY(-6px) rotate(-1.2deg);
  box-shadow: 0 20px 32px -12px rgba(22,38,28,0.4);
}
.novel-badge {
  position: absolute; top: 10px; right: -6px;
  background: var(--brass);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 3px 10px 3px 8px;
  border-radius: 2px 0 0 2px;
  z-index: 2;
}
.novel-info { padding-top: 14px; }
.novel-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.novel-author { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.novel-price {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--maroon);
  margin-top: 8px;
}

/* ---------------- WHY VARQ / FEATURES ---------------- */
.features {
  background: var(--green);
  color: var(--paper);
  padding: 88px 0;
}
.features .section-head { border-color: rgba(250,247,242,0.15); }
.features .section-head h2 { color: var(--paper); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.feature-card {
  padding: 30px 26px;
  border: 1px solid rgba(250,247,242,0.12);
  border-radius: 4px;
  background: rgba(250,247,242,0.02);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-8px);
  border-color: var(--brass);
  background: rgba(250,247,242,0.05);
  box-shadow: 0 24px 40px -20px rgba(0,0,0,0.5);
}
.feature-num {
  font-family: var(--font-mono);
  color: var(--brass);
  font-size: 13px;
  margin-bottom: 14px;
  display: inline-block;
  transition: transform 0.35s ease;
}
.feature-card:hover .feature-num { transform: translateX(4px); }
.feature-grid h3 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}
.feature-card:hover h3 { color: var(--brass-soft); }
.feature-grid p { color: rgba(250,247,242,0.7); font-size: 14.5px; }

/* ---------------- PROMO BANNER (admin-uploaded) ---------------- */
.promo-banner {
  max-width: 1180px;
  margin: 28px auto 0;
  padding: 0 32px;
}
.promo-banner-inner {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  aspect-ratio: 21/6;
  background-size: cover;
  background-position: center;
  box-shadow: 0 20px 40px -18px rgba(22,38,28,0.35);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.promo-banner-inner:hover { transform: scale(1.008); }
@media (max-width: 700px) {
  .promo-banner-inner { aspect-ratio: 4/3; }
}

/* ---------------- FOOTER ---------------- */
.site-footer {
  background: var(--green);
  color: rgba(250,247,242,0.75);
  padding: 72px 0 0;
  margin-top: 0;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(250,247,242,0.1);
}
.footer-brand .brand {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--paper);
}
.footer-brand .brand img {
  height: 46px;
  filter: brightness(0) invert(1);
}
.footer-brand p {
  margin-top: 14px;
  font-size: 14px;
  max-width: 30ch;
  line-height: 1.7;
  color: rgba(250,247,242,0.55);
}
.footer-social { display: flex; gap: 12px; margin-top: 22px; }
.footer-social a {
  width: 34px; height: 34px;
  border: 1px solid rgba(250,247,242,0.18);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.footer-social a:hover {
  border-color: var(--brass);
  background: rgba(201,161,92,0.1);
  transform: translateY(-3px);
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brass);
  letter-spacing: 0.03em;
  margin-bottom: 18px;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: rgba(250,247,242,0.65);
  margin-bottom: 12px;
  transition: color 0.2s ease, transform 0.2s ease;
  width: fit-content;
}
.footer-col a:hover { color: var(--paper); transform: translateX(3px); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  font-size: 12.5px;
  color: rgba(250,247,242,0.45);
}
@media (max-width: 800px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}

/* ---------------- BOOK DETAIL PAGE ---------------- */
.detail-wrap {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 64px;
  padding: 64px 0 90px;
}
.detail-cover {
  aspect-ratio: 2/3;
  border-radius: 2px 6px 6px 2px;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-book);
  position: sticky;
  top: 100px;
}
.detail-genre {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--maroon);
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  color: var(--green);
  line-height: 1.12;
}
.detail-author { margin-top: 10px; font-size: 15px; color: var(--ink-soft); }
.detail-desc { margin-top: 26px; font-size: 16px; color: var(--ink-soft); max-width: 62ch; line-height: 1.7; }
.detail-meta { display: flex; gap: 28px; margin-top: 28px; font-size: 13.5px; color: var(--ink-soft); }
.detail-meta strong { color: var(--ink); display: block; font-family: var(--font-mono); font-size: 15px; margin-bottom: 2px; }

.buy-box {
  margin-top: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px;
  background: var(--paper-dim);
}
.buy-price {
  font-family: var(--font-mono);
  font-size: 30px;
  color: var(--maroon);
}
.buy-price span { font-size: 14px; color: var(--ink-soft); margin-left: 6px; }
.buy-box .btn-primary { width: 100%; text-align: center; margin-top: 18px; }
.buy-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 14px; line-height: 1.6; }
.owned-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-soft); color: var(--paper);
  padding: 10px 16px; border-radius: var(--radius); font-size: 14px;
  margin-top: 18px;
}

/* ---------------- AUTH / FORMS ---------------- */
.auth-shell {
  min-height: calc(100vh - 74px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 42px 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
}
.auth-card h1 { font-family: var(--font-display); font-size: 28px; color: var(--green); margin-bottom: 8px; }
.auth-card p.sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 14.5px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--maroon);
  outline: none;
}
.form-btn {
  width: 100%;
  padding: 13px;
  background: var(--maroon);
  color: var(--paper);
  border-radius: 3px;
  font-weight: 500;
  font-size: 15px;
  transition: background 0.2s ease;
}
.form-btn:hover { background: var(--maroon-dark); }
.form-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-switch { margin-top: 22px; font-size: 13.5px; color: var(--ink-soft); text-align: center; }
.auth-switch a { color: var(--maroon); font-weight: 500; }
.form-msg { font-size: 13.5px; padding: 10px 14px; border-radius: 3px; margin-bottom: 16px; }
.form-msg.error { background: rgba(107,20,33,0.08); color: var(--maroon); }
.form-msg.success { background: rgba(34,58,42,0.1); color: var(--green-soft); }

/* ---------------- LIBRARY (my books) ---------------- */
.empty-state {
  text-align: center;
  padding: 90px 24px;
  color: var(--ink-soft);
}
.empty-state h3 { font-family: var(--font-display); font-size: 24px; color: var(--green); margin-bottom: 10px; }

/* ---------------- LOADER ---------------- */
.skel {
  background: linear-gradient(90deg, var(--paper-dim) 25%, #e9e2d5 37%, var(--paper-dim) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 2px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 40px; }
  .book-stack { height: 300px; order: -1; }
  .detail-wrap { grid-template-columns: 1fr; }
  .detail-cover { position: static; max-width: 240px; margin: 0 auto; }
  .feature-grid { grid-template-columns: 1fr; gap: 32px; }
  .nav-links { gap: 20px; }
}
@media (max-width: 560px) {
  .container, .nav-inner, .hero-inner { padding-left: 20px; padding-right: 20px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero h1 { font-size: 32px; }
}
