/* =========================================================================
   CREA EDITORES — Editorial design system
   Bookish / literary, warm paper, gilt accents, brand blue
   Type: Spectral (display serif) · Montserrat (labels/UI) · Lato (body)
   ========================================================================= */

/* ---- Tokens ---- */
:root {
  /* Paper & ink */
  --cream:        #FAF6EF;   /* primary warm paper background */
  --cream-2:      #F2EADD;   /* deeper paper for alternating sections */
  --cream-3:      #ECE2D2;   /* card / inset on cream */
  --ink:          #2F2F2F;   /* brand dark gray — primary text */
  --ink-soft:     #5C564E;   /* secondary text */
  --ink-faint:    #8C857A;   /* captions, meta */
  --line:         #E2D8C7;   /* hairlines on cream */

  /* Deep navy (from El Códice) for dark sections */
  --navy:         #14233B;
  --navy-2:       #1B2E4A;
  --navy-line:    rgba(255,255,255,.14);
  --on-navy:      #F4F1EA;
  --on-navy-soft: #B9C2D2;

  /* Brand blue */
  --blue:         #62A1FF;   /* brand hue — decorative, large */
  --blue-soft:    #DCE9FF;   /* tints */
  --blue-ink:     #2B5FD0;   /* accessible blue for links/buttons/text */
  --blue-ink-2:   #1E4EB8;   /* hover */

  /* Gilt / literary accent (from cover border) */
  --gold:         #B0883E;
  --gold-soft:    #D9C189;

  /* Fonts */
  --serif:  "Spectral", Georgia, "Times New Roman", serif;
  --label:  "Montserrat", system-ui, sans-serif;
  --body:   "Lato", system-ui, sans-serif;

  /* Rhythm */
  --container: 1200px;
  --container-wide: 1340px;
  --radius: 4px;
  --radius-lg: 10px;

  /* Book shadow */
  --book-shadow:
     0 2px 4px rgba(20,35,59,.10),
     0 18px 36px rgba(20,35,59,.22),
     0 40px 80px rgba(20,35,59,.18);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; }

/* ---- Language visibility ---- */
html[data-lang="es"] [data-en] { display: none !important; }
html[data-lang="en"] [data-es] { display: none !important; }

/* ---- Layout helpers ---- */
.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 28px; }
.wrap-wide { max-width: var(--container-wide); }
.section { padding-block: clamp(64px, 9vw, 128px); }
.section-tight { padding-block: clamp(48px, 6vw, 84px); }
.bg-cream2 { background: var(--cream-2); }
.bg-navy { background: var(--navy); color: var(--on-navy); }

/* ---- Typography ---- */
.eyebrow {
  font-family: var(--label);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--blue-ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.bg-navy .eyebrow { color: var(--blue); }
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: currentColor;
  opacity: .7;
}
.eyebrow.center { justify-content: center; }
.eyebrow.no-rule::before { display: none; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.08; letter-spacing: -.01em; color: var(--ink); }
.bg-navy h1, .bg-navy h2, .bg-navy h3, .bg-navy h4 { color: var(--on-navy); }

.display {
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.02em;
}
.display em { font-style: italic; color: var(--blue-ink); font-weight: 600; }
.bg-navy .display em { color: var(--blue); }

