/* Los Cuadernos de Don Aurelio: sales site for the three ebooks.
   Same family as the covers (ebooks/tools/make_covers.py): lime-wash paper, cobalt azulejo tiles, terracotta bands,
   maize-yellow accents, round-topped "arch" windows around the paintings. Type is Alegreya / Alegreya Sans
   (Huerta Tipográfica, Argentina). Sized for 55+ readers. Hal's site is the dark pine-green opposite of this. */

:root {
  --cal: #f6efe1;           /* lime-wash white, matches CAL in make_covers.py */
  --cal-deep: #efe4cf;
  --paper: #fbf7ee;
  --ink: #34210f;           /* INK */
  --ink-soft: #5c402c;
  --terra: #b0522d;         /* TERRA */
  --terra-deep: #8e3f20;
  --cobalt: #1f4e8c;        /* COBALT */
  --cobalt-deep: #173b6b;
  --maiz: #e0a526;          /* MAIZ */
  --oliva: #5f6b2e;
  --line: #d9ccb3;
  --serif: "Alegreya", Georgia, serif;
  --sc: "Alegreya SC", Georgia, serif;
  --sans: "Alegreya Sans", "Segoe UI", sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .3 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cal) var(--grain);
  color: var(--ink);
  font: 20px/1.6 var(--serif);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cobalt); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 900; line-height: 1.1; margin: 0 0 .4em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); letter-spacing: -.01em; }
h1 em { font-style: italic; font-weight: 500; color: var(--terra); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; }
.eyebrow { font-family: var(--sc); font-weight: 700; letter-spacing: .12em; color: var(--cobalt); font-size: .95rem; margin-bottom: .6em; }
.fine { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); }

section { padding: clamp(56px, 8vw, 100px) var(--gutter); }
section > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.band { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 760px; margin-bottom: 48px; }
.section-head p:last-child { color: var(--ink-soft); }

/* ---- the azulejo: a strip of tiles between sections, and the little tile in the logo ---- */
.azulejo-strip {
  height: 46px;
  background: url("../img/azulejo.svg") repeat-x center / 46px 46px;
  border-top: 3px solid var(--terra);
  border-bottom: 3px solid var(--terra);
}
.tile { display: inline-block; width: 28px; height: 28px; border-radius: 3px; vertical-align: -6px; margin-right: 10px;
        background: url("../img/azulejo.svg") center / cover; box-shadow: 0 0 0 2px var(--terra); }

/* ---- buttons ---- */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 1.12rem; text-decoration: none;
  color: #fff8ec; background: var(--terra); padding: .85em 1.6em; border-radius: 999px; border: 0; cursor: pointer;
  box-shadow: 0 3px 0 var(--terra-deep); transition: transform .12s, background .12s;
}
.btn:hover { background: var(--terra-deep); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--terra-deep); }
.btn:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--maiz); outline-offset: 3px; }
.btn.small { font-size: .95rem; padding: .55em 1.2em; }

/* ---- header ---- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gutter); background: rgba(246, 239, 225, .94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 900; font-size: 1.15rem; color: var(--ink); text-decoration: none; margin-right: auto; white-space: nowrap; }
.top nav { display: flex; gap: 22px; font-family: var(--sans); font-size: 1rem; }
.top nav a { color: var(--ink-soft); text-decoration: none; }
.top nav a:hover { color: var(--terra); }

/* ---- hero ---- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; max-width: none; }
.hero > * { margin: 0; }
.hero { padding-left: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); padding-right: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 34em; }
.price-box { display: flex; align-items: center; gap: 24px; margin: 28px 0 24px; padding: 16px 22px;
             background: var(--paper); border: 2px solid var(--cobalt); border-radius: 14px; width: fit-content; max-width: 100%; }
.price { font-weight: 900; font-size: 3.6rem; line-height: 1; color: var(--terra); white-space: nowrap; }
.price .cur { font-size: 1.2rem; font-weight: 700; vertical-align: top; margin-right: 4px; color: var(--ink-soft); }
.incl { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 1rem; line-height: 1.5; }
.incl li::before { content: "✓ "; color: var(--oliva); font-weight: 700; }
.hero .fine { margin-top: 14px; }
.hero-art img { filter: drop-shadow(0 18px 24px rgba(52, 33, 15, .18)); }

/* ---- arch windows (round-topped frames, like the covers) ---- */
.arch { margin: 0; padding: 10px; background: var(--terra); border-radius: 999px 999px 18px 18px; }
.arch img { border-radius: 999px 999px 10px 10px; border: 5px solid var(--cobalt); width: 100%; object-fit: cover; }
.arch.wide { border-radius: 48% 48% 18px 18px / 30% 30% 18px 18px; }
.arch.wide img { border-radius: 48% 48% 10px 10px / 30% 30% 10px 10px; aspect-ratio: 16 / 9; }

