/*
 * adiostetita.com — the home page ("C1 · Rosa", chosen from the mockups of 2026-11-27):
 * one calm centred column on white, a soft cream top with the turning hardcover (mockup H2e), the book's hand lettering for
 * titles only. Loaded after styles.css, which keeps the fonts, the colour variables and
 * the other pages (gracias, leer, legal). No inline styles: the CSP forbids them.
 */

.hm {
  --hm-ink: #2f2a5c;
  --hm-soft: #4f4a7e;
  --hm-muted: #6a6593;
  --hm-pink: #f6cfd9;
  --hm-cream: #f7f6dc;
  --hm-line: #e3e1ee;
  background: #fff;
  color: var(--hm-ink);
  font-size: 17px;
  line-height: 1.55;
}

.hm h1,
.hm h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.05;
  color: var(--hm-ink);
  text-wrap: balance;
}

.hm h2 {
  font-size: clamp(30px, 4vw, 46px);
}

.hm h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.25;
}

.hm p {
  margin: 0;
}

.hm-note {
  font-size: 15px;
  color: var(--hm-muted);
}

/* ─── Buttons and links ────────────────────────────────────────────────── */

.hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--hm-ink);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.hm-btn:hover {
  background: #1f1b45;
}

.hm-btn-lg {
  min-height: 58px;
  padding: 16px 30px;
  font-size: 18px;
}

/* ─── Pink top: header and hero ────────────────────────────────────────── */

.hm-top {
  background: var(--hm-cream);
  border-radius: 0 0 50% 50% / 0 0 clamp(36px, 5vw, 72px) clamp(36px, 5vw, 72px);
  overflow: clip;
}

.hm-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.hm-brand {
  flex-grow: 1;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  color: var(--hm-ink);
  text-decoration: none;
}

.hm-nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
  font-weight: 700;
}

.hm-nav a {
  padding: 12px 0;
  color: var(--hm-ink);
  text-decoration: none;
}

.hm-nav a:hover {
  text-decoration: underline;
}

.hm-hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px var(--gutter) clamp(56px, 7vw, 88px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px 56px;
}

.hm-hero-copy {
  flex: 1 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.hm-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hm h1 {
  font-size: clamp(44px, 5.6vw, 76px);
  line-height: 0.98;
}

.hm-sub {
  max-width: 24em;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
  color: #3d3870;
}

.hm-hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

/* ─── The hardcover on its pedestal ────────────────────────────────────────
 * Mockup "H2e" (2026-11-27). A real box in 3D: two boards, the spine, three edges of
 * paper, and inside the cover two leaves over a last page. One 24 s loop: a full turn
 * (front, back cover, front), then the cover opens and the two leaves turn. All the
 * moving parts share that 24 s clock, so their keyframes are percentages of it.
 */

.hm-stage {
  /* How far the book slides right as it opens, so the open spread sits over the pedestal. */
  --bk-shift: 45%;
  flex: 1.3 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 24px 3% 0 0;
  perspective: 1800px;
  perspective-origin: 50% 35%;
}

.hm-stage-in {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hm-bk {
  position: relative;
  z-index: 1;
  width: min(340px, 56vw);
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transform: translateX(0%) rotateX(-8deg) rotateY(-26deg);
  animation: hm-bk-turn 24s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}

.hm-bk img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hm-bk-back,
.hm-bk-front,
.hm-bk-inside,
.hm-bk-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.hm-bk-back {
  border-radius: 10px 3px 3px 10px;
  transform: translateZ(-9px) rotateY(180deg);
}

.hm-bk-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 18px;
  transform-origin: left center;
  transform: translateZ(-9px) rotateY(-90deg);
  background: #eab9c6;
}

.hm-bk-edge {
  position: absolute;
  background: repeating-linear-gradient(90deg, #fffdf6 0 2px, #e4dccb 2px 3px);
}

.hm-bk-edge-r {
  top: 7px;
  bottom: 7px;
  left: calc(100% - 7px);
  width: 12px;
  transform-origin: left center;
  transform: translateZ(6px) rotateY(90deg);
}

.hm-bk-edge-t,
.hm-bk-edge-b {
  left: 0;
  right: 7px;
  height: 12px;
  transform-origin: center top;
  transform: translateZ(6px) rotateX(-90deg);
  background: #f1ebdc;
}

.hm-bk-edge-t {
  top: 7px;
}

.hm-bk-edge-b {
  top: calc(100% - 7px);
}

.hm-bk-leaf {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 0;
  right: 7px;
  transform-style: preserve-3d;
  transform-origin: left center;
}

.hm-bk-face {
  background: #fffdf6;
  border-radius: 2px 5px 5px 2px;
}

/* The shadow of the fold, on the spine side of every page. */
.hm-bk-face::after,
.hm-bk-inside::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(47, 42, 92, 0.2), rgba(47, 42, 92, 0) 12%);
}

.hm-bk-face-back {
  border-radius: 5px 2px 2px 5px;
  transform: rotateY(180deg);
}

