/* ==========================================================================
   Brave Little Hearts · styles
   Mobile-first. Colours pulled from the book cover.
   ========================================================================== */

:root {
  --sky: #8CCFF3;
  --sky-soft: #D4EEFC;
  --sea: #2477BF;
  --deep: #123566;
  --blush: #FBDDE6;
  --pink: #F06E98;
  --red: #D62F3A;
  --green: #4DB462;
  --lilac: #9D8BDB;
  --sun: #FFCF4A;
  --butter: #FFF1C7;
  --ink: #1B2140;
  --ink-soft: #454C6B;
  --paper: #FFF9F2;
  --white: #fff;

  --display: "Chewy", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --line: 3px solid var(--ink);
  --pop: 5px 5px 0 var(--ink);
  --radius: 22px;
  --wrap: 1120px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

main { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
svg { display: block; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: .01em;
  margin: 0 0 .45em;
}
h2 { font-size: clamp(2.2rem, 8vw, 3.6rem); }
h3 { font-size: clamp(1.5rem, 5vw, 1.9rem); }
h4 { font-size: 1.4rem; margin-bottom: .2em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 720px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: .6em 1em; border-radius: 12px; font-weight: 800;
}
.skip:focus { top: 12px; }

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

.lead { font-size: 1.18rem; font-weight: 700; }
.small { font-size: .92rem; opacity: .85; }

.kicker {
  display: inline-block;
  margin: 0 0 1rem;
  padding: .4em .9em;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  border-radius: 99px;
  transform: rotate(-2deg);
}
.kicker-sun { background: var(--sun); color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 52px;
  padding: .8em 1.4em;
  font: 800 1.05rem/1.1 var(--body);
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
  border: var(--line);
  border-radius: 99px;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn svg { width: 22px; height: 22px; }
.btn-red { background: var(--red); color: #fff; }
.btn-sun { background: var(--sun); }
.btn-sm { min-height: 42px; padding: .5em 1em; font-size: .95rem; white-space: nowrap; box-shadow: 0 3px 0 var(--ink); }
.btn-sm:hover { box-shadow: 0 5px 0 var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--sky);
  border-bottom: 3px solid transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--ink); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 66px; }

.logo {
  display: flex; align-items: center; gap: .4rem;
  font-family: var(--display); font-size: clamp(1.1rem, 5.4vw, 1.35rem); line-height: 1;
  text-decoration: none; white-space: nowrap;
}
.logo svg { flex: none; width: 26px; height: 26px; color: var(--red); transition: transform .3s ease; }
.logo:hover svg { transform: scale(1.2) rotate(-10deg); }

.nav { display: none; }

@media (min-width: 880px) {
  .nav { display: flex; gap: 1.6rem; margin-left: auto; margin-right: 1.2rem; }
  .nav a { font-weight: 800; text-decoration: none; position: relative; }
  .nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px;
    background: var(--red); border-radius: 3px; transform: scaleX(0); transition: transform .2s ease;
  }
  .nav a:hover::after { transform: scaleX(1); }
  .logo { font-size: 1.6rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--sky);
  padding: 20px 0 84px;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; gap: 24px;
  grid-template-areas: "head" "cover" "body";
}
.hero-head { grid-area: head; }
.hero-body { grid-area: body; }
.hero-cover { grid-area: cover; }

.sticker {
  display: inline-flex; align-items: center; gap: .4em;
  margin: 0;
  padding: .4em 1em;
  font-weight: 900; font-size: .95rem;
  background: var(--sun);
  border: var(--line);
  border-radius: 99px;
  box-shadow: 0 3px 0 var(--ink);
  transform: rotate(-3deg);
}
.sticker svg { width: 16px; height: 16px; }

.title {
  margin: .3em 0 .25em;
  font-size: clamp(3.4rem, 17vw, 6.4rem);
  line-height: .95;
  text-shadow: 3px 3px 0 #fff;
}
.title span { display: inline-block; }
.title span:nth-child(1) { transform: rotate(-5deg); }
.title span:nth-child(2) { transform: rotate(2deg) translateY(-4px); }
.title span:nth-child(3) { transform: rotate(-2deg); color: var(--red); }

.tagline { margin: 0; font-size: clamp(1.12rem, 4.8vw, 1.4rem); font-weight: 900; line-height: 1.35; max-width: 24em; }
.tagline mark {
  background: linear-gradient(transparent 55%, var(--sun) 55%);
  color: inherit; padding: 0 .1em;
}
.hero-sub { max-width: 34em; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin: 1.4rem 0 1.2rem; }
.hero-ctas .btn { flex: 1 1 180px; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.hero-meta li {
  padding: .2em .8em;
  font-size: .9rem; font-weight: 800;
  background: rgba(255, 255, 255, .6);
  border-radius: 99px;
}

.hero-cover { display: flex; justify-content: center; padding: 6px 0 10px; }
.cover-float { position: relative; width: min(66vw, 320px); animation: bob 6s ease-in-out infinite; }
.cover-float img {
  border: 4px solid var(--ink);
  border-radius: 14px;
  box-shadow: 10px 10px 0 var(--ink);
  transform: rotate(3deg);
}
.cover-badge {
  position: absolute; right: -22px; bottom: -34px;
  display: grid; place-items: center;
  width: 74px; height: 74px;
  font-weight: 900; font-size: .8rem; line-height: 1; text-align: center;
  background: var(--sun);
  border: var(--line);
  border-radius: 50%;
  box-shadow: 0 4px 0 var(--ink);
  transform: rotate(-12deg);
}
.cover-badge b { font-family: var(--display); font-weight: 400; font-size: 1.45rem; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* floating decorations */
.deco { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--s); height: var(--s);
  color: var(--c);
  --heart-sw: 1.6;
  transform: rotate(var(--r, 0));
  animation: drift var(--t) ease-in-out infinite;
}
.float.spark { animation-name: twinkle; }
.bubble {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--s); height: var(--s);
  border: 2.5px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  animation: drift var(--t) ease-in-out infinite;
}
@keyframes drift {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}
@keyframes twinkle {
  0%, 100% { scale: 1; opacity: 1; }
  50% { scale: .55; opacity: .5; }
}

@media (min-width: 900px) {
  .hero { padding: 56px 0 120px; }
  .hero-grid {
    grid-template-columns: 1.1fr .9fr;
    grid-template-areas: "head cover" "body cover";
    column-gap: 56px; row-gap: 20px;
  }
  .hero-head { align-self: end; }
  .hero-body { align-self: start; }
  .hero-cover { align-self: center; }
  .cover-float { width: 420px; }
  .cover-badge { width: 100px; height: 100px; font-size: .9rem; }
  .cover-badge b { font-size: 2rem; }
  .hero-ctas .btn { flex: 0 0 auto; }
}

/* ---------- Ribbon ---------- */
.ribbon {
  position: relative; z-index: 2;
  width: 110%; margin: -34px 0 0 -5%;
  padding: .75rem 0;
  background: var(--ink);
  color: var(--sun);
  transform: rotate(-2.5deg);
  overflow: hidden;
}
.ribbon-track {
  display: flex; align-items: center; gap: 1.1rem;
  width: max-content;
  font-family: var(--display); font-size: 1.5rem; white-space: nowrap;
  animation: marquee 40s linear infinite;
}
.ribbon-track svg { width: 20px; height: 20px; color: var(--pink); --heart-sw: 0; flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: 72px 0; }

/* wavy top edge that inherits the section background */
.wavy::before {
  content: "";
  position: absolute; left: 0; right: 0; top: -31px;
  height: 32px;
  background: inherit;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 32' preserveAspectRatio='none'%3E%3Cpath d='M0 16C180 36 360-4 540 16s360 20 540 0 270-18 360 0V32H0z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 32' preserveAspectRatio='none'%3E%3Cpath d='M0 16C180 36 360-4 540 16s360 20 540 0 270-18 360 0V32H0z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  pointer-events: none;
}

@media (min-width: 900px) {
  .section { padding: 104px 0; }
}

/* ---------- The Book ---------- */
.book { padding-top: 64px; }
.book-intro { max-width: 760px; }
.shimmer {
  background: linear-gradient(100deg, var(--lilac), var(--pink) 30%, var(--sun) 50%, var(--pink) 70%, var(--lilac));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 4s linear infinite;
  text-shadow: none;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 1.4rem 0 0; list-style: none; }
.chips li {
  padding: .3em .9em;
  font-weight: 800; font-size: .95rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 99px;
}
.chips li:nth-child(5n+1) { background: var(--blush); }
.chips li:nth-child(5n+2) { background: var(--butter); }
.chips li:nth-child(5n+3) { background: var(--sky-soft); }
.chips li:nth-child(5n+4) { background: #E3F4DF; }
.chips li:nth-child(5n+5) { background: #ECE7FA; }

.cast-title { margin-top: 56px; }
.cast { display: grid; gap: 16px; padding: 0; margin: 0; list-style: none; }

.card {
  display: flex; gap: 16px; align-items: center;
  padding: 18px;
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  transition: transform .2s ease;
}
.card p { margin: 0; font-size: .98rem; }
.card .role { margin: 0 0 .35em; font-size: .75rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.card .traits { margin-bottom: .3em; font-weight: 800; }
.card-icon { flex: none; width: 72px; height: 72px; }
.avatar {
  object-fit: cover;
  background: var(--blush);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
}
.c-red { background: var(--blush); }
.c-sun { background: var(--butter); }
.c-green { background: #E3F4DF; }
.c-lilac { background: #ECE7FA; }

@media (hover: hover) {
  .card:hover { transform: translateY(-4px) rotate(-1deg); }
}

@media (min-width: 640px) {
  .cast { grid-template-columns: 1fr 1fr; gap: 20px; }
}
@media (min-width: 1000px) {
  .cast { grid-template-columns: repeat(4, 1fr); }
  .card { flex-direction: column; align-items: flex-start; padding: 22px; }
  .card-icon { width: 84px; height: 84px; }
}

.facts {
  margin-top: 48px;
  padding: 22px;
  background: var(--white);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
}
.facts dl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 0; }
.facts dt { font-size: .75rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 800; }
.facts .wide { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .facts { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 24px; padding: 28px 32px; }
  .facts h3 { margin: 0; }
  .facts dl { grid-template-columns: repeat(4, 1fr); }
  .facts .wide { grid-column: auto; }
}

/* ---------- Origin ---------- */
.origin { background: var(--blush); text-align: center; }
.origin .wrap { position: relative; }
.moon { width: 56px; height: 56px; margin: 0 auto 12px; color: var(--sun); transform: rotate(-20deg); }
.aside {
  margin-top: .6rem;
  font-family: var(--display); font-size: 1.35rem; line-height: 1.3; color: var(--red);
}
.aside svg { display: inline-block; vertical-align: -3px; width: 22px; height: 22px; color: var(--red); --heart-sw: 0; }

/* ---------- Author ---------- */
.author { background: var(--paper); }
.author-grid { display: grid; gap: 36px; align-items: center; }
.author-photo { position: relative; width: min(72vw, 300px); margin: 0 auto; }
.photo-frame {
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 58% 42% 50% 50% / 48% 52% 48% 52%;
  box-shadow: 8px 8px 0 var(--pink);
  transform: rotate(-3deg);
}
.photo-frame img { width: 100%; }
.hello {
  position: absolute; right: -10px; top: 8px;
  padding: .3em .8em;
  font-family: var(--display); font-size: 1.4rem;
  background: var(--sun);
  border: var(--line);
  border-radius: 18px 18px 18px 4px;
  transform: rotate(8deg);
  box-shadow: 0 4px 0 var(--ink);
}

.fun-facts { display: grid; gap: 10px; padding: 0; margin: 1.4rem 0; list-style: none; }
.fun-facts li {
  padding: .6em 1em;
  font-weight: 800;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 14px;
}
.fun-facts span { margin-right: .3em; }

.pull {
  margin: 1.6rem 0;
  padding: 0 0 0 18px;
  border-left: 5px solid var(--pink);
}
.pull p { margin: 0 0 .3em; font-family: var(--display); font-size: 1.5rem; line-height: 1.2; }
.pull cite { font-style: normal; font-weight: 800; font-size: .9rem; color: var(--ink-soft); }

.press {
  display: grid; gap: 2px;
  padding: 16px 18px;
  text-decoration: none;
  background: var(--sky-soft);
  border: var(--line);
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.press:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.press-label { font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.press-title { font-weight: 900; font-size: 1.08rem; line-height: 1.3; }
.press-source { font-size: .9rem; font-weight: 700; color: var(--ink-soft); }

@media (min-width: 640px) {
  .fun-facts { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .author-grid { grid-template-columns: 380px 1fr; gap: 64px; }
  .author-photo { width: 340px; }
}

/* ---------- Adventure ahead ---------- */
.adventure {
  color: #fff;
  background: linear-gradient(180deg, var(--sea) 0%, var(--deep) 100%);
}
.adventure.wavy::before { background: var(--sea); }
.adv-intro { max-width: 720px; }
.adventure .lead strong { color: var(--sun); }

.bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bubbles span {
  position: absolute; bottom: -30px; left: var(--x);
  width: var(--s); height: var(--s);
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  animation: rise var(--t) linear var(--d) infinite;
}
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(12px, -55vh); }
  100% { transform: translate(-6px, -110vh); opacity: 0; }
}

.trail {
  position: relative;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 8px;
  max-width: 640px;
  padding: 0; margin: 36px 0 18px;
  list-style: none;
}
.trail li { position: relative; display: grid; place-items: center; aspect-ratio: 1; }
.trail svg { width: 100%; max-width: 72px; height: auto; aspect-ratio: 1; }
.trail .n {
  position: absolute; top: 31%;
  font-family: var(--display); font-size: 1.2rem; line-height: 1;
  color: var(--ink);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff;
}
.trail .is-out { --gem-fill: var(--sun); --gem-stroke: var(--ink); }
.trail .is-out svg { filter: drop-shadow(0 0 12px rgba(255, 207, 74, .9)); animation: glow 2.4s ease-in-out infinite; }
.trail .is-next { --gem-fill: var(--pink); --gem-stroke: var(--ink); }
.trail .is-next svg { animation: wiggle 2.6s ease-in-out infinite; }
.trail .is-written { --gem-fill: #BFE6FB; --gem-stroke: var(--ink); --gem-facets: .45; }
.trail .is-dream { --gem-fill: transparent; --gem-stroke: rgba(255, 255, 255, .75); --gem-dash: 4 4; --gem-facets: 0; }
.trail .is-dream .n { color: rgba(255, 255, 255, .85); text-shadow: none; }

@keyframes glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 207, 74, .6)); }
  50% { filter: drop-shadow(0 0 18px rgba(255, 207, 74, 1)); }
}
@keyframes wiggle {
  0%, 80%, 100% { transform: rotate(0); }
  85% { transform: rotate(-8deg); }
  90% { transform: rotate(8deg); }
  95% { transform: rotate(-4deg); }
}

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; margin: 0 0 40px; list-style: none; font-size: .9rem; font-weight: 800; }
.legend li { display: flex; align-items: center; gap: .45em; }
.legend li::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--ink); transform: rotate(45deg); }
.legend .is-out::before { background: var(--sun); }
.legend .is-next::before { background: var(--pink); }
.legend .is-written::before { background: #BFE6FB; }
.legend .is-dream::before { border: 2px dashed rgba(255, 255, 255, .8); }

.milestones { display: grid; gap: 18px; }
.milestone {
  padding: 22px;
  color: var(--ink);
  background: var(--white);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--sun);
}
.milestone.next { background: var(--blush); box-shadow: 6px 6px 0 var(--pink); }
.milestone p:last-child { margin: 0; }
.m-tag { display: inline-block; margin-bottom: .6rem; font-size: .78rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }

.follow {
  margin-top: 44px;
  padding: 28px 22px;
  text-align: center;
  background: rgba(255, 255, 255, .1);
  border: 3px dashed rgba(255, 255, 255, .55);
  border-radius: 28px;
}
.follow .btn { margin: .4rem 0 1.2rem; max-width: 100%; }
.follow .small { max-width: 34em; margin: 0 auto; }

@media (min-width: 760px) {
  .trail { grid-template-columns: repeat(10, 1fr); max-width: none; gap: 10px; }
  .trail::before {
    content: ""; position: absolute; left: 5%; right: 5%; top: 50%;
    border-top: 3px dotted rgba(255, 255, 255, .5);
  }
  .milestones { grid-template-columns: 1fr 1fr; gap: 24px; }
  .follow { padding: 40px; }
}

/* ---------- Fun ---------- */
.fun { background: var(--butter); }
.fun-grid { display: grid; gap: 24px; }
.panel {
  padding: 24px 20px;
  background: var(--white);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
}

.boost { text-align: center; }
.boost-stage { position: relative; display: grid; place-items: center; height: 190px; }
.boost-btn {
  width: 150px; height: 150px;
  padding: 0;
  color: var(--red);
  background: none; border: 0; border-radius: 50%;
  cursor: pointer;
  --heart-sw: 1;
  animation: beat 1.6s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.boost-btn svg { width: 100%; height: 100%; filter: drop-shadow(4px 5px 0 var(--ink)); }
.boost-btn.pop { animation: pop .45s ease; }
@keyframes beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.08); }
  30% { transform: scale(.98); }
  45% { transform: scale(1.05); }
}
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(.85); }
  75% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.confetti {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  color: var(--c);
  --heart-sw: 0;
  pointer-events: none;
  animation: burst .9s cubic-bezier(.2, .7, .3, 1) forwards;
}
.confetti svg { width: 100%; height: 100%; }
@keyframes burst {
  0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; }
}

