/* =========================================================
   Books & Cloud — Museum / Gallery design system
   Palette: deep green, rich brown, gold accent, creamy off-white
   Typography: Playfair Display (display) + Cormorant Garamond (body serif) + Montserrat (micro type)
   ========================================================= */

:root {
  /* Palette */
  --cream:      #f5efe1;
  --cream-2:    #ede4d0;
  --cream-3:    #e4d9c0;
  --paper:      #faf6ec;     /* lighter than cream, for raised surfaces */
  --ink:        #1c1b18;
  --ink-2:      #3a3830;
  --green:      #1e3329;     /* deep forest green */
  --green-2:    #28483a;
  --brown:      #5a3a22;     /* rich brown */
  --brown-2:    #7b5236;
  --gold:       #b68c3f;     /* more museum, less shiny */
  --gold-2:     #d4b277;
  --gold-deep:  #8f6a27;
  --hairline:   rgba(28, 27, 24, 0.14);
  --hairline-2: rgba(28, 27, 24, 0.08);

  /* Typography */
  --display:    'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --serif:      'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --sans:       'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:       'Courier New', monospace;

  --radius:     4px;
  --radius-lg:  8px;

  --container:  1320px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--serif);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga", "kern";
  /* very subtle paper grain */
  background-image:
    radial-gradient(rgba(90, 58, 34, 0.025) 1px, transparent 1px),
    radial-gradient(rgba(32, 57, 44, 0.018) 1px, transparent 1px);
  background-size: 32px 32px, 48px 48px;
  background-position: 0 0, 16px 16px;
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; transition: color .25s ease, opacity .25s ease; }
a:hover { color: var(--gold-deep); }

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--green);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); font-weight: 400; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: 1.6rem; font-weight: 500; }

p { margin: 0 0 1em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 40px; }

/* ---------- Museum-label micro-type ---------- */
.label-micro,
.section-head .subtitle {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brown-2);
  font-weight: 500;
  margin-bottom: 0.8em;
  display: block;
}

.label-number {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--gold-deep);
  font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn-gold, .btn-ghost, .btn-outline, .btn-link {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.6em;
  padding: 0.85em 2em;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 0;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .3s ease;
  text-decoration: none;
}
.btn-gold {
  background: var(--green);
  color: var(--cream);
  border-color: var(--green);
}
.btn-gold:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn-ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn-ghost:hover { background: var(--green); color: var(--cream); }

.btn-outline { background: transparent; color: var(--brown); border-color: var(--hairline); padding: 0.7em 1.4em; letter-spacing: 0.15em; }
.btn-outline:hover { border-color: var(--brown); color: var(--brown); }

.btn-link {
  background: transparent; border: none; padding: 0;
  color: var(--gold-deep); font-size: 0.8rem;
  position: relative;
}
.btn-link::after {
  content: ""; display: block;
  width: 100%; height: 1px; background: currentColor;
  margin-top: 6px;
  transform: scaleX(0.4); transform-origin: left;
  transition: transform 0.4s ease;
}
.btn-link:hover::after { transform: scaleX(1); }

.btn-block { display: flex; width: 100%; }

/* ---------- Header ---------- */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 100;
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(28, 27, 24, 0.06);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 22px 40px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 32px;
}

