/* ============================================================
   Taylor Kids English
   Palette: #a8bbef · #67a37d · #e78951 · #eaa5c3 · #f3d274 · white
   Colour usage: sections get a ~14% wash of one brand colour.
                 Full-strength colour only on buttons and small details.
                 The photography carries the saturation. No gradients.
   Type:  Config Rounded — Light (300) & Regular (400)
   Layout: editorial — large asymmetric photography, generous whitespace
   ============================================================ */

@font-face {
  font-family: 'Config Rounded';
  src: url('assets/fonts/ConfigRounded-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Config Rounded';
  src: url('assets/fonts/ConfigRounded-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Config Rounded';
  src: url('assets/fonts/ConfigRounded-Medium.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Config Rounded';
  src: url('assets/fonts/ConfigRounded-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette — full strength, for buttons and small details only */
  --c-white:  #ffffff;
  --c-blue:   #a8bbef;
  --c-green:  #67a37d;
  --c-orange: #e78951;
  --c-pink:   #eaa5c3;
  --c-yellow: #f3d274;

  /* ~14% washes of the same five colours — section backgrounds */
  --t-blue:   #f3f6fd;
  --t-green:  #eaf2ed;
  --t-orange: #fcefe7;
  --t-pink:   #fcf2f7;
  --t-yellow: #fdf9ec;

  /* Ink & neutrals */
  --c-ink:         #23282b;
  --c-muted:       #5c6663;
  --c-line:        rgba(35,40,43,0.13);
  --c-line-soft:   rgba(35,40,43,0.07);
  --c-shadow:      rgba(35,40,43,0.13);

  --ff: 'Config Rounded', 'Trebuchet MS', 'Helvetica Neue', Arial, sans-serif;

  --r:      24px;
  --r-sm:   16px;
  --r-lg:   34px;
  --r-pill: 999px;
  --container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff);
  font-weight: 400;
  color: var(--c-ink);
  background: var(--c-white);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
em, i { font-style: normal; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--c-blue);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip link — off-screen until focused */
.skip-link {
  position: fixed;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 14px 24px;
  font-size: 15px;
  color: var(--c-ink);
  background: var(--c-white);
  border-radius: var(--r-pill);
  box-shadow: 0 12px 32px -12px var(--c-shadow);
}
.skip-link:focus { left: 20px; top: 20px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ==== Typography ==== */
.display {
  font-family: var(--ff);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.06;
  margin: 0;
}
.h-xl { font-size: clamp(40px, 5.6vw, 70px); }
.h-lg { font-size: clamp(32px, 4.2vw, 52px); }
.h-md { font-size: clamp(24px, 2.5vw, 32px); }

.lead {
  font-size: clamp(18px, 1.5vw, 21px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--c-muted);
}

/* Eyebrow — small full-colour detail */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-ink);
  margin: 0 0 24px;
}
.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--c-blue);
  flex-shrink: 0;
}
.eyebrow--center { justify-content: center; }
.eyebrow--green::before  { background: var(--c-green); }
.eyebrow--orange::before { background: var(--c-orange); }
.eyebrow--pink::before   { background: var(--c-pink); }
.eyebrow--yellow::before { background: var(--c-yellow); }

/* ==== Buttons — lilac with bold white text (all buttons) ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 19px 36px;
  font-family: var(--ff);
  font-size: 17px;
  /* Medium (600) è il peso "bold" di Config Rounded: sopra c'è solo il Black */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-align: center;
  color: var(--c-white);
  background: var(--c-blue);
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.2,0.7,0.2,1), box-shadow 0.25s ease, background 0.25s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -12px var(--c-shadow);
}

/* ==== Reveal-on-scroll ==== */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.85s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-30px); }
[data-reveal="right"] { transform: translateX(30px); }
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: 0.07s; }
[data-reveal-delay="2"] { transition-delay: 0.14s; }
[data-reveal-delay="3"] { transition-delay: 0.21s; }
[data-reveal-delay="4"] { transition-delay: 0.28s; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ==== NAVBAR — floating glass pill, revealed on scroll ==== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 18px 20px 0;
  pointer-events: none;
}
.nav-inner {
  pointer-events: none;
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 11px 14px 11px 24px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-pill);
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.nav.is-scrolled .nav-inner {
  pointer-events: auto;
  opacity: 1;
  transform: none;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 16px 40px -22px var(--c-shadow);
}
.nav-brand { display: inline-flex; }
.nav-brand img { height: 36px; width: auto; display: block; }
.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
  margin-right: 8px;
}
.nav-links a {
  font-size: 16px;
  color: var(--c-ink);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  transition: background 0.2s ease;
}
.nav-links a:hover { background: var(--t-blue); }
.nav-cta { padding: 13px 22px; font-size: 14px; letter-spacing: 0.05em; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-pill);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.nav-toggle:hover { background: var(--t-blue); }
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--c-ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==== HERO — full-screen video ==== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--c-ink);
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}
/* No overlay layer over the video. Legibility comes from a soft shadow on
   the type itself, which does not tint the footage. */