.h2 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.06; }
.h3 { font-size: clamp(1.35rem, 1.8vw, 1.6rem); line-height: 1.18; }
.lede {
  font-family: var(--body);
  font-size: clamp(1.05rem, 1.4vw, 1.32rem);
  line-height: 1.6;
  color: var(--ink-soft);
  font-weight: 400;
  max-width: 56ch;
}
.bg-navy .lede { color: var(--on-navy-soft); }
.section-head { max-width: 64ch; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { margin-bottom: 22px; }
.section-head .lede { margin-top: 22px; }

.serif-quote { font-family: var(--serif); font-style: italic; }

/* ---- Buttons ---- */
.btn {
  font-family: var(--label);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: var(--radius);
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--blue-ink); color: #fff; box-shadow: 0 8px 20px rgba(43,95,208,.26); }
.btn-primary:hover { background: var(--blue-ink-2); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(43,95,208,.32); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }
.bg-navy .btn-ghost { color: var(--on-navy); border-color: rgba(255,255,255,.5); }
.bg-navy .btn-ghost:hover { background: var(--on-navy); color: var(--navy); }
.btn-wa { background: #1FA855; color: #fff; box-shadow: 0 8px 20px rgba(31,168,85,.28); }
.btn-wa:hover { background: #178a45; transform: translateY(-2px); }
.btn-text {
  font-family: var(--label); font-weight: 600; font-size: 14px; letter-spacing: .04em;
  color: var(--blue-ink); display: inline-flex; align-items: center; gap: 8px;
}
.btn-text svg { width: 16px; height: 16px; transition: transform .18s ease; }
.btn-text:hover svg { transform: translateX(4px); }
.btn-lg { padding: 17px 32px; font-size: 15px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 80;
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--cream) 94%, transparent); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand .emblem {
  width: 40px; height: 40px; border-radius: 50%; background: var(--navy);
  display: flex; align-items: center; justify-content: center; position: relative; flex: none;
  box-shadow: 0 3px 9px rgba(20,35,59,.20);
}
.brand .emblem::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1px solid var(--gold-soft); }
.brand .emblem .mono { font-family: "Parisienne", cursive; font-size: 24px; color: #fff; line-height: 1; transform: translateY(1px); }
.brand .word { font-family: "Parisienne", cursive; font-size: 30px; line-height: .85; color: var(--blue-ink); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-family: var(--label); font-weight: 500; font-size: 14.5px; color: var(--ink-soft);
  position: relative; padding-block: 6px; transition: color .16s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1.5px;
  background: var(--blue-ink); transition: width .22s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 16px; flex: none; }

/* Language toggle */
.lang-toggle {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--cream-3);
}
.lang-toggle button {
  font-family: var(--label); font-weight: 600; font-size: 12.5px; letter-spacing: .04em;
  padding: 6px 13px; border-radius: 999px; color: var(--ink-faint); transition: all .18s ease;
}
.lang-toggle button.active { background: var(--ink); color: var(--cream); }

.nav-toggle { display: none; width: 42px; height: 42px; border-radius: var(--radius); align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 22px; height: 2px; background: var(--ink); transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle span::before { transform: translateY(-7px); }
.nav-toggle span::after  { transform: translateY(5px); }
.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { transform: rotate(45deg); }
.nav-toggle.open span::after  { transform: rotate(-45deg) translateY(-1px); }

/* ---- Reveal animation ---- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---- 3D book mockup ---- */
.book3d { position: relative; transform-style: preserve-3d; }
.book3d .cover {
  position: relative; border-radius: 2px 5px 5px 2px; overflow: hidden;
  box-shadow: var(--book-shadow);
  transform: perspective(1600px) rotateY(-21deg) rotateX(3deg);
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.book3d .cover img { width: 100%; height: auto; display: block; }
.book3d .cover::after { /* spine shading */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.32) 0%, rgba(0,0,0,.12) 7%, rgba(255,255,255,.10) 11%, rgba(255,255,255,0) 22%);
  pointer-events: none;
}
.book3d:hover .cover { transform: perspective(1600px) rotateY(-12deg) rotateX(2deg); }
.book3d.flat .cover { transform: none; }
.book3d.flat:hover .cover { transform: translateY(-6px); }

/* ---- Footer ---- */
.site-footer { background: var(--navy); color: var(--on-navy-soft); padding-block: 72px 36px; }
.site-footer a { color: var(--on-navy-soft); transition: color .16s ease; }
.site-footer a:hover { color: var(--on-navy); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 40px; }
.footer-col h4 { font-family: var(--label); font-weight: 600; font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--on-navy); margin-bottom: 20px; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.footer-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.footer-brand .emblem { width: 44px; height: 44px; border-radius: 50%; background: #fff; position: relative; display: flex; align-items: center; justify-content: center; flex: none; }
.footer-brand .emblem::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1px solid var(--gold); }
.footer-brand .emblem .mono { font-family: "Parisienne", cursive; font-size: 26px; color: var(--navy); line-height: 1; transform: translateY(1px); }
.footer-brand .word { font-family: "Parisienne", cursive; font-size: 32px; color: #fff; line-height: .85; }
.footer-bottom { border-top: 1px solid var(--navy-line); margin-top: 56px; padding-top: 28px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; font-size: 13.5px; }
.footer-bottom .legal { display: flex; gap: 24px; flex-wrap: wrap; }

/* Newsletter */
.news-form { display: flex; gap: 8px; margin-top: 8px; }
.news-form input {
  flex: 1; min-width: 0; font-family: var(--body); font-size: 14.5px;
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--navy-line);
  background: rgba(255,255,255,.06); color: var(--on-navy);
}
.news-form input::placeholder { color: var(--on-navy-soft); }
.news-form button { background: var(--blue); color: var(--navy); padding: 0 16px; border-radius: var(--radius); font-family: var(--label); font-weight: 700; }

/* ---- Floating WhatsApp ---- */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 58px; height: 58px; border-radius: 50%;
  background: #1FA855; color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(31,168,85,.4); transition: transform .2s ease;
}
.wa-float:hover { transform: scale(1.07); }
.wa-float svg { width: 30px; height: 30px; }

/* ---- Generic card ---- */
.card { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(20,35,59,.10); border-color: var(--blue-soft); }

/* ---- Pills ---- */
.pill { font-family: var(--label); font-weight: 600; font-size: 12px; letter-spacing: .05em; padding: 5px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-ink); display: inline-flex; align-items: center; gap: 6px; }

/* ---- Utility ---- */
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.gilt-rule { width: 64px; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); border: none; }

/* ---- Responsive base ---- */
@media (max-width: 900px) {
  body { font-size: 17px; }
  .nav-links, .nav .desktop-only { display: none; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-col.newsletter { grid-column: 1 / -1; }
  /* mobile menu */
  .nav-links.mobile-open {
    display: flex; position: absolute; top: 76px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: 12px 28px 22px; box-shadow: 0 18px 30px rgba(20,35,59,.10);
  }
  .nav-links.mobile-open a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav-links.mobile-open a:last-child { border-bottom: none; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .btn-row .btn { width: 100%; }
}
