/* Nonna's Storybook website, third design (Nov 20, evening).
   Anto: keep it fun, but the books are for children and the site is for the buyers; be selective with
   the handwriting font; more elegant. So:
   - Lora (the serif the books are set in) for headlines and text;
   - Figtree, a clean sans, for the menu, buttons, prices and labels;
   - Patrick Hand only for two handwritten touches ("Benvenuti!" and "Buona Befana!");
   - cream page, a slightly deeper linen for a few bands, colour from the book pictures;
   - large type: nothing under 18 px. */

@font-face { font-family: "Lora"; src: url("/fonts/lora.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/fonts/lora-italic.woff") format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("/fonts/patrick-hand.woff") format("woff"); font-weight: 400; font-display: swap; }

:root {
  --cream: #FBF4E6;
  --linen: #F4EAD8;
  --paper: #FFFCF7;
  --ink: #33241B;                       /* headings */
  --text: #4D3C31;                      /* body */
  --muted: #6E5A4C;
  --red: #B24631;
  --red-dark: #96382A;
  --pine: #285C3F;                      /* dark Christmas green: the main buttons */
  --pine-dark: #1E4A32;
  --green: #456F4B;
  --gold: #B8862A;
  --line: rgba(51, 36, 27, .13);
  --shadow: 0 1px 2px rgba(51, 36, 27, .05), 0 12px 32px rgba(51, 36, 27, .08);
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Figtree", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --hand: "Patrick Hand", "Segoe Print", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.25rem;                   /* 20 px */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 4.6vw, 4.25rem); font-weight: 500; line-height: 1.07; letter-spacing: -.018em; }
h2 { font-size: clamp(2.2rem, 3.5vw, 3.1rem); font-weight: 500; line-height: 1.13; letter-spacing: -.012em; }
h3 { font-size: clamp(1.5rem, 2vw, 1.8rem); font-weight: 600; line-height: 1.25; letter-spacing: -.005em; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { color: var(--ink); font-weight: 600; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 56px); margin-inline: auto; }
.wrap--narrow { max-width: 820px; margin-inline: auto; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 10px 16px; border-radius: 8px; z-index: 10; font-family: var(--sans); }
.skip:focus { left: 8px; }
.lead { font-size: 1.4rem; line-height: 1.65; color: var(--muted); }

/* A small Italian label above each English heading */
.kicker {
  font-family: var(--serif); font-style: italic; font-size: 1.3rem; line-height: 1.3; color: var(--green);
  margin: 0 0 .45em;
}
.kicker.center::before, .kicker.center::after {
  content: ""; display: inline-block; width: 26px; height: 1px; background: currentColor; opacity: .5;
  vertical-align: middle; margin: 0 14px 4px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 58px; padding: 10px 30px;
  font-family: var(--sans); font-size: 1.15rem; font-weight: 600; letter-spacing: .01em; line-height: 1.15;
  text-decoration: none; text-align: center;
  color: #fff; background: var(--pine); border: 1.5px solid var(--pine); border-radius: 999px;
  box-shadow: 0 6px 16px rgba(40, 92, 63, .24);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn:hover { background: var(--pine-dark); border-color: var(--pine-dark); box-shadow: 0 8px 20px rgba(40, 92, 63, .3); transform: translateY(-1px); }
.btn--ghost { color: var(--ink); background: transparent; border-color: rgba(51, 36, 27, .35); box-shadow: none; }
.btn--ghost:hover { color: var(--ink); background: rgba(51, 36, 27, .05); border-color: var(--ink); box-shadow: none; }
.btn--small { min-height: 48px; padding: 8px 24px; font-size: 1.125rem; }
.btn--wide { width: 100%; }

/* "Choose your book" buttons along the page */
.cta { text-align: center; margin: 56px 0 0; }

/* Who it is for: three ways families give the book */
.givers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 40px 0 0; }
.givers li { text-align: center; padding: 0 8px; }
.givers h3 { font-size: 1.45rem; margin-bottom: .35em; }
.givers p { font-size: 1.2rem; line-height: 1.6; color: var(--muted); margin: 0; }
.givers li::before {
  content: ""; display: block; width: 30px; height: 30px; margin: 0 auto 14px; background: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 34'%3E%3Cpath d='M17 1 L20.6 13.4 L33 17 L20.6 20.6 L17 33 L13.4 20.6 L1 17 L13.4 13.4 Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 34'%3E%3Cpath d='M17 1 L20.6 13.4 L33 17 L20.6 20.6 L17 33 L13.4 20.6 L1 17 L13.4 13.4 Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Header */
.top { position: relative; border-bottom: 1px solid var(--line); background: var(--cream); }
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 14px 0; }
.top__logo img { width: 210px; }
.top__nav { margin-left: auto; display: flex; gap: 34px; font-family: var(--sans); font-size: 1.125rem; font-weight: 500; color: var(--ink); }
.top__nav a { text-decoration: none; padding: 6px 0; background: linear-gradient(var(--red), var(--red)) 0 100% / 0 1.5px no-repeat; transition: background-size .2s ease; }
.top__nav a:hover { background-size: 100% 1.5px; }

/* Top of the page */
.hero { padding: 54px 0 40px; }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); column-gap: 32px;
  grid-template-areas: "words picture" "note picture";
}
.hero__words { grid-area: words; align-self: end; }
.hero__picture { grid-area: picture; align-self: center; margin-right: -16px; }
.eyebrow { font-style: italic; font-size: 1.4rem; color: var(--green); margin-bottom: .5em; }
.hero__sub { font-size: 1.45rem; line-height: 1.55; color: var(--muted); max-width: 22em; }
.hero__buttons { display: flex; flex-wrap: wrap; gap: 14px; margin: 34px 0 30px; }
.hero__note {
  grid-area: note; align-self: start; margin: 0; max-width: 27em;
  font-family: var(--sans); font-size: 1.125rem; line-height: 1.55; color: var(--muted);
  padding-top: 22px; border-top: 1px solid var(--line);
}
.hero__note strong { font-weight: 600; }