/* ---- refrán ---- */
.refran { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.refran blockquote { margin: 0; }
.refran blockquote p { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-style: italic; font-weight: 500; line-height: 1.25; color: var(--cobalt-deep); }
.refran cite { font-family: var(--sans); font-style: normal; color: var(--ink-soft); }

/* ---- the books ---- */
.books { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.book { display: grid; grid-template-columns: 170px 1fr; gap: 22px; padding: 22px; background: var(--cal);
        border: 1px solid var(--line); border-radius: 16px; }
.book img { border-radius: 4px; box-shadow: 0 8px 18px rgba(52, 33, 15, .2); }
.book .vol { font-family: var(--sc); font-weight: 700; color: var(--terra); letter-spacing: .08em; margin-bottom: .2em; }
.book p { color: var(--ink-soft); font-size: 1.02rem; }
.book ul { margin: 0; padding-left: 1.1em; font-family: var(--sans); font-size: .98rem; line-height: 1.5; }
.book li { margin-bottom: .3em; }
.book li::marker { color: var(--maiz); }
.book.gift { background: #fff6e0; border-color: var(--maiz); }

/* ---- north / south / tropics ---- */
.hemi-table { border: 2px solid var(--cobalt); border-radius: 14px; overflow: hidden; background: var(--paper); font-family: var(--sans); }
.hemi-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; border-top: 1px solid var(--line); }
.hemi-row:first-child { border-top: 0; }
.hemi-row > span { padding: 14px 18px; }
.hemi-row > span:first-child { font-weight: 700; color: var(--ink); background: var(--cal-deep); }
.hemi-row .span3 { grid-column: span 3; }
.hemi-row.head { background: var(--cobalt); color: #fff; }
.hemi-row.head > span { font-weight: 700; }
.hemi-row.head > span:first-child { background: var(--cobalt-deep); color: #fff; }
.hemi-row.head small { display: block; font-weight: 400; opacity: .85; font-size: .82rem; }

/* ---- rules, as tiles ---- */
.rules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.rule { position: relative; padding: 56px 22px 22px; background: var(--cal); border-radius: 12px;
        border: 2px solid var(--cobalt); box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 8px var(--maiz); }
.rule h3 { font-size: 1.25rem; color: var(--cobalt-deep); }
.rule p { font-family: var(--sans); font-size: .98rem; color: var(--ink-soft); margin: 0; }
.rule .n { position: absolute; top: 16px; left: 22px; width: 32px; height: 32px; border-radius: 50%;
           display: grid; place-items: center; background: var(--terra); color: #fff; font-weight: 900; }

/* ---- freebie ---- */
.freebie { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.card-preview { background: var(--paper); padding: 30px 30px 26px; border-radius: 6px; transform: rotate(-2deg);
                box-shadow: 0 16px 30px rgba(52, 33, 15, .18); border-top: 10px solid var(--terra);
                background-image: linear-gradient(var(--paper), var(--paper)), url("../img/azulejo.svg"); }
.cp-title { font-weight: 900; font-size: 1.7rem; margin: 0; }
.cp-sub { font-style: italic; color: var(--terra); margin-bottom: 18px; }
.card-preview ul { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: .98rem; }
.card-preview li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--line); }
.egg { flex: none; width: 30px; height: 38px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #d9a97c; box-shadow: inset -4px -4px 0 rgba(0,0,0,.08); }
.egg.tiny { width: 16px; height: 20px; margin: 0 7px; }
.egg.soft { background: #efe2cc; border: 2px dashed #c7ae8c; }
.egg.big { width: 36px; height: 46px; margin: -4px -3px; }
.egg.broken { background: linear-gradient(135deg, #d9a97c 55%, var(--maiz) 55%); }
.signup label { display: block; font-family: var(--sans); font-weight: 700; margin-bottom: 6px; }
.signup .row { display: flex; gap: 10px; flex-wrap: wrap; }
.signup input[type=email] { flex: 1 1 240px; min-width: 0; font: 1.05rem var(--sans); padding: .8em 1em;
                             border: 2px solid var(--cobalt); border-radius: 999px; background: #fff; color: var(--ink); }
.signup .fine { margin-top: 10px; }
.done { font-family: var(--sans); font-weight: 700; color: var(--oliva); margin-top: 12px; }
.done.err { color: var(--terra-deep); }

/* ---- about ---- */
.about { display: grid; grid-template-columns: 300px 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.about p { color: var(--ink-soft); }
.arch.portrait { max-width: 300px; }
.arch.portrait img { aspect-ratio: 4 / 5; }

/* ---- faq ---- */
.faq { max-width: none; }
.faq details { max-width: 800px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.2rem; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--terra); font-weight: 900; font-size: 1.5rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-soft); font-size: 1.05rem; }

/* ---- closing + footer ---- */
.closing { text-align: center; background: var(--cobalt); color: #f7efe0; }
.closing h2 { color: #fff; }
.closing p { font-size: 1.2rem; opacity: .9; }
.closing .btn { background: var(--maiz); color: var(--ink); box-shadow: 0 3px 0 #a87a14; }
.closing .btn:hover { background: #f0b83a; }
.foot { text-align: center; padding: 34px var(--gutter) 46px; font-family: var(--sans); }
.foot p { max-width: 760px; margin: 0 auto 8px; }
.foot a { color: var(--ink); }

/* ---- small screens ---- */
@media (max-width: 960px) {
  .rules { grid-template-columns: repeat(2, 1fr); }
  .books { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 19px; }
  .top nav { display: none; }
  .hero, .refran, .freebie, .about { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 520px; margin: 0 auto; }
  .price-box { gap: 16px; padding: 14px 16px; }
  .price { font-size: 3rem; }
  .book { grid-template-columns: 110px 1fr; padding: 16px; gap: 16px; }
  .rules { grid-template-columns: 1fr; }
  .about .arch.portrait { margin: 0 auto; max-width: 240px; }
  .hemi-row { grid-template-columns: 1fr; }
  .hemi-row .span3 { grid-column: auto; }
  .hemi-row.head { display: none; }
  .hemi-row > span:not(:first-child)::before { font-weight: 700; color: var(--cobalt); }
  .hemi-row:nth-child(2) > span:nth-child(2)::before { content: "Norte: "; }
  .hemi-row:nth-child(2) > span:nth-child(3)::before { content: "Sur: "; }
  .hemi-row:nth-child(2) > span:nth-child(4)::before { content: "Trópico: "; }
  .card-preview { transform: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }
