/* naukago.com: the home page, the pages for parents and teachers, the
   subjects' and the exam's pages. One stylesheet, so a visitor going from
   page to page loads it once.

   The look is a Polish school's stationery: a squared exercise book
   ("zeszyt w kratkę") behind the headings, a yellow highlighter on the
   words that matter, and cards drawn like stickers, with an ink outline
   and a hard shadow. The colours and the typeface (Nunito) are the app's
   own, so the site and the app read as one thing. */

@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("/fonts/nunito-400.woff") format("woff"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("/fonts/nunito-700.woff") format("woff"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("/fonts/nunito-800.woff") format("woff"); }
@font-face { font-family: "Nunito"; font-weight: 900; font-display: swap; src: url("/fonts/nunito-900.woff") format("woff"); }

:root {
    --paper: #fffcf6;
    --paper-2: #f5f0ff;
    --card: #ffffff;
    --ink: #1f1a3a;
    --muted: #57506f;
    --edge: #1f1a3a;
    --drop: #1f1a3a;
    --soft-edge: #e5def6;
    --line: var(--soft-edge);
    --grid: rgba(59, 139, 246, .11);
    --margin: rgba(255, 93, 143, .35);
    --bar: rgba(255, 252, 246, .94);
    --link: #5636c9;
    --violet: #6c4ce0;
    --on-violet: #ffffff;
    --marker: #ffc93c;
    --marker-band: #ffd966;
    --on-marker: #1f1a3a;
    --ok: #0f7a5f;
    --ok-soft: #e1f6ee;
    --tip: #fff3cc;

    /* The subjects, each with a colour of the app's palette and a tint
       for the cards that carry it. */
    --math: #3b8bf6;
    --math-tint: #e6f0fe;
    --polish: #f0457c;
    --polish-tint: #ffe7ef;
    --english: #0f9f8f;
    --english-tint: #defaf5;
    --nature: #24a86a;
    --nature-tint: #e1f7ea;
    --geography: #f07a2a;
    --geography-tint: #ffeedf;
    --exam: #6c4ce0;
    --exam-tint: #efe9ff;

    --radius: 18px;
    --shadow: 4px 4px 0 var(--drop);
    --shadow-small: 3px 3px 0 var(--drop);
    --font: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #15102a;
        --paper-2: #1c1538;
        --card: #221a42;
        --ink: #f3efff;
        --muted: #bdb4da;
        --edge: #51458a;
        --drop: #07040f;
        --soft-edge: #3a2f66;
        --grid: rgba(185, 168, 255, .075);
        --margin: rgba(255, 93, 143, .28);
        --bar: rgba(21, 16, 42, .94);
        --link: #c4b5ff;
        --violet: #8b70ff;
        --on-violet: #ffffff;
        --marker-band: rgba(255, 201, 60, .38);
        --ok: #6ee7c4;
        --ok-soft: #163b37;
        --tip: #3a3020;

        --math: #6aa8ff;
        --math-tint: #1b2a4d;
        --polish: #ff7aa3;
        --polish-tint: #3c1c34;
        --english: #3fd1c0;
        --english-tint: #143a3a;
        --nature: #4fd18c;
        --nature-tint: #153a2a;
        --geography: #ffa05c;
        --geography-tint: #3d2619;
        --exam: #a993ff;
        --exam-tint: #2b2259;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 18px/1.6 var(--font);
    font-variant-numeric: lining-nums;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; font-weight: 900; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); margin: 0 0 16px; }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.2rem); margin: 0 0 12px; }
