:root {
  --paper: #f4ede1;
  --paper-2: #ebe1d0;
  --ink: #23201c;
  --ink-soft: #5b544b;
  --line: #d8ccb7;
  --accent: #2e5e45;
  --accent-ink: #fff8ef;
  --green: #2f8a4e;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --gutter: clamp(16px, 5vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
em { font-style: italic; color: var(--accent); }

.eyebrow {
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font: 600 15px/1 var(--sans);
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-call { background: var(--accent); color: var(--accent-ink); }
.btn-call:hover { background: #1f4331; }
.btn-sm { padding: 10px 16px; font-size: 14px; }
.btn-lg { padding: 18px 26px; font-size: 17px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font: 600 18px/1 var(--serif);
}
.brand-name { font: 600 19px/1 var(--serif); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; font-weight: 500; color: var(--ink-soft); transition: color .2s; }
.nav-links a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 48px;
  padding: clamp(48px, 9vw, 120px) var(--gutter) clamp(56px, 8vw, 110px);
  max-width: 1280px; margin: 0 auto;
}
.hero h1 { font-size: clamp(44px, 7vw, 92px); }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-soft); max-width: 34em; margin: 26px 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.status {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 28px 0 0; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; color: var(--ink-soft);
}
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.status.is-open .dot { background: var(--green); box-shadow: 0 0 0 0 rgba(47,138,78,.5); animation: pulse 2s infinite; }
.status.is-open .status-text { color: var(--green); font-weight: 600; }
.status.is-closed .dot { background: #a39a8c; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(47,138,78,0); } 100% { box-shadow: 0 0 0 0 rgba(47,138,78,0); } }

/* Shelf of spines */
.hero-shelf {
  display: flex; align-items: flex-end; justify-content: center; gap: 8px;
  height: clamp(300px, 38vw, 460px);
  padding: 0 12px;
  border-bottom: 10px solid var(--ink);
  border-radius: 2px;
}
.spine {
  position: relative;
  width: clamp(38px, 4.4vw, 58px);
  border-radius: 4px 4px 2px 2px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,248,239,.92);
  box-shadow: inset -6px 0 0 rgba(0,0,0,.12), inset 3px 0 0 rgba(255,255,255,.08);
  transform-origin: bottom center;
  animation: rise .9s cubic-bezier(.2,.8,.2,1) both;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.spine:hover { transform: translateY(-14px); }
.spine::before, .spine::after {
  content: ""; position: absolute; left: 18%; right: 18%; height: 2px; background: rgba(255,248,239,.4);
}
.spine::before { top: 16px; } .spine::after { bottom: 16px; }
.spine span { writing-mode: vertical-rl; transform: rotate(180deg); font: 400 clamp(14px, 1.3vw, 17px)/1 var(--serif); letter-spacing: .04em; }
.s1 { height: 72%; background: #2e5e45; animation-delay: .05s; }
.s2 { height: 88%; background: #2f4a3a; animation-delay: .12s; }
.s3 { height: 64%; background: #b7793a; animation-delay: .19s; }
.s4 { height: 80%; background: #1f3550; animation-delay: .26s; }
.s5 { height: 94%; background: #5a3b5e; animation-delay: .33s; }
.s6 { height: 70%; background: #466b6f; animation-delay: .40s; }
.s7 { height: 84%; background: var(--ink); animation-delay: .47s; transform: rotate(-9deg); transform-origin: bottom left; }
.s7:hover { transform: rotate(-9deg) translateY(-14px); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { opacity: 1; } }
.s7 { animation-name: rise-tilt; }
@keyframes rise-tilt { from { transform: translateY(40px) rotate(-9deg); opacity: 0; } to { transform: rotate(-9deg); opacity: 1; } }

/* ---------- Reveal (content visible without JS) ---------- */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js-reveal .reveal.is-in { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* ---------- Sections ---------- */
.section-head { max-width: 1280px; margin: 0 auto 36px; }
.section-head h2, .info-card h2 { font-size: clamp(34px, 4.6vw, 56px); }
.section-sub { color: var(--ink-soft); margin: 14px 0 0; max-width: 40em; }

.catalog {
  background: var(--paper-2);
  padding: clamp(64px, 9vw, 120px) var(--gutter);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.catalog-tools {
  max-width: 1280px; margin: 0 auto 18px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  font: 500 14px/1 var(--sans); color: var(--ink);
  cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; min-width: 260px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
}
.search:focus-within { border-color: var(--ink); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-soft); stroke-width: 2; flex: none; }
.search input { border: 0; background: transparent; padding: 12px 0; font: 400 15px var(--sans); color: var(--ink); width: 100%; outline: none; }

.result-count { max-width: 1280px; margin: 0 auto 22px; font-size: 14px; color: var(--ink-soft); }
.groups { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: clamp(48px, 6vw, 80px); }
.cat-section[hidden] { display: none; }
.cat-head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 18px;
  padding-bottom: 16px; margin-bottom: 28px;
  border-bottom: 1px solid var(--ink);
}
.cat-num { font: 400 clamp(32px, 4vw, 48px)/.9 var(--serif); color: var(--accent); font-style: italic; }
.cat-name { font-size: clamp(26px, 3vw, 36px); }
.cat-desc { margin: 6px 0 0; color: var(--ink-soft); font-size: 15px; }
.cat-count { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; padding-bottom: 6px; }
.chip-n { display: inline-block; margin-left: 4px; font-size: 12px; opacity: .6; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 28px 22px;
}
.book { display: flex; flex-direction: column; gap: 14px; animation: fade .45s ease both; }
.book[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
.cover {
  --c: #2e5e45;
  position: relative; aspect-ratio: 2 / 3;
  padding: 18px 16px 16px 22px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(90deg, rgba(0,0,0,.22) 0 6px, rgba(255,255,255,.07) 6px 8px, transparent 8px), var(--c);
  color: #fff8ef;
  border-radius: 3px 8px 8px 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 14px 26px -14px rgba(35,32,28,.55);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.cover::after { content: ""; position: absolute; left: 22px; right: 16px; top: 50%; height: 1px; background: rgba(255,248,239,.35); }
.book:hover .cover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 24px 34px -16px rgba(35,32,28,.6); }
.cover-title { font: 400 clamp(17px, 1.6vw, 21px)/1.15 var(--serif); }
.cover-author { font: 500 11px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.book-title { font: 600 17px/1.25 var(--serif); margin: 0 0 2px; }
.book-author { margin: 0 0 8px; font-size: 14px; color: var(--ink-soft); }
.book-ask { font-size: 13px; font-weight: 600; color: var(--accent); text-underline-offset: 3px; }
.empty { max-width: 1280px; margin: 24px auto 0; color: var(--ink-soft); }
.empty a { color: var(--accent); font-weight: 600; }

/* ---------- Info ---------- */
.info {
  max-width: 1280px; margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.info-card { padding: clamp(28px, 4vw, 48px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.contact { background: var(--ink); color: var(--paper); border-color: var(--ink); display: flex; flex-direction: column; align-items: flex-start; }
.contact .eyebrow { color: #a9d3b6; }
.contact p { color: #cfc6b8; margin: 16px 0 28px; }
.hours-list { margin: 26px 0 0; }
.hours-list div { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.hours-list div:last-child { border-bottom: 0; }
.hours-list dt { font-weight: 500; }
.hours-list dd { margin: 0; font-family: var(--serif); font-size: 18px; }
.hours-list .is-today dt::after {
  content: "Hoy"; margin-left: 10px; padding: 3px 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font: 600 11px/1 var(--sans); letter-spacing: .06em; vertical-align: 2px;
}

/* ---------- Location ---------- */
.location { padding: 0 var(--gutter) clamp(64px, 9vw, 120px); }
.map-wrap {
  max-width: 1280px; margin: 0 auto;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 7; min-height: 320px;
  background: var(--paper-2);
}
.map-wrap iframe { width: 100%; height: 100%; border: 0; filter: sepia(.25) saturate(.85); }
.map-actions { max-width: 1280px; margin: 20px auto 0; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Footer ---------- */
.footer {
  display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 24px;
  padding: 48px var(--gutter) 32px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft); font-size: 15px;
}
.footer p { margin: 0 0 4px; }
.footer .brand-name { color: var(--ink); margin-bottom: 8px; }
.footer a { color: var(--accent); font-weight: 600; text-decoration: none; }
.footer .copy { grid-column: 1 / -1; font-size: 13px; margin-top: 16px; }

/* ---------- Floating call (mobile) ---------- */
.fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  width: 58px; height: 58px; border-radius: 50%;
  display: none; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 12px 24px -8px rgba(46,94,69,.6);
}
.fab svg { width: 24px; height: 24px; fill: currentColor; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-shelf { height: 240px; order: -1; }
  .info { grid-template-columns: 1fr; }
  .map-wrap { aspect-ratio: auto; height: 380px; }
}
@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav .btn-call span { display: none; }
  .nav .btn-call { padding: 10px; }
  .search { min-width: 0; width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .cat-head { grid-template-columns: auto 1fr; }
  .cat-count { grid-column: 2; padding: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; }
  .cover { padding: 14px 12px 12px 18px; }
  .footer { grid-template-columns: 1fr; }
  .fab { display: grid; }
  .btn-lg { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .status.is-open .dot { animation: none; }
}
