/* English (/learn-english) — the English mini site: built like the
   road-safety site (road-safety.css), with its own English look: a violet
   page with letters of the ABC falling slowly, a line of an English
   notebook between the parts, the title "English" in the Pleyi home title's
   letters with toy ABC blocks beside it (english-site.js). The lessons,
   exercises and games use the English page's styles (english-learning.css,
   english-games.css). */

:root {
  --es-bg: #9f8cff;
  --es-deep: #2d2366;
  --es-paper: #fff8e7;
  --es-line-blue: #7fa6e8;
  --es-line-red: #ff5a6e;
  --es-tint: #eaf5ff;
  --es-ink: #000;
  --es-shadow: 6px 7px 0 0 var(--es-ink);
  --es-bar-h: 64px;
}

html:has(body.page-eng-site) {
  background: var(--es-bg);
  scroll-padding-top: 12px;
}

body.page-eng-site {
  position: relative;
  min-height: 100vh;
  background: var(--es-bg);
}

/* styles.css gives every section 80px top and bottom. */
body.page-eng-site section.es-hero,
body.page-eng-site section.es-section {
  padding: 0;
  scroll-margin-top: 12px;
}

body.page-eng-site main section {
  background: transparent;
}

/* The page sits over the falling letters. */
body.page-eng-site main,
body.page-eng-site footer {
  position: relative;
  z-index: 1;
}

/* ── The background: letters of the ABC falling slowly (english-site.js).
   !important: clean-site.css makes every child of body position:relative
   with z-index 1. ── */

.es-ambient {
  position: fixed !important;
  inset: 0;
  z-index: 0 !important;
  overflow: hidden;
  pointer-events: none;
  direction: ltr;
  background: var(--es-bg);
}

.es-amb-letter {
  position: absolute;
  top: -10vh;
  font-family: "Fredoka", var(--font-sans);
  font-size: var(--l-size, 30px);
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  animation: es-amb-fall linear infinite;
}

/* The Pleyi site's layered waves down both sides (ambient-bg.js), in the
   page's violet. */
.es-amb-side {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(72px, 11vw, 148px);
}

.es-amb-side--left { left: 0; }
.es-amb-side--right { right: 0; }

.es-amb-side svg {
  display: block;
  width: 100%;
  height: 100%;
}

.es-amb-side--right svg {
  transform: scaleX(-1);
}

@media (max-width: 720px) {
  .es-amb-side {
    width: clamp(48px, 14vw, 72px);
    opacity: 0.85;
  }
}

@keyframes es-amb-fall {
  0% {
    transform: translate3d(0, -10vh, 0) rotate(0deg);
    opacity: 0;
  }
  6% {
    opacity: var(--l-opacity, 0.5);
  }
  92% {
    opacity: var(--l-opacity, 0.5);
  }
  100% {
    transform: translate3d(var(--drift, 0px), 115vh, 0) rotate(var(--l-turn, 0deg));
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .es-amb-letter {
    animation: none;
    opacity: var(--l-opacity, 0.4);
  }
}

/* The exercise screens have their own page (english-learning.css). */
html.eng-runner-open .es-ambient {
  display: none;
}

html.eng-soft body.page-eng-site {
  background: transparent;
}

/* ── Top bar: no strip, only the buttons over the page, as on the Pleyi
   site — the four pages as separate white pills (the open page yellow),
   sign-in, and on phones the menu button. ── */

.es-bar {
  position: relative !important;
  z-index: 60 !important;
  background: transparent;
  padding-top: env(safe-area-inset-top, 0px);
}

.es-bar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: var(--es-bar-h);
  padding-block: 8px 13px;
}

.es-bar .eng-bar-back {
  grid-column: 1;
  justify-self: start;
}

.es-bar .eng-bar-back:empty {
  display: none;
}

/* No arrow on the home page. On the other pages it leads home, and from a
   topic up to the exercises (english-site.js). */
html[data-es-page="home"] .es-bar .eng-bar-back {
  display: none;
}

.es-bar .eng-back {
  width: 42px;
  height: 42px;
  box-shadow: 3px 3px 0 0 var(--es-ink);
}

.es-tabs {
  grid-column: 2;
  display: flex;
  gap: 8px;
}

.es-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: clamp(15px, 1.75vw, 18px);
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: var(--shadow-sticker);
  transition: transform 0.15s ease, background 0.15s ease;
}

.es-tab:hover {
  background: var(--memyellow);
  color: var(--ink);
  transform: scale(1.04);
}