h3 { font-size: 1.2rem; margin: 0 0 6px; }
p { margin: 0 0 12px; }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 780px; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 16px; }
:is(.grid, .grid-3, .subjects, .prices, .card, .faq) + .note { margin-top: 22px; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 62ch; margin: 0 0 24px; }
/* Under the store buttons: the iPhone version is still to come. */
.store-note { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.kicker {
    display: inline-block; margin: 0 0 10px; font-size: 14px; font-weight: 800;
    letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.label { display: block; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* The highlighter: a band of yellow under the word, drawn a little crooked
   as by a hand. */
mark {
    color: inherit;
    background: linear-gradient(100deg, transparent 2%, var(--marker-band) 4%, var(--marker-band) 96%, transparent 98%) 0 72% / 100% 42% no-repeat;
    padding: 0 .08em;
}

/* The squared page of an exercise book, with its pink margin on screens
   wide enough to keep it clear of the words. */
.paper-grid {
    position: relative;
    background-color: var(--paper);
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: -1px -1px;
}
@media (min-width: 1260px) {
    .paper-grid::before {
        content: ""; position: absolute; top: 0; bottom: 0; width: 2px;
        left: calc(50% - 590px); background: var(--margin);
    }
}

/* Buttons: stickers too, pressed in when tapped. */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 10px 20px; border-radius: 14px;
    border: 2px solid var(--edge); box-shadow: var(--shadow-small);
    font: 800 17px/1.2 var(--font); text-decoration: none; white-space: nowrap;
    background: var(--card); color: var(--ink);
    transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--drop); text-decoration: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--drop); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-play { background: var(--marker); color: var(--on-marker); border-color: #1f1a3a; }
.btn-violet { background: var(--violet); color: var(--on-violet); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---- The menu ---------------------------------------------------- */

.site-top {
    position: sticky; top: 0; z-index: 20;
    background: var(--bar);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--edge);
}
.site-top .bar { display: flex; align-items: center; gap: 10px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 22px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.menu { display: flex; align-items: center; gap: 2px; }
.menu > a, .menu-subjects {
    font: 800 16px/1.2 var(--font); color: var(--ink); text-decoration: none;
    padding: 10px 12px; border-radius: 12px; white-space: nowrap;
    background: none; border: 0; cursor: pointer;
}
.menu > a:hover, .menu-subjects:hover, .menu > a[aria-current], .menu-subjects.current { background: var(--paper-2); }
.menu > a[aria-current], .menu-subjects.current { box-shadow: inset 0 -3px 0 var(--marker); }
.menu-subjects { display: inline-flex; align-items: center; gap: 6px; }
.menu-subjects::after {
    content: ""; width: 8px; height: 8px; margin-top: -4px;
    border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
    transform: rotate(45deg); transition: transform .15s ease;
}
.menu-group { position: relative; }
.subjects-list {
    list-style: none; margin: 0; padding: 10px;
    display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
    position: absolute; top: calc(100% + 10px); left: -10px; width: 460px;
    background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius); box-shadow: var(--shadow);
}
.subjects-list li { margin: 0; }
.subjects-list a {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
    color: var(--ink); text-decoration: none; font-weight: 800; line-height: 1.2;
}
.subjects-list a:hover, .subjects-list a[aria-current] { background: var(--s-tint, var(--paper-2)); }
.subjects-list small { display: block; font-weight: 700; color: var(--muted); font-size: 14px; }
.subjects-list .icon { width: 38px; height: 38px; padding: 8px; border-radius: 10px; background: var(--s-tint); color: var(--s); flex: none; }
/* A mouse opens the list by pointing, a tap or a key by the button (the
   script); without the script, focus opens it. */
.menu-group:hover .subjects-list, .subjects-open .subjects-list, html:not(.js) .menu-group:focus-within .subjects-list { display: grid; }
.subjects-open .menu-subjects::after { transform: rotate(-135deg); margin-top: 4px; }
/* Hovering opens the list; this keeps it open across the gap above it. */
.menu-group::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
.bar-play .short { display: none; }
.menu-toggle {
    display: none; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px;
    font: 800 16px/1 var(--font); color: var(--ink); background: var(--card);
    border: 2px solid var(--edge); border-radius: 12px; box-shadow: var(--shadow-small); cursor: pointer;
}
.menu-toggle .lines, .menu-toggle .lines::before, .menu-toggle .lines::after {
    display: block; width: 18px; height: 2.5px; border-radius: 2px; background: currentColor; position: relative;
}
.menu-toggle .lines::before, .menu-toggle .lines::after { content: ""; position: absolute; left: 0; }
.menu-toggle .lines::before { top: -6px; }
.menu-toggle .lines::after { top: 6px; }
.menu-open .menu-toggle .lines { background: transparent; }
.menu-open .menu-toggle .lines::before { top: 0; transform: rotate(45deg); }
.menu-open .menu-toggle .lines::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 1080px) {
    .bar-play .long { display: none; }
    .bar-play .short { display: inline; }
}
/* On a phone or a narrow window the links fold under one "Menu" button:
   six links and five subjects in rows would cover half the screen. */
@media (max-width: 920px) {
    .site-top .bar { flex-wrap: wrap; min-height: 64px; gap: 8px; }
    .brand { font-size: 20px; }
    .brand img { width: 36px; height: 36px; }
    .bar-play { order: 1; min-height: 44px; padding: 8px 14px; font-size: 16px; }
    .menu-toggle { order: 2; }
    .menu {
        order: 3; width: 100%; flex-direction: column; align-items: stretch; gap: 2px;
        padding: 4px 0 16px;
    }
    .menu > a { padding: 12px 10px; font-size: 18px; }
    .menu-subjects { display: none; }
    .subjects-list {
        display: grid; position: static; width: auto; box-shadow: none; border: 0; padding: 0 0 8px;
        background: none; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .subjects-list a { background: var(--s-tint); }
    .menu-group::before {
        content: "Przedmioty"; display: block; padding: 8px 10px 6px; font-size: 14px; font-weight: 800;
        letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
    }
    .menu-group::after { display: none; }
    /* With the script the list folds away; without it, it stays open.
       The page is marked "js" in its head, before the menu is drawn, so
       the open list never flashes past. */
    .js .menu-toggle { display: inline-flex; }
    .js .menu { display: none; max-height: calc(100vh - 70px); overflow-y: auto; }
    .js .menu-open .menu { display: flex; }
}
/* A small phone: the name, "Pobierz" and "Menu" still in one row. */
@media (max-width: 400px) {
    .site-top .wrap { padding-inline: 16px; }
    .site-top .bar { gap: 6px; }
    .brand { gap: 8px; }
    .brand span { font-size: 19px; }
    .bar-play svg { display: none; }
    .bar-play, .menu-toggle { padding-inline: 11px; }
}
@media (max-width: 340px) {
    .brand span { display: none; }
}

/* ---- Sections and cards ------------------------------------------ */

main { display: block; }
.band { padding-block: 64px; }
.band.tint { background: var(--paper-2); border-block: 2px solid var(--soft-edge); }
.band-head { max-width: 760px; margin-bottom: 28px; }
.band-head p:last-child { margin-bottom: 0; }

.card {
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature { display: flex; flex-direction: column; gap: 8px; }
.feature .icon {
    width: 48px; height: 48px; padding: 11px; border-radius: 14px;
    background: var(--s-tint, var(--paper-2)); color: var(--s, var(--violet));
    border: 2px solid var(--edge);
}
.feature h3 { margin: 6px 0 0; }
.feature p { margin: 0; color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 32px; margin: 0; }
.ticks li::before {
    content: ""; position: absolute; left: 0; top: .3em; width: 20px; height: 20px; border-radius: 50%;
    background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f7a5f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.s-math { --s: var(--math); --s-tint: var(--math-tint); }
.s-polish { --s: var(--polish); --s-tint: var(--polish-tint); }
.s-english { --s: var(--english); --s-tint: var(--english-tint); }
.s-nature { --s: var(--nature); --s-tint: var(--nature-tint); }
.s-geography { --s: var(--geography); --s-tint: var(--geography-tint); }
.s-exam { --s: var(--exam); --s-tint: var(--exam-tint); }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: 14px; font-weight: 800; background: var(--s-tint, var(--paper-2)); color: var(--ink);
    border: 1.5px solid var(--s, var(--edge));
}

/* ---- The home page ------------------------------------------------ */

.hero { padding-block: 48px 64px; overflow: hidden; border-bottom: 2px solid var(--edge); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 1.6rem + 4vw, 4.4rem); line-height: 1.02; }
.hero .lead { font-size: 1.2rem; color: var(--ink); }
.hero .actions { margin-top: 8px; }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.facts li {
    margin: 0; padding: 8px 14px; border-radius: 12px; background: var(--card);
    border: 2px solid var(--edge); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums;
}
.facts b { font-weight: 900; }
.hero-art { position: relative; justify-self: center; width: min(100%, 340px); padding: 10px 30px 30px; }
.hero-art .phone { transform: rotate(3deg); }
.hero-art .bartek { position: absolute; width: 46%; left: -14%; bottom: -2%; filter: drop-shadow(3px 4px 0 rgba(31, 26, 58, .25)); }
.hero-art .mila { position: absolute; width: 30%; right: -16%; top: -6%; filter: drop-shadow(3px 4px 0 rgba(31, 26, 58, .25)); }
.sticker {
    position: absolute; z-index: 2; padding: 6px 12px; border-radius: 12px; font-weight: 900; font-size: 15px;
    background: var(--marker); color: var(--on-marker); border: 2px solid #1f1a3a; box-shadow: var(--shadow-small);
    white-space: nowrap;
}
.sticker.one { right: -6%; bottom: 22%; transform: rotate(-6deg); }
.sticker.two { left: -4%; top: 18%; transform: rotate(5deg); background: var(--card); color: var(--ink); border-color: var(--edge); }
@media (max-width: 860px) {
    .hero { padding-block: 32px 48px; }
    .facts { gap: 8px; }
    .facts li { padding: 6px 11px; font-size: 15px; }
    .hero .wrap { grid-template-columns: 1fr; }
    .hero-art { width: min(100%, 300px); }
}

/* A phone with a screenshot of the app in it. */
.phone {
    margin: 0; border: 7px solid #1f1a3a; border-radius: 30px; overflow: hidden; background: #1f1a3a;
    box-shadow: 6px 6px 0 var(--drop); aspect-ratio: 9 / 16;
}
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* The subjects. */
/* Rows of three: five subjects and the exam make two full rows, and the
   exam never stands alone in a row of its own. Three rows of two on a
   tablet, one under another on a phone. */
.subjects { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .subjects { grid-template-columns: minmax(0, 1fr); } }
.subject {
    display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink);
    background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px; border-top: 10px solid var(--s);
    transition: transform .12s ease, box-shadow .12s ease;
}
.subject:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--drop); }
.subject .icon { width: 44px; height: 44px; padding: 9px; border-radius: 12px; background: var(--s-tint); color: var(--s); }
.subject strong { font-size: 1.25rem; font-weight: 900; line-height: 1.2; }
.subject .grades { font-weight: 800; color: var(--s); }
.subject p { margin: 0; color: var(--muted); font-size: 16px; }
.subject .more { margin-top: auto; padding-top: 6px; font-weight: 800; color: var(--link); font-size: 16px; }