.hm-bk-face-back::after,
.hm-bk-inside::after {
  background: linear-gradient(270deg, rgba(47, 42, 92, 0.2), rgba(47, 42, 92, 0) 12%);
}

.hm-bk-base {
  transform: translateZ(5px);
}

.hm-bk-leaf-2 {
  transform: translateX(0px) translateZ(6px) rotateY(0deg);
  animation: hm-bk-leaf-2 24s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}

.hm-bk-leaf-1 {
  transform: translateX(0px) translateZ(7px) rotateY(0deg);
  animation: hm-bk-leaf-1 24s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}

.hm-bk-cover {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: left center;
  transform: translateZ(9px) rotateY(0deg);
  animation: hm-bk-cover 24s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}

.hm-bk-front {
  border-radius: 3px 10px 10px 3px;
}

/* The groove of the hinge. */
.hm-bk-front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(47, 42, 92, 0.12) 0,
    rgba(47, 42, 92, 0) 2.5%,
    rgba(47, 42, 92, 0.1) 5%,
    rgba(47, 42, 92, 0) 7%
  );
}

.hm-bk-inside {
  border-radius: 10px 3px 3px 10px;
  transform: translateZ(-1.5px) rotateY(180deg);
}

.hm-pedestal {
  width: min(430px, 78vw);
  height: 80px;
  margin-top: -32px;
  border-radius: 50%;
  background: var(--hm-pink);
  box-shadow:
    0 14px 0 #ecb6c5,
    0 44px 50px rgba(47, 42, 92, 0.22);
}

