:root {
  --nb-navy: #073b52;
  --nb-deep: #032b3e;
  --nb-yellow: #ffbd16;
  --nb-orange: #f47b20;
  --nb-paper: #fffdf8;
  --nb-cream: #f7f0e3;
  --nb-blue: #eaf7ff;
  --nb-ink: #15384e;
  --nb-line: rgba(42, 96, 127, .14);
  --nb-shadow: 0 24px 60px rgba(20, 52, 69, .16);
}

.notebook-home { overflow: hidden; color: var(--nb-ink); background: var(--nb-paper); }
.notebook-shell { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.notebook-home h1, .notebook-home h2, .notebook-home h3 { color: var(--nb-navy); font-family: Georgia, "Times New Roman", serif; }
.notebook-kicker { margin: 0 0 12px; color: var(--nb-orange); font-size: 13px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.notebook-button { display: inline-flex; align-items: center; gap: 12px; padding: 14px 22px; border-radius: 999px; background: var(--nb-yellow); color: var(--nb-deep) !important; font-size: 14px; font-weight: 900; text-decoration: none; box-shadow: 0 9px 24px rgba(255, 189, 22, .26); transition: transform .2s ease, box-shadow .2s ease; }
.notebook-button:hover { transform: translateY(-2px); box-shadow: 0 13px 30px rgba(255, 189, 22, .34); }

/* Interactive book */
.notebook-hero-section { position: relative; padding: clamp(16px, 2.5vh, 28px) 24px 18px; background-color: #a97648; background-image: linear-gradient(90deg, rgba(255,255,255,.04) 50%, transparent 50%), repeating-linear-gradient(3deg, rgba(78,41,15,.10) 0 2px, transparent 2px 10px); background-size: 44px 100%, auto; }
.notebook-slider { width: min(1360px, 100%); margin: auto; outline: none; }
.notebook-book { position: relative; width: 100%; height: clamp(440px, calc(100svh - 190px), 570px); min-height: 0; overflow: hidden; perspective: 2200px; filter: drop-shadow(0 18px 19px rgba(40, 24, 13, .26)); }
.notebook-slide { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); visibility: hidden; opacity: 0; pointer-events: none; }
.notebook-slide.is-active { z-index: 1; visibility: visible; opacity: 1; pointer-events: auto; }
.notebook-page { position: relative; box-sizing: border-box; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; background-color: var(--nb-paper); background-image: repeating-linear-gradient(0deg, transparent 0 34px, rgba(41,105,145,.08) 34px 35px); }
.notebook-page:first-child { border-radius: 28px 5px 5px 28px; box-shadow: inset -16px 0 28px rgba(25, 50, 64, .09), inset 0 0 0 1px rgba(40,60,70,.08); }
.notebook-page:nth-child(2) { border-radius: 5px 28px 28px 5px; box-shadow: inset 16px 0 28px rgba(25, 50, 64, .09), inset 0 0 0 1px rgba(40,60,70,.08); }
.notebook-copy-page { display: flex; align-items: flex-start; justify-content: center; flex-direction: column; padding: clamp(38px, 5vw, 68px); }
.notebook-copy-page h1, .notebook-copy-page h2 { max-width: 620px; margin: 0 0 18px; font-size: clamp(40px, 4.5vw, 64px); line-height: 1; letter-spacing: -.045em; }
.notebook-copy-page > p:not(.notebook-kicker) { max-width: 610px; margin: 0 0 22px; color: #4f6775; font-size: clamp(14px, 1.25vw, 17px); line-height: 1.65; }
.notebook-doodle { position: absolute; inset-inline-end: 58px; bottom: 50px; color: var(--nb-navy); font-family: "Segoe Print", "Comic Sans MS", cursive; font-size: 18px; font-weight: 800; line-height: 1.25; transform: rotate(-5deg); }
.notebook-photo-page { padding: clamp(24px, 3vw, 36px); display: grid; place-items: center; }
.notebook-photo-page > img { box-sizing: border-box; display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: cover; border: 10px solid #fff; box-shadow: 0 14px 28px rgba(31,47,55,.17); transform: rotate(1deg); }
.notebook-note { position: absolute; inset-inline-end: 54px; bottom: 52px; padding: 15px 20px; background: #fff1a9; color: var(--nb-navy); font-family: "Segoe Print", "Comic Sans MS", cursive; font-weight: 800; transform: rotate(-3deg); box-shadow: 0 9px 18px rgba(46,43,22,.14); }
.notebook-photo-collage { grid-template-columns: 1fr 1fr; gap: 18px; }
.notebook-photo-collage > img { height: min(370px, 72%); }
.notebook-photo-collage > img:last-child { margin-top: 34px; transform: rotate(-2deg); }
.notebook-mini-langs { display: flex; flex-wrap: wrap; gap: 10px; }
.notebook-mini-langs span { padding: 9px 13px; border: 1px solid var(--nb-line); border-radius: 999px; background: #fff; color: var(--nb-navy); font-size: 13px; font-weight: 800; }
.notebook-spine { position: absolute; z-index: 8; inset-block: 10px; left: calc(50% - 9px); width: 18px; border-radius: 50%; background: linear-gradient(90deg, rgba(12,35,48,.16), rgba(255,255,255,.72), rgba(12,35,48,.19)); box-shadow: 0 0 30px rgba(13, 35, 46, .25); pointer-events: none; }
.notebook-leaf { position: absolute; z-index: 7; top: 0; left: 50%; box-sizing: border-box; width: 50%; height: 100%; min-width: 0; min-height: 0; transform-origin: left center; transform-style: preserve-3d; pointer-events: none; visibility: hidden; }
.notebook-leaf-front, .notebook-leaf-back { position: absolute; inset: 0; box-sizing: border-box; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 4px 28px 28px 4px; background-color: var(--nb-paper); background-image: repeating-linear-gradient(0deg, transparent 0 34px, rgba(41,105,145,.11) 34px 35px); box-shadow: inset 18px 0 28px rgba(25,50,64,.10), -8px 0 20px rgba(25,43,54,.15); }
.notebook-leaf-back { transform: rotateY(180deg); border-radius: 28px 4px 4px 28px; box-shadow: inset -18px 0 28px rgba(25,50,64,.10), 8px 0 20px rgba(25,43,54,.15); }
.notebook-leaf.is-turning-next { visibility: visible; animation: nb-page-next .82s cubic-bezier(.58,.01,.22,1) forwards; }
.notebook-leaf.is-turning-prev { left: 0; transform-origin: right center; visibility: visible; animation: nb-page-prev .82s cubic-bezier(.58,.01,.22,1) forwards; }
@keyframes nb-page-next { 0% { transform: rotateY(0); } 45% { filter: brightness(.92); } 100% { transform: rotateY(-180deg); } }
@keyframes nb-page-prev { 0% { transform: rotateY(0); } 100% { transform: rotateY(180deg); } }
.notebook-arrow { position: absolute; z-index: 12; bottom: 24px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--nb-navy); color: #fff; font-size: 35px; line-height: 1; box-shadow: 0 8px 18px rgba(3,43,62,.28); cursor: pointer; transition: transform .2s ease, background .2s ease; }
.notebook-arrow:hover { transform: scale(1.08); background: var(--nb-orange); }
.notebook-arrow.is-prev { left: 23px; }
.notebook-arrow.is-next { right: 23px; }
.notebook-controls { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 10px; color: #fff; }
.notebook-controls p { margin: 0; font-family: "Segoe Print", "Comic Sans MS", cursive; font-size: 15px; }
.notebook-controls [role="tablist"] { display: flex; gap: 8px; }
.notebook-controls button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.48); cursor: pointer; }
.notebook-controls button.is-active { width: 28px; border-radius: 999px; background: var(--nb-yellow); }

/* Homepage sections */
.notebook-paths { position: relative; z-index: 4; display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 38px; padding: 14px; gap: 12px; border: 1px solid var(--nb-line); border-radius: 18px; background: #fff; box-shadow: var(--nb-shadow); }
.notebook-paths a { display: flex; align-items: center; gap: 17px; min-height: 92px; padding: 16px 22px; border-radius: 13px; color: var(--nb-navy); text-decoration: none; transition: transform .2s ease, background .2s ease; }
.notebook-paths a:first-child, .notebook-paths a:hover { background: var(--nb-yellow); transform: translateY(-2px); }
.notebook-paths b { display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid currentColor; border-radius: 50%; font-size: 21px; }
.notebook-paths span { display: grid; gap: 4px; }
.notebook-paths strong { font-size: 19px; }
.notebook-paths small { color: #657984; }
.notebook-gallery { min-height: min(680px, 86svh); display: grid; grid-template-columns: .84fr 1.7fr; gap: 48px; align-items: center; padding-block: clamp(52px, 7vh, 82px); }
.notebook-intro { display: flex; align-self: stretch; justify-content: center; flex-direction: column; }
.notebook-intro h2, .notebook-language-head h2, .notebook-ped-copy h2, .notebook-section-head h2, .notebook-join h2 { margin: 0 0 18px; font-size: clamp(38px, 4vw, 58px); line-height: 1.05; }
.notebook-intro > p:last-child, .notebook-language-head > p:last-child, .notebook-ped-copy > p { color: #5f737e; font-size: 16px; line-height: 1.78; }
.notebook-polaroids { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: center; }
.notebook-polaroids figure { margin: 0; padding: 10px 10px 18px; background: #fff; box-shadow: 0 13px 30px rgba(29,55,68,.14); transform: rotate(-2deg); }
.notebook-polaroids figure:nth-child(even) { transform: rotate(2deg) translateY(15px); }
.notebook-polaroids img { display: block; width: 100%; height: clamp(150px, 18vw, 230px); object-fit: cover; }
.notebook-polaroids figcaption { padding-top: 11px; color: var(--nb-navy); font-family: "Segoe Print", "Comic Sans MS", cursive; font-weight: 800; text-align: center; }
.notebook-languages { padding: 95px 0; background-color: var(--nb-blue); background-image: repeating-linear-gradient(0deg, transparent 0 39px, rgba(30,106,151,.09) 39px 40px); }
.notebook-language-head { max-width: 800px; margin-bottom: 44px; }
.notebook-language-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.notebook-language-grid article { position: relative; padding: 30px; border: 1px solid rgba(26,91,127,.12); border-radius: 3px; background: rgba(255,255,255,.91); box-shadow: 0 15px 35px rgba(31,77,101,.11); }
.notebook-language-grid article::before { content: ""; position: absolute; top: -8px; left: 50%; width: 72px; height: 22px; background: rgba(231, 205, 154, .62); transform: translateX(-50%) rotate(-2deg); }
.notebook-language-grid b { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--nb-yellow); color: var(--nb-navy); font-size: 27px; }
.notebook-language-grid h3 { margin: 17px 0 8px; font-size: 27px; }
.notebook-language-grid p { margin: 0; color: #607783; }
.notebook-pedagogy { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; padding-block: 105px; }
.notebook-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.notebook-notes article { min-height: 145px; padding: 26px; background-color: #fffdfa; background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(41,105,145,.07) 31px 32px); box-shadow: 0 13px 32px rgba(25,56,71,.11); transform: rotate(-1deg); }
.notebook-notes article:nth-child(even) { transform: rotate(1.2deg) translateY(12px); }
.notebook-notes b { color: var(--nb-yellow); font-size: 26px; }
.notebook-notes h3 { margin: 18px 0 0; font-family: "Segoe Print", "Comic Sans MS", cursive; font-size: 20px; }
.notebook-news { padding: 95px 0; background: #faf6ee; }
.notebook-section-head { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 36px; }
.notebook-section-head > a, .notebook-news-grid article > a { color: var(--nb-navy); font-weight: 900; text-decoration: none; }
.notebook-news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.notebook-news-grid article { padding: 14px 14px 24px; background: #fff; box-shadow: 0 14px 35px rgba(31,55,66,.10); }
.notebook-news-photo { display: block; overflow: hidden; }
.notebook-news-grid img { width: 100%; aspect-ratio: 1.55; object-fit: cover; transition: transform .4s ease; }
.notebook-news-grid article:hover img { transform: scale(1.04); }
.notebook-news-grid time { display: block; margin: 15px 4px 7px; color: #7a8c95; font-size: 12px; }
.notebook-news-grid h3 { margin: 0 4px 14px; font-size: 24px; }
.notebook-news-grid h3 a { color: inherit; text-decoration: none; }
.notebook-news-grid article > a:last-child { margin-inline: 4px; color: var(--nb-orange); font-size: 13px; }
.notebook-join { padding: 82px 0; background: var(--nb-navy); color: #fff; }
.notebook-join-grid { display: grid; grid-template-columns: 1fr 370px; gap: 80px; align-items: center; }
.notebook-join h2 { color: #fff; }
.notebook-join p { max-width: 700px; color: rgba(255,255,255,.75); font-size: 17px; line-height: 1.8; }
.notebook-join div > div { display: flex; align-items: center; gap: 22px; }
.notebook-link { color: #fff; font-weight: 800; text-decoration: none; }
.notebook-join aside { padding: 26px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); }
.notebook-join aside > strong { display: block; margin-bottom: 15px; color: var(--nb-yellow); }
.notebook-join aside p { display: flex; justify-content: space-between; margin: 9px 0; font-size: 14px; }
.notebook-join aside b { color: #fff; }

/* Delay off-screen rendering without changing document dimensions. */
.notebook-gallery,
.notebook-languages,
.notebook-pedagogy,
.notebook-news,
.notebook-join {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}
.notebook-leaf.is-turning-next,
.notebook-leaf.is-turning-prev { will-change: transform; }

html[lang^="fr"] .notebook-home, html[lang^="en"] .notebook-home { direction: ltr; }
html[lang^="ar"] .notebook-home { direction: rtl; }

@media (max-width: 960px) {
  .notebook-book { height: clamp(430px, calc(100svh - 170px), 540px); }
  .notebook-copy-page { padding: 48px; }
  .notebook-copy-page h1, .notebook-copy-page h2 { font-size: 48px; }
  .notebook-gallery, .notebook-pedagogy { grid-template-columns: 1fr; }
  .notebook-polaroids { grid-template-columns: repeat(4, 1fr); }
  .notebook-join-grid { grid-template-columns: 1fr 320px; gap: 38px; }
}

@media (max-width: 720px) {
  .notebook-shell { width: min(100% - 30px, 1240px); }
  .notebook-hero-section { padding: 10px 10px 12px; }
  .notebook-book { height: clamp(420px, calc(100svh - 145px), 610px); min-height: 0; }
  .notebook-slide { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .notebook-page { min-height: 0; }
  .notebook-page:first-child { border-radius: 22px 22px 4px 4px; box-shadow: inset 0 -12px 22px rgba(25,50,64,.08); }
  .notebook-page:nth-child(2) { border-radius: 4px 4px 22px 22px; box-shadow: inset 0 12px 22px rgba(25,50,64,.08); }
  .notebook-copy-page { min-height: 0; padding: clamp(16px, 3.2vh, 24px) 26px; }
  .notebook-copy-page h1, .notebook-copy-page h2 { margin-bottom: 9px; font-size: clamp(27px, 7.9vw, 36px); line-height: .98; }
  .notebook-copy-page > p:not(.notebook-kicker) { margin-bottom: 11px; font-size: 12px; line-height: 1.42; }
  .notebook-copy-page .notebook-button { padding: 10px 16px; font-size: 12px; }
  .notebook-kicker { margin-bottom: 5px; font-size: 9px; }
  .notebook-photo-page { min-height: 0; padding: 15px 22px; }
  .notebook-photo-page > img { max-height: 100%; border-width: 7px; }
  .notebook-spine { inset-inline: 18px; top: calc(50% - 7px); left: auto; width: auto; height: 14px; background: linear-gradient(0deg, rgba(12,35,48,.16), rgba(255,255,255,.72), rgba(12,35,48,.19)); }
  .notebook-leaf { top: 50%; left: 0; width: 100%; height: 50%; transform-origin: top center; }
  .notebook-leaf.is-turning-prev { top: 0; left: 0; transform-origin: bottom center; }
  @keyframes nb-page-next { to { transform: rotateX(180deg); } }
  @keyframes nb-page-prev { to { transform: rotateX(-180deg); } }
  .notebook-doodle, .notebook-note { display: none; }
  .notebook-arrow { bottom: 15px; width: 42px; height: 42px; }
  .notebook-paths, .notebook-language-grid, .notebook-news-grid, .notebook-join-grid { grid-template-columns: 1fr; }
  .notebook-paths { margin-top: 24px; }
  .notebook-gallery, .notebook-pedagogy, .notebook-languages, .notebook-news { min-height: 0; padding-block: 46px; }
  .notebook-polaroids { grid-template-columns: 1fr 1fr; }
  .notebook-polaroids img { height: clamp(92px, 27vw, 130px); }
  .notebook-notes { gap: 13px; }
  .notebook-notes article { padding: 18px; }
  .notebook-section-head { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .notebook-leaf { display: none !important; }
  .notebook-button, .notebook-arrow, .notebook-news-grid img, .notebook-polaroids figure { transition: none !important; transform: none !important; }
}