.boost-text {
  min-height: 3.4em;
  margin: 8px auto 4px;
  max-width: 22em;
  font-family: var(--display); font-size: 1.45rem; line-height: 1.2;
}
.boost-count { margin: 0; min-height: 1.5em; font-size: .9rem; font-weight: 800; color: var(--ink-soft); }

.cert {
  position: relative;
  margin: 18px 0;
  padding: 24px 18px 18px;
  text-align: center;
  background: var(--paper);
  border: 3px dashed var(--pink);
  border-radius: 18px;
  outline: 3px solid var(--ink);
  outline-offset: 5px;
}
.cert p { margin: 0; }
.cert-heart { width: 40px; height: 40px; margin: 0 auto 6px; color: var(--red); --heart-sw: 1.2; }
.cert-kicker { font-size: .72rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.cert-title { font-family: var(--display); font-size: 2rem; line-height: 1.1; color: var(--red); margin-bottom: .5em !important; }
.cert-line { font-weight: 700; }
.cert-name {
  min-height: 1.4em;
  margin: .2em auto .3em !important;
  max-width: 90%;
  font-family: var(--display); font-size: 2.2rem; line-height: 1.2;
  color: var(--sea);
  border-bottom: 3px solid var(--ink);
  overflow-wrap: anywhere;
}
.cert-name:empty::before { content: "Your name here"; opacity: .35; }
.cert-foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  margin-top: 16px;
  font-size: .82rem; font-weight: 800; color: var(--ink-soft);
}
.cert-foot span { display: inline-flex; align-items: center; gap: .3em; }
.cert-foot svg { width: 14px; height: 14px; color: var(--sun); }

