/* Compact reading surfaces; motion never takes over native scrolling. */

:root {
  --blue: #1248d8;
  --paper: #fff;
}

.sheet-explanations {
  display: none;
}

.hero-proof>div>strong,.hero-proof .proof-source>strong {
  font-size: 52px;
  letter-spacing: -.055em;
}

.hero-proof strong>span {
  font-size: .62em;
}

.hero-proof .proof-caption,.hero-proof>div>span {
  font-size: 14px;
}

.hero-note {
  --paper: #f8f7e9;
}

.hero-note .note-content {
  background: var(--paper);
}

.hero-note .hero-manuscript img {
  background: var(--paper);
}

.hero-service {
  max-width: 670px;
}

.contact-hint {
  font-size: 14px;
  max-width: 330px;
}

.section-heading h2 {
  letter-spacing: -.05em;
}

.subject p,.cross-subject {
  font-size: 16px;
}

.topics summary {
  font-size: 14px;
}

.lesson-intro p {
  font-size: 16px;
}

.lesson-commentary {
  font-size: 16px;
  line-height: 1.75;
}

.lesson-commentary .eyebrow {
  font-size: 12px;
}

.lesson-commentary h4 {
  font-size: 29px;
  line-height: 1.2;
}

.lesson-paper {
  position: relative;
  top: auto;
  border-color: var(--paper);
  box-shadow: 0 14px 40px #15254e0b;
}

.lesson-paper img {
  height: 610px;
  padding: 12px;
}

.lesson-paper figcaption {
  font-size: 12px;
  border: 0;
}

.lesson-navigation {
  border-top: 1px solid #cdd4df;
  padding-top: 18px;
}

.lesson-thumbnails button {
  border-radius: 8px;
}

.lesson-frame {
  gap: 48px;
  animation: page-in .3s ease-out;
}

.lesson-pager.bottom {
  margin-top: 24px;
}

.after-lesson {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 32px;
  margin: 30px 0;
  background: #e9eefb;
  border-radius: 16px;
  align-items: center;
}

.after-copy h4 {
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -.035em;
  margin: 15px 0;
}

.after-copy>p {
  font-size: 16px;
}

.after-copy .eyebrow {
  font-size: 12px;
}

.after-copy .button {
  font-size: 14px;
  min-height: 48px;
  margin-top: 18px;
}

.after-copy .after-note {
  font-size: 12px;
  margin-top: 12px;
}

.sheet-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.sheet-pair a {
  display: block;
  color: #294269;
  text-decoration: none;
  font-size: 12px;
}

.sheet-pair img {
  display: block;
  width: 100%;
  height: auto;
  background: white;
  border: 1px solid #dee5f3;
  box-shadow: 0 5px 14px #13307912;
  transition: transform .25s;
}

.sheet-pair a:hover img {
  transform: translateY(-5px);
}

.sheet-pair span {
  display: block;
  margin-top: 10px;
}

.method-compact>summary {
  font-size: 16px;
}

.method-compact>div {
  font-size: 16px;
}

.review blockquote {
  font-size: 16px;
}

.about-story {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px 80px;
  align-items: start;
}

.about-heading {
  position: sticky;
  top: 110px;
}

.about-heading h2 {
  line-height: 1.08;
  letter-spacing: -.055em;
  margin: 20px 0;
}

.about-heading>p:not(.eyebrow) {
  font-size: 17px;
  max-width: 440px;
}

.about-card {
  padding: 0 0 42px;
  margin: 0 0 40px;
  border-bottom: 1px solid #cbd6ec;
}

.about-card:last-child {
  margin-bottom: 0;
}

.story-number {
  display: block;
  font-size: clamp(68px,8vw,110px);
  line-height: 1.05;
  letter-spacing: -.07em;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 22px;
  will-change: transform;
}

.story-word {
  font-size: clamp(56px,6.5vw,80px);
}

.about-card h3 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -.03em;
}

.about-card p {
  font-size: 16px;
  line-height: 1.75;
}

.about-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 700;
}

.story-controls {
  display: none;
}

