/* La Gran Obra · hoja de estilos única. Sin recursos de terceros. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson";
  src: url("fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson";
  src: url("fonts/atkinson-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson";
  src: url("fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --cloth: #1e3a33;       /* tela de encuadernar, verde botella */
  --cloth-deep: #142a24;  /* lomo */
  --foil: #c8a35a;        /* oro de estampación */
  --foil-light: #dcc184;
  --paper: #f6f7f3;       /* papel, blanco frío */
  --ink: #1d2b27;         /* tinta */
  --pencil: #55655f;      /* texto secundario */
  --rule: #d6dcd5;        /* filetes */
  --measure: 38rem;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Atkinson", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;      /* 18 px: se lee bien a partir de los 50 */
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

a { color: var(--cloth); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap { width: min(100% - 2.5rem, 70rem); margin-inline: auto; }

/* Cabecera */
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}
.mark {
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 560;
  font-variation-settings: "SOFT" 60, "opsz" 36;
  color: var(--cloth);
  text-decoration: none;
  letter-spacing: 0.005em;
}
.lang { font-size: 1rem; color: var(--pencil); }

/* Portada del libro: el único elemento con ornamento */
.hero {
  display: grid;
  gap: 2.5rem;
  padding-block: 1.5rem 4rem;
  align-items: center;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 420;
  font-variation-settings: "SOFT" 80, "opsz" 120, "WONK" 0;
  font-size: clamp(2.375rem, 6.4vw, 4.125rem);
  line-height: 1.04;
  letter-spacing: -0.012em;
  margin: 0 0 1.25rem;
  max-width: 14ch;
  color: var(--cloth);
  text-wrap: balance;
}
.lead { font-size: 1.25rem; line-height: 1.55; max-width: 32rem; margin: 0 0 2rem; }

.book { display: grid; justify-items: center; gap: 1.25rem; }

.cover {
  position: relative;
  width: min(19.5rem, 78vw);
  aspect-ratio: 3 / 4;
  border-radius: 3px 9px 9px 3px;
  background-color: var(--cloth);
  background-image:
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.028) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgb(0 0 0 / 0.07) 0 1px, transparent 1px 3px);
  box-shadow:
    inset 1.1rem 0 0 var(--cloth-deep),
    inset calc(1.1rem + 1px) 0 0 rgb(255 255 255 / 0.07),
    0 1.5rem 2.5rem -1.25rem rgb(20 42 36 / 0.55);
  color: var(--foil);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.4rem 1.6rem 1.8rem 2.7rem;
  text-align: center;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0.85rem 0.85rem 0.85rem 1.95rem;
  border: 1px solid rgb(200 163 90 / 0.75);
  border-radius: 2px;
  pointer-events: none;
}
.cover .small {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-variation-settings: "SOFT" 100, "opsz" 14;
  letter-spacing: 0.04em;
  opacity: 0.9;
}
.cover .name {
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "opsz" 72;
  font-size: 2.6rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
  background: linear-gradient(170deg, var(--foil-light) 10%, var(--foil) 55%, #a9843d 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity 0.2s ease;
}
.cover .name.long { font-size: 2.05rem; }
.cover .name.xlong { font-size: 1.6rem; }
.cover .name.swap { opacity: 0.35; }
.cover .rule { width: 2.5rem; height: 1px; background: var(--foil); margin: 0.9rem auto; opacity: 0.8; }

.namefield { display: grid; gap: 0.35rem; width: min(19.5rem, 78vw); font-size: 1rem; color: var(--pencil); }
.namefield input, .card-form input, .card-form textarea {
  font: inherit;
  font-size: 1.125rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9c3bc;
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  width: 100%;
}
.namefield input:focus, .card-form input:focus, .card-form textarea:focus { border-color: var(--cloth); outline: 2px solid var(--foil); outline-offset: 1px; }

/* Botón */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: 7px;
  background: var(--cloth);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.1875rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.cta:hover { background: var(--cloth-deep); }
.note { font-size: 1rem; color: var(--pencil); max-width: 30rem; margin: 1rem 0 0; }

/* Secciones */
section { padding-block: 3.5rem; border-top: 1px solid var(--rule); }
h2 {
  font-family: var(--serif);
  font-weight: 480;
  font-variation-settings: "SOFT" 70, "opsz" 48;
  font-size: clamp(1.75rem, 3.6vw, 2.375rem);
  line-height: 1.15;
  color: var(--cloth);
  margin: 0 0 1.75rem;
}
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1rem; }

