:root{--fg:#0a0a0a;--mute:#666;--bg:#fff;--accent:#1d4ed8;--line:#e5e5e5}
*{box-sizing:border-box;margin:0;padding:0}
html,body{font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:var(--fg);background:var(--bg);line-height:1.5;-webkit-font-smoothing:antialiased}
body{padding:0 20px 60px;max-width:760px;margin:0 auto;opacity:0;transition:opacity .15s}
body.ready{opacity:1}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:14px 0;gap:12px;flex-wrap:wrap}
.open-app-link{color:var(--accent);font-size:.9rem;font-weight:600;text-decoration:none;padding:6px 10px;border:1px solid var(--accent);border-radius:6px;transition:background .15s,color .15s}
.open-app-link:hover{background:var(--accent);color:#fff}
.lang-switch{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap}
.lang-switch button{background:none;border:0;color:var(--mute);font:inherit;font-size:.85rem;cursor:pointer;padding:4px 6px}
.lang-switch button.is-active{color:var(--fg);font-weight:600}
.lang-switch button:hover{color:var(--fg)}
.lang-select{display:none}
main>section{padding:36px 0;border-bottom:1px solid var(--line)}
main>section:last-child{border-bottom:0}
.hero{padding-top:24px;border-bottom:0;padding-bottom:8px}
/* Edge-to-edge grey band behind the demo carousel. slate-200 — darker than the
 * page background, still much lighter than the demo card (slate-900). box-shadow
 * paints the band past the body's max-width without changing layout; clip-path
 * keeps the paint vertically constrained so it doesn't bleed into adjacent
 * sections. The CTA lead + button live in their own .demos-cta section below,
 * which keeps the normal white background. */
.demos{padding-top:24px;padding-bottom:36px;background:#94a3b8;border-bottom:0;box-shadow:0 0 0 100vmax #94a3b8;clip-path:inset(0 -100vmax)}
.demos-cta{padding-top:28px;padding-bottom:36px;border-bottom:1px solid var(--line)}
.eyebrow{color:var(--mute);font-style:italic;font-size:.95rem;margin-bottom:14px}
h1{font-size:2rem;line-height:1.2;letter-spacing:-0.01em;margin-bottom:14px}
h2{font-size:1.5rem;line-height:1.25;margin-bottom:18px}
h3{font-size:1.05rem;margin-bottom:6px}
.sub{color:var(--mute);font-size:1.1rem;margin-bottom:18px}
.hero-try-now{display:inline-block;color:var(--accent);font-weight:600;font-size:1.05rem;text-decoration:none;border-bottom:2px solid transparent;transition:border-color .15s}
.hero-try-now:hover{border-bottom-color:var(--accent)}
html{scroll-behavior:smooth}
.tiers-grid{display:grid;gap:20px;grid-template-columns:1fr}
.demos>.sub{margin-bottom:18px}

/* --- Demo carousel: Embla loop mode, iPhone-sized card centred, arrows + dots --- */
.demos-carousel{position:relative}
/* Soft fade-out at the left/right edges so the carousel slides melt into the
 * grey band instead of clipping with a hard line. The mask is on the embla
 * viewport (the overflow:hidden container); the arrow buttons are positioned
 * outside it, so they stay fully opaque. */
.demos-viewport{overflow:hidden;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 8%,#000 92%,transparent 100%);mask-image:linear-gradient(to right,transparent 0,#000 8%,#000 92%,transparent 100%)}
.demos-viewport:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:14px}
/* Use per-slide right-margin instead of flex `gap` — Embla translates slides
 * around in loop mode, and `gap` (which lives between DOM siblings) doesn't
 * follow the translation, so visually the gap appears only between un-moved
 * slides. Margin "belongs to" the slide and goes with it.
 * Physical `margin-right` on purpose (same for the arrows' left/right below):
 * .demos is an LTR island even on the ar/fa variants — see the RTL block at
 * the bottom of this file — so the carousel never mirrors. */
.demos-track{display:flex;touch-action:pan-y pinch-zoom}
.demos-track .demo-slide{margin-right:14px}
.demo-slide{flex:0 0 360px;max-width:100%;display:flex;flex-direction:column;gap:10px}
.demo-label{margin:0;font-size:.95rem;font-weight:600;color:var(--fg);text-align:center;letter-spacing:-0.01em}
.demo-card{height:600px;background:#0f172a;border:1px solid #1e293b;border-radius:14px;overflow:hidden;display:flex;align-items:stretch;justify-content:stretch;color:#94a3b8;font-size:.9rem;position:relative;min-width:0}
/* The SPA's .card-stack sets `min-height: 60vh` so the flashcard fills mobile
 * screens. Inside the bounded landing demo card it forces the flashcard out of
 * the parent box. Reset to flex naturally so the card-stack shares space with
 * the answer buttons properly. Leave .flashcard alone — it positions absolute
 * inside .card-stack with `inset: 12px 16px`, and that works fine as long as
 * .card-stack is now flex-bounded. */
.demo-card .card-stack{min-height:0;flex:1 1 auto;min-width:0;position:relative}
.demo-card .quiz-actions{flex:0 0 auto}
.demo-card:has(.multistage-compact){align-items:stretch;justify-content:stretch;color:inherit}
.demo-card .multistage-compact{width:100%;height:100%;display:flex;flex-direction:column}
/* Article-quiz buttons in compact landing mode use the same compact footprint
 * as prep/adj/plural (the .article-btn default — 22px padding, 1.4rem font —
 * was tuned for the standalone SPA Article Quiz, where the buttons ARE the
 * whole card). Colors (der/die/das mnemonic) keep working — the rule below
 * only overrides size, not background/border. */
.demo-card .article-actions-default .article-btn{padding:10px 6px;font-size:1.05rem;border-radius:10px}
/* Compact-mode finished state: big verdict + button-styled CTA. Scoped to
 * .demo-card so SPA usages (if added later) stay opt-in. Flips into view
 * like a card turning to show its back face. */
@keyframes demo-card-flip-in{
  0%{transform:perspective(900px) rotateY(-90deg);opacity:0}
  50%{transform:perspective(900px) rotateY(-30deg);opacity:.6}
  100%{transform:perspective(900px) rotateY(0);opacity:1}
}
.demo-card .multistage-compact:has(.cta){align-items:center;justify-content:center;gap:32px;padding:32px 20px;animation:demo-card-flip-in 600ms cubic-bezier(.4,0,.2,1) both;transform-origin:center;backface-visibility:hidden}
.demo-card .multistage-compact .quiz-actions:has(.cta){display:flex;flex-direction:column;align-items:center;gap:24px;padding:0;width:100%;background:none;border:0;box-shadow:none;grid-template-columns:none}
.demo-card .multistage-compact .finished-hint{font-size:4.5rem;line-height:1;font-weight:700;color:#fff}
.demo-card .multistage-compact .verdict-ok{color:#4ade80}
.demo-card .multistage-compact .verdict-err{color:#f87171}
.demo-card .multistage-compact a.cta{display:inline-block;padding:14px 22px;background:#3b82f6;color:#fff;text-decoration:none;border-radius:10px;font-weight:600;font-size:1rem;max-width:100%;text-align:center;transition:background .15s}
.demo-card .multistage-compact a.cta:hover{background:#60a5fa}
@media(max-width:420px){
  .demo-slide{flex:0 0 calc(100vw - 56px)}
  .demo-card{height:620px}
}

.carousel-arrow{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:40px;border-radius:50%;background:var(--bg);border:1px solid var(--line);color:var(--fg);font:inherit;font-size:1.5rem;line-height:1;cursor:pointer;z-index:2;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px rgba(0,0,0,.06)}
.carousel-arrow:hover{border-color:var(--fg);background:#fafafa}
.carousel-arrow:disabled{opacity:.4;cursor:default}
.carousel-prev{left:-4px}
.carousel-next{right:-4px}
@media(max-width:520px){
  .carousel-arrow{display:none}
}

.demos-dots{display:flex;justify-content:center;gap:8px;margin-top:14px}
.demos-dots span{width:8px;height:8px;border-radius:50%;background:var(--line);transition:background .15s}
.demos-dots span.is-active{background:var(--fg)}

.demos-cta-lead{color:var(--mute);font-size:.95rem;margin:0 0 12px;text-align:center}
.demos-cta-note{color:var(--mute);font-size:.95rem;margin:0 0 14px;text-align:center}
/* Primary = real button (dark filled), secondary = plain text link below it.
 * Two buttons side-by-side felt like a fork in the road; the text-link makes
 * the hierarchy obvious — Sign up is THE call to action, "Or try without
 * signup" is a low-commitment escape hatch. */
.demos-cta-buttons{display:flex;flex-direction:column;align-items:center;gap:14px;margin:0 auto;width:fit-content;max-width:100%}
.demos-cta-button{display:inline-block;text-decoration:none;transition:background .15s,color .15s,border-color .15s}
.demos-cta-button.primary{padding:14px 28px;background:var(--fg);color:#fff;border-radius:8px;font-weight:600;font-size:1.05rem;text-align:center}
.demos-cta-button.primary:hover{background:var(--accent)}
/* Equal visual weight with primary: for sceptical traffic (Reddit) the
 * "no sign-up" path is the main offer, a text link hid it. */
.demos-cta-button.secondary{padding:13px 28px;border:1.5px solid var(--fg);border-radius:8px;color:var(--fg);font-weight:600;font-size:1.05rem;text-align:center}
.demos-cta-button.secondary:hover{background:var(--fg);color:#fff}

/* --- AI tutor closed-beta teaser. The CTA reuses .demos-cta-button.primary and
 * leads to sign-up: the beta queue lives inside the app, not on the landing. */
.tutor-beta-badge{display:inline-block;color:var(--accent);border:1px solid var(--accent);border-radius:999px;padding:2px 12px;font-size:.85rem;font-weight:600;margin-bottom:14px}
.tutor-beta-line{color:var(--mute);font-size:1.05rem;margin-bottom:10px;max-width:560px}
.tutor-beta .tutor-beta-cta{margin-top:10px}

.howto ol{padding-inline-start:24px}
.howto li{margin-bottom:10px}
.tier{padding:18px;border:1px solid var(--line);border-radius:10px}
.tier p{color:var(--mute);font-size:.95rem}
.tier-note{color:var(--mute);font-size:.85rem;margin-top:14px;text-align:center}
footer{padding:30px 0 0;color:var(--mute);font-size:.85rem;text-align:center}
footer a{color:var(--mute)}
footer p+p{margin-top:6px}
.community a{white-space:nowrap}
/* Deck table: borderless, language codes across the columns. On a narrow screen
 * 13 columns do not fit, so below 520px every row is laid out as two rows: the
 * textbook name, and under it a row of codes (12 × 26px = 312px < 360). */
.decks{margin:10px auto 0;border-collapse:collapse;color:var(--mute)}
.decks caption{padding-bottom:4px}
.decks th{font-weight:400;text-align:start;padding:2px 0;padding-inline-end:12px;white-space:nowrap}
/* The horizontal padding is given to the separator entirely: keep it on both
   the cell and the dot and the gap to the left of the dot becomes twice the one
   to its right, and the row drifts. */
/* The separator holds the column width, so min-width is gone: it only reached
   the first cell (which has no dot to its left) and made the first gap a pixel
   and a half wider than the rest. */
.decks td{padding:2px 0;text-align:center}
/* Separator between the codes. Without it the codes sit flush: the gap between
   cells equals the gap between letters inside a code, and the row reads as
   "RUENTRPL", one word. A dot, not a line: the table is deliberately
   borderless, and the dot is the same separator as the line above in "Find us:
   Reddit · Telegram · X". Two declarations in a row are progressive
   enhancement: the second hands a screen reader an empty alternative instead of
   "dot" between the links, and where it is not understood the first remains. */
.decks td+td::before{content:"·";padding-inline:6px}
.decks td+td::before{content:"·" / "";padding-inline:6px}
.decks a{text-decoration:none;letter-spacing:.03em}
.decks a:hover{text-decoration:underline}
.decks+p{margin-top:12px}
.community .chan svg{width:1em;height:1em;fill:currentColor;vertical-align:-.15em;margin-inline-end:.3em}
@media(min-width:720px){
  .demos-grid{grid-template-columns:repeat(3,1fr)}
  .tiers-grid{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:520px){
  .lang-switch button{display:none}
  .decks,.decks caption,.decks tbody{display:block}
  .decks tr{display:flex;flex-wrap:wrap;justify-content:center}
  .decks th{flex:0 0 100%;text-align:center;padding:8px 0 2px}
  /* On a narrow screen there is no separator: the row is already folded into a
     strip of 12 cells of 26px (312px fits in 360px), the dots would add ~96px
     and spill the row onto a second line. Fixed-width cells space the codes
     out by themselves. */
  .decks td{flex:0 0 26px;padding:0}
  .decks td+td::before{content:none}
  .lang-select{display:inline-block;padding:8px 10px;font:inherit;font-size:.9rem;background:var(--bg);border:1px solid var(--line);border-radius:6px}
}

/* The 404 page. Its own visibility: styles.css holds body{opacity:0} and it is
   script.js that reveals .ready — this page does not have it (it would fight
   over lang and pull the demo bundle in for an error screen). */
body.error{opacity:1;display:flex;flex-direction:column;min-height:100vh}
.error-brand{color:var(--fg);font-weight:700;text-decoration:none}
.error-main{flex:1;display:flex;flex-direction:column;justify-content:center;padding:40px 0 80px}
.error-code{font-size:3rem;font-weight:700;color:var(--line);line-height:1}
.error-title{font-size:1.5rem;margin:8px 0 12px}
.error-text{color:var(--mute);max-width:46ch}
.error-links{margin-top:24px;font-size:.95rem;color:var(--mute)}
.error-links a{color:var(--accent);text-decoration:none}
.error-links a:hover{text-decoration:underline}

/* ============================================================
 * RTL — the Arabic and Persian variants (2026-08-21)
 * ============================================================
 * Direction is set in exactly one place: <html dir="rtl"> in the
 * index.ar.html / index.fa.html variants (scripts/render_landing_variants.py)
 * and the same thing in script.js when a visitor switches language on the fly.
 * The browser mirrors the layout itself from there — everything is flex/grid
 * and logical properties, no physical offsets are left in the text flow.
 *
 * The rules below describe the EXCEPTIONS — parts of the page that must stay
 * left-to-right even on the Arabic page. For the ten LTR languages the whole
 * block is a no-op: no rule matches without dir="rtl" on the root.
 */

/* The demo carousel is an LTR island. Inside the cards lives the app interface,
 * and it is GERMAN: both the button labels and the exercise sentences. It must
 * not be mirrored, plus Embla in loop mode measures slide offsets from the left
 * edge (slides are spread with margin-right, arrows are positioned left/right),
 * so an RTL container would break the carousel before it broke the typography.
 * The slide heading is an exception within the exception: it is translated
 * (data-i18n), and `plaintext` gives it its own direction from its first strong
 * character. The .demos-cta section is NOT part of the island: the text there is
 * in the visitor's language. */
[dir="rtl"] .demos{direction:ltr}
.demo-label{unicode-bidi:plaintext}

/* The German epigraph and the footer: a paragraph takes its direction from its
 * own first strong character (the Unicode P2/P3 rule, the same one dir="auto"
 * applies). Without this, on the Arabic page the full stop of the German quote
 * drifts to the left edge and the line "Anki: Menschen A1 DE→RU · DE→EN · …"
 * comes out back to front: the Latin deck names are separated by neutral "·",
 * and neutrals between runs of the same direction take the direction of the
 * PARAGRAPH, i.e. RTL.
 * unicode-bidi is not inherited, so the rule hangs on the paragraphs themselves.
 * The "Find us:" line is translated — its first strong character is Arabic, the
 * paragraph honestly becomes RTL, and the channel order mirrors along with it. */
.eyebrow,
footer p{unicode-bidi:plaintext}

/* --- Reader comic teaser: a card linking to /reader/ (comic + guide) and a
 * "Request access" mailto: the reader is an invite-only beta. */
.reader-promo-card{display:flex;align-items:flex-start;gap:18px;padding:14px;border:1.5px solid var(--fg);border-radius:12px;color:var(--fg);box-shadow:4px 4px 0 var(--fg)}
.reader-promo-pic{flex:none;line-height:0}
.reader-promo-card img{width:132px;height:165px;object-fit:cover;border-radius:6px;border:1.5px solid var(--fg)}
.reader-promo-text{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0}
.reader-promo-badge{color:var(--accent);border:1px solid var(--accent);border-radius:999px;padding:0 10px;font-size:.78rem;font-weight:600}
.reader-promo-title{font-weight:700;font-size:1.15rem;line-height:1.25}
.reader-promo-sub{color:var(--mute);font-size:.95rem}
.reader-promo-link{color:var(--accent);font-weight:600;text-decoration:none}
.reader-promo-link:hover{text-decoration:underline}
.reader-promo-access{margin-top:6px;padding:8px 16px;background:var(--fg);color:#fff;border-radius:8px;font-weight:600;font-size:.95rem;text-decoration:none}
.reader-promo-access:hover{background:var(--accent)}
@media(max-width:420px){.reader-promo-card img{width:104px;height:130px}.reader-promo-card{gap:14px}}
/* the card sits right under the hero now: less room above it */
.hero+.reader-promo{padding-top:8px;padding-bottom:28px;border-bottom:0}