.compact-faq {
  grid-column: 1/-1;
}

.compact-faq summary,.compact-faq p {
  font-size: 16px;
}

.cta-reassurance {
  font-size: 16px !important;
  opacity: .92;
}

.final-actions .button {
  min-height: 60px;
  font-size: 18px;
  padding-inline: 24px;
}

.doc-toolbar>span {
  font-size: 13px;
  color: #526077;
}

.doc-source {
  justify-content: center;
}

.doc-explanation .lesson-commentary {
  font-size: 17px;
}

.doc-explanation h3 {
  font-size: 29px;
}

.doc-reader-open .header {
  visibility: hidden;
}

.hero-proof>div {
  transition: transform .1s linear;
}

.section-heading {
  transition: transform .25s ease-out;
}

.motion-active .reveal {
  transition: opacity .45s ease,transform .45s ease;
}

.motion-active .reveal:not(.in-view) {
  opacity: .92;
  transform: translateY(18px);
}

.motion-active .reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@keyframes page-in {
  from {
    opacity: .65;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width:1000px) {
  #materie {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 0 65px;
    align-items: start;
  }
  #materie>.section-heading {
    position: sticky;
    top: 110px;
    grid-row: 1/4;
  }
  #materie .subjects {
    grid-template-columns: 1fr 1fr;
  }
  .hero-proof {
    padding-block: 26px;
  }
  .examples .section-heading {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 45px;
  }
  .examples .section-heading .eyebrow {
    grid-column: 1/-1;
  }
  .examples .section-heading>p:last-child {
    align-self: center;
  }
}

@media (max-width:1000px) {
  .after-lesson {
    gap: 24px;
    padding: 24px;
  }
  .about-story {
    gap: 35px;
  }
  .lesson-frame {
    gap: 28px;
  }
  .lesson-paper img {
    height: 530px;
  }
}

@media (max-width:700px) {
  .section {
    padding-block: 44px;
  }
  .hero-proof>div>strong,.hero-proof .proof-source>strong {
    font-size: 38px;
  }
  .hero-proof .proof-caption,.hero-proof>div>span {
    font-size: 12px;
  }
  .hero-proof .proof-source>strong>span,.hero-proof>div:nth-child(2)>strong>span {
    font-size: .65em;
  }
  .hero-proof>div>strong>span {
    font-size: 15px;
  }
  .hero-proof>div {
    padding-inline: 8px;
  }
  .hero-email {
    font-size: 14px;
    flex-wrap: wrap;
  }
  .hero-email a {
    overflow-wrap: anywhere;
  }
  .hero-copy {
    font-size: 16px;
  }
  .hero-notes-link {
    font-size: 14px;
  }
  .lesson-paper {
    position: relative;
    top: auto;
  }
  .lesson-paper img {
    height: 390px;
    padding: 8px;
  }
  .lesson-commentary h4 {
    font-size: 27px;
  }
  .lesson-commentary {
    font-size: 16px;
  }
  .lesson-commentary .equation {
    font-size: 16px;
  }
  .lesson-navigation {
    gap: 12px;
  }
  .lesson-thumbnails {
    justify-content: flex-start !important;
    overflow-x: auto;
  }
  .lesson-thumbnails button {
    min-width: 46px;
  }
  .after-lesson {
    grid-template-columns: 1fr;
    gap: 22px;
    margin: 26px -2px;
    padding: 24px 20px;
  }
  .after-copy h4 {
    font-size: 28px;
  }
  .after-copy .button {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
  }
  .sheet-pair {
    max-width: 450px;
    gap: 12px;
  }
  .sheet-pair span {
    font-size: 12px;
  }
  .about-story {
    display: block;
  }
  .about-heading {
    position: static;
  }
  .about-heading>p:not(.eyebrow) {
    font-size: 16px;
  }
  .about-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    align-items: flex-start;
    padding: 5px 0 14px;
  }
  .about-card {
    flex: 0 0 94%;
    scroll-snap-align: start;
    padding: 22px;
    margin: 0;
    border: 1px solid #ced9ed;
    border-radius: 12px;
    background: #f7f9fe;
    max-width: 94%;
  }
  .about-card p {
    font-size: 16px;
  }
  .story-number {
    font-size: 80px;
    margin-bottom: 18px;
  }
  .story-word {
    font-size: 56px;
  }
  .about-card h3 {
    font-size: 25px;
  }
  .story-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 24px 0 10px;
    font-size: 14px;
  }
  .story-controls button {
    border: 1px solid #c0cee8;
    color: var(--blue);
    border-radius: 50%;
    background: #fff;
    min-width: 44px;
    min-height: 44px;
  }
  .compact-faq {
    margin-top: 28px;
  }
  .compact-faq summary,.compact-faq p {
    font-size: 15px;
  }
  .doc-toolbar>span {
    font-size: 12px;
    max-width: 125px;
    text-align: right;
  }
  .after-copy .eyebrow {
    line-height: 1.6;
  }
  .final-actions .button {
    font-size: 16px;
  }
  .review-track .review blockquote {
    font-size: 16px;
  }
  .review-track .review figcaption>a {
    font-size: 12px;
  }
  .subject p {
    font-size: 16px;
  }
  .cross-subject {
    font-size: 15px;
  }
  .topics summary {
    font-size: 14px;
  }
  .doc-explanation .lesson-commentary {
    font-size: 16px;
  }
}