/* The games, as phones in a row: a strip to swipe, with arrows where
   there is a mouse. */
.shots-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 8px; }
.shots-arrows { display: flex; gap: 10px; margin: 0 0 14px auto; }
.shots-arrows[hidden] { display: none; }
.shots-arrows .btn { min-width: 52px; font-size: 20px; padding-inline: 14px; }
.shots {
    display: grid; gap: 24px; grid-auto-flow: column; grid-auto-columns: minmax(200px, 228px);
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 6px;
    padding: 6px 6px 22px; margin-inline: -6px;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.shot { margin: 0; scroll-snap-align: start; display: flex; flex-direction: column; gap: 12px; }
.shot .phone { border-width: 6px; border-radius: 26px; box-shadow: 5px 5px 0 var(--drop); }
.shot figcaption { display: grid; gap: 4px; font-size: 16px; line-height: 1.4; }
.shot figcaption strong { font-size: 17px; }
.shot figcaption span:last-child { color: var(--muted); }
.swipe-hint { display: none; color: var(--muted); font-size: 15px; margin: -12px 0 10px; }
@media (hover: none) { .swipe-hint { display: block; } }
@media (max-width: 700px) { .shots-arrows { display: none; } }

/* Mila, who teaches. */
.teach { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.teach .board { position: relative; width: min(100%, 300px); justify-self: center; }
.teach .board img.card-pic { display: block; width: 100%; border-radius: 12px; background: #fff; }
.teach .board .mila { position: absolute; width: 110px; right: -70px; bottom: -24px; }
@media (max-width: 820px) { .teach { grid-template-columns: 1fr; } .teach .board .mila { width: 84px; right: -8px; } }

/* For whom: the three ways in. */
.who { display: flex; flex-direction: column; gap: 10px; }
.who img { width: 84px; height: 84px; }
.who .ticks { font-size: 16px; }
.who .btn { margin-top: auto; align-self: flex-start; }

/* The price in short, and in full on the parents' page. */
.prices { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); align-items: stretch; }
.price { position: relative; display: flex; flex-direction: column; gap: 6px; }
.price .amount { font-size: 2.1rem; font-weight: 900; margin: 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
.price .per { color: var(--muted); margin: 0 0 6px; font-size: 16px; }
.price ul { margin: 0; font-size: 16px; }
.price.best { background: var(--exam-tint); }
.price .tag {
    position: absolute; top: -14px; right: 16px; padding: 3px 12px; border-radius: 999px;
    background: var(--marker); color: var(--on-marker); border: 2px solid #1f1a3a; font-weight: 900; font-size: 14px;
}

/* News, newest first, each with its day. */
.news { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.news li { margin: 0; display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 18px; padding-bottom: 14px; border-bottom: 2px dashed var(--soft-edge); }
.news li:last-child { border-bottom: 0; padding-bottom: 0; }
.news time { font-weight: 800; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.news h3 { font-size: 1.1rem; margin: 0 0 4px; }
.news p { margin: 0; }
@media (max-width: 600px) { .news li { grid-template-columns: 1fr; gap: 2px; } }

.cast { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.cast .card { text-align: center; }
.cast img { width: 112px; height: 112px; }
.cast p { margin: 6px 0 0; }

/* The closing call into the app. */
.cta { display: flex; gap: 24px; align-items: center; background: var(--paper-2); }
.cta img { width: 112px; height: 112px; flex: none; }
.cta h2 { margin-bottom: 6px; }
.cta p { color: var(--muted); margin: 0 0 16px; }
@media (max-width: 640px) { .cta { flex-direction: column; text-align: center; } .cta .actions { justify-content: center; } }

/* Steps in order: how to start. */
.steps-row { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: step; }
.steps-row li { margin: 0; counter-increment: step; position: relative; padding-top: 54px; }
.steps-row li::before {
    content: counter(step); position: absolute; top: 0; left: 0; width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 900; font-size: 20px;
    background: var(--marker); color: var(--on-marker); border: 2px solid #1f1a3a; box-shadow: var(--shadow-small);
}
.steps-row.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); row-gap: 28px; }
.steps-row h3 { margin-bottom: 4px; }
.steps-row p { margin: 0; color: var(--muted); }

/* Text beside a phone. */
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 40px; align-items: center; }
.split .phone { width: min(100%, 280px); justify-self: center; }
/* The phone first, on the left; under the words on a phone. */
.split.flip { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
@media (max-width: 820px) { .split, .split.flip { grid-template-columns: 1fr; } .split.flip > .phone { order: 2; } }

.faq { display: grid; gap: 12px; }
.faq details { background: var(--card); border: 2px solid var(--edge); border-radius: 14px; padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.faq details[open] summary { margin-bottom: 8px; }
.faq details p:last-child { margin-bottom: 0; }

/* ---- Inner pages: their heading ---------------------------------- */

.page-head { padding-block: 28px 36px; border-bottom: 2px solid var(--edge); }
.page-head .wrap { display: flex; gap: 28px; align-items: center; }
.page-head .text { flex: 1; min-width: 0; }
.page-head h1 { margin: 6px 0 10px; }
.page-head .intro { margin: 0; font-size: 1.1rem; max-width: 66ch; }
.page-head img.guide { width: 140px; height: 140px; flex: none; }
.crumbs { font-size: 15px; margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; font-weight: 700; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 4px; color: var(--muted); }
.crumbs a { color: var(--muted); }
@media (max-width: 640px) {
    .page-head img.guide { width: 84px; height: 84px; align-self: flex-start; }
}

.page main { padding-block: 8px 40px; }
.page main section { padding-top: 36px; }
.page main h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.8rem); }

/* ---- The subjects' and the exam's pages -------------------------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.tiles .card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-small); padding: 18px; transition: transform .12s ease, box-shadow .12s ease; }
.tiles .card:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow); }
.tiles .card strong { color: var(--link); font-size: 18px; line-height: 1.3; }
.tiles .card span { color: var(--muted); font-size: 15px; }
.grade-1, .grade-2, .grade-3 { border-top: 8px solid var(--geography) !important; }
.grade-4, .grade-5, .grade-6 { border-top: 8px solid var(--english) !important; }
.grade-7, .grade-8 { border-top: 8px solid var(--violet) !important; }

.cheat { display: grid; gap: 18px; }
.cheat .idea { font-size: 20px; font-weight: 700; margin: 0; }
.cheat figure { margin: 0; background: #fff; color: #1f1a3a; border-radius: 14px; padding: 10px; border: 2px solid var(--soft-edge); text-align: center; overflow-x: auto; }
.cheat figure img { max-width: 100%; width: 380px; height: auto; }
.cheat figure table { margin-inline: auto; text-align: left; }
.cheat figcaption { font-size: 14px; color: #57506f; }
.cheat figure .options li { background: #f5f0ff; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.steps li::before {
    content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%;
    background: var(--violet); color: var(--on-violet); font-weight: 900; display: grid; place-items: center; font-size: 15px;
}
.example { background: var(--paper-2); border-radius: 14px; padding: 16px 18px; }
.example p { margin: 4px 0; }
.answer { font-weight: 800; color: var(--ok); }
.tip { display: flex; gap: 14px; align-items: center; background: var(--tip); border-radius: 14px; padding: 14px 18px; }
.tip img { width: 64px; height: 64px; flex: none; }
.tip p { margin: 0; }

.task { display: grid; gap: 10px; }
.task + .task { margin-top: 18px; }
.task header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.task header h3 { margin: 0; }
.task .points { color: var(--muted); font-size: 15px; white-space: nowrap; }
.task p { margin: 0; }
.task .question { font-weight: 800; }
.task figure { margin: 0; background: #fff; border-radius: 12px; padding: 8px; border: 2px solid var(--soft-edge); overflow-x: auto; }
.task figure img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.options { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.options li { background: var(--paper-2); border-radius: 12px; padding: 6px 14px; margin: 0; font-variant-numeric: tabular-nums; }
.options b { color: var(--link); margin-right: 6px; }
.pairs { border-collapse: collapse; }
.pairs td { padding: 4px 18px 4px 0; }
.pairs th { padding: 4px 18px 4px 0; text-align: left; font-size: 14px; color: var(--muted); }
.task details, .cheat details { background: var(--ok-soft); border-radius: 14px; padding: 10px 16px; }
.task summary, .cheat summary { cursor: pointer; font-weight: 800; color: var(--ok); }
.task details ol { margin: 10px 0 6px; padding-left: 22px; }
.part + .part { border-top: 2px dashed var(--soft-edge); padding-top: 12px; }
/* The story, the question, the options and the solution, each with room
   of its own; the label stays close to the options it names, and the
   solution stands a little apart, after the thinking. */
.part { display: grid; gap: 10px; }
.part > .label { margin-bottom: -6px; }
.part > details { margin-top: 8px; }

.links-list { margin: 0; padding-left: 20px; }
.links-list li { margin: 4px 0; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager a { text-decoration: none; font-weight: 800; }
table { max-width: 100%; }

/* ---- Documents: the terms, the privacy policy, the pages from e-mail
   links. Read from top to bottom, on a sheet of their own. */

.doc { max-width: 820px; margin: 32px auto 48px; padding: 28px 28px 32px; }
.doc h1 { font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.2rem); margin: 0 0 4px; }
.doc h2 { font-size: 1.3rem; margin: 32px 0 8px; }
.doc .meta { color: var(--muted); margin: 0 0 16px; }
.doc .box { border-left: 5px solid var(--violet); background: var(--paper-2); padding: 12px 16px; border-radius: 0 12px 12px 0; }
@media (max-width: 860px) { .doc { margin: 20px 16px 40px; padding: 22px 18px; } }

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

.site-foot { margin-top: 24px; padding-block: 48px 40px; border-top: 2px solid var(--edge); background: var(--paper-2); font-size: 16px; }
.site-foot .cols { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
.site-foot h2 { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-foot li { margin: 0; }
.site-foot a { color: var(--ink); text-decoration: none; font-weight: 700; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .about p { color: var(--muted); }
.site-foot .about .brand { margin-bottom: 10px; }
.site-foot .small { margin-top: 32px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
.site-foot .small a { color: var(--muted); font-weight: 700; }
@media (max-width: 860px) { .site-foot .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .site-foot .about { grid-column: 1 / -1; } }
@media (max-width: 420px) { .site-foot .cols { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .subject, .tiles .card { transition: none; }
}