.logo { display: inline-flex; align-items: center; gap: 12px; color: var(--green); }
.logo:hover { color: var(--green); opacity: 0.75; }
.logo svg { flex-shrink: 0; }
.logo-text {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
}
.logo-books { color: var(--green); }
.logo-amp   { color: var(--gold); margin: 0 0.25em; font-style: italic; font-weight: 400; }
.logo-cloud {
  color: var(--brown);
  font-family: var(--sans);
  font-size: 0.72em;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.main-nav { display: flex; gap: 36px; justify-self: center; }
.main-nav a {
  position: relative;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 8px 0;
}
.main-nav a::after {
  content: ""; position: absolute; bottom: 0; left: 50%;
  width: 0; height: 1px; background: var(--gold);
  transition: all 0.35s ease;
}
.main-nav a:hover { color: var(--green); }
.main-nav a:hover::after { width: 100%; left: 0; }

.search-form {
  display: flex; align-items: center;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: 0 4px 0 18px;
  transition: border-color 0.25s ease;
  min-width: 240px;
}
.search-form:focus-within { border-color: var(--gold); }
.search-form input {
  flex: 1; border: none; background: transparent; outline: none;
  font-family: var(--sans); font-size: 0.82rem; color: var(--ink);
  padding: 10px 0;
  letter-spacing: 0.04em;
}
.search-form input::placeholder { color: var(--brown-2); }
.search-form button {
  background: transparent; color: var(--green);
  width: 32px; height: 32px;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s ease;
}
.search-form button:hover { color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.cart-btn {
  position: relative;
  background: transparent; border: none; cursor: pointer;
  color: var(--ink); padding: 8px;
  transition: color 0.2s ease;
}
.cart-btn:hover { color: var(--gold); }
.cart-count {
  position: absolute; top: -2px; right: -2px;
  background: var(--green); color: var(--gold-2);
  font-family: var(--sans);
  font-size: 0.65rem; font-weight: 500;
  min-width: 16px; height: 16px; line-height: 16px;
  padding: 0 4px; border-radius: 0; text-align: center;
}

.user-menu { position: relative; }
.avatar-btn {
  background: none; border: 1px solid var(--gold); padding: 2px;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; overflow: hidden;
  transition: transform 0.25s ease;
}
.avatar-btn:hover { transform: scale(1.06); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 14px);
  background: var(--paper); min-width: 220px;
  border: 1px solid var(--hairline);
  padding: 10px 0;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: all 0.25s ease;
  z-index: 50;
}
.user-menu.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
  display: block; padding: 12px 22px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.15s ease, color 0.15s ease;
}
.dropdown a:hover { background: var(--cream-2); color: var(--green); }

.mobile-menu-btn {
  display: none;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.mobile-menu-btn span {
  display: block; width: 24px; height: 1px; background: var(--ink); margin: 6px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero — gallery style ---------- */
.hero {
  position: relative;
  padding: 80px 0 120px;
  overflow: hidden;
}
.hero-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 40px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 100px;
  align-items: center;
  position: relative;
}

.hero-text { position: relative; }
.hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 500;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-eyebrow::before {
  content: ""; display: inline-block;
  width: 32px; height: 1px; background: var(--gold);
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
  font-weight: 400;
}
.hero h1 em {
  font-style: italic;
  color: var(--brown);
  font-family: var(--display);
  font-weight: 400;
}

.hero p.lead {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.55;
  max-width: 480px;
  color: var(--ink-2);
  margin-bottom: 50px;
  font-weight: 400;
}

.hero-cta { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }

/* Hero artifact — gallery display with museum label */
.artifact-display {
  position: relative;
  padding: 40px;
}
.artifact-frame {
  position: relative;
  aspect-ratio: 3/4;
  max-width: 440px;
  margin: 0 auto;
  background: var(--paper);
  padding: 16px;
  border: 1px solid var(--hairline);
  transition: transform 1.2s cubic-bezier(0.4, 0.2, 0.2, 1);
}
.artifact-frame::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid var(--gold);
  opacity: 0.4;
  pointer-events: none;
}
.artifact-slide {
  position: absolute;
  inset: 16px;
  opacity: 0;
  transition: opacity 1s ease;
  background: var(--green-2);
  overflow: hidden;
}
.artifact-slide.active { opacity: 1; }
.artifact-slide img { width: 100%; height: 100%; object-fit: cover; }

.artifact-label {
  margin-top: 30px;
  padding-left: 20px;
  border-left: 1px solid var(--gold);
  max-width: 360px;
}
.artifact-label .catalog-num {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--gold-deep);
  text-transform: uppercase;
  display: block;
  margin-bottom: 10px;
}
.artifact-label h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--green);
  margin: 0 0 6px;
  font-weight: 500;
}
.artifact-label .attribution {
  font-style: italic;
  color: var(--brown);
  font-size: 0.95rem;
  margin: 0;
  font-family: var(--serif);
}

.artifact-nav {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 40px;
  padding-left: 20px;
}
.artifact-nav button {
  background: none;
  border: 1px solid var(--hairline);
  width: 44px; height: 44px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.artifact-nav button:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
}
.artifact-counter {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--brown-2);
}

/* ---------- Section heading — museum style ---------- */
.section { padding: 100px 0; position: relative; }
.section + .section { border-top: 1px solid var(--hairline-2); }
.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  margin-bottom: 70px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--hairline);
}
.section-head > div:first-child { max-width: 720px; }
.section-head h2 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
}
.section-head a.view-all {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  align-self: end;
  padding-bottom: 8px;
  position: relative;
}
.section-head a.view-all::after {
  content: "→"; margin-left: 10px;
  transition: margin 0.3s ease;
}
.section-head a.view-all:hover::after { margin-left: 16px; }