@media (max-width:360px) {
  .hero-proof>div>strong,.hero-proof .proof-source>strong {
    font-size: 32px;
  }
  .hero-proof .proof-caption,.hero-proof>div>span {
    font-size: 11px;
  }
  .lesson-paper img {
    height: 335px;
  }
  .story-word {
    font-size: 45px;
  }
  .about-card {
    padding: 18px;
  }
  .about-heading h2 {
    font-size: 35px;
  }
}

@media (prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto !important;
  }
  *,*::before,*::after {
    animation: none !important;
    transition: none !important;
  }
  .motion-active .reveal:not(.in-view) {
    opacity: 1;
    transform: none;
  }
  .story-number,.hero-proof>div {
    transform: none !important;
  }
}

@media print {
  body {
    display: none !important;
  }
}

/* Bring the manuscript into view sooner on small screens. */

@media (max-width:700px) {
  .examples .section-heading {
    margin-bottom: 18px;
  }
  .examples .section-heading>p:not(.eyebrow) {
    margin-top: 12px;
  }
  .examples .lesson-subject-picker {
    margin-bottom: 18px;
  }
  .lesson-intro {
    margin-bottom: 15px;
  }
  .lesson-intro h3 {
    font-size: 26px;
  }
  .lesson-intro p {
    font-size: 15px;
    line-height: 1.6;
    margin-top: 9px;
  }
  .lesson-navigation {
    padding-top: 12px;
  }
  .lesson-thumbnails {
    padding-top: 8px;
  }
  .lesson-thumbnails button {
    min-height: 58px;
    flex-direction: row;
    gap: 6px;
  }
  .lesson-thumbnails img {
    height: 38px;
    width: 27px;
  }
  .lesson-thumbnails span {
    font-size: 12px;
  }
}

/* La colonna fissa termina con le attività; le FAQ sono fuori dal suo contenitore. */

.about-story {
  min-width: 0;
}

.bio .compact-faq {
  margin-top: 48px;
}

.hero-delivery {
  font-size: 15px;
  line-height: 1.65;
  color: #23457c;
  margin-top: 14px;
  max-width: 580px;
}

.about-heading h2 {
  font-size: clamp(34px,3.5vw,48px);
}

@media (max-height:700px) {
  .about-heading {
    position: static;
  }
}

@media (max-width:700px) {
  .bio .compact-faq {
    margin-top: 30px;
  }
  .about-heading h2 {
    font-size: 35px;
  }
  .hero-delivery {
    font-size: 14px;
  }
}

.lesson-social-proof {
  font-size: 14px !important;
  margin-top: 18px;
}

.lesson-social-proof a {
  font-weight: 650;
}

.final-cta .final-social-proof {
  font-size: 15px;
  line-height: 1.7;
  margin-top: 22px;
}

.final-social-proof a {
  color: inherit;
  font-weight: 750;
  text-decoration: underline;
}

/* Il foglio resta fisso solo con due colonne e spazio verticale sufficiente.
   Sotto 801px la spiegazione segue il foglio: entrambi scorrono nel flusso. */

@media (min-width:801px) and (min-height:760px) {
  .lesson-paper {
    position: sticky;
    top: 100px;
  }
}

/* Inviti contestuali al contatto, nello stesso flusso dei contenuti. */

.inline-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid #ccd6e7;
  padding-top: 24px;
  margin-top: 28px;
}

.inline-contact>div {
  min-width: 0;
  max-width: 570px;
}

.inline-contact h3 {
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -.025em;
  margin: 0;
}

.inline-contact p {
  font-size: 15px;
  line-height: 1.65;
  margin-top: 8px;
}

.inline-contact .button {
  flex-shrink: 0;
  min-height: 48px;
  font-size: 14px;
  padding: 14px 18px;
  white-space: normal;
  text-align: left;
}

.inline-contact .cta-label {
  min-width: 0;
}

.inline-contact .wa-icon {
  flex-shrink: 0;
}

#materie>.inline-contact {
  grid-column: 2;
}

.examples .inline-contact {
  margin-top: 26px;
}

.reviews-section .inline-contact {
  margin-top: 32px;
}

@media (max-width:999px) {
  #materie>.inline-contact {
    grid-column: auto;
  }
}