.es-tab[aria-current="page"] {
  background: var(--memyellow);
}

.es-bar-end {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.es-login {
  padding: 8px 18px;
  border: 3px solid var(--es-ink);
  border-radius: 999px;
  background: var(--es-tint);
  color: #000;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 0 var(--es-ink);
  transition: transform 0.12s ease;
}

.es-login:hover {
  transform: translateY(-2px);
}

.es-bar .nav-user-avatar {
  width: 44px;
  height: 44px;
}

/* ── Phone menu: the yellow button opens the parts full screen, on a page
   of an English notebook (the four writing lines, a red margin) ── */

.es-bar .es-menu-toggle {
  display: none;
  padding: 9px 10px;
  border-width: 3px;
  border-radius: 12px;
  box-shadow: 3px 3px 0 0 var(--es-ink);
}

.es-menu-toggle span {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.es-menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.es-menu-toggle.open span:nth-child(2) { opacity: 0; }
.es-menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.es-menu {
  position: fixed !important;
  inset: 0;
  z-index: 59 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: calc(env(safe-area-inset-top, 0px) + 88px) 34px calc(32px + env(safe-area-inset-bottom, 0px));
  background:
    linear-gradient(var(--es-line-red), var(--es-line-red)) right 22px top 0 / 3px 100% no-repeat,
    repeating-linear-gradient(transparent 0 38px, var(--es-line-blue) 38px 40px),
    var(--es-paper);
  background-attachment: fixed;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.es-menu.open {
  opacity: 1;
  visibility: visible;
}

html.es-menu-open {
  overflow: hidden;
}

html.es-menu-open .es-bar .nav-user {
  visibility: hidden;
}

/* Each button a colored sticker, in turn. */
.es-menu-link,
.es-menu .mobile-nav-auth,
.es-menu a {
  display: block;
  flex-shrink: 0;
  width: 100%;
  max-width: 300px;
  padding: 13px 14px;
  border: 3px solid var(--es-ink);
  border-radius: 14px;
  background: #ffe873;
  color: #000;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 5px 0 0 var(--es-ink);
}

.es-menu > :nth-child(5n + 2) { background: #9ff0b5; }
.es-menu > :nth-child(5n + 3) { background: #a9d8ff; }
.es-menu > :nth-child(5n + 4) { background: #ffb8d2; }
.es-menu > :nth-child(5n + 5) { background: #dcc9ff; }

.es-menu-link:active,
.es-menu .mobile-nav-auth:active,
.es-menu a:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 2px 0 0 var(--es-ink);
}

.es-menu #mobileLogoutBtn {
  display: none;
}

.es-menu .es-menu-link--home,
.es-menu .mobile-nav-auth,
.es-menu a[href="/my-room"] {
  font-size: 1rem;
  background: var(--es-tint);
}

body.page-eng-site .es-menu .mobile-nav-auth {
  min-height: 0;
  padding: 13px 14px;
  font-size: 1rem;
}

.es-menu .mobile-nav-auth.hidden {
  display: none;
}

/* ── Home: the title with the ABC blocks beside it, and under them two
   lines and the button to the lessons library ── */

.es-hero {
  overflow-x: clip;
  overflow-y: visible;
}

/* --es-title-size sizes the title and the blocks together, by the screen's
   width and height, so the hero and the line under it fit on the first
   screen. */
.es-hero-inner {
  --es-title-size: clamp(5rem, min(12.5vw, (100svh - 420px) / 1.9), 10.5rem);
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "title art";
  justify-content: center;
  align-items: end;
  gap: calc(var(--es-title-size) * 0.18);
  padding-block: clamp(8px, 1.4vw, 16px) clamp(14px, 1.8vw, 20px);
  text-align: center;
}

.es-hero-text {
  padding-block: clamp(12px, 1.6vw, 18px) clamp(28px, 3vw, 40px);
  text-align: center;
}

/* No outline on the heading itself (styles.css outlines cartoon headings):
   the letters carry their own. */
.es-title {
  -webkit-text-stroke: 0 !important;
  paint-order: normal !important;
  text-shadow: none !important;
}

/* The Latin letters of the Pleyi logo's "comic" look (clean-site.css has
   the Hebrew ones). */
@font-face {
  font-family: "Rubik Doodle Shadow";
  src: url("/fonts/RubikDoodleShadow-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0020-007E;
}

.es-title {
  grid-area: title;
  margin: 0.6em 0 0;
  font-family: "Rubik", var(--font-sans);
  font-size: var(--es-title-size);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #000;
  cursor: default;
}

.es-word {
  display: block;
  position: relative;
  width: fit-content;
  margin-inline: auto;
  white-space: nowrap;
}

/* The Pleyi logo's "comic" look (clean-site.css [data-logo-style="comic"]):
   colored Rubik letters under a hand-drawn outline with a hatched shadow.
   They fall in one by one, land with a squash and then sway. */
.es-ch {
  display: inline-block;
  position: relative;
  color: var(--ch-color);
  -webkit-text-fill-color: var(--ch-color);
  -webkit-text-stroke: 0 !important;
  animation:
    es-ch-bounce 2.6s ease-in-out calc(var(--ch-delay, 0s) + 1.6s) infinite,
    es-ch-drop 0.95s linear calc(var(--ch-delay, 0s) * 0.6) backwards;
}

.es-ch::after {
  content: attr(data-ch);
  position: absolute;
  inset: 0;
  font-family: "Rubik Doodle Shadow";
  font-weight: 400;
  color: var(--es-ink);
  -webkit-text-fill-color: var(--es-ink);
  -webkit-text-stroke: 0;
}

@keyframes es-ch-drop {
  0% {
    translate: 0 -130%;
    scale: 0.9 1.15;
    opacity: 0;
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  20% { opacity: 1; }
  50% {
    translate: 0 0;
    scale: 0.9 1.15;
    animation-timing-function: ease-out;
  }
  64% {
    translate: 0 12%;
    scale: 1.28 0.76;
    animation-timing-function: ease-in-out;
  }
  80% {
    translate: 0 -9%;
    scale: 0.94 1.08;
    animation-timing-function: ease-in-out;
  }
  92% {
    translate: 0 2%;
    scale: 1.04 0.97;
  }
  100% {
    translate: 0 0;
    scale: 1 1;
    opacity: 1;
  }
}

@keyframes es-ch-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(clamp(-4px, -0.8vw, -10px)) scale(1.07); }
}

@media (prefers-reduced-motion: reduce) {
  .es-ch {
    animation: none;
  }
}

/* As the Pleyi home's "לומדים במשחקים!": light letters in a thick ink
   outline, the key words yellow. */
.es-hero-line {
  margin: 0;
  font-size: clamp(1.6rem, 4.4vw, 2.5rem);
  line-height: 1.25;
  color: var(--text-soft-turquoise, #f0fffd);
  -webkit-text-fill-color: var(--text-soft-turquoise, #f0fffd);
  -webkit-text-stroke: min(0.3em, 24px) var(--es-ink);
  paint-order: stroke fill;
  text-shadow: none;
  letter-spacing: 0;
  text-wrap: balance;
}

.es-hero-accent {
  color: var(--memyellow);
  -webkit-text-fill-color: var(--memyellow);
}

.es-hero-actions {
  margin-top: clamp(16px, 2.4vw, 24px);
}

.es-hero-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 20px 42px;
  border-width: 5px;
  font-size: clamp(30px, 4.2vw, 46px);
  white-space: nowrap;
  text-decoration: none;
}

/* The ABC blocks — in the title's look, the hatched shadow drawn in the
   SVG (it spills out of it to the bottom left) — about as tall as one and
   a half letters, standing on the title's line. */
.es-hero-art {
  grid-area: art;
  align-self: end;
  margin-bottom: calc(var(--es-title-size) * 0.02);
}

.es-blocks {
  display: block;
  height: calc(var(--es-title-size) * 1.45);
  width: auto;
  overflow: visible;
}

.es-block {
  cursor: pointer;
  transform-box: view-box;
  -webkit-tap-highlight-color: transparent;
}

/* The letter as the title's: a colored Rubik letter under the hand-drawn
   outline of Rubik Doodle Shadow. */
.es-block text {
  font-size: 66px;
  text-anchor: middle;
  dominant-baseline: central;
}

.es-block-fill {
  font-family: "Rubik", var(--font-sans);
  font-weight: 700;
}

.es-block-ink {
  font-family: "Rubik Doodle Shadow";
  font-weight: 400;
  fill: var(--es-ink);
}

/* ── The mascot: the Pleyi fox, standing on the title's first letter ──
   The letter's top (its outline) is 0.135em under the word's top (Rubik's
   capitals, line-height 1): the fox's feet rest right on it. It sways with
   the letter (es-buddy-ride = es-ch-bounce's rise, plus what the letter's
   1.07 scale lifts its top), timed with it by english-site.js. */

.es-buddy {
  position: absolute;
  left: -0.08em;
  bottom: calc(100% - 0.135em);
  width: clamp(56px, 0.8em, 110px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: es-buddy-ride 2.6s ease-in-out 1.6s infinite;
}

@keyframes es-buddy-ride {
  0%, 100% { transform: none; }
  50% { transform: translateY(calc(clamp(-4px, -0.8vw, -10px) - 0.025em)); }
}

.es-buddy-fig {
  display: block;
  transform-origin: 50% 100%;
  filter: drop-shadow(2px 3px 0 var(--es-ink));
  /* Lands once the letters have come in. */
  animation: es-buddy-land 0.8s linear 1.1s backwards;
}

.es-buddy.is-landed:not(.is-hop) .es-buddy-fig {
  animation: none;
}

.es-buddy.is-hop .es-buddy-fig {
  animation: es-buddy-hop 0.7s ease-in-out;
}

@keyframes es-buddy-hop {
  0%, 100% { transform: none; }
  15% { transform: scale(1.12, 0.86); }
  45% { transform: translateY(-22%) scale(0.94, 1.08); }
  75% { transform: scale(1.1, 0.9); }
}

@keyframes es-buddy-land {
  0% {
    translate: 0 -160%;
    opacity: 0;
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  20% { opacity: 1; }
  55% {
    translate: 0 0;
    scale: 1;
    animation-timing-function: ease-out;
  }
  70% { scale: 1.16 0.84; }
  86% { scale: 0.95 1.06; }
  100% {
    translate: 0 0;
    scale: 1;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .es-buddy,
  .es-buddy-fig {
    animation: none !important;
  }
}

/* ── מי אנחנו: a few lines right on the page (no card), and under them the
   demo of the site (about-demo.js, as on the Pleyi home page) ── */

.es-about-lead {
  max-width: 680px;
  margin: 0 auto clamp(20px, 4vw, 28px);
  text-align: center;
}

.es-about-lead p {
  margin: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 800;
  line-height: 1.5;
  color: #000;
  text-wrap: balance;
}

/* The demo: plain drawn screens, no browser bar, on a drawn monitor (a
   phone on phones), as on the road-safety site. Sizes are in cqw (% of the
   screen's width), so they follow the screen. */
.es-about .about-demo-scene {
  isolation: isolate;
}

.es-demo {
  --es-bezel: clamp(10px, 2.2vw, 14px);
  --es-chin: clamp(26px, 5.4vw, 38px);
  overflow: visible;
  padding: var(--es-bezel) var(--es-bezel) var(--es-chin);
  border-radius: 22px;
  background: #2a2e33;
  box-shadow: var(--es-shadow);
}

.es-demo::before {
  content: "";
  position: absolute;
  top: calc(var(--es-bezel) / 2 - 3.5px);
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #10161b;
  box-shadow: 0 0 0 2px #5d6a76;
}

.es-demo::after {
  content: "";
  position: absolute;
  bottom: calc(var(--es-chin) / 2 - 4px);
  right: calc(var(--es-bezel) + 6px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 2px #10161b, 0 0 8px 1px rgba(46, 204, 113, 0.7);
}

.es-demo .about-demo-screen {
  container-type: inline-size;
  border-radius: 8px;
  background: var(--es-tint);
  box-shadow: 0 0 0 3px var(--es-ink);
}

.es-demo .about-demo-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.55) 0 7%, transparent 7.2% 9.6%, rgba(255, 255, 255, 0.4) 9.8% 11.6%, transparent 11.8%);
  pointer-events: none;
}

.es-monitor-stand {
  position: relative;
  z-index: -1;
  margin-top: -6px;
}

.es-monitor-stand svg {
  display: block;
  width: 100%;
  height: auto;
}

.es-demo .es-demo-touch {
  display: none;
}

.es-demo-shot {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3cqw;
  padding: 0 5cqw;
  background: var(--es-tint);
  color: #000;
  text-align: center;
  line-height: 1.3;
}

.es-demo-shot p {
  margin: 0;
}

.es-demo-shot mark {
  padding: 0 0.18em;
  border-radius: 0.25em;
  background: color-mix(in srgb, var(--memteal) 45%, #fff);
  color: #000;
}

.es-demo-tiles {
  display: flex;
  gap: 3.4cqw;
}

.es-demo-tile {
  display: grid;
  place-items: center;
  width: 23cqw;
  aspect-ratio: 1;
  padding: 2cqw;
  border: 0.7cqw solid var(--es-ink);
  border-radius: 3cqw;
  box-shadow: 1cqw 1.2cqw 0 var(--es-ink);
  font-size: 4cqw;
  font-weight: 900;
}

.es-demo-tile--teal { background: #00e0c6; }
.es-demo-tile--yellow { background: #ffd23f; }
.es-demo-tile--lilac { background: #dcc9ff; }

.es-demo-title {
  font-size: 5.6cqw;
  font-weight: 900;
}

.es-demo-examples {
  display: grid;
  gap: 2cqw;
  width: 62cqw;
}

/* An example card: the English line and its Hebrew under it. */
.es-demo-ex {
  display: grid;
  gap: 0.4cqw;
  padding: 1.6cqw 2cqw;
  border: 0.5cqw solid var(--es-ink);
  border-radius: 1.8cqw;
  background: #fff3c4;
  box-shadow: 0.5cqw 0.6cqw 0 var(--es-ink);
}

.es-demo-ex [lang="en"] {
  font-size: 4.6cqw;
  font-weight: 800;
}

.es-demo-ex b {
  padding: 0 0.15em;
  border-radius: 0.2em;
  background: color-mix(in srgb, var(--memteal) 45%, #fff);
}

.es-demo-he {
  font-size: 3.4cqw;
  font-weight: 700;
}

/* I → am, He → is, We → are */
.es-demo-table {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 1.4cqw 3cqw;
  font-size: 5cqw;
  font-weight: 900;
}

.es-demo-table span {
  text-align: end;
}

.es-demo-table i {
  display: block;
  width: 7cqw;
  height: 0.8cqw;
  border-radius: 1cqw;
  background: var(--es-ink);
  position: relative;
}

.es-demo-table i::after {
  content: "";
  position: absolute;
  right: -0.4cqw;
  top: 50%;
  width: 2.2cqw;
  height: 2.2cqw;
  border-top: 0.8cqw solid var(--es-ink);
  border-right: 0.8cqw solid var(--es-ink);
  transform: translateY(-50%) rotate(45deg);
}

.es-demo-table b {
  padding: 0.3cqw 1.6cqw;
  border: 0.5cqw solid var(--es-ink);
  border-radius: 1.6cqw;
  background: #ffd23f;
  text-align: start;
}

.es-demo-next {
  position: absolute;
  bottom: 4cqw;
  left: 4cqw;
  display: flex;
  align-items: center;
  gap: 1cqw;
  padding: 1cqw 2.4cqw;
  border: 0.6cqw solid var(--es-ink);
  border-radius: 2.2cqw;
  background: #00e0c6;
  box-shadow: 0.6cqw 0.7cqw 0 var(--es-ink);
  font-size: 3.6cqw;
  font-weight: 900;
}

.es-demo-next svg {
  width: 1em;
  height: 1em;
}

/* The word game: a picture and three words. */
.es-demo-pic {
  width: 20cqw;
  height: 20cqw;
  border: 0.7cqw solid var(--es-ink);
  border-radius: 3cqw;
  background: #fff3c4;
  box-shadow: 1cqw 1.2cqw 0 var(--es-ink);
}

.es-demo-choices {
  display: flex;
  gap: 3cqw;
}

.es-demo-btn {
  display: grid;
  place-items: center;
  width: 17cqw;
  padding: 1.6cqw 0;
  border: 0.6cqw solid var(--es-ink);
  border-radius: 2.2cqw;
  background: #dcc9ff;
  box-shadow: 0.7cqw 0.9cqw 0 var(--es-ink);
  font-size: 4.4cqw;
  font-weight: 900;
  transition: background-color 0.25s ease, opacity 0.25s ease;
}

.es-demo-q {
  font-size: 5.6cqw;
  font-weight: 800;
}

.es-demo-options {
  display: flex;
  gap: 2.4cqw;
}

.es-demo-opt {
  width: 15cqw;
  padding: 1.2cqw 0;
  border: 0.5cqw solid var(--es-ink);
  border-radius: 1.8cqw;
  background: #ddf6f1;
  box-shadow: 0.5cqw 0.6cqw 0 var(--es-ink);
  font-size: 4.4cqw;
  font-weight: 800;
  transition: background-color 0.25s ease, opacity 0.25s ease;
}

/* The answer comes out right: the clicked one turns green, the rest fade. */
.es-demo-yes {
  font-size: 3.6cqw;
  font-weight: 900;
  color: #14833f;
  visibility: hidden;
}

.es-demo-shot.is-done .es-demo-yes {
  visibility: visible;
  animation: es-demo-pop 0.35s ease-out;
}

.es-demo-shot.is-done :is(.es-demo-btn--right, .es-demo-opt--right) {
  background: #2ecc71;
}

.es-demo-shot.is-done :is(.es-demo-btn:not(.es-demo-btn--right), .es-demo-opt:not(.es-demo-opt--right)) {
  opacity: 0.4;
}

@keyframes es-demo-pop {
  0% { transform: scale(0.6); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Phones: the demo plays on a drawn phone, each screen top to bottom, and a
   fingertip taps instead of the arrow. */
@media (max-width: 640px) {
  .es-about .about-demo-scene {
    width: min(240px, 68%);
  }

  .es-demo {
    --es-bezel: 9px;
    padding: var(--es-bezel);
    border-radius: 40px;
  }

  .es-demo::before,
  .es-demo::after {
    top: 22%;
    bottom: auto;
    z-index: -1;
    width: 12px;
    height: 13%;
    margin: 0;
    border: 3px solid var(--es-ink);
    border-radius: 5px;
    background: #2a2e33;
    box-shadow: none;
  }

  .es-demo::before {
    left: -13px;
  }

  .es-demo::after {
    top: 27%;
    right: -13px;
    height: 10%;
  }

  .es-demo .about-demo-screen {
    aspect-ratio: 9 / 17;
    border-radius: 31px;
  }

  .es-demo .about-demo-screen::after {
    inset: 4cqw auto auto 50%;
    width: 28cqw;
    height: 8cqw;
    border-radius: 999px;
    background: #10161b;
    translate: -50% 0;
  }

  .es-monitor-stand {
    display: none;
  }

  .es-demo .about-demo-cursor {
    width: 30px;
    margin: 0;
    translate: -50% -50%;
  }

  .es-demo .es-demo-arrow {
    display: none;
  }

  .es-demo .es-demo-touch {
    display: inline;
  }

  .es-demo-shot {
    gap: 5cqw;
    padding: 0 7cqw;
  }

  .es-demo-tiles {
    flex-direction: column;
    gap: 4.5cqw;
  }

  .es-demo-tile {
    width: 66cqw;
    aspect-ratio: auto;
    padding: 5.5cqw 3cqw;
    border-width: 1.1cqw;
    border-radius: 4cqw;
    box-shadow: 1.4cqw 1.6cqw 0 var(--es-ink);
    font-size: 7.4cqw;
  }

  .es-demo-title {
    font-size: 9cqw;
  }

  .es-demo-examples {
    gap: 4cqw;
    width: 86cqw;
  }

  .es-demo-ex {
    padding: 3cqw;
    border-width: 1cqw;
    border-radius: 3.2cqw;
    box-shadow: 1cqw 1.2cqw 0 var(--es-ink);
  }

  .es-demo-ex [lang="en"] {
    font-size: 8cqw;
  }

  .es-demo-he {
    font-size: 6.2cqw;
  }

  .es-demo-table {
    gap: 3cqw 5cqw;
    font-size: 9cqw;
  }

  .es-demo-table i {
    width: 12cqw;
    height: 1.4cqw;
  }

  .es-demo-table i::after {
    width: 4cqw;
    height: 4cqw;
    border-width: 1.4cqw;
  }

  .es-demo-table b {
    border-width: 1cqw;
    border-radius: 3cqw;
    padding: 0.6cqw 3cqw;
  }

  .es-demo-next {
    bottom: 7cqw;
    left: 50%;
    gap: 1.6cqw;
    padding: 2.2cqw 6cqw;
    border-width: 1cqw;
    border-radius: 3.6cqw;
    box-shadow: 1cqw 1.2cqw 0 var(--es-ink);
    font-size: 6.6cqw;
    translate: -50% 0;
  }

  .es-demo-pic {
    width: 44cqw;
    height: 44cqw;
    border-width: 1.1cqw;
    border-radius: 5cqw;
    box-shadow: 1.4cqw 1.6cqw 0 var(--es-ink);
  }

  .es-demo-choices,
  .es-demo-options {
    flex-direction: column;
    gap: 3.4cqw;
  }

  .es-demo-btn,
  .es-demo-opt {
    width: 60cqw;
    padding: 2.6cqw 0;
    border-width: 1cqw;
    border-radius: 3.4cqw;
    box-shadow: 1cqw 1.2cqw 0 var(--es-ink);
    font-size: 7.4cqw;
  }

  .es-demo-q {
    font-size: 9cqw;
  }

  .es-demo-yes {
    font-size: 7cqw;
  }
}

/* ── צור קשר: the Pleyi home page's two buttons (clean-site.css) ── */

.es-contact .clean-contact {
  max-width: 720px;
}

/* ── Sections and headings ── */

.es-section {
  padding-block: clamp(32px, 6vw, 56px) !important;
}

.es-heading {
  margin: 0 0 clamp(18px, 3vw, 28px);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 900;
  text-align: center;
  color: #000;
}

/* The pages' titles: the Pleyi pages' big yellow title with the thick ink
   outline (styles.css .hero-title). */
.es-heading.es-page-title,
.es-heading.es-section-title {
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 1.1;
  color: var(--memyellow);
  -webkit-text-fill-color: var(--memyellow);
  paint-order: stroke fill;
  -webkit-text-stroke: min(0.3em, 24px) var(--ink);
  text-shadow: none;
  letter-spacing: 0;
}

.es-heading.es-section-title {
  font-size: clamp(2.35rem, 6.8vw, 3.75rem);
}

.es-toc-lesson {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

/* The reading lesson in the table of contents: a row like a stage's, with
   no number, that opens the lesson. */
.es-toc-reading {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 900;
  text-align: start;
}

/* Each page shows its own parts: html[data-es-page] is home, lessons,
   games, practice, news, or engine (a topic, an exercise or a game, in
   #engMain). english-site.js and a script in the page's <head> set it. */
html:not([data-es-page="home"]) .es-page-home,
html:not([data-es-page="lessons"]) .es-page-lessons,
html:not([data-es-page="games"]) .es-page-games,
html:not([data-es-page="news"]) .es-page-news,
html[data-es-page="home"] #engMain,
html[data-es-page="lessons"] #engMain,
html[data-es-page="games"] #engMain,
html[data-es-page="news"] #engMain {
  display: none !important;
}

/* ── מה חדש ── */

.es-news-open {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.news-item.es-news-open {
  background: var(--es-paper);
}

.es-news-open .news-shot {
  cursor: inherit;
}

.es-news-open:hover .news-shot > *,
.es-news-open:focus-visible .news-shot > * {
  transform: rotate(-2deg) scale(1.04);
}

.es-news-open:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

/* A card with no screenshot: its drawing in the screenshot's frame. */
body.page-eng-site .news-shot--art {
  display: block;
}

body.page-eng-site .news-shot--art > * {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  padding: 12%;
  box-sizing: border-box;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #dcc9ff;
  box-shadow: var(--shadow-sticker);
  color: #000;
  transition: transform 0.2s ease;
}

.es-news-page {
  max-width: 760px;
}

.es-news-lead {
  margin: 0 auto clamp(24px, 4vw, 34px);
  text-align: center;
}

.es-news-lead p {
  margin: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  font-weight: 800;
  line-height: 1.5;
  color: #000;
}

.es-news-group + .es-news-group {
  margin-top: clamp(30px, 5vw, 44px);
}

.es-news-cards {
  display: grid;
  gap: clamp(16px, 2.5vw, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.es-news-card {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 24px);
  padding: clamp(16px, 3.5vw, 22px) clamp(16px, 4vw, 26px);
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--es-paper);
  box-shadow: var(--shadow-sticker);
  color: #000;
}

.es-news-actions {
  margin-top: 14px;
}

.es-news-card .es-news-go {
  padding: 9px 20px;
  border-width: 3px !important;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 4px 5px 0 0 var(--es-ink);
}

@media (max-width: 480px) {
  .es-news-card {
    flex-direction: column;
    gap: 14px;
  }

  .es-news-card .news-shot {
    order: -1;
    width: 104px;
  }
}

/* ── The lessons library: the English page's stage headings
   (english-learning.css) over the Pleyi library's cards (service-landing.css
   .svc-lesson-card, its sticker look extended to .page-eng-site) ── */

/* ── Games: the topic picker, then a card per game – its icon on a
   colored panel, the name and "לשחק" ── */

.es-topic-bar {
  margin-bottom: clamp(18px, 3vw, 26px);
}

.es-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: clamp(16px, 2.5vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.es-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 4px solid var(--es-ink);
  border-radius: 22px;
  background: var(--es-paper);
  box-shadow: var(--es-shadow);
  overflow: hidden;
}

.es-card-art {
  display: grid;
  place-items: center;
  height: 150px;
  padding: 10px;
  border-bottom: 4px solid var(--es-ink);
  background: var(--card-color, var(--es-tint));
  color: #000;
}

.es-card-art svg {
  display: block;
  width: 96px;
  height: 96px;
  transition: transform 0.2s ease;
}

.es-card:hover .es-card-art svg {
  transform: rotate(-6deg) scale(1.08);
}

.es-card-title {
  margin: 14px 12px 10px;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  color: #000;
}

.es-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  padding: 0 12px 16px;
}

.es-card-actions .es-open {
  padding: 10px 20px;
  font-size: 1.05rem;
  border-width: 3px !important;
  text-decoration: none;
  box-shadow: 4px 5px 0 0 var(--es-ink);
}

/* ── Footer ── */

.es-footer {
  padding: 16px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 4px solid var(--es-ink);
  background: var(--es-deep);
  color: #fff;
  text-align: center;
}

.es-footer-brand {
  margin: 0 0 4px;
  font-family: "Fredoka", var(--font-sans);
  font-size: 1.7rem;
  color: var(--memyellow);
  -webkit-text-fill-color: var(--memyellow);
  -webkit-text-stroke: 5px var(--es-ink);
  paint-order: stroke fill;
}

.es-footer-by {
  margin: 0 0 6px;
  font-weight: 800;
}

.es-footer a {
  color: var(--memyellow);
}

.es-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  font-size: 0.95rem;
}

/* The exercise screen is fixed, without the top bar or the footer. */
html.eng-runner-open .es-bar,
html.eng-runner-open .es-footer {
  display: none !important;
}

/* Dialog titles in plain black: styles.css outlines every .modal h2. */
body.page-eng-site .modal h2,
body.page-eng-site .modal h2 * {
  paint-order: normal;
  -webkit-text-stroke: 0;
  -webkit-text-fill-color: #000;
  color: #000;
  text-shadow: none;
}

/* ── Tablets and phones ── */

@media (max-width: 860px) {
  .es-bar-inner {
    gap: 10px;
    padding-block: 8px 10px;
  }

  /* The tabs and sign-in move into the phone menu. */
  .es-tabs,
  .es-bar .es-login {
    display: none;
  }

  .es-bar .es-menu-toggle {
    display: flex;
  }
}

@media (min-width: 861px) {
  .es-menu {
    display: none;
  }
}

@media (max-width: 640px) {
  .es-bar-inner {
    gap: 6px 8px;
    padding-block: 6px 9px;
  }

  .es-bar .eng-back {
    width: 38px;
    height: 38px;
  }

  .es-hero-inner {
    --es-title-size: clamp(2.8rem, 15.5vw, 5.4rem);
    gap: calc(var(--es-title-size) * 0.12);
  }

  .es-blocks {
    height: calc(var(--es-title-size) * 1.25);
  }

  .es-hero-actions {
    margin-top: 18px;
  }

  .es-hero-actions .btn {
    padding: 16px 28px;
    border-width: 5px;
    /* As big as fits one line beside the 16px side gutters. */
    font-size: clamp(22px, calc(11vw - 8px), 40px);
  }

  /* A game card on one row: the icon beside the name. */
  .es-cards {
    grid-template-columns: 1fr;
  }

  .es-card {
    display: grid;
    grid-template-columns: 104px 1fr;
    grid-template-rows: 1fr auto;
  }

  .es-card-art {
    grid-row: 1 / 3;
    height: 100%;
    min-height: 112px;
    border-bottom: 0;
    border-inline-end: 4px solid var(--es-ink);
    padding: 6px;
  }

  .es-card-art svg {
    width: 64px;
    height: 64px;
  }

  .es-card-title {
    align-self: end;
    margin: 12px 12px 8px;
    font-size: 1.4rem;
    text-align: start;
  }

  .es-card-actions {
    justify-content: flex-end;
    padding: 0 12px 12px;
  }

  .es-card-actions .es-open {
    padding: 8px 14px;
    font-size: 0.98rem;
  }

  .es-legal {
    padding-inline: 58px;
    gap: 4px 14px;
  }
}

@media (max-width: 380px) {
  .es-card {
    grid-template-columns: 88px 1fr;
  }
}
