/* Plantilla «carta». Una hoja (--papel) sobre una mesa (--suave), letra de tinta.
   El acento es el sello y el filete del margen: nunca letra. Una sola familia: Literata. */

:root {
  --papel: #FFFFFF;
  --tinta: #1B2A5C;
  --acento: #F2C94C;
  --suave: #DDE3EC;
  --libro: "Literata", Georgia, "Times New Roman", serif;
  --margen: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--suave);
  color: var(--tinta);
  font-family: var(--libro);
  font-optical-sizing: auto;
  font-size: 1.1875rem;
  line-height: 1.7;
  transition: background-color .35s, color .35s;
}
h1, h2, p { margin: 0; }
a { color: inherit; text-underline-offset: .18em; }
a:focus-visible { outline: 3px solid var(--tinta); outline-offset: 3px; }

.mesa { padding: clamp(28px, 6vw, 80px) var(--margen) 120px; }

.hoja {
  position: relative;
  max-width: 41rem;
  margin: 0 auto;
  background: var(--papel);
  padding: clamp(28px, 6vw, 72px) clamp(22px, 6vw, 76px) clamp(32px, 5vw, 56px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 12px 32px -12px rgba(0, 0, 0, .18);
  transition: background-color .35s;
}
/* El filete del margen, como en un papel de carta. */
.hoja::before {
  content: "";
  position: absolute;
  left: clamp(10px, 2.4vw, 30px);
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--acento);
}

/* ─── Membrete ───────────────────────────────────────────────────── */

.membrete { padding-right: 5.5rem; margin-bottom: 2.4rem; }
.membrete h1 {
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -.005em;
  text-wrap: balance;
}
.membrete-que { font-style: italic; margin-top: .3rem; }

/* El sello de la esquina: una estampilla con las iniciales. El borde dentado sale de una máscara:
   el centro entero, y en el margen un círculo cada 12px que deja los dientes. */
.sello {
  position: absolute;
  top: clamp(20px, 4vw, 40px);
  right: clamp(18px, 4vw, 44px);
  width: 4.6rem;
  height: 5.4rem;
  padding: 6px;
  display: grid;
  place-items: center;
  background: var(--acento);
  color: var(--tinta);
  transform: rotate(4deg);
  -webkit-mask: conic-gradient(#000 0 0) content-box, radial-gradient(circle 5px, #0000 97%, #000) 50% / 12px 12px round;
          mask: conic-gradient(#000 0 0) content-box, radial-gradient(circle 5px, #0000 97%, #000) 50% / 12px 12px round;
}
.sello span {
  display: grid;
  place-items: center;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  border: 1.5px solid var(--tinta);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: .04em;
}

/* ─── El cuerpo de la carta ──────────────────────────────────────── */

.cuerpo { display: grid; gap: 1.1rem; }
.cuerpo section { display: grid; gap: .8rem; margin-top: .8rem; }
.saludo { font-style: italic; }
.lema { font-size: 1.45rem; line-height: 1.4; font-weight: 600; text-wrap: pretty; }
.cuerpo h2 {
  font-style: italic;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
}
.item strong { font-weight: 600; }

.despedida { margin-top: 1.8rem; font-style: italic; }
.firma {
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
}
.posdata {
  margin-top: 1.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--tinta);
  font-size: 1.0625rem;
}
.pd { font-weight: 600; }

.legal {
  margin-top: 2.4rem;
  font-size: .875rem;
  line-height: 1.5;
}

.pie-juliana {
  max-width: 41rem;
  margin: 1.6rem auto 0;
  font-size: .95rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  body, .hoja { transition: none; }
}