.hm-bk-pause {
  min-height: 44px;
  margin-top: 52px;
  padding: 0 18px;
  border: 1px solid rgba(47, 42, 92, 0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--hm-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.hm-bk-pause:hover {
  background: rgba(255, 255, 255, 0.6);
}

.is-paused .hm-bk,
.is-paused .hm-bk * {
  animation-play-state: paused;
}

/* A turned leaf also steps a few pixels off the hinge, the way pages stack in a real
 * book; without that it would cut through the cover it lies against.
 *
 * The 24 s clock: 0-1.5 s front · 1.5-4.5 turn · 4.5-6.5 back cover · 6.5-9.5 turn ·
 * 10-11.8 the cover opens · 13.6-14.8 first leaf · 16.8-18 second leaf · 18-21 the story's
 * first spread · 21-23.2 everything closes as one block. */
@keyframes hm-bk-turn {
  0%,
  6.25% {
    transform: translateX(0%) rotateX(-8deg) rotateY(-26deg);
  }
  18.75%,
  27.08% {
    transform: translateX(0%) rotateX(-8deg) rotateY(154deg);
  }
  39.58%,
  41.67% {
    transform: translateX(0%) rotateX(-8deg) rotateY(334deg);
  }
  49.17%,
  87.5% {
    transform: translateX(var(--bk-shift)) rotateX(-10deg) rotateY(324deg);
  }
  96.67%,
  100% {
    transform: translateX(0%) rotateX(-8deg) rotateY(334deg);
  }
}

@keyframes hm-bk-cover {
  0%,
  41.67% {
    transform: translateZ(9px) rotateY(0deg);
  }
  49.17%,
  87.5% {
    transform: translateZ(9px) rotateY(-118deg);
  }
  96.67%,
  100% {
    transform: translateZ(9px) rotateY(0deg);
  }
}

@keyframes hm-bk-leaf-1 {
  0%,
  56.67% {
    transform: translateX(0px) translateZ(7px) rotateY(0deg);
  }
  61.67%,
  87.5% {
    transform: translateX(3px) translateZ(9px) rotateY(-115deg);
  }
  96.67%,
  100% {
    transform: translateX(0px) translateZ(7px) rotateY(0deg);
  }
}

@keyframes hm-bk-leaf-2 {
  0%,
  70% {
    transform: translateX(0px) translateZ(6px) rotateY(0deg);
  }
  75%,
  87.5% {
    transform: translateX(5px) translateZ(10px) rotateY(-112deg);
  }
  96.67%,
  100% {
    transform: translateX(0px) translateZ(6px) rotateY(0deg);
  }
}

/* ─── Sections ─────────────────────────────────────────────────────────── */

.hm main > section {
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(64px, 8vw, 104px);
}

.hm-statement {
  max-width: 760px;
  padding-top: clamp(64px, 8vw, 104px) !important;
  padding-bottom: clamp(48px, 6vw, 72px) !important;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.hm-statement p {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--hm-soft);
}

.hm-pages {
  max-width: 1120px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.hm-pages figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.hm-pages figcaption {
  font-size: 16px;
  color: var(--hm-soft);
}

.hm-pages figcaption strong {
  color: var(--hm-ink);
}

.hm-pages img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: clamp(24px, 3vw, 32px);
}

.hm-reasons {
  max-width: 1120px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.hm-reason {
  padding: clamp(24px, 3vw, 32px);
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hm-reason p {
  color: var(--hm-soft);
}

.hm-reason-pink {
  background: #fdf1f4;
}

.hm-reason-lime {
  background: #f7f6dc;
}

.hm-reason-lav {
  background: #efedfa;
}

.hm-steps {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  text-align: center;
}

.hm-steps ol {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.hm-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hm-steps li strong {
  font-size: 19px;
}

.hm-steps li > span:last-child {
  color: var(--hm-soft);
}

.hm-step-n {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--hm-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
}

.hm-authors {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.hm-authors img {
  width: min(100%, 300px);
}

.hm-authors-names {
  font-size: clamp(18px, 2vw, 20px);
}

/* ─── Buy ──────────────────────────────────────────────────────────────── */

.hm-buy {
  max-width: 880px;
}

.hm-buy-box {
  padding: clamp(24px, 5vw, 56px);
  border-radius: clamp(28px, 4vw, 40px);
  background: #f7f6f2;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
}

.hm-buy-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.hm-buy-head h2 {
  flex: 1 1 260px;
}

.hm-card {
  padding: clamp(20px, 3vw, 32px);
  border: 2px solid var(--hm-ink);
  border-radius: 28px;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: clamp(20px, 3vw, 36px);
}

.hm-card > img {
  flex: 0 1 200px;
  width: 200px;
  min-width: 0;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 5px 12px 12px 5px;
  box-shadow: 0 16px 34px rgba(47, 42, 92, 0.22);
}

.hm-card-copy {
  flex: 1 1 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.hm-card-copy p {
  color: var(--hm-soft);
}

.hm-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.hm-price strong {
  font-size: clamp(38px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hm-price s,
.hm-price span {
  font-size: 15px;
  color: var(--hm-muted);
}

/* The pre-sale has to be seen: a sunny tag over the price, and the delivery day in ink. */
.hm-flag,
.hm-pill-deal {
  background: #ffd84d;
}

.hm-flag {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--hm-ink) !important;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hm-deal {
  max-width: 30em;
  color: #3d3870;
}

.hm-deal strong,
.hm-when strong {
  color: var(--hm-ink);
}

.hm-hero-copy .hm-note a {
  color: var(--hm-ink);
  font-weight: 800;
}

/* "Para mí" or "Para regalar", and the gift's fields. */
.hm-for button {
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

.hm-gift {
  width: 100%;
  display: grid;
  gap: 6px;
}

.hm-gift label {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--hm-ink);
}

.hm-gift label span {
  font-weight: 400;
  color: var(--hm-muted);
}

.hm-gift input,
.hm-gift textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid #cfcbe6;
  border-radius: 14px;
  background: #fff;
  color: var(--hm-ink);
  font: inherit;
}

.hm-gift textarea {
  resize: vertical;
}

.hm-gift input:focus-visible,
.hm-gift textarea:focus-visible {
  outline: 3px solid var(--star);
  outline-offset: 2px;
}

.hm-gift .hm-note {
  margin-top: 6px;
}

/* ─── Questions ────────────────────────────────────────────────────────── */

.hm-faq {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hm-faq h2 {
  text-align: center;
}

.hm-faq > div {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hm-faq details {
  border: 1px solid var(--hm-line);
  border-radius: 20px;
}

/* The padding is the summary's, so the whole row opens the question. */
.hm-faq summary {
  padding: 18px 24px;
  cursor: pointer;
  font-weight: 800;
  font-size: 18px;
}

.hm-faq details p {
  margin-top: -6px;
  padding: 0 24px 18px;
  color: var(--hm-soft);
}

/* ─── Footer ───────────────────────────────────────────────────────────── */

.hm-footer {
  border-top: 1px solid #eceaf6;
  padding: 32px var(--gutter) 48px;
  font-size: 14px;
  color: var(--hm-muted);
}

.hm-footer > div,
.hm-footer > p {
  max-width: 1120px;
  margin: 0 auto;
}

.hm-footer > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 32px;
}

.hm-footer > div > span {
  flex-grow: 1;
}

.hm-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
}

.hm-footer nav a {
  padding: 12px 0;
}

/* ─── Phones ───────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .hm-nav {
    display: none;
  }

  .hm-hero-cta .hm-btn {
    width: 100%;
  }

  .hm-hero-copy {
    align-items: center;
    text-align: center;
  }

  .hm-hero-cta {
    justify-content: center;
  }

  .hm-stage {
    --bk-shift: 47%;
    align-items: center;
    padding-right: 0;
  }

  .hm-card > img {
    flex-basis: 140px;
    width: 140px;
  }

  .hm-card-copy .hm-btn {
    width: 100%;
  }

  /* Small phones: the section, the box and the card each had their own padding. */
  .hm main > .hm-buy {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hm-buy-box {
    padding: 24px 14px;
  }

  .hm-card {
    padding: 20px 16px;
  }

  /* Room for the fixed buy bar. */
  .hm-footer {
    padding-bottom: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm-btn {
    transition: none;
  }

  .hm-bk,
  .hm-bk * {
    animation: none;
  }

  .hm-bk-pause {
    display: none;
  }
}