/* ---------- Book grid — artifact card style ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 60px 44px;
}

.book-card {
  position: relative;
  cursor: pointer;
  /* no perspective here — children use their own */
}

.book-card-inner {
  position: relative;
  aspect-ratio: 2/3;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(0.4, 0.2, 0.2, 1);
  perspective: 1400px;
}
.book-card:hover .book-card-inner {
  transform: rotateY(180deg);
}

.book-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  overflow: hidden;
}
.book-front { background: var(--green); }
.book-front img { width: 100%; height: 100%; object-fit: cover; }
.book-front::after {
  /* subtle spine shadow line */
  content: "";
  position: absolute;
  left: 12px; top: 0; bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.book-back {
  transform: rotateY(180deg);
  background: var(--green);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 28px;
  border: 1px solid var(--gold-deep);
}
.book-back::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(212, 178, 119, 0.3);
  pointer-events: none;
}
.book-back h4 {
  color: var(--gold-2);
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.book-back .back-author {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  opacity: 0.7;
  margin-bottom: 18px;
}
.book-back .back-summary {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.55;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 8;
line-clamp: 8;
  -webkit-box-orient: vertical;
  opacity: 0.9;
}
.book-back .back-cta {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(212, 178, 119, 0.25);
}
.book-back .back-cta a,
.book-back .back-cta button {
  flex: 1;
  font-family: var(--sans);
  font-size: 0.66rem;
  padding: 12px 6px;
  border: 1px solid var(--gold);
  color: var(--cream);
  background: transparent;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: 0;
}
.book-back .back-cta a:hover,
.book-back .back-cta button:hover {
  background: var(--gold);
  color: var(--ink);
}

/* Museum-style catalog label under each book */
.book-meta {
  padding-top: 22px;
  border-top: 1px solid var(--hairline-2);
  margin-top: 20px;
}
.book-meta .catalog-id {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--gold-deep);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}
.book-meta .t {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 500;
  margin: 0 0 4px;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.book-meta .a {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--brown);
  margin: 0 0 12px;
}
.book-meta .p {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  color: var(--green);
  font-weight: 500;
}

/* ---------- Manifesto section (museum placard) ---------- */
.manifesto {
  background: var(--paper);
  padding: 120px 0;
  position: relative;
}
.manifesto-inner {
  max-width: 920px; margin: 0 auto; padding: 0 40px;
  text-align: center;
}
.manifesto-rule {
  width: 80px; height: 1px;
  background: var(--gold);
  margin: 0 auto 40px;
}
.manifesto blockquote {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.35;
  color: var(--green);
  font-style: italic;
  font-weight: 400;
  margin: 0 0 40px;
  letter-spacing: -0.01em;
}
.manifesto .attribution {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brown-2);
}

/* ---------- Vibe section (gallery wing) ---------- */
.vibe-wing {
  background: var(--green);
  color: var(--cream);
  padding: 110px 0;
  position: relative;
  overflow: hidden;
}
.vibe-wing::before {
  content: "";
  position: absolute;
  inset: 40px;
  border: 1px solid rgba(212, 178, 119, 0.2);
  pointer-events: none;
}
.vibe-wing .container { position: relative; }
.vibe-wing .section-head {
  border-color: rgba(212, 178, 119, 0.2);
}
.vibe-wing .section-head h2 { color: var(--cream); }
.vibe-wing .subtitle { color: var(--gold-2); }
.vibe-wing .lead {
  max-width: 600px;
  font-size: 1.2rem;
  color: rgba(245, 239, 225, 0.85);
  margin-bottom: 40px;
  line-height: 1.6;
}