/* The opening (Nov 21): a short clip made in Gemini from the logo's Nonna: she opens her storybook, light and
   sparkles rise, the glow fills the frame, and the La Befana book appears. Plays once; skipped when the device
   asks for less motion, without JavaScript, or when the clip cannot play. */
.hero { overflow: hidden; overflow: clip; }
.magic { position: relative; }
.magic__stage { display: none; position: absolute; inset: 0; pointer-events: none; }
.js-magic .magic__stage { display: block; }
.js-magic .magic__book { opacity: 0; }
.magic.is-done .magic__stage { display: none; }
.magic.is-done .magic__book { opacity: 1; animation: none; }
.m-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  -webkit-mask: radial-gradient(ellipse closest-side at 50% 50%, #000 72%, transparent 100%);
          mask: radial-gradient(ellipse closest-side at 50% 50%, #000 72%, transparent 100%);
  transition: opacity .45s ease;
}
.magic.is-playing .m-video { opacity: 1; }
.magic.is-reveal .m-video { opacity: 0; transition: opacity 1.1s ease .15s; }
.magic.is-reveal .magic__book { transform-origin: 50% 60%; animation: m-book 1.3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes m-book {
  0% { opacity: 0; transform: scale(.9); filter: blur(10px); }
  55% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}

/* The welcome */
.welcome { padding: 56px 0 18px; }
.welcome__hello { font-family: var(--hand); font-size: 2.6rem; line-height: 1; color: var(--red); margin: 0 0 14px; transform: rotate(-2deg); }
.welcome__line { font-style: italic; font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.45; color: var(--ink); margin: 0; }

/* Sections */
.section { padding: clamp(72px, 9vw, 116px) 0; }
.section + .section:not(.section--linen) { padding-top: clamp(24px, 4vw, 48px); }
.section--linen { background: var(--linen); }
.section > .wrap > h2 { margin-bottom: .55em; }

/* The story */
.scenes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 52px 0 0; }
.scenes figure { margin: 0; }
.scenes img { border-radius: 14px; box-shadow: var(--shadow); }
.scenes figcaption { font-style: italic; font-size: 1.2rem; color: var(--muted); text-align: center; margin-top: 16px; line-height: 1.4; }
.note { max-width: 700px; margin: 64px auto 0; padding: 30px 0 6px; text-align: center; border-top: 1px solid var(--line); }
.note h3 { font-size: 1.6rem; }
.note p { color: var(--muted); }

/* See inside */
.rows { display: grid; gap: 24px; margin-top: 26px; }
.row { display: grid; grid-template-columns: minmax(0, 56fr) minmax(0, 44fr); align-items: center; gap: 40px; }
.row--flip img { order: 2; }
.row__words h3 { font-size: clamp(1.7rem, 2.4vw, 2.1rem); margin-bottom: .4em; }
.row__words p { font-size: 1.3rem; line-height: 1.65; color: var(--muted); margin: 0; max-width: 24em; }

/* The six looks */
.looks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; margin-top: 44px; }
.looks__group h3 { text-align: center; font-size: 1.55rem; margin-bottom: 20px; }
.looks__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.looks__row img { border-radius: 10px; box-shadow: var(--shadow); }
.looks__row span { display: block; text-align: center; font-family: var(--sans); font-size: 1.125rem; font-weight: 600; color: var(--ink); margin-top: 12px; }
.looks__more { font-size: 1.25rem; color: var(--muted); max-width: 760px; margin: 48px auto 0; }