@media (max-width:800px) {
  .inline-contact {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .inline-contact .button {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 420px;
  }
  .inline-contact h3 {
    font-size: 20px;
  }
  .inline-contact p {
    font-size: 15px;
  }
}

/* Each moving line has its own travel space; neighbouring content stays in flow. */

.motion-active .scroll-word-slot {
  padding-block: 24px;
  transform: none;
  will-change: auto;
}

.scroll-word {
  display: block;
  transform: translate3d(0,var(--scroll-word-y,0px),0);
  will-change: transform;
}

.motion-active .section-heading.reveal,.motion-active .about-card.reveal {
  transform: none;
  transition: opacity .45s ease;
}

.motion-active .hero-proof>div {
  transform: none;
  transition: none;
}

@media (prefers-reduced-motion:reduce) {
  .scroll-word {
    transform: none !important;
    will-change: auto;
  }
}

.motion-active .hero-proof strong.scroll-word-slot>.scroll-word {
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

.hero-proof .scroll-word>span {
  font-size: .62em;
  font-weight: 600;
}

@media (max-width:700px) {
  .hero-proof>div:first-child .scroll-word>span {
    font-size: 15px;
  }
}

/* Headings move subtly; proof numbers retain their more visible travel. */

.motion-active h2.scroll-word-slot {
  padding-block: 8px;
}

/* Single parent contact line; the existing FAQ structure stays unchanged. */
.parents-note { grid-column: 1 / -1; font-size: 15px; line-height: 1.65; margin-top: 20px; }
.parents-note a { font-weight: 650; }

.hero-mobile-context, .note-label-mobile { display: none; }

/* Mobile hero: proof before the longer copy, with a real manuscript excerpt. */
@media (max-width:800px) {
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding-top: 16px; }
  .hero-main { display: contents; }
  .hero-main > .eyebrow { order: 0; font-size: 11px; line-height: 1.5; }
  .hero h1 { order: 1; font-size: clamp(30px, 8.5vw, 40px); margin-top: 12px; line-height: 1.08; }
  .hero h1 .desktop-break { display: none; }
  .hero-proof { order: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 0; margin-top: 16px; padding-block: 8px 12px; }
  .hero-proof > div { display: block; padding-inline: 10px; min-width: 0; }
  .hero-proof > div:first-child { grid-column: 1 / -1; display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 12px; border: 0; padding: 0 0 4px; }
  .hero-proof > div:nth-child(2) { padding-left: 0; border-left: 0; }
  .hero-proof > div > strong, .hero-proof .proof-source > strong { display: block; font-size: 30px; line-height: 1.1; }
  .hero-proof > div:first-child > strong { font-size: 26px; }
  .hero-proof > div > span, .hero-proof .proof-caption { font-size: 14px; line-height: 1.4; margin-top: 0; }
  .hero-proof .proof-source { display: block; }
  .hero-proof .proof-read { font-size: 13px; }
  .motion-active .hero-proof .scroll-word-slot { padding-block: 8px; }
  .hero-note { order: 3; display: block; align-self: stretch; margin: 14px 0 0; border-radius: 10px; }
  .hero-note .note-top, .hero-note .note-content > .eyebrow, .hero-note .note-content > h2, .hero-note > a, .hero-manuscript figcaption { display: none; }
  .hero-note .note-content { padding: 0; }
  .hero-note .hero-manuscript { margin: 0; }
  .hero-note .hero-note-open { display: block; }
  .hero-note .hero-manuscript img { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; object-position: center; padding: 0; }
  .hero-note .note-label-desktop { display: none; }
  .hero-note .note-label-mobile { display: inline; }
  .hero-note .hero-mobile-context { display: grid; gap: 6px; padding: 16px; color: #18202b; }
  .hero-note .hero-mobile-context strong { font-size: 17px; line-height: 1.35; }
  .hero-note .hero-mobile-context > span { font-size: 15px; line-height: 1.5; font-weight: 400; }
  .hero-note .note-open-label { font-size: 15px; padding: 14px 16px; min-height: 48px; }
  .hero-contact { order: 4; margin-top: 18px; }
  .hero-contact .button { width: 100%; }
  .hero-service { order: 5; font-size: 16px; margin-top: 24px; }
  .hero-copy { order: 6; }
  .hero-delivery { order: 7; }
  .hero-notes-link { order: 8; }
  .hero-email { order: 9; }
}

/* Compared at 112/136/150px on 320–430px phones: preserve context and visible contact. */
@media(max-width:560px){
 .hero-note .hero-note-open img{height:150px;object-fit:cover;object-position:top center}
}

/* Visible return paths to the group course, separate from individual lessons. */
.percorsi-entry { margin-block:32px; padding:28px; border:1px solid #cddbe8; border-left:4px solid #1248d8; border-radius:16px; background:#f3f7ff; color:#18202b; }
.percorsi-entry h2 { margin:8px 0 12px; font-size:clamp(24px,3vw,34px); line-height:1.25; letter-spacing:-.03em; }
.percorsi-entry p { max-width:76ch; line-height:1.65; }
.percorsi-entry .eyebrow { margin:0; color:#24478a; font-size:12px; }
.percorsi-entry-facts { margin:16px 0 8px; }
.percorsi-entry .percorsi-entry-note { font-size:14px; color:#465267; }
.percorsi-entry-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:20px; }
.percorsi-entry-actions .button { white-space:normal; min-height:48px; text-align:center; justify-content:center; line-height:1.4; }
.percorsi-entry-actions .percorsi-course-link { background:#1248d8; color:#fff; border:1px solid #1248d8; text-decoration:none; }
.percorsi-entry-actions .percorsi-course-whatsapp { background:#fff; color:#173a31; border:1px solid #a9c8bc; }
.percorsi-entry-actions a:focus-visible { outline:3px solid #172b52; outline-offset:4px; }
.percorsi-entry-compact { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 24px; }
.percorsi-entry-compact h2 { font-size:21px; margin-bottom:0; }
.percorsi-entry-compact .percorsi-entry-actions { margin-top:0; }
.subject .percorsi-entry-actions { margin-block:16px; }
@media(max-width:800px) {
 .percorsi-entry { padding:20px; }
 .percorsi-entry-compact { flex-direction:column; align-items:stretch; gap:16px; }
 .percorsi-entry-actions { flex-direction:column; align-items:stretch; }
 .percorsi-entry-actions .button { width:100%; padding:14px 12px; font-size:15px; }
 .percorsi-entry-actions .cta-label { white-space:normal; }
}
