:root {
  --indigo: #4530C6;
  --violet: #7B61FF;
  --violet-shade: #6A4FEA;
  --ink: #1F2350;
  --paper: #EEEBFF;
  --coral: #FF8080;
  --lime: #D4FF00;
  --sheet: #1A1C40;

  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --hand: "Caveat", cursive;
  --pad: clamp(20px, 5vw, 72px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Keep product motion on — OS reduce-motion only softens native scroll. */
  .speaking .wave i { animation: wave .9s ease-in-out infinite; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.55;
  font-variation-settings: "opsz" 14;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }
img, svg { display: block; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 6px; }
.lesson :focus-visible, .subjects :focus-visible, .hours :focus-visible, .foot :focus-visible { outline-color: var(--violet); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--lime); color: var(--ink); padding: 10px 16px; border-radius: 10px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: inherit; font-weight: 650; text-decoration: none;
  background: var(--lime); color: var(--ink);
  border-radius: 999px;
  transition: transform .25s var(--ease-out), background-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-small { padding: 9px 18px; font-size: 1rem; }
.btn-store { padding: 16px 26px 16px 22px; font-size: 1.125rem; }
.btn-store svg { width: 22px; height: 22px; fill: currentColor; margin-top: -3px; }

/* ---------- nav ---------- */

.nav {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--pad);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 9px; }
.brand span { font-weight: 800; font-size: 1.5rem; letter-spacing: -.04em; font-variation-settings: "opsz" 96; }

.nav-links { display: flex; gap: 32px; }
.nav-links a { text-decoration: none; opacity: .82; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }

.nav-end { display: flex; align-items: center; gap: 14px; }

.lang {
  font: inherit; font-size: .95rem; color: #fff;
  background: none; border: 1.5px solid rgba(255,255,255,.35); border-radius: 999px;
  padding: 6px 4px; display: flex; cursor: pointer;
}
.lang span { padding: 0 9px; opacity: .55; transition: opacity .2s; }
html[lang="pl"] .lang [data-l="pl"],
html[lang="en"] .lang [data-l="en"] { opacity: 1; font-weight: 700; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  min-height: max(100svh, 680px);
  background: var(--indigo);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.hero-copy {
  position: relative; z-index: 2;
  padding: clamp(120px, 17vh, 180px) var(--pad) 0;
  max-width: 58rem;
}

h1 {
  font-weight: 800;
  font-size: clamp(3.4rem, 9.2vw, 9.6rem);
  line-height: .9;
  letter-spacing: -.055em;
  font-variation-settings: "opsz" 96;
}
h1 .line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
h1 .line > span { display: inline-block; }

.hero-sub {
  margin-top: clamp(24px, 3.4vh, 36px);
  max-width: 30ch;
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
  line-height: 1.45;
  color: rgba(255,255,255,.86);
}

.hero-actions { margin-top: clamp(28px, 4vh, 44px); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }

/* Desktop only: nudge the store row ~2mm up so overflow:hidden doesn’t clip it */
@media (min-width: 641px) {
  .hero-copy { padding-bottom: 10px; }
  .hero-actions { position: relative; top: -8px; }
}
.hero-note { font-size: .98rem; color: rgba(255,255,255,.7); max-width: 22ch; line-height: 1.35; }

.mascot {
  --m: min(76vw, 112svh, 1180px);
  position: absolute; z-index: 1;
  width: var(--m);
  right: calc(var(--m) * -.12);
  bottom: calc(var(--m) * -.27);
  transform-origin: 50% 100%;
}
.mascot-svg { width: 100%; height: auto; }

.blob-back { fill: #5F45E3; opacity: .9; }
.blob-body { fill: var(--violet); }
.blob-shade { fill: var(--violet-shade); opacity: .75; }
.cheek { fill: var(--coral); }
.eye ellipse:first-child { fill: var(--ink); }
.glint { fill: #fff; }
.smile { fill: none; stroke: var(--ink); stroke-width: 17; stroke-linecap: round; }

.eye, .cheek { transform-box: fill-box; transform-origin: center; }
.eye { transition: transform .12s ease-out; }
.eye.shut { transform: scaleY(.08); }
.glint { transition: transform .35s var(--ease-out); }
.eye ellipse:first-child { transition: transform .35s var(--ease-out); }

.bubble {
  position: absolute;
  left: 60%; top: 11%;
  transform-origin: 0 100%;
  background: var(--lime); color: var(--ink);
  font-weight: 750; font-size: clamp(1.1rem, 1.9vw, 1.7rem); letter-spacing: -.02em;
  font-variation-settings: "opsz" 48;
  padding: .45em .9em .5em;
  border-radius: 1.1em 1.1em 1.1em .2em;
}

/* intro start states (only when JS + motion allowed) */
.intro .mascot { transform: translateY(75%); }
.intro .eye { transform: scaleY(.08); }
.intro .cheek { transform: scale(0); }
.intro .bubble { transform: scale(0); }
.intro h1 .line > span { transform: translateY(105%); }
.intro .hero-sub, .intro .hero-actions, .intro .nav { opacity: 0; }

/* ---------- lesson ---------- */

.lesson {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(48px, 7vw, 120px);
  align-items: center;
  padding: clamp(96px, 14vw, 180px) var(--pad);
  max-width: 1440px; margin: 0 auto;
}

h2 {
  font-weight: 780;
  font-size: clamp(2.4rem, 5.2vw, 4.6rem);
  line-height: .98;
  letter-spacing: -.045em;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}

.steps { list-style: none; padding: 0; margin-top: clamp(40px, 5vw, 64px); counter-reset: step; display: grid; gap: 34px; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 3.2rem 1fr; column-gap: 12px;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-weight: 800; font-size: 2.4rem; line-height: 1;
  font-variation-settings: "opsz" 96;
  color: var(--violet);
}
.steps h3 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variation-settings: "opsz" 32; }
.steps p { margin-top: 6px; color: rgba(31,35,80,.72); max-width: 38ch; }

.notebook { position: relative; }

.said {
  display: inline-flex; align-items: center; gap: 12px;
  background: #fff; color: var(--ink);
  padding: 12px 20px 12px 16px;
  border-radius: 22px 22px 22px 6px;
  font-weight: 550;
  margin: 0 0 18px 6%;
  box-shadow: 0 1px 0 rgba(31,35,80,.06);
}
.wave { display: inline-flex; gap: 3px; align-items: center; height: 20px; }
.wave i { width: 3px; height: 100%; border-radius: 2px; background: var(--violet); transform: scaleY(.3); }
.speaking .wave i { animation: wave .9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: -.2s; }
.wave i:nth-child(3) { animation-delay: -.45s; }
.wave i:nth-child(4) { animation-delay: -.1s; }
.wave i:nth-child(5) { animation-delay: -.6s; }
@keyframes wave { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

.sheet {
  position: relative;
  overflow: visible;
  background-color: var(--sheet);
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
  border-radius: 28px;
  padding: clamp(26px, 3.2vw, 44px) clamp(24px, 3.6vw, 52px) clamp(34px, 4vw, 56px);
  color: #fff;
  transform: rotate(-1.4deg);
  box-shadow: 0 40px 80px -40px rgba(31,35,80,.55);
}

.pip {
  position: absolute; top: clamp(-56px, -4vw, -36px); right: clamp(-28px, -2vw, -12px);
  width: clamp(116px, 11vw, 158px); aspect-ratio: 3 / 4;
  border-radius: 20px; overflow: hidden;
  background: #262A5C;
  border: 1.5px solid rgba(255,255,255,.16);
  transform: rotate(3deg);
  box-shadow: 0 24px 40px -24px rgba(0,0,0,.6);
}
.pip img { width: 150%; max-width: none; height: auto; margin: 8% 0 0 -25%; }

.sheet-head { padding-right: clamp(110px, 10vw, 140px); display: flex; flex-direction: column; gap: 6px; padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1.5px solid rgba(255,128,128,.45); }
.sheet-title { font-family: var(--hand); font-weight: 700; font-size: 2rem; line-height: 1; }
.sheet-sub { font-family: var(--hand); font-size: 1.35rem; color: var(--coral); }

.note { border-left: 2px solid rgba(255,128,128,.55); padding-left: 18px; margin-bottom: 22px; overflow: visible; }
.note:last-child { margin-bottom: 0; }
.note p { font-family: var(--hand); font-weight: 500; font-size: clamp(1.6rem, 2.2vw, 2.05rem); line-height: 1.25; overflow: visible; }
.note .label { color: var(--coral); font-size: clamp(1.25rem, 1.6vw, 1.45rem); }
.note-you { border-left-color: var(--lime); }
.note-you .label { color: var(--lime); }

/* padding-right: Caveat glyphs hang past the advance width and get clipped by clip-path */
.ink { width: fit-content; max-width: 100%; padding-right: 0.45em; box-decoration-break: clone; }
.writing .ink { clip-path: inset(-12% 100% -12% -2%); }

/* ---------- stance ---------- */

.stance {
  padding: clamp(80px, 12vw, 160px) var(--pad);
  background: var(--ink); color: #fff;
}
.stance p {
  max-width: 19ch;
  font-weight: 750;
  font-size: clamp(2.2rem, 5.6vw, 5.4rem);
  line-height: 1;
  letter-spacing: -.045em;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
}

/* ---------- subjects ---------- */

.subjects { padding: clamp(96px, 13vw, 170px) var(--pad); max-width: 1440px; margin: 0 auto; }
.subjects-lead { margin-top: 20px; max-width: 46ch; color: rgba(31,35,80,.72); }
.cast { margin-top: clamp(48px, 6vw, 80px); }
.cast-row {
  list-style: none; padding: 24px 0 0; margin: 0;
  display: flex;
  border-bottom: 5px solid var(--ink);
  scrollbar-width: none;
}
.cast-row::-webkit-scrollbar { display: none; }
.cast-row li { flex: 1 1 0; min-width: 0; max-width: 220px; position: relative; }
.cast-row li + li { margin-left: clamp(-34px, -1.9vw, -16px); }
.cast-row button {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 100%;
  transition: transform .45s var(--ease-out), filter .3s;
}
.cast-row img { width: 100%; height: auto; pointer-events: none; }
.cast-row button:hover, .cast-row button:focus-visible, .cast-row button[aria-pressed="true"] { transform: translateY(-16px) scale(1.04); }
.cast-row li:has(button[aria-pressed="true"]),
.cast-row li:has(button:hover),
.cast-row li:has(button:focus-visible) { z-index: 2; }
.cast-row:hover button:not(:hover) { filter: saturate(.75) brightness(.97); }
.cast-row button:focus-visible { outline: none; }
.cast-row button:focus-visible img { outline: 3px solid var(--violet); outline-offset: -3px; border-radius: 50% 50% 0 0; }

.cast-caption {
  margin-top: 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-height: 2.4rem;
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.cast-caption.is-swap { opacity: 0; transform: translateY(6px); }
.cast-name { font-weight: 720; font-size: 1.4rem; letter-spacing: -.02em; font-variation-settings: "opsz" 32; }
.cast-subj { font-family: var(--hand); font-weight: 700; font-size: 1.75rem; line-height: 1.15; color: var(--violet); padding-right: 0.2em; }

.subject-list {
  list-style: none; padding: 0.12em 0 0.2em;
  margin-top: clamp(64px, 8vw, 110px);
  display: flex; flex-wrap: wrap; gap: .12em .55em;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.18;
  letter-spacing: -.04em;
  font-variation-settings: "opsz" 96;
  overflow: visible;
}
.subject-list li { transition: color .2s; cursor: default; padding-right: 0.04em; }
.subject-list li:hover { color: var(--violet); }
.subject-list .own { font-family: var(--hand); font-weight: 700; letter-spacing: 0; color: var(--violet); font-size: 1.12em; line-height: .96; }
.subjects-foot { margin-top: clamp(40px, 5vw, 64px); max-width: 52ch; color: rgba(31,35,80,.72); }

/* ---------- hours ---------- */

.hours {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 120px); align-items: center;
  padding: clamp(72px, 10vw, 130px) var(--pad) clamp(96px, 13vw, 170px);
  max-width: 1440px; margin: 0 auto;
  border-top: 1.5px solid rgba(31,35,80,.12);
}
.hours-copy p { margin-top: 22px; max-width: 44ch; color: rgba(31,35,80,.72); }

.battery { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.battery-body {
  height: clamp(84px, 9vw, 120px);
  border: 4px solid var(--ink); border-radius: 26px; padding: 9px;
}
.battery-fill {
  height: 100%; width: 72%; border-radius: 15px;
  background: var(--violet);
  transform-origin: left center;
}
.battery-cap { width: 12px; height: 36%; background: var(--ink); border-radius: 0 8px 8px 0; margin-left: 4px; }
.battery-label { grid-column: 1 / -1; margin-top: 16px; font-size: 1.1rem; color: rgba(31,35,80,.72); }
.battery-num { font-weight: 750; color: var(--ink); font-variation-settings: "opsz" 32; }

/* ---------- final ---------- */

.final {
  position: relative; overflow: hidden;
  background: var(--indigo); color: #fff;
  padding: clamp(96px, 13vw, 170px) var(--pad) 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 40px;
}
.final h2 { max-width: 13ch; font-size: clamp(2.6rem, 6.4vw, 6rem); }
.peek { width: min(640px, 100%); margin: 0 0 -2px auto; height: auto; }
.peek-body { fill: var(--violet); }
.peek-eye { fill: var(--ink); }
.peek-glint { fill: #fff; }

/* ---------- footer ---------- */

.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
  padding: 30px var(--pad);
  background: var(--paper);
  font-size: 1rem;
}
.foot-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.25rem; letter-spacing: -.04em; }
.foot-brand img { border-radius: 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 26px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-copy { color: rgba(31,35,80,.6); }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .nav-links { display: none; }
  .lesson, .hours { grid-template-columns: 1fr; }
  .notebook { max-width: 560px; }
}

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .nav { padding-top: 16px; }
  .nav .btn-small { display: none; }
  .hero { min-height: 100svh; }
  .hero-copy {
    padding-top: 104px;
    /* reserve the lower hero for the mascot so CTA + bubble don’t collide */
    padding-bottom: clamp(220px, 58vw, 320px);
  }
  .hero-sub { max-width: 26ch; }
  .hero-note { max-width: 26ch; }
  .hero-actions { position: relative; z-index: 3; }
  .mascot {
    --m: 118vw;
    right: -11vw;
    bottom: calc(var(--m) * -.38);
  }
  /* sit the bubble on the face, below the download row */
  .bubble { left: 54%; top: 28%; }
  .sheet { transform: rotate(-1deg); border-radius: 22px; }
  .said { margin-left: 0; }
  .steps li { grid-template-columns: 2.4rem 1fr; }
  .cast-row { overflow-x: auto; margin: 0 calc(var(--pad) * -1); padding-left: var(--pad); padding-right: var(--pad); scroll-snap-type: x proximity; }
  .cast-row li { flex: 0 0 128px; scroll-snap-align: start; }
  .steps li::before { font-size: 2rem; }
}

/* short phones — tighten type so the first screen stays clear */
@media (max-width: 640px) and (max-height: 760px) {
  h1 { font-size: clamp(2.55rem, 10.5vw, 3.2rem); }
  .hero-sub { margin-top: 16px; font-size: 1.05rem; }
  .hero-actions { margin-top: 18px; }
  .hero-copy { padding-bottom: clamp(180px, 48vw, 260px); }
  .mascot { bottom: calc(var(--m) * -.42); }
  .bubble { top: 30%; left: 56%; }
}