.hero > .container {
  position: relative;
  z-index: 2;
  padding-top: 150px;
  padding-bottom: 106px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.42), 0 1px 34px rgba(0,0,0,0.34);
}
/* Flag + logo pinned near the top of the hero, clear of the centred headline */
.hero-brand {
  position: absolute;
  top: clamp(26px, 3.4vw, 46px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.hero-flag {
  display: block;
  width: clamp(34px, 3vw, 44px);
  height: auto;
  border-radius: 5px;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.55), 0 4px 14px rgba(0,0,0,0.32);
}
.hero-logo {
  display: block;
  width: auto;
  height: clamp(38px, 4.2vw, 58px);
  filter: drop-shadow(0 2px 14px rgba(0,0,0,0.3));
}
/* The headline is the hero's main element */
.br-m { display: none; }
.hero h1 {
  font-size: clamp(38px, 7.4vw, 100px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.0;
  margin: 0 auto 26px;
  max-width: none;
  color: var(--c-white);
}
.hero-sub {
  font-size: clamp(18px, 1.5vw, 21px);
  font-weight: 400;
  line-height: 1.6;
  color: var(--c-white);
  max-width: 46ch;
  margin: 0 auto 40px;
}
.hero .btn { text-shadow: none; }
.hero-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px;
  height: 42px;
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.6);
}
.hero-cue::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: var(--r-pill);
  background: var(--c-white);
  animation: cue 1.9s cubic-bezier(0.3, 0.7, 0.3, 1) infinite;
}
@keyframes cue {
  0%, 18% { transform: translateY(0);    opacity: 0; }
  35%     { opacity: 1; }
  75%     { transform: translateY(15px); opacity: 0; }
  100%    { transform: translateY(15px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-cue::after { animation: none; opacity: 1; }
}

/* ==== SECTION SHELL — one colour wash per section ==== */
.section { padding: clamp(88px, 10vw, 148px) 0; }
.section--blue   { background: var(--t-blue); }
.section--green  { background: var(--t-green); }
.section--orange { background: var(--t-orange); }
.section--pink   { background: var(--t-pink); }
.section--yellow { background: var(--t-yellow); }

.section-head { max-width: 660px; margin: 0 0 clamp(48px, 5vw, 72px); }
.section-head h2 { margin: 0; }
.section-head .lead { margin: 22px 0 0; }
.section-head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-head--center .eyebrow { justify-content: center; }

/* ==== EDITORIAL SPLIT — asymmetric photo + text ==== */
.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(44px, 6vw, 96px);
  align-items: center;
}
.split--flip .split-media { order: 2; }
.split-text { max-width: 46ch; }
.split-text h2 { margin: 0 0 24px; }
.split-text p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--c-muted);
  margin: 0 0 20px;
}
.split-text p:last-of-type { margin-bottom: 34px; }

.figure {
  position: relative;
  margin: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--t-blue);
}
.figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure--tall  { aspect-ratio: 4/5; }
.figure--port  { aspect-ratio: 3/4; }
.figure--wide  { aspect-ratio: 4/3; }

/* Two-photo editorial pair: large photo, smaller one offset below it */
.figure-stack { display: grid; gap: 20px; }
.figure-stack .figure--main { aspect-ratio: 5/4; }
.figure-stack .figure--inset {
  aspect-ratio: 16/10;
  width: 62%;
  margin-left: auto;
  border-radius: var(--r);
}

/* ==== WHY — heading + photo on top, then a full-width spec list ====
   The five points carry a paragraph each, so they get the full container
   width in three columns (number · title · description) instead of being
   squeezed into a side column. */
.why-top {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(40px, 5vw, 84px);
  align-items: center;
  margin-bottom: clamp(48px, 6vw, 84px);
}
.why-intro h2 { margin: 0; }
/* the source is a tall portrait with a lot of sky — pull the crop down to the subject */
.why-top .figure img { object-position: center 72%; }

.spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--c-line-soft);
}
.spec-row {
  display: grid;
  grid-template-columns: 52px minmax(190px, 0.85fr) 1.5fr;
  gap: 30px;
  align-items: start;
  padding: 30px 0;
  border-bottom: 1px solid var(--c-line-soft);
}
.num {
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--c-ink);
  background: var(--c-blue);
}
.spec-row:nth-child(1) .num { background: var(--c-blue); }
.spec-row:nth-child(2) .num { background: var(--c-green); }
.spec-row:nth-child(3) .num { background: var(--c-yellow); }
.spec-row:nth-child(4) .num { background: var(--c-pink); }
.spec-row:nth-child(5) .num { background: var(--c-orange); }
.spec-row h3 {
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 7px 0 0;
}
.spec-row p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--c-muted);
  margin: 8px 0 0;
  max-width: 62ch;
}