/* Calendario: un hilo que une los cuatro momentos */
.thread { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.thread li { position: relative; padding: 0 0 2rem 2.25rem; }
.thread li::before {
  content: "";
  position: absolute;
  left: 0.36rem;
  top: 0.65rem;
  bottom: -0.65rem;
  width: 2px;
  background: var(--foil);
}
.thread li:last-child { padding-bottom: 0; }
.thread li:last-child::before { display: none; }
.thread li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--foil);
}
.thread li:last-child::after { background: var(--foil); }
.when { display: block; font-family: var(--serif); font-weight: 600; font-variation-settings: "SOFT" 60, "opsz" 24; font-size: 1.25rem; color: var(--cloth); margin-bottom: 0.2rem; }

.plain { margin: 0; padding-left: 1.2rem; max-width: var(--measure); }
.plain li { margin-bottom: 0.6rem; padding-left: 0.2rem; }
.plain li::marker { color: var(--foil); }

.promises { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.promises li { padding: 0.95rem 0; border-bottom: 1px solid var(--rule); }
.promises li:first-child { padding-top: 0; }
.promises strong { color: var(--cloth); }

/* Preguntas */
.faq { max-width: var(--measure); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 2rem 1rem 0;
  position: relative;
  font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 0.85rem;
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--foil);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 1.1rem; }

.price { font-family: var(--serif); font-size: clamp(2.25rem, 5vw, 3rem); font-variation-settings: "SOFT" 60, "opsz" 72; color: var(--cloth); margin: 0 0 0.5rem; line-height: 1; }

footer { border-top: 1px solid var(--rule); padding-block: 2rem 3rem; font-size: 0.95rem; color: var(--pencil); }
footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 0.75rem; }

/* Páginas de texto legal */
.legal { padding-block: 1rem 4rem; }
.legal h1 { font-family: var(--serif); font-weight: 480; font-variation-settings: "SOFT" 70, "opsz" 72; font-size: clamp(2rem, 5vw, 2.75rem); color: var(--cloth); margin: 1rem 0 1.5rem; line-height: 1.1; }
.legal h2 { font-size: 1.375rem; margin: 2.25rem 0 0.75rem; }
.legal p, .legal li { max-width: var(--measure); }
.legal .box { border: 1px solid var(--rule); background: #fff; padding: 1.25rem 1.5rem; border-radius: 6px; max-width: var(--measure); }

/* Tarjeta regalo */
.gift { display: grid; gap: 2.5rem; padding-block: 1rem 4rem; }
.gift-h1 { font-family: var(--serif); font-weight: 420; font-variation-settings: "SOFT" 80, "opsz" 96; font-size: clamp(2.25rem, 5vw, 3.25rem); color: var(--cloth); margin: 0.5rem 0 1rem; line-height: 1.08; }
.card-form { display: grid; gap: 1rem; max-width: 28rem; }
.card-form label { display: grid; gap: 0.35rem; font-size: 1rem; color: var(--pencil); }
.card {
  background: var(--cloth);
  background-image:
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.028) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgb(0 0 0 / 0.07) 0 1px, transparent 1px 3px);
  color: var(--paper);
  border-radius: 10px;
  padding: 2.25rem 2rem;
  max-width: 34rem;
  aspect-ratio: 148 / 105;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.card::before { content: ""; position: absolute; inset: 0.7rem; border: 1px solid rgb(200 163 90 / 0.7); border-radius: 5px; pointer-events: none; }
.card .c-title { font-family: var(--serif); font-variation-settings: "SOFT" 100, "opsz" 72; font-weight: 560; font-size: clamp(1.6rem, 4.5vw, 2.25rem); line-height: 1.1; color: var(--foil-light); margin: 0; }
.card .c-body { margin: 0.75rem 0 0; font-size: 1.05rem; max-width: 26rem; }
.card .c-msg { font-style: italic; margin: 0.75rem 0 0; }
.card .c-foot { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.95rem; color: var(--foil-light); margin-top: 1rem; }
.preview-banner { background: var(--foil-light); color: var(--ink); font-size: 0.95rem; padding: 0.6rem 1rem; text-align: center; }

@media (min-width: 900px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; padding-block: 2.5rem 5rem; }
  .gift { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
  section .split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* Vuelta de Stripe: elegir el idioma de la tarjeta */
.router { padding-block: 1rem 5rem; max-width: 40rem; }
.router p { margin: 0 0 0.75rem; }
.router-choices { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; margin: 1.75rem 0 1.25rem; }

@media print {
  body { background: #fff; }
  .top, .gift-copy, .card-form, footer, .preview-banner, .no-print { display: none !important; }
  .gift { display: block; padding: 0; }
  .card { max-width: none; width: 100%; -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
  @page { size: A5 landscape; margin: 8mm; }
}