/* At a glance */
.glance { max-width: 880px; margin: 30px auto 0; border-top: 1px solid var(--line); }
.glance > div { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.glance dt { font-family: var(--sans); font-size: 1.125rem; font-weight: 600; color: var(--ink); padding-top: 3px; }
.glance dd { margin: 0; font-size: 1.25rem; line-height: 1.6; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px; margin-top: 40px; counter-reset: step; }
.steps li { text-align: center; }
.steps__n {
  display: block; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 3.6rem; line-height: 1;
  color: var(--gold); margin-bottom: 14px;
}
.steps li::after { content: ""; display: block; width: 40px; height: 1px; background: var(--line); margin: 18px auto 0; }
.steps p { font-size: 1.25rem; line-height: 1.6; max-width: 17em; margin-inline: auto; }

/* Choose your book */
.books { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 44px; align-items: stretch; }
.book { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.book > img { width: 100%; background: var(--cream); }
.book__body { display: flex; flex-direction: column; flex: 1; padding: 22px 28px 28px; border-top: 1px solid var(--line); }
.book__body h3 { font-size: 1.65rem; margin-bottom: .2em; }
.book__price { font-family: var(--sans); font-size: 1.2rem; font-weight: 600; color: var(--red); margin-bottom: .7em; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.book__body p { font-size: 1.2rem; line-height: 1.6; }
.book__body .btn { margin-top: auto; }
.book__soon { font-style: italic; color: var(--muted); margin: auto 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.badge { font-family: var(--sans); font-size: 1.125rem; font-weight: 600; color: var(--green); background: rgba(69, 111, 75, .1); border-radius: 999px; padding: 3px 14px; }
.buona { font-family: var(--hand); font-size: 2.5rem; line-height: 1; color: var(--red); margin: 56px 0 0; transform: rotate(-2deg); }

/* About */
.about__grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 64px; align-items: start; }
.about__nonna { width: 280px; margin-top: 8px; }
.about h2 { font-size: clamp(2rem, 3vw, 2.6rem); }
.about p { max-width: 36em; }
.about p:last-child { font-style: italic; color: var(--muted); }

/* Questions */
.faq { margin-top: 30px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  font-family: var(--serif); font-size: 1.35rem; font-weight: 600; line-height: 1.35; color: var(--ink);
  padding: 22px 56px 22px 2px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after {
  content: ""; position: absolute; right: 10px; top: 50%; width: 18px; height: 2px; background: var(--green);
  transition: transform .2s ease;
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq summary:hover { color: var(--red); }
.faq details p { padding: 0 2px 24px; margin: 0; font-size: 1.25rem; color: var(--muted); }
.questions__more { font-size: 1.25rem; margin: 40px 0 0; }
.questions__more a, .prose a { color: var(--red); font-weight: 600; text-underline-offset: 3px; }

/* Footer */
.foot { background: var(--linen); padding: 60px 0 54px; border-top: 1px solid var(--line); }
.foot__logo { width: 240px; margin: 0 auto; }
.foot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 38px; margin: 30px 0 22px; font-family: var(--sans); font-size: 1.125rem; font-weight: 500; color: var(--ink); }
.foot__links a { padding: 6px 0; text-underline-offset: 4px; }
.foot__small { font-family: var(--sans); font-size: 1.125rem; color: var(--muted); margin: 0; }
.foot__name { font-family: var(--serif); font-size: 2rem; font-weight: 500; color: var(--ink); margin: 0; }
.foot__tag { font-style: italic; color: var(--green); margin: 4px 0 0; }

/* Plain pages (privacy, not found) */
.prose { padding: clamp(50px, 7vw, 90px) 0 clamp(60px, 8vw, 100px); }
.prose h1 { font-size: clamp(2.5rem, 4vw, 3.4rem); }
.prose h2 { font-size: 1.7rem; font-weight: 600; margin-top: 1.4em; }

/* Tablets */
@media (max-width: 1040px) {
  .top__nav { display: none; }
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .looks { grid-template-columns: 1fr; max-width: 620px; margin-inline: auto; }
  .about__grid { grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
  .about__nonna { width: 200px; }
}

/* Phones */
@media (max-width: 760px) {
  body { font-size: 1.15rem; }          /* 18.4 px */
  .wrap { width: min(1160px, 100% - 40px); }
  h1 { font-size: 2.45rem; }
  h2 { font-size: 2.05rem; }
  .lead { font-size: 1.25rem; }
  .top__row { padding: 10px 0; gap: 12px; }
  .top__logo img { width: 158px; }
  .btn--small { min-height: 46px; padding: 6px 18px; }
  .hero { padding: 28px 0 24px; }
  .hero__grid { grid-template-columns: 1fr; grid-template-areas: "words" "picture" "note"; row-gap: 6px; }
  .hero__words, .hero__note { text-align: center; }
  .eyebrow { font-size: 1.25rem; }
  .hero__sub { font-size: 1.25rem; margin-inline: auto; }
  .hero__buttons { justify-content: center; gap: 10px; margin: 24px 0 8px; }
  .hero__buttons .btn { flex: 1 1 100%; }
  .hero__picture { margin: 0 -20px; }
  .hero__note { margin-inline: auto; padding-top: 16px; }
  .welcome { padding: 34px 0 6px; }
  .welcome__hello { font-size: 2.3rem; }
  .welcome__line { font-size: 1.5rem; }
  .kicker.center::before, .kicker.center::after { width: 16px; margin: 0 10px 4px; }
  .scenes, .steps, .books, .givers { grid-template-columns: 1fr; }
  .cta { margin-top: 40px; }
  .cta .btn { width: 100%; }
  .scenes { gap: 30px; }
  .row, .row--flip { grid-template-columns: 1fr; gap: 4px; }
  .row--flip img { order: 0; }
  .row img { margin: 0 -20px; max-width: calc(100% + 40px); }
  .row__words { text-align: center; }
  .row__words p { font-size: 1.2rem; margin-inline: auto; }
  .rows { gap: 44px; }
  .looks__row { gap: 10px; }
  .glance > div { grid-template-columns: 1fr; gap: 2px; padding: 16px 0; }
  .glance dd { font-size: 1.15rem; }
  .steps { gap: 30px; }
  .about__grid { grid-template-columns: 1fr; justify-items: center; gap: 12px; }
  .about__nonna { width: 170px; }
  .about .kicker, .about h2 { text-align: center; }
  .faq summary { font-size: 1.25rem; padding-right: 48px; }
  .faq details p { font-size: 1.15rem; }
  .questions__more { font-size: 1.15rem; }
  .buona { font-size: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .top__nav a, .faq summary::after { transition: none; }
}