/* ==== COURSES — staggered editorial columns ==== */
.stagger {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 44px);
  align-items: start;
}
.stagger > *:nth-child(2) { margin-top: clamp(30px, 5vw, 76px); }
.stagger > *:nth-child(3) { margin-top: clamp(60px, 10vw, 152px); }

.course { margin: 0; }
.course-media {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--t-blue);
  margin-bottom: 26px;
}
.course-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.course:hover .course-media img { transform: scale(1.04); }
.course-age {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  font-size: 14px;
  color: var(--c-ink);
  background: var(--c-white);
  padding: 8px 16px;
  border-radius: var(--r-pill);
}
.course h3 {
  font-family: var(--ff);
  font-weight: 300;
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0 0 14px;
}
.course p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--c-muted);
  margin: 0;
}
.course-rule {
  width: 40px;
  height: 3px;
  border-radius: var(--r-pill);
  margin: 0 0 18px;
  background: var(--c-blue);
}
.stagger > *:nth-child(2) .course-rule { background: var(--c-pink); }
.stagger > *:nth-child(3) .course-rule { background: var(--c-yellow); }

/* ==== TEACHERS ====
   Solo intestazione: nessuna griglia di ritratti, quindi il margine inferiore
   della section-head andrebbe a sommarsi al padding della sezione. */
#teachers .section-head { margin-bottom: 0; }

/* ==== PARENTS ==== */
.parents-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.parents-inner h2 { margin: 0 0 24px; }
.parents-inner p {
  font-size: clamp(18px, 1.5vw, 21px);
  font-weight: 300;
  line-height: 1.65;
  color: var(--c-muted);
  margin: 0 auto;
  max-width: 46ch;
}

/* ==== FAQ — thin rules, no boxes ==== */
.faq-list {
  max-width: 860px;
  margin: 0 auto;
  border-top: 1px solid var(--c-line-soft);
}
.faq-item { border-bottom: 1px solid var(--c-line-soft); }
.faq-item summary {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 28px 4px;
  cursor: pointer;
  font-size: 19px;
  font-weight: 400;
  list-style: none;
  transition: color 0.2s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--c-muted); }
.faq-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--c-blue);
  flex-shrink: 0;
  transition: background 0.25s ease;
}
.faq-item:nth-child(2) .faq-dot { background: var(--c-green); }
.faq-item:nth-child(3) .faq-dot { background: var(--c-yellow); }
.faq-item:nth-child(4) .faq-dot { background: var(--c-pink); }
.faq-item:nth-child(5) .faq-dot { background: var(--c-orange); }
.faq-item:nth-child(6) .faq-dot { background: var(--c-blue); }
.faq-sign {
  margin-left: auto;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  position: relative;
  transition: transform 0.3s ease;
}
.faq-sign::before,
.faq-sign::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 1.5px;
  background: var(--c-ink);
  transform: translate(-50%, -50%);
}
.faq-sign::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: opacity 0.25s ease;
}
.faq-item[open] .faq-sign { transform: rotate(180deg); }
.faq-item[open] .faq-sign::after { opacity: 0; }
.faq-answer {
  padding: 0 4px 30px 54px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--c-muted);
  margin: 0;
  max-width: 60ch;
}

/* ==== FINAL CTA ==== */
.cta-final-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.cta-final-inner h2 { margin: 0 0 24px; }
.cta-final-inner p {
  font-size: clamp(18px, 1.5vw, 21px);
  font-weight: 300;
  line-height: 1.65;
  color: var(--c-muted);
  margin: 0 auto 40px;
  max-width: 44ch;
}

/* ==== FOOTER ==== */
.footer {
  background: var(--c-white);
  padding: clamp(64px, 7vw, 90px) 0 44px;
  border-top: 1px solid var(--c-line-soft);
}
.footer-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 60px;
}
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-logo { height: 44px; width: auto; margin-bottom: 8px; }
.footer-tagline {
  font-size: 16px;
  font-weight: 300;
  color: var(--c-muted);
  max-width: 26ch;
  margin: 0;
}
.footer-label {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 6px;
}
.footer-link,
.footer-text { font-size: 16px; line-height: 1.6; }
.footer-link { transition: color 0.2s ease; }
.footer-link:hover { color: var(--c-muted); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--c-line-soft);
}
.footer-meta { font-size: 15px; color: var(--c-muted); }
.footer-pill-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.footer-pill-tab {
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  box-shadow: inset 0 0 0 1px var(--c-line);
  transition: background 0.25s ease;
}
.footer-pill-tab:hover { background: var(--t-blue); }
.footer-pill-tab.is-active,
.footer-pill-tab.is-active:hover {
  background: var(--c-green);
  box-shadow: none;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 1080px) {
  .nav-links a { padding: 10px 12px; font-size: 15px; }
  .stagger { gap: 22px; }
}