.vibe-chips { display: flex; flex-wrap: wrap; gap: 12px; }
.vibe-wing .vibe-chip {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(212, 178, 119, 0.4);
  padding: 0.7em 1.6em;
}
.vibe-wing .vibe-chip:hover,
.vibe-wing .vibe-chip.active {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

.vibe-chip {
  display: inline-flex; align-items: center;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.6em 1.5em;
  border-radius: 0;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--green);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.vibe-chip:hover { border-color: var(--gold); color: var(--gold-deep); }
.vibe-chip.active {
  background: var(--green);
  color: var(--cream);
  border-color: var(--green);
}
.vibe-chip input { display: none; }

/* ---------- Cart drawer (museum style) ---------- */
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100vh;
  width: min(440px, 95vw); max-width: 440px;
  background: var(--paper);
  box-shadow: -20px 0 60px rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1);
  z-index: 200;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-overlay {
  position: fixed; inset: 0; background: rgba(28,27,24,0.45);
  opacity: 0; visibility: hidden;
  transition: all 0.35s ease;
  z-index: 150;
  backdrop-filter: blur(3px);
}
.cart-overlay.show { opacity: 1; visibility: visible; }
.cart-drawer-header {
  padding: 32px 32px 24px;
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--hairline);
}
.cart-drawer-header h2 {
  margin: 0; font-size: 1.6rem;
  font-family: var(--display);
  font-weight: 500;
}
.cart-drawer-header h2::before {
  content: "No. ";
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: block;
  margin-bottom: 8px;
}
.cart-drawer-header button {
  background: none; border: none; font-size: 1.6rem; color: var(--ink);
  cursor: pointer; line-height: 1; padding: 0;
}
.cart-drawer-header button:hover { color: var(--gold); }

.cart-drawer-body { flex: 1; overflow-y: auto; padding: 16px 32px; }
.cart-drawer-footer { padding: 24px 32px; border-top: 1px solid var(--hairline); }
.cart-total {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--green);
  margin-bottom: 20px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.cart-total span:first-child {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brown-2);
}
.cart-item {
  display: grid; grid-template-columns: 60px 1fr auto; gap: 16px; align-items: start;
  padding: 20px 0; border-bottom: 1px solid var(--hairline-2);
}
.cart-item img {
  width: 60px; height: 90px; object-fit: cover;
  border: 1px solid var(--hairline);
}
.cart-item .ci-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}
.cart-item .ci-author {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--brown);
  margin: 4px 0 10px;
}
.cart-item .ci-price {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--green);
}
.cart-item .qty-control {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap;
}
.cart-item .qty-control button {
  width: 26px; height: 26px;
  border: 1px solid var(--hairline);
  background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 0.85rem;
  color: var(--ink);
  transition: all 0.2s ease;
}
.cart-item .qty-control button:hover { border-color: var(--gold); color: var(--gold-deep); }
.cart-item .qty-control span {
  font-family: var(--sans);
  font-size: 0.85rem;
  min-width: 18px;
  text-align: center;
}
.cart-item .remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--brown-2);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
  margin-left: 4px;
  transition: all 0.22s ease;
  border-radius: 0;
}
.cart-item .remove-btn::before {
  content: "";
  width: 10px;
  height: 11px;
  background:
    linear-gradient(currentColor, currentColor) top left / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 20% 50%  / 1px 60% no-repeat,
    linear-gradient(currentColor, currentColor) 50% 50%  / 1px 60% no-repeat,
    linear-gradient(currentColor, currentColor) 80% 50%  / 1px 60% no-repeat;
  background-position: 0 2px, 20% 100%, 50% 100%, 80% 100%;
  opacity: 0.7;
  transition: opacity 0.22s ease;
}
.cart-item .remove-btn:hover {
  border-color: var(--brown);
  color: var(--brown);
  background: rgba(90, 58, 34, 0.04);
}
.cart-item .remove-btn:hover::before { opacity: 1; }
.cart-item .remove-btn:active { transform: translateY(1px); }
.cart-item .remove-btn:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(182, 140, 63, 0.2);
}
.cart-item .ci-line-total {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink);
  align-self: start;
}
.cart-empty {
  text-align: center;
  color: var(--brown);
  padding: 60px 20px;
  font-style: italic;
  font-family: var(--serif);
  font-size: 1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 0;
  background: var(--green);
  color: var(--cream);
  padding: 0;
}
.footer-inner {
  max-width: var(--container); margin: 0 auto; padding: 100px 40px 60px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 60px;
  border-top: 1px solid rgba(212, 178, 119, 0.2);
}
.footer-logo {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--gold-2);
  margin-bottom: 18px;
  font-weight: 500;
}
.footer-brand p {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: rgba(245, 239, 225, 0.7);
  max-width: 360px;
  line-height: 1.6;
}
.footer-col h4 {
  color: var(--gold-2);
  font-family: var(--sans);
  font-size: 0.72rem;
  margin-bottom: 22px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 500;
}
.footer-col a {
  display: block;
  color: var(--cream);
  opacity: 0.75;
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: 1rem;
  transition: all 0.2s ease;
}
.footer-col a:hover { opacity: 1; color: var(--gold-2); padding-left: 6px; }
.footer-bottom {
  border-top: 1px solid rgba(212, 178, 119, 0.15);
  padding: 30px 40px;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 239, 225, 0.5);
}