.cert-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.cert-form label { grid-column: 1 / -1; font-weight: 900; margin-bottom: -4px; }
.cert-form input {
  width: 100%; min-height: 52px;
  padding: .6em .9em;
  font: 700 1.1rem var(--body);
  color: var(--ink);
  background: var(--white);
  border: var(--line);
  border-radius: 14px;
}
.cert-form input:focus { outline: none; box-shadow: 0 0 0 4px var(--sky); }
.panel .small { margin: 12px 0 0; }

@media (min-width: 900px) {
  .fun-grid { grid-template-columns: 1fr 1.2fr; gap: 32px; }
  .boost { display: flex; flex-direction: column; justify-content: center; }
  .panel { padding: 30px; }
}

/* ---------- Buy ---------- */
.buy { background: var(--sky); }
.buy-grid { display: grid; gap: 20px; }
.shop {
  display: flex; flex-direction: column;
  padding: 24px 22px;
  background: var(--white);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
}
.shop:first-child { background: var(--blush); }
.shop h3 { margin-bottom: .3em; }
.shop .btn { margin-top: auto; align-self: flex-start; }
.shop-tag { margin-bottom: .5rem; font-size: .75rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.price { font-family: var(--display); font-size: 2.2rem; line-height: 1; }
.isbn { font-weight: 900; font-size: 1.15rem; letter-spacing: .04em; }

@media (min-width: 800px) {
  .buy-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  padding: 56px 0 36px;
  color: #fff;
  background: var(--ink);
  text-align: center;
}
.footer-logo {
  display: inline-flex; align-items: center; gap: .4rem;
  margin: 0 0 .2em;
  font-family: var(--display); font-size: 2rem;
}
.footer-logo svg { width: 34px; height: 34px; color: var(--red); --heart-stroke: #fff; }
.footer-motto { font-weight: 800; color: var(--sun); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; padding: 0; margin: 1.4rem 0; list-style: none; font-weight: 800; }
.footer-links a { text-decoration-thickness: 2px; text-underline-offset: 4px; }
.footer-links a:hover { color: var(--sun); }
.fine { margin: 0; font-size: .85rem; opacity: .75; }

/* ---------- Scroll reveal (only when JS is on) ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .3, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .cast .reveal:nth-child(2) { transition-delay: .08s; }
.js .cast .reveal:nth-child(3) { transition-delay: .16s; }
.js .cast .reveal:nth-child(4) { transition-delay: .24s; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Print: just the certificate ---------- */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  * { animation: none !important; transition: none !important; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body * { visibility: hidden; }
  .site-header, .ribbon, .wavy::before { display: none; }
  .reveal, .panel { transform: none !important; opacity: 1 !important; }
  #cert, #cert * { visibility: visible; }
  #cert {
    position: fixed; inset: 0; margin: auto;
    width: 250mm; height: 165mm;
    display: flex; flex-direction: column; justify-content: center;
    padding: 14mm 18mm;
  }
  .cert-heart { width: 64px; height: 64px; }
  .cert-kicker { font-size: 1rem; }
  .cert-title { font-size: 3.4rem; }
  .cert-line { font-size: 1.3rem; }
  .cert-name { font-size: 3.6rem; min-height: 1.3em; }
  .cert-name:empty::before { content: ""; }
  .cert-foot { font-size: 1rem; margin-top: 28px; }
}