@media (max-width: 960px) {
  .nav { padding: 12px 16px 0; }
  .nav-inner { padding: 9px 10px 9px 18px; gap: 10px; }
  .nav-brand { margin-right: auto; }
  .nav-brand img { height: 30px; }
  .nav-cta { padding: 11px 18px; font-size: 14px; }
  .nav-toggle { display: inline-flex; }

  .nav-links {
    display: flex;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    margin: 0;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(16px) saturate(1.15);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--r);
    box-shadow: 0 20px 34px -22px var(--c-shadow);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav-links.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-links a { padding: 14px 16px; font-size: 16px; border-radius: var(--r-sm); }

  .split { grid-template-columns: 1fr; gap: 40px; }
  .split--flip .split-media { order: 0; }
  .split-text { max-width: none; }

  .why-top { grid-template-columns: 1fr; gap: 34px; }
  /* number + title on one row, description below spanning the text column */
  .spec-row {
    grid-template-columns: 44px 1fr;
    gap: 8px 20px;
    padding: 26px 0;
  }
  .spec-row p { grid-column: 2; max-width: none; }

  .figure--tall, .figure--port { aspect-ratio: 4/3; }
  .figure-stack .figure--main { aspect-ratio: 4/3; }
  .figure-stack .figure--inset { width: 72%; }

  .stagger { grid-template-columns: 1fr; gap: 48px; }
  .stagger > *:nth-child(2),
  .stagger > *:nth-child(3) { margin-top: 0; }
  .course-media { aspect-ratio: 4/3; }

  .footer-cols { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 620px) {
  .container { padding: 0 20px; }
  body { font-size: 16px; }

  /* Phones: four short lines, so the headline can be far larger.
     Longest line is "dal primo" at 3.745x the font size (-0.05em tracking),
     so 21vw keeps it inside (viewport - 28px) with ~4% margin down to 320px. */
  .br-m { display: block; }
  .hero-brand { top: 70px; }
  /* narrower gutters here only, to buy width for the headline */
  .hero > .container {
    padding: 156px 14px 90px;
  }
  .hero h1 {
    font-size: clamp(56px, 21vw, 82px);
    letter-spacing: -0.05em;
    line-height: 0.95;
    margin-bottom: 24px;
    max-width: 100%;
  }
  .hero-sub { margin-bottom: 34px; }
  .hero .btn { width: 100%; max-width: 340px; }
  .hero-cue { bottom: 20px; }

  .section { padding: 68px 0; }
  .section-head { margin-bottom: 36px; }

  /* Headings larger on phones */
  .h-lg { font-size: clamp(30px, 9.4vw, 44px); }
  .course h3 { font-size: clamp(24px, 7vw, 30px); }

  .split-text p { font-size: 16px; }
  .split-text .btn,
  .cta-final-inner .btn { width: 100%; max-width: 340px; }

  .spec-row { grid-template-columns: 38px 1fr; gap: 6px 16px; padding: 22px 0; }
  .num { width: 38px; height: 38px; font-size: 13px; }
  .spec-row h3 { font-size: 19px; margin-top: 5px; }
  .spec-row p { font-size: 16px; }

  /* I nostri corsi: slider a scorrimento orizzontale con snap nativo */
  .stagger {
    --cpad: 20px;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(50% - 50vw);
    padding-inline: var(--cpad);
    padding-bottom: 8px;
    scroll-padding-inline: var(--cpad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .stagger::-webkit-scrollbar { display: none; }
  .course {
    flex: 0 0 80%;
    scroll-snap-align: start;
  }
  .course-media { aspect-ratio: 3/4; }

  .faq-item summary { padding: 22px 2px; font-size: 17px; gap: 16px; }
  .faq-answer { padding: 0 2px 24px 26px; font-size: 16px; }

  .footer-cols { grid-template-columns: 1fr; gap: 30px; padding-bottom: 44px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .btn { padding: 17px 24px; font-size: 16px; letter-spacing: 0.05em; }
}

@media (max-width: 380px) {
  .container { padding: 0 16px; }
  .nav-cta { padding: 10px 13px; font-size: 12px; letter-spacing: 0.03em; }
  .nav-brand img { height: 26px; }
  .btn { font-size: 15px; letter-spacing: 0.04em; }
}

@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 48px; }
  .nav-links a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ==== Anti horizontal overflow safety net ==== */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