/* ---------- Forms ---------- */
.form-page {
  max-width: 520px;
  margin: 80px auto;
  padding: 64px 56px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  position: relative;
}
.form-page::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid var(--gold);
  opacity: 0.3;
  pointer-events: none;
}
.form-page > * { position: relative; }
.form-page h1 { text-align: center; margin-bottom: 36px; }

.form-field { margin-bottom: 24px; }
.form-field label {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--brown-2);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--hairline);
  border-radius: 0;
  transition: border-color 0.25s ease;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--gold);
}

.form-error {
  padding: 14px 18px;
  background: rgba(175, 50, 30, 0.08);
  color: #7a2a1b;
  border-left: 2px solid #a03a22;
  margin-bottom: 24px;
  font-size: 0.92rem;
  font-family: var(--serif);
}
.form-success {
  padding: 14px 18px;
  background: rgba(30, 51, 41, 0.06);
  color: var(--green);
  border-left: 2px solid var(--gold);
  margin-bottom: 24px;
  font-size: 0.92rem;
  font-family: var(--serif);
}
.form-footer {
  text-align: center;
  margin-top: 28px;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--brown);
}

/* ---------- Book detail ---------- */
.book-detail {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 80px;
  padding: 80px 0;
}
.book-detail .cover {
  background: var(--green);
  aspect-ratio: 2/3;
  padding: 14px;
  border: 1px solid var(--hairline);
  position: relative;
}
.book-detail .cover::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid var(--gold);
  opacity: 0.4;
  pointer-events: none;
}
.book-detail .cover img { width: 100%; height: 100%; object-fit: cover; }
.book-detail h1 {
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  margin-bottom: 16px;
  line-height: 1.05;
}
.book-detail .author {
  font-family: var(--serif);
  font-style: italic;
  color: var(--brown);
  font-size: 1.3rem;
  margin-bottom: 30px;
}
.book-detail .price-lg {
  font-family: var(--display);
  font-size: 2.4rem;
  color: var(--green);
  font-weight: 500;
  margin: 30px 0;
  padding-top: 30px;
  border-top: 1px solid var(--hairline);
}
.book-detail .description {
  color: var(--ink-2);
  line-height: 1.8;
  margin: 24px 0;
  font-size: 1.08rem;
}
.book-detail .actions {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin: 36px 0;
}

/* ---------- Profile ---------- */
.profile-page { padding: 80px 0; }
.profile-header {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--hairline);
}
.profile-avatar {
  width: 180px; height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--gold);
  padding: 6px;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  margin-bottom: 60px;
}
.stats-grid .stat-card {
  padding: 32px 28px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 0;
  border-left-width: 0;
}
.stats-grid .stat-card:first-child { border-left-width: 1px; }
.stats-grid .stat-card .label {
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--brown-2);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin-bottom: 16px;
}
.stats-grid .stat-card .value {
  font-family: var(--display);
  font-size: 2.4rem;
  color: var(--green);
  font-weight: 500;
  line-height: 1;
}

/* ---------- Shelf tabs ---------- */
.shelf-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--hairline);
  margin: 40px 0;
}
.shelf-tabs a {
  padding: 18px 32px 18px 0;
  margin-right: 32px;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--brown-2);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: all 0.25s ease;
}
.shelf-tabs a:hover { color: var(--green); }
.shelf-tabs a.active {
  color: var(--green);
  border-color: var(--gold);
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Utility ---------- */
.center { text-align: center; }
.muted  { color: var(--brown); }
.mt-20  { margin-top: 20px; }
.mt-40  { margin-top: 40px; }

/* Subtle tilt on cards & stat cards */
.tilt-on-hover {
  transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1);
}
.tilt-on-hover:hover {
  transform: translateY(-4px);
}

/* Page intro (used on subpages) */
.page-intro {
  padding: 90px 0 70px;
  text-align: center;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 60px;
}
.page-intro .subtitle {
  margin-bottom: 24px;
}
.page-intro h1 {
  margin: 0;
}