/* mathville.app. The page is a day in the game's sky: morning at the top, dusk for the story, the Future's night at the foot.
   Each band of sky ends in the colour the next one starts with. Buttons and frames are the game's own: white, an ink outline. */

@font-face { font-family: "Baloo 2"; font-weight: 500 800; font-display: swap; src: url(/fonts/baloo2-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo 2"; font-weight: 500 800; font-display: swap; src: url(/fonts/baloo2-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #1d2433;
  --soft: #4b5468;
  --paper: #ffffff;
  --orange: #f28c28;
  --orange-deep: #d9701a;
  --grass: #6fae3f;
  --sky-0: #237fe0; --sky-1: #74b8f3; --sky-2: #b3dbfb; --sky-3: #e2f1fe;
  --dusk-0: #ffe0b8; --dusk-1: #f6a77e; --dusk-2: #b8678f;
  --night-0: #4b3d7f; --night-1: #1b1e3a; --night-2: #10132a;
  --round: "Baloo 2", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--night-2); }
body { margin: 0; color: var(--ink); font: 18px/1.6 var(--body); background: var(--sky-0); -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--round); font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(36px, 5.2vw, 56px); margin-bottom: 14px; }
h3 { font-size: 25px; line-height: 1.15; margin-bottom: 6px; }
p { margin: 0 0 14px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.lede { font-size: 21px; max-width: 46ch; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; border-radius: 10px; z-index: 9; }
.skip:focus { left: 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* the game's buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 700 20px/1 var(--round); padding: 13px 22px 11px; border: 3px solid var(--ink);
  border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: 0 4px 0 var(--ink); cursor: pointer; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.go { background: var(--orange); color: #fff; text-shadow: 0 1px 0 rgba(29, 36, 51, .35); }
.store.soon { cursor: default; transform: none; box-shadow: 0 4px 0 var(--ink); }
.store.soon::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--grass); box-shadow: 0 0 0 3px #d9f0c8; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 0; }

/* an iPad held sideways */
.ipad { border: 10px solid var(--ink); border-radius: 26px; background: var(--ink); overflow: hidden; box-shadow: 0 18px 40px -18px rgba(16, 19, 42, .55); }
.ipad img, .ipad video { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; }

/* the top bar: the name home and the languages */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; }
.home { display: inline-flex; align-items: center; gap: 10px; font: 800 24px/1 var(--round); text-decoration: none; color: #fff; text-shadow: 0 2px 0 rgba(29, 36, 51, .4); }
.home img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.langs { display: flex; flex-wrap: wrap; gap: 6px; }
.langs a { font: 700 15px/1 var(--round); padding: 8px 11px 6px; border-radius: 999px; color: #fff; text-decoration: none; background: rgba(29, 36, 51, .22); }
.langs a:hover { background: rgba(29, 36, 51, .4); }
.langs a[aria-current] { background: #fff; color: var(--ink); }

/* morning: the island */
.hero { background: linear-gradient(180deg, var(--sky-0), var(--sky-1)); color: #fff; padding-bottom: 40px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.05fr; align-items: center; gap: 12px; }
.hero h1 { margin-top: 38px; font-size: clamp(64px, 10.5vw, 132px); text-shadow: 0 4px 0 rgba(29, 36, 51, .35); }
.hero .lede { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.35; font-family: var(--round); font-weight: 600; margin-top: 6px; }
.hero .for { color: #eaf5ff; max-width: 40ch; }
.hero .copy { padding: 40px 0 60px; }
.island { width: 100%; max-width: 640px; justify-self: center; animation: float 7s ease-in-out infinite; filter: drop-shadow(0 30px 30px rgba(16, 60, 120, .25)); }
@keyframes float { 50% { transform: translateY(-14px) rotate(-.6deg); } }

/* still the day: the film */
.play { background: linear-gradient(180deg, var(--sky-1), var(--sky-2)); padding: 30px 0 70px; }
.play .head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 6px 30px; margin-bottom: 22px; }
.play .head p { max-width: 44ch; margin: 0; color: #24304a; }
.film { max-width: 980px; margin: 0 auto; }
.caption { min-height: 2.9em; margin: 16px auto 18px; max-width: 980px; font-size: 19px; }
.caption b { font-family: var(--round); font-size: 22px; }
.clips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; max-width: 980px; margin: 0 auto; padding: 0; list-style: none; }
.clips button { width: 100%; padding: 0; border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); cursor: pointer; overflow: hidden; color: var(--ink);
  font: 700 15px/1.2 var(--round); box-shadow: 0 3px 0 var(--ink); text-align: center; }
.clips button img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.clips button span { display: block; padding: 7px 4px 5px; }
.clips button[aria-pressed="true"] { border-color: var(--orange-deep); box-shadow: 0 3px 0 var(--orange-deep), 0 0 0 3px var(--orange); }

/* late morning: why it helps */
.why { background: linear-gradient(180deg, var(--sky-2), var(--sky-3)); padding: 40px 0 70px; }
.why .intro { max-width: 60ch; font-size: 20px; margin-bottom: 40px; }
.points { display: grid; gap: 54px; }
.point { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.point:nth-child(even) .ipad { order: -1; }
.point p { max-width: 48ch; color: #26304a; }

/* noon: nothing taken */
.safe { background: linear-gradient(180deg, var(--sky-3), var(--dusk-0)); padding: 50px 0 80px; }
.safe dl { margin: 10px 0 30px; display: grid; grid-template-columns: max-content 1fr; gap: 18px 40px; align-items: baseline; }
.safe dt { font: 800 clamp(34px, 5vw, 60px)/1 var(--round); }
.safe dd { margin: 0; max-width: 52ch; font-size: 19px; color: #2b3249; }
.price { display: flex; gap: 18px; align-items: center; max-width: 760px; padding: 18px 22px; background: var(--paper); border: 3px solid var(--ink); border-radius: 20px; }
.price p { margin: 0; }
.price b { font-family: var(--round); font-size: 21px; }

/* dusk: our story */
.story { background: linear-gradient(180deg, var(--dusk-0), var(--dusk-1) 60%, var(--dusk-2)); padding: 50px 0 90px; }
.story .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 50px; align-items: start; }
.letter p { max-width: 60ch; }
.letter .sign { font: 700 21px/1.3 var(--round); margin-top: 18px; }
.then { position: sticky; top: 24px; display: grid; gap: 14px; }
.card { background: #fdf6e3; border: 3px solid var(--ink); border-radius: 22px; padding: 16px 20px 18px; box-shadow: 0 5px 0 var(--ink); }
.card .when { font: 700 17px/1 var(--round); color: var(--soft); margin: 0 0 8px; }
.card .sums { font: 800 clamp(30px, 3.4vw, 40px)/1.15 var(--round); margin: 0; }
.card .sums span { display: block; }
.arrow { justify-self: center; font: 800 34px/1 var(--round); color: var(--ink); }
.facts { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 17px; }
.facts li { background: rgba(255, 255, 255, .6); border-radius: 14px; padding: 10px 14px; }

/* evening: how to play, along the quest path */
.how { background: linear-gradient(180deg, var(--dusk-2), var(--night-0)); color: #fff; padding: 50px 0 80px; }
.path { list-style: none; margin: 30px 0 34px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; position: relative; counter-reset: step; }
.path::before { content: ""; position: absolute; left: 10%; right: 10%; top: 32px; border-top: 4px dashed rgba(255, 255, 255, .55); }
.path li { position: relative; counter-increment: step; }
.path li::before { content: counter(step); display: grid; place-items: center; width: 64px; height: 64px; margin: 0 0 14px; border-radius: 50%;
  background: #fff; color: var(--ink); border: 3px solid var(--ink); font: 800 30px/1 var(--round); box-shadow: 0 4px 0 var(--ink); }
.path li:last-child::before { background: var(--orange); color: #fff; }
.path p { color: #ece6ff; font-size: 17px; }

/* night: the Future, among the stars */
.foot { background: linear-gradient(180deg, var(--night-0), var(--night-1) 40%, var(--night-2)); color: #e9e7ff; padding: 70px 0 50px; position: relative; }
.foot::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .8;
  background-image: radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 27% 64%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 41% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 55% 47%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 68% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 79% 71%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 88% 33%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 6% 83%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 35% 90%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 94% 88%, #fff 50%, transparent 51%); }
.foot .wrap { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; }
.foot h2 { color: #fff; display: flex; align-items: center; gap: 14px; }
.foot h2 img { width: 64px; height: 64px; border-radius: 15px; }
.foot nav { display: grid; gap: 10px; align-content: start; font-size: 18px; }
.foot .small { color: #a9a6cf; font-size: 15px; margin-top: 30px; }
.foot .langs { margin-top: 14px; }
.foot .langs a:not([aria-current]) { background: rgba(255, 255, 255, .12); }

/* the guide: a calm day, the text on paper */
.guide { background: linear-gradient(180deg, var(--sky-0) 0, var(--sky-1) 260px, var(--sky-2) 900px, var(--sky-3)); padding-bottom: 60px; }
.guide .title { color: #fff; padding: 20px 0 30px; }
.guide .title h1 { font-size: clamp(46px, 7vw, 84px); text-shadow: 0 4px 0 rgba(29, 36, 51, .3); }
.guide .title p { color: #eef7ff; font-size: 20px; max-width: 56ch; margin-top: 10px; }
.sheet { background: var(--paper); border: 3px solid var(--ink); border-radius: 28px; padding: 34px clamp(18px, 4vw, 48px) 20px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 34px; list-style: none; }
.toc a { display: inline-block; font: 700 16px/1 var(--round); padding: 9px 13px 7px; border: 2px solid var(--ink); border-radius: 999px; text-decoration: none; }
.toc a:hover { background: var(--sky-3); }
.topic { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; padding: 30px 0; border-top: 2px dashed #d5dbe6; scroll-margin-top: 20px; }
.topic:first-of-type { border-top: 0; }
.topic.solo { grid-template-columns: 1fr; }
.topic h2 { font-size: clamp(30px, 3.6vw, 40px); }
.topic p { max-width: 54ch; }
.topic .shots { display: grid; gap: 14px; }
.topic .ipad { border-width: 7px; border-radius: 20px; }
.topic .ipad img { border-radius: 13px; }

@media (max-width: 860px) {
  .hero .wrap, .point, .story .wrap, .foot .wrap, .topic { grid-template-columns: 1fr; }
  .hero .copy { padding: 10px 0 0; }
  .island { max-width: 460px; }
  .point:nth-child(even) .ipad { order: 0; }
  .clips { grid-template-columns: repeat(3, 1fr); }
  .safe dl { grid-template-columns: 1fr; gap: 4px; }
  .safe dd { margin-bottom: 18px; }
  .then { position: static; }
  .path { grid-template-columns: 1fr; gap: 6px; }
  .path::before { left: 30px; right: auto; top: 30px; bottom: 30px; border-top: 0; border-left: 4px dashed rgba(255, 255, 255, .55); }
  .path li { display: grid; grid-template-columns: 64px 1fr; gap: 0 18px; }
  .path li::before { grid-row: span 2; }
}
@media (prefers-reduced-motion: reduce) {
  .island { animation: none; }
  .btn:hover, .btn:active { transform: none; }
}

/* the teachers' page: the guide's paper, a message to copy, and a leaflet that prints alone */
.ladders { display: grid; grid-template-columns: max-content 1fr; gap: 12px 22px; margin: 0; align-items: baseline; }
.ladders dt { font: 800 21px/1.2 var(--round); }
.ladders dd { margin: 0; max-width: 46ch; color: var(--soft); }
.teachers .topic .ladders { margin-top: 4px; }
.ladders.stack { grid-template-columns: 1fr; gap: 2px; }
.ladders.stack dd { margin-bottom: 12px; }
.note { white-space: pre-line; max-width: 60ch; background: var(--sky-3); border: 2px dashed #9cc4e8; border-radius: 18px; padding: 18px 22px; overflow-wrap: anywhere; }
.flyer { position: relative; overflow: hidden; background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; padding: 28px 30px 30px;
  display: grid; gap: 14px; align-content: start; max-width: 620px; box-shadow: 0 6px 0 var(--ink); }
.fl-head { display: flex; align-items: center; gap: 18px; }
.fl-head img { width: 86px; height: 86px; border-radius: 20px; }
.fl-name { font: 800 48px/1 var(--round); margin: 0; }
.fl-tag { font: 700 20px/1.25 var(--round); margin: 4px 0 0; color: var(--soft); }
.fl-for { font-size: 18px; margin: 0; }
.fl-points { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.fl-scan { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; padding-right: 190px; }
.fl-scan img { width: 150px; height: 150px; image-rendering: pixelated; border: 2px solid var(--ink); border-radius: 10px; padding: 6px; background: #fff; }
.fl-scan p { margin: 0; max-width: 26ch; }
.fl-scan b { display: block; font: 800 24px/1.3 var(--round); margin-top: 6px; }
.fl-island { position: absolute; right: -50px; bottom: -60px; width: 250px; pointer-events: none; }
@media (max-width: 860px) { .ladders { grid-template-columns: 1fr; gap: 2px; } .ladders dd { margin-bottom: 10px; } .fl-island { display: none; } .fl-scan { padding-right: 0; } }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; padding: 0; }
  .skip, .bar, .title, .foot, .topic:not(#leaflet), #leaflet > div:first-child { display: none; }
  .wrap, .sheet, #leaflet { display: block; max-width: none; padding: 0; margin: 0; border: 0; background: none; }
  .flyer { max-width: none; border: 0; box-shadow: none; padding: 0; gap: 22px; break-inside: avoid; }
  .fl-name { font-size: 72px; }
  .fl-tag { font-size: 28px; }
  .fl-for, .fl-points { font-size: 22px; }
  .fl-scan img { width: 230px; height: 230px; }
  .fl-scan { padding-right: 300px; }
  .fl-scan p { font-size: 20px; }
  .fl-island { display: block; width: 340px; right: -20px; bottom: -50px; }
}

/* our other games: a card at nightfall on the home page, and a game's own page on the guide's paper (Czech pages only) */
.more { background: var(--night-0); color: #fff; padding: 0 0 80px; }
.game { display: grid; grid-template-columns: 1fr 1.1fr; gap: 34px; align-items: center; max-width: 980px; padding: 22px; color: var(--ink);
  background: var(--paper); border: 3px solid var(--ink); border-radius: 28px; box-shadow: 0 6px 0 var(--ink); }
.game h3 { display: flex; align-items: center; gap: 14px; font-size: 36px; margin-bottom: 12px; }
.game h3 img { width: 64px; height: 64px; border-radius: 15px; }
.game p { color: var(--soft); max-width: 44ch; }
.game .ipad { border-width: 7px; border-radius: 20px; }
.game .ipad img, .topic .ipad video { border-radius: 13px; }
.game-title { display: flex; align-items: center; gap: 28px; }
.game-title > img { width: clamp(96px, 14vw, 168px); border-radius: 24%; box-shadow: 0 0 0 4px rgba(255, 255, 255, .7), 0 18px 30px -16px rgba(16, 19, 42, .6); }
.guide .game-title .lede { font: 600 clamp(22px, 2.4vw, 28px)/1.3 var(--round); margin: 6px 0 8px; color: #fff; }
.topic .small { font-size: 16px; color: var(--soft); }
@media (max-width: 860px) { .game { grid-template-columns: 1fr; } .game-title { flex-direction: column; align-items: start; } }
/* The press page's pictures, three to a row. */
.press-shots { grid-template-columns: repeat(3, 1fr); margin-top: 18px; }
@media (max-width: 860px) { .press-shots { grid-template-columns: 1fr 1fr; } }
/* Czech pages: the three games in the header, as pills beside the languages; a portrait frame for Befemele, which runs upright on an iPad */
.games { display: flex; flex-wrap: wrap; gap: 6px; }
.games a { font: 700 15px/1 var(--round); padding: 8px 12px 6px; border-radius: 999px; color: #fff; text-decoration: none; border: 2px solid rgba(255, 255, 255, .55); }
.games a:hover { background: rgba(29, 36, 51, .25); }
.games a[aria-current] { background: var(--orange); border-color: var(--orange); }
.tops { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; }
.bar { flex-wrap: wrap; }
.games-cards { display: grid; gap: 26px; }

/* News & Updates (news.html, post.html) and the season's strip on the home page */
.news .when { font: 700 17px/1 var(--round); color: var(--soft); margin: 0 0 10px; }
.news .title .when { color: #eef7ff; margin: 0 0 12px; }
.news .topic h2 a { color: inherit; text-decoration: none; }
.news .topic h2 a:hover { text-decoration: underline; }
.news .read { font: 700 18px/1 var(--round); }
.pic { display: block; margin: 0; border: 3px solid var(--ink); border-radius: 20px; overflow: hidden; box-shadow: 0 5px 0 var(--ink); }
.pic img { display: block; width: 100%; height: auto; }
.post .sheet .pic { margin: 0 0 26px; }
.post .sheet p { max-width: 62ch; font-size: 19px; }
.post .sheet .actions { margin: 26px 0 14px; }
.promo { background: var(--ink); }
.promo a { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px 0; color: #fff; text-decoration: none; font: 700 19px/1.3 var(--round); }
.promo a:hover span { text-decoration: underline; }
.promo b { flex: none; background: var(--orange); padding: 5px 11px 3px; border-radius: 999px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }

/* The offer for teachers, across the top of Matikov's pages (not their own page) */
.tstrip { background: #2e6b2f; color: #fff; }
.tstrip .wrap { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: center; padding-top: 9px; padding-bottom: 9px; font: 700 17px/1.3 var(--round); text-align: center; }
.tstrip a { color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 5px 13px 3px; text-decoration: none; white-space: nowrap; }
.tstrip a:hover { background: var(--sky-3); }
