/* ==========================================================================
   Wörtzel — Немецкий вприкуску · Mirelight Studio
   Warm bakery palette: cream dough, pretzel orange, baked crust, salt white.
   ========================================================================== */
:root {
  --cream: #fff7ec;
  --cream-2: #fcebd3;
  --paper: #fffdf8;
  --ink: #2b1609;
  --ink-2: #5c3b26;
  --ink-3: #8b6a52;
  --orange: #f28a1e;
  --orange-l: #ffbe6b;
  --orange-d: #d9690b;
  --crust: #8e3b12;
  --red: #e5332a;
  --green: #2f9e6b;
  --green-l: #dff3e8;
  --bad-l: #fde3df;
  --line: rgba(43, 22, 9, 0.1);
  --shadow-sm: 0 2px 6px rgba(74, 34, 8, 0.08);
  --shadow: 0 12px 34px -12px rgba(74, 34, 8, 0.28);
  --shadow-lg: 0 30px 70px -24px rgba(74, 34, 8, 0.45);
  --r: 22px;
  --r-sm: 14px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Unbounded', 'Onest', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --nav-h: 72px;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: var(--orange-d); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(2rem, 4.4vw, 3.3rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
kbd { font-family: var(--font); font-size: 0.78em; font-weight: 600; padding: 0.12em 0.45em; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); border-bottom-width: 2px; }
mark { background: #ffd89b; color: inherit; border-radius: 3px; padding: 0 2px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip:focus { left: 8px; }
.wrap { width: min(1220px, 100% - 40px); margin-inline: auto; }
.center { text-align: center; margin-top: 28px; }
.muted { color: var(--ink-3); }
.noscript { position: fixed; bottom: 0; inset-inline: 0; background: var(--ink); color: #fff; padding: 12px; text-align: center; margin: 0; z-index: 300; }

/* --- Buttons ------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; padding: 0.8em 1.35em; border-radius: 999px; border: 0; background: var(--paper); color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; transition: transform 0.25s var(--spring), box-shadow 0.25s, background 0.2s; position: relative; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-primary { background: linear-gradient(180deg, #ffa443, var(--orange-d)); color: #fff; box-shadow: 0 6px 0 var(--crust), 0 14px 26px -10px rgba(217, 105, 11, 0.7); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15); }
.btn-primary:hover { box-shadow: 0 8px 0 var(--crust), 0 18px 30px -10px rgba(217, 105, 11, 0.75); }
.btn-primary:active { box-shadow: 0 2px 0 var(--crust), 0 8px 18px -10px rgba(217, 105, 11, 0.7); transform: translateY(4px); }
.btn-ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { background: var(--paper); box-shadow: inset 0 0 0 2px var(--orange); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--crust); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); }
.btn-tg { background: #2aabee; color: #fff; }
.btn-tg svg { width: 18px; height: 18px; }
.btn-sm { padding: 0.55em 1em; font-size: 0.9rem; }
.btn-lg { padding: 1em 1.7em; font-size: 1.05rem; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); display: inline-grid; place-items: center; font-size: 1.1rem; transition: transform 0.25s var(--spring); flex: none; }
.icon-btn:hover { transform: scale(1.1) rotate(-6deg); }
.icon-btn.sm { width: 36px; height: 36px; font-size: 0.95rem; }

/* ==========================================================================
   LOADER
   ========================================================================== */
.loader { display: none; }
.js .loader {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 214, 150, 0.55), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='%23fff' fill-opacity='.22'%3E%3Crect x='14' y='18' width='6' height='6' transform='rotate(45 17 21)'/%3E%3Crect x='62' y='52' width='5' height='5' transform='rotate(45 64 54)'/%3E%3Crect x='40' y='78' width='4' height='4' transform='rotate(45 42 80)'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(160deg, #ffa443 0%, #f28a1e 45%, #c9580a 100%);
  clip-path: circle(150% at 50% 50%);
  transition: clip-path 0.9s var(--ease), opacity 0.6s 0.3s;
}
.loader.out { clip-path: circle(0% at 50% 45%); opacity: 0; pointer-events: none; }
.loader-stage { position: relative; width: min(420px, 86vw); aspect-ratio: 1; display: grid; place-items: center; }
.loader-draw { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.25; transform: scale(1.25); }
.loader-draw path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: draw 2.2s var(--ease) forwards; }
.ld-outline { stroke: #7a2e08; stroke-width: 58; }
.loader-draw .ld-dough { stroke: #ffe0b0; stroke-width: 40; animation-delay: 0.15s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.loader-hero { width: 62%; animation: loaderPop 0.9s 0.5s var(--spring) both; position: relative; z-index: 1; }
@keyframes loaderPop { from { transform: translateY(60px) scale(0.6); opacity: 0; } }
.loader-bubble { position: absolute; top: -6%; left: 50%; translate: -50% 0; z-index: 2; width: max-content; max-width: min(380px, 88vw); background: #fff; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: clamp(0.95rem, 2.4vw, 1.2rem); line-height: 1.3; text-align: center; padding: 14px 22px; border-radius: 22px; box-shadow: 0 12px 30px -10px rgba(80, 30, 0, 0.5); opacity: 0; transform: scale(0.7) translateY(10px); transition: opacity 0.25s, transform 0.4s var(--spring); }
.loader-bubble::after { content: ''; position: absolute; left: 50%; bottom: -10px; width: 22px; height: 22px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 4px; }
.loader-bubble.show { opacity: 1; transform: none; }
.loader-bubble b { color: var(--orange-d); }
.loader-bottom { display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 120px; }
.loader-bar { width: min(260px, 70vw); height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: #fff; border-radius: inherit; transition: width 0.3s; }
.loader-go { animation: loaderPop 0.5s var(--spring); }
.loader-go.btn-primary { background: #fff; color: var(--crust); box-shadow: 0 6px 0 rgba(90, 30, 0, 0.45); text-shadow: none; }
.loader-skip { background: none; border: 0; color: rgba(255, 255, 255, 0.85); text-decoration: underline; text-underline-offset: 3px; font-size: 0.9rem; }

/* ==========================================================================
   WÖRTZEL character animations
   ========================================================================== */
/* ---------- Wörtzel mascot (image-based) ---------- */
.wortzel { position: relative; display: block; width: 100%; aspect-ratio: 1; user-select: none; -webkit-user-select: none; }
.wortzel .w-lean { position: absolute; inset: 0; display: block; perspective: 900px; transform-origin: 50% 96%; transform: rotate(var(--lean, 0deg)) translateY(var(--tilt, 0px)); transition: transform 0.6s var(--ease); }
.wortzel .w-fig { position: absolute; inset: 0; display: block; transform-origin: 50% 96%; }
.wortzel .w-img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; transform: rotateY(var(--turn, 0deg)); transition: transform 0.6s var(--ease); }
.wortzel .w-shadow { position: absolute; left: 22%; right: 22%; bottom: 1%; height: 7%; border-radius: 50%; background: radial-gradient(closest-side, rgba(58, 31, 15, 0.32), transparent); }
.wortzel.pose-in .w-img { animation: poseIn 0.38s var(--spring); }
@keyframes poseIn { from { opacity: 0.35; transform: scale(0.94) rotateY(var(--turn, 0deg)); } }

.wortzel .w-prop { position: absolute; top: 2%; right: -6%; z-index: 2; }
.wortzel .w-sign { display: inline-block; max-width: 13em; padding: 0.45em 0.8em; border-radius: 12px; background: #fffbf4; border: 3px solid var(--ink); color: var(--ink); font: 700 clamp(0.72rem, 1.3vw, 0.95rem)/1.15 Unbounded, sans-serif; box-shadow: 0 6px 0 rgba(58, 31, 15, 0.18); transform: rotate(6deg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: signIn 0.5s var(--spring); }
@keyframes signIn { from { opacity: 0; transform: translateY(18px) rotate(-6deg) scale(0.7); } }

.wortzel.is-idle .w-fig { animation: bob 3s ease-in-out infinite; }
.wortzel.is-idle .w-shadow { animation: shadowBob 3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-2.2%) rotate(-1.2deg); } 50% { transform: translateY(-3.2%) rotate(0); } 75% { transform: translateY(-2.2%) rotate(1.2deg); } }
@keyframes shadowBob { 50% { transform: scaleX(0.88); opacity: 0.7; } }

.wortzel.is-wave .w-fig { animation: rock 1.4s ease-in-out; }
@keyframes rock { 20% { transform: rotate(-4deg) translateY(-2%); } 45% { transform: rotate(3deg); } 70% { transform: rotate(-2deg) translateY(-1%); } }

.wortzel.is-jump .w-fig { animation: jump 0.9s var(--ease); }
.wortzel.is-jump .w-shadow { animation: shadowJump 0.9s var(--ease); }
@keyframes jump { 0% { transform: none; } 15% { transform: scale(1.06, 0.9); } 45% { transform: translateY(-16%) scale(0.96, 1.05); } 75% { transform: scale(1.05, 0.93); } 100% { transform: none; } }
@keyframes shadowJump { 45% { transform: scaleX(0.6); opacity: 0.35; } }

.wortzel.is-happy .w-fig { animation: hop 0.5s ease-in-out 2; }
@keyframes hop { 50% { transform: translateY(-8%) scale(1.02); } }

.wortzel.is-wiggle .w-fig { animation: wiggle 0.6s ease-in-out; }
@keyframes wiggle { 20% { transform: rotate(-7deg); } 45% { transform: rotate(6deg); } 70% { transform: rotate(-4deg); } }

.wortzel.is-sad .w-fig { animation: slump 1.4s var(--ease) both; }
@keyframes slump { 30%, 70% { transform: translateY(3%) rotate(-4deg) scaleY(0.95); } }

.wortzel.is-think .w-fig { animation: thinkTilt 1.4s var(--ease) both; }
@keyframes thinkTilt { 30%, 75% { transform: rotate(-5deg) translateX(-2%); } }

.wortzel.is-shrug .w-fig { animation: shrugB 1.2s var(--ease) both; }
@keyframes shrugB { 30%, 70% { transform: translateY(-4%) scale(1.02); } }

.wortzel.is-dance .w-fig { animation: dance 0.6s ease-in-out infinite; }
@keyframes dance { 0%, 100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-6%); } }

/* ==========================================================================
   SCROLL PROGRESS + NAV
   ========================================================================== */
.scroll-progress { position: fixed; top: 0; inset-inline: 0; height: 4px; z-index: 120; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange-l), var(--orange), var(--crust)); }
.scroll-progress img { position: absolute; top: -9px; width: 22px; height: 22px; left: -11px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25)); }
.nav { position: fixed; top: 10px; left: 50%; translate: -50% 0; z-index: 110; width: min(1240px, 100% - 20px); height: var(--nav-h); display: flex; align-items: center; gap: 20px; padding: 0 14px 0 18px; border-radius: 999px; transition: background 0.3s, box-shadow 0.3s; }
.nav.scrolled { background: rgba(255, 250, 242, 0.8); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.6); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1.25rem; }
.brand-mark { width: 44px; height: 38px; transition: transform 0.6s var(--spring); }
.brand:hover .brand-mark { transform: rotate(-14deg) scale(1.08); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text small { font-family: var(--font); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.04em; color: var(--ink-3); margin-top: 4px; }
.nav-links { display: flex; gap: 4px; margin-inline: auto; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 8px 14px; border-radius: 999px; transition: background 0.2s, color 0.2s; }
.nav-links a:hover { background: rgba(242, 138, 30, 0.12); color: var(--ink); }
.nav-links a.active { background: var(--ink); color: #fff; }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.stat-pill { display: flex; gap: 10px; padding: 8px 14px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: 0.9rem; }
.stat-pill.bump { animation: bump 0.5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.15); } }
#xp { color: var(--orange-d); }
.burger { display: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--ink); position: relative; flex: none; }
.burger span { position: absolute; left: 13px; right: 13px; height: 2px; background: #fff; border-radius: 2px; transition: transform 0.3s var(--ease); }
.burger span:first-child { top: 18px; }
.burger span:last-child { top: 25px; }
.nav.open .burger span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.open .burger span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + 40px) 0 90px; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 70% 40%, #ffe6c4 0%, transparent 55%), linear-gradient(180deg, #fff3e2, var(--cream)); }
.glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; transition: transform 1.2s var(--ease); }
.g1 { width: 520px; height: 520px; background: #ffb459; right: -120px; top: 6%; }
.g2 { width: 380px; height: 380px; background: #ffd9a8; left: -120px; bottom: -80px; }
.g3 { width: 240px; height: 240px; background: #ff9f8a; left: 42%; top: 12%; opacity: 0.3; }
.salt-snow { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 1px rgba(160, 90, 30, 0.6)); }
.floating-words { position: absolute; inset: 0; transition: transform 1s var(--ease); }
.floating-words span { position: absolute; font-family: var(--display); font-weight: 700; font-size: calc(clamp(0.8rem, 1.3vw, 1.1rem) * var(--s, 1)); color: var(--crust); opacity: 0.08; white-space: nowrap; animation: floaty 9s ease-in-out infinite; animation-delay: calc(var(--d) * -1); }
@keyframes floaty { 50% { transform: translateY(-18px) rotate(-2deg); } }
.hero-inner { width: min(1220px, 100% - 40px); margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 30px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 8px 16px 8px 12px; background: rgba(255, 255, 255, 0.75); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 0.92rem; color: var(--ink-2); }
.eyebrow .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(47, 158, 107, 0.2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(47, 158, 107, 0); } }
.hero h1 { font-size: clamp(3rem, 7vw, 6.6rem); font-weight: 900; letter-spacing: -0.045em; line-height: 0.95; }
.hero h1 .line { display: block; padding-bottom: 0.06em; }
.hero h1 em { font-style: normal; display: inline-block; color: transparent; background: linear-gradient(180deg, #ffad4f 0%, var(--orange) 45%, var(--crust) 120%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 4px 0 rgba(142, 59, 18, 0.18)); }
/* a bite taken out of the word */
.hero h1 em.bitten {
  padding-right: 0.12em;
  -webkit-mask: radial-gradient(circle at 100% 0.1em, transparent 0.19em, #000 0.2em), radial-gradient(circle at calc(100% - 0.24em) -0.04em, transparent 0.16em, #000 0.17em);
  -webkit-mask-composite: source-in;
  mask: radial-gradient(circle at 100% 0.1em, transparent 0.19em, #000 0.2em), radial-gradient(circle at calc(100% - 0.24em) -0.04em, transparent 0.16em, #000 0.17em);
  mask-composite: intersect;
}
.js body:not(.entered) .hero h1, .js body:not(.entered) .hero-copy > *:not(h1) { opacity: 0; transform: translateY(30px); }
.js .hero h1, .js .hero-copy > * { transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .hero-copy > :nth-child(3) { transition-delay: 0.2s; }
.js .hero-copy > :nth-child(4) { transition-delay: 0.3s; }
.js .hero-copy > :nth-child(5) { transition-delay: 0.4s; }
.js body:not(.entered) .hero-stage { opacity: 0; transform: translateY(60px) scale(0.92); }
.js .hero-stage { transition: opacity 1s var(--ease) 0.15s, transform 1.1s var(--spring) 0.15s; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.22rem); color: var(--ink-2); max-width: 34em; margin: 26px 0 32px; }
.lead b { color: var(--ink); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats { display: flex; gap: clamp(20px, 4vw, 48px); margin: 44px 0 0; }
.hero-stats div { position: relative; }
.hero-stats div + div::before { content: ''; position: absolute; left: calc(clamp(20px, 4vw, 48px) / -2); top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.hero-stats dt { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 3vw, 2.5rem); color: var(--ink); }
.hero-stats dd { margin: 0; color: var(--ink-3); font-weight: 500; }
.hero-stage { position: relative; display: grid; place-items: center; min-height: 540px; }
.halo { position: absolute; width: min(540px, 96%); aspect-ratio: 1; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(242, 138, 30, 0.16) 0 9deg, transparent 9deg 18deg); -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); mask: radial-gradient(circle, #000 25%, transparent 70%); animation: spin 60s linear infinite; }
.halo::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0) 70%); }
@keyframes spin { to { transform: rotate(360deg); } }
.wortzel-wrap { position: relative; width: min(520px, 94%); background: none; border: 0; padding: 0; cursor: pointer; z-index: 1; filter: drop-shadow(0 24px 30px rgba(120, 50, 10, 0.25)); -webkit-tap-highlight-color: transparent; }
.wortzel-wrap:focus-visible { outline-offset: 10px; border-radius: 30px; }
.bubble { position: absolute; top: 0; left: 0; z-index: 3; max-width: 280px; padding: 16px 20px; border-radius: 24px 24px 24px 6px; background: #fff; box-shadow: var(--shadow); font-weight: 600; line-height: 1.35; opacity: 0; transform: scale(0.6) translateY(20px); transform-origin: 10% 100%; transition: opacity 0.25s, transform 0.45s var(--spring); pointer-events: none; }
.bubble b { font-family: var(--display); font-size: 1.05rem; color: var(--crust); }
.bubble small { color: var(--ink-3); font-weight: 500; }
.bubble.show { opacity: 1; transform: none; }
.stage-hint { position: absolute; bottom: 0; margin: 0; font-weight: 700; font-size: 0.9rem; color: var(--ink-3); background: rgba(255, 255, 255, 0.7); padding: 6px 14px; border-radius: 99px; animation: hint 2.4s ease-in-out infinite; }
@keyframes hint { 50% { transform: translateY(-4px); } }
.scroll-cue { position: absolute; bottom: 26px; left: 50%; translate: -50% 0; width: 30px; height: 48px; border-radius: 20px; box-shadow: inset 0 0 0 2px var(--ink-3); }
.scroll-cue span { position: absolute; left: 50%; top: 9px; width: 4px; height: 9px; margin-left: -2px; border-radius: 4px; background: var(--orange); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 60% { transform: translateY(14px); opacity: 0; } }

/* ==========================================================================
   MARQUEE — Wörtzels Welt
   ========================================================================== */
.welt { padding: 20px 0 30px; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.mq-track { display: flex; gap: 22px; width: max-content; padding: 16px 0; animation: marquee 70s linear infinite; }
.welt:hover .mq-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.mq-item { position: relative; flex: none; width: 300px; aspect-ratio: 16 / 10; border: 0; padding: 0; border-radius: 20px; overflow: hidden; background: var(--cream-2); box-shadow: var(--shadow); transform: rotate(-1.6deg); transition: transform 0.4s var(--spring), box-shadow 0.3s; }
.mq-item:nth-child(even) { transform: rotate(1.6deg) translateY(10px); }
.mq-item:hover { transform: rotate(0) scale(1.06); box-shadow: var(--shadow-lg); z-index: 1; }
.mq-item img { width: 100%; height: 100%; object-fit: cover; }
.mq-item span { position: absolute; left: 10px; bottom: 10px; right: 10px; text-align: left; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.9); font-weight: 600; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mq-item.no-img img { display: none; }

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { padding: clamp(70px, 10vw, 120px) 0; position: relative; }
.section-tint { background: linear-gradient(180deg, var(--cream-2), #fdf0dd); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.kicker { margin: 0 0 10px; font-family: var(--display); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange-d); display: flex; align-items: center; gap: 10px; }
.kicker::before { content: ''; width: 26px; height: 3px; border-radius: 3px; background: currentColor; }
.sub { color: var(--ink-2); max-width: 40em; margin: 14px 0 0; font-size: 1.05rem; }
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--ink-2); font-weight: 600; background: var(--paper); border-radius: var(--r); border: 2px dashed var(--line); }

/* --- Word of the day ------------------------------------------------------ */
.wort { padding-top: 40px; }
.wotd { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'label mascot' 'body mascot' 'actions mascot'; gap: 10px 30px; padding: clamp(28px, 4vw, 54px); border-radius: 34px; background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.14), transparent 50%), linear-gradient(135deg, #3a1d0b, #2b1609 60%, #47210b); color: #fff; box-shadow: var(--shadow-lg); overflow: hidden; }
.wotd::before { content: 'Wort'; position: absolute; right: -0.05em; bottom: -0.28em; font-family: var(--display); font-weight: 900; font-size: clamp(7rem, 18vw, 15rem); color: rgba(255, 255, 255, 0.04); pointer-events: none; line-height: 1; }
.wotd.pop .wotd-de { animation: popIn 0.6s var(--spring); }
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
.wotd-label { grid-area: label; display: flex; align-items: center; gap: 14px; }
.tag { font-family: var(--display); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; background: var(--orange); color: #fff; padding: 7px 14px; border-radius: 99px; }
.wotd-date { color: rgba(255, 255, 255, 0.6); font-weight: 500; text-transform: capitalize; }
.wotd-body { grid-area: body; padding: 10px 0; position: relative; }
.wotd-de { font-size: clamp(1.9rem, 4.6vw, 3.6rem); font-weight: 800; color: var(--orange-l); }
.wotd-ru { font-size: clamp(1.1rem, 2vw, 1.4rem); margin: 12px 0 18px; color: #fff; }
.wotd-ex { margin: 0; padding: 14px 20px; border-left: 4px solid var(--orange); background: rgba(255, 255, 255, 0.06); border-radius: 0 14px 14px 0; font-size: 1.05rem; font-style: italic; max-width: 40em; }
.wotd-ex small { display: block; font-style: normal; color: rgba(255, 255, 255, 0.6); margin-top: 4px; }
.wotd-ex:empty { display: none; }
.wotd-actions { grid-area: actions; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; position: relative; }
.wotd .btn-ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2); }
.wotd .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 2px var(--orange); }
.wotd-mascot { grid-area: mascot; width: clamp(160px, 20vw, 250px); align-self: end; margin-bottom: -24px; }

/* --- Posts ---------------------------------------------------------------- */
.sync { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--paper); border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 0.9rem; color: var(--ink-2); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; box-shadow: 0 0 0 4px rgba(47, 158, 107, 0.2); flex: none; }
.sync.offline .pulse { background: var(--orange); box-shadow: 0 0 0 4px rgba(242, 138, 30, 0.2); }
.toolbar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 30px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 0; padding: 10px 16px; border-radius: 99px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 0.92rem; transition: background 0.2s, color 0.2s, transform 0.25s var(--spring); }
.chip small { opacity: 0.55; margin-left: 4px; }
.chip:hover { transform: translateY(-2px); }
.chip.on { background: var(--ink); color: #fff; }
.search { display: flex; align-items: center; gap: 10px; padding: 0 18px; min-width: 260px; height: 48px; border-radius: 99px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.2s; }
.search:focus-within { box-shadow: inset 0 0 0 2px var(--orange), 0 0 0 5px rgba(242, 138, 30, 0.15); }
.search svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.search input { border: 0; outline: 0; background: none; font: inherit; flex: 1; min-width: 0; color: var(--ink); }
.search-lg { min-width: min(420px, 100%); height: 56px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; perspective: 1200px; }
.post-card { position: relative; display: flex; flex-direction: column; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); overflow: hidden; cursor: pointer; transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); transition: transform 0.35s var(--ease), box-shadow 0.35s; animation: cardIn 0.6s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes cardIn { from { opacity: 0; translate: 0 30px; } }
.post-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.35), transparent 45%); opacity: 0; transition: opacity 0.3s; }
.post-card:hover { box-shadow: var(--shadow-lg); }
.post-card:hover::after { opacity: 1; }
.post-media { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--orange-l), var(--orange)); }
.post-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.post-card .post-media { overflow: visible; }
.post-card .post-media img { border-radius: 0; }
.post-card:hover .post-media img { transform: scale(1.03); }
.post-media.no-img img { display: none; }
.post-media.no-img::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 340'%3E%3Cpath d='M135 262 C170 220 230 170 265 120 C295 75 345 75 355 130 C368 200 300 300 200 305 C100 300 32 200 45 130 C55 75 105 75 135 120 C170 170 230 220 265 262' fill='none' stroke='%23fff' stroke-opacity='.35' stroke-width='40' stroke-linecap='round'/%3E%3C/svg%3E") center / 55% no-repeat; }
.post-emoji { position: absolute; right: 14px; bottom: -24px; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--paper); box-shadow: var(--shadow); z-index: 1; }
.post-kind { position: absolute; left: 12px; top: 12px; padding: 6px 12px; border-radius: 99px; background: rgba(43, 22, 9, 0.72); color: #fff; font-weight: 600; font-size: 0.78rem; backdrop-filter: blur(6px); }
.post-new { position: absolute; right: 12px; top: 12px; padding: 5px 11px; border-radius: 99px; background: var(--red); color: #fff; font-family: var(--display); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; animation: bump 1.6s ease-in-out infinite; }
.post-body { padding: 22px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-body h3 { font-size: 1.1rem; padding-right: 44px; }
.post-ru { margin: 6px 0 0; color: var(--ink-2); font-size: 0.95rem; }
.post-meta { display: flex; gap: 14px; margin: 12px 0 0; font-size: 0.84rem; color: var(--ink-3); }
.post-learn { display: flex; justify-content: space-between; align-items: center; margin: auto 0 0; padding-top: 16px; font-weight: 600; font-size: 0.9rem; color: var(--ink-2); }
.post-go { color: var(--orange-d); transition: transform 0.3s var(--spring); }
.post-card:hover .post-go { transform: translateX(4px); }

/* --- Modal ---------------------------------------------------------------- */
.modal { width: min(900px, 100% - 24px); max-height: 92vh; padding: 0; border: 0; border-radius: 30px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg); overflow: auto; overscroll-behavior: contain; }
.modal[open] { animation: modalIn 0.5s var(--spring); }
@keyframes modalIn { from { opacity: 0; transform: translateY(40px) scale(0.96); } }
.modal::backdrop { background: rgba(43, 22, 9, 0.55); backdrop-filter: blur(6px); }
.modal-close { position: sticky; top: 14px; float: right; margin: 14px 14px -58px 0; z-index: 3; }
.modal-media { aspect-ratio: 16 / 8; overflow: hidden; background: var(--cream-2); }
.modal-media img { width: 100%; height: 100%; object-fit: cover; }
.modal-content { padding: clamp(22px, 4vw, 44px); }
.modal-kicker { margin: 0 0 10px; font-weight: 600; color: var(--orange-d); font-size: 0.9rem; }
.modal-content h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.modal-ru { margin: 8px 0 0; color: var(--ink-2); font-size: 1.1rem; }
.tg-text { margin: 26px 0; padding: 22px 24px; border-radius: var(--r-sm); background: var(--cream); line-height: 1.6; }
.tg-text p { margin: 0 0 4px; }
.tl-head { font-weight: 700; font-family: var(--display); font-size: 0.95rem; margin-bottom: 8px !important; }
.tl-phrase { margin-top: 14px !important; font-weight: 700; color: var(--crust); }
.tl-phrase .dash { color: var(--ink-3); }
.tl-tr { color: var(--ink-3); font-style: italic; }
.say { border: 0; background: none; padding: 0 4px; font-size: 0.9rem; opacity: 0.6; transition: opacity 0.2s, transform 0.2s; }
.say:hover { opacity: 1; transform: scale(1.2); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.post-practice { margin-top: 34px; padding: clamp(18px, 3vw, 30px); border-radius: 26px; background: linear-gradient(180deg, #fff3e2, var(--cream-2)); box-shadow: inset 0 0 0 1px var(--line); }
.pp-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.pp-head h3 { font-size: 1.35rem; }
.pp-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-mode { border: 0; padding: 7px 12px; border-radius: 99px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 0.84rem; transition: transform 0.2s var(--spring); }
.pp-mode:hover { transform: translateY(-2px); }
.pp-mode.on { background: var(--orange); color: #fff; }
.pp-words { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: thin; }
.pp-word { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 240px; padding: 10px 14px; border: 0; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-sm); text-align: left; font-size: 0.85rem; transition: transform 0.2s var(--spring); }
.pp-word:hover { transform: translateY(-3px); }
.pp-word b { color: var(--crust); }
.pp-word span { color: var(--ink-3); }
.pp-stage { margin-top: 10px; }
.pp-more { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.pp-none { margin-top: 24px; padding: 18px; border-radius: 16px; background: var(--cream); color: var(--ink-2); }

/* --- Flashcards ----------------------------------------------------------- */
.deck-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.deck-stats span { padding: 8px 14px; border-radius: 99px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 0.9rem; color: var(--ink-2); }
.deck-stats b { color: var(--ink); }
.cards-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 34px; align-items: start; }
.deck-panel { display: flex; flex-direction: column; gap: 18px; padding: 24px; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); position: sticky; top: calc(var(--nav-h) + 30px); }
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 0.9rem; color: var(--ink-2); }
.field select { appearance: none; font: inherit; font-weight: 600; color: var(--ink); padding: 12px 40px 12px 16px; border-radius: 14px; border: 0; background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235c3b26' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center; box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; text-overflow: ellipsis; cursor: pointer; }
.field-inline { flex-direction: row; align-items: center; }
.field-inline select { background-color: var(--paper); min-width: 260px; max-width: 360px; }
.seg { display: inline-flex; padding: 4px; border-radius: 99px; background: var(--cream); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border: 0; background: none; padding: 9px 16px; border-radius: 99px; font-weight: 600; font-size: 0.9rem; color: var(--ink-2); transition: background 0.2s, color 0.2s; }
.seg button.on { background: var(--ink); color: #fff; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 0.92rem; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--orange); }
.kbd-help { font-size: 0.85rem; color: var(--ink-3); }
.kbd-help p { margin: 4px 0; }
.card-zone { display: flex; flex-direction: column; gap: 22px; align-items: center; }
.progress { flex: 1; width: 100%; height: 10px; border-radius: 99px; background: rgba(43, 22, 9, 0.08); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--orange-l), var(--orange)); transition: width 0.5s var(--ease); }
.flashcard { position: relative; width: min(620px, 100%); aspect-ratio: 16 / 10; perspective: 1400px; cursor: pointer; outline: 0; }
.flashcard[hidden] { display: none; }
.flashcard:focus-visible .fc-face { box-shadow: 0 0 0 4px var(--orange), var(--shadow-lg); }
.fc-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.7s var(--spring); }
.flashcard.flipped .fc-inner { transform: rotateY(180deg); }
.flashcard.swap { animation: swap 0.3s var(--ease); }
@keyframes swap { from { opacity: 0.2; transform: translateX(30px) rotate(2deg); } }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 34px; border-radius: 28px; box-shadow: var(--shadow-lg); overflow: hidden; }
.fc-front { background: var(--paper); }
.fc-front::before { content: ''; position: absolute; right: -40px; bottom: -50px; width: 220px; height: 190px; opacity: 0.07; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 340'%3E%3Cpath d='M135 262 C170 220 230 170 265 120 C295 75 345 75 355 130 C368 200 300 300 200 305 C100 300 32 200 45 130 C55 75 105 75 135 120 C170 170 230 220 265 262' fill='none' stroke='%238e3b12' stroke-width='44' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.fc-back { transform: rotateY(180deg); background: linear-gradient(150deg, #ffa443, var(--orange-d)); color: #fff; }
.fc-theme { position: absolute; top: 20px; left: 24px; right: 70px; text-align: left; font-size: 0.82rem; font-weight: 600; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-back .fc-theme { color: rgba(255, 255, 255, 0.8); }
.fc-word { font-family: var(--display); font-weight: 800; font-size: clamp(1.5rem, 3.6vw, 2.5rem); margin: 0; line-height: 1.15; }
.fc-word-sm { font-size: clamp(1.3rem, 3vw, 2rem); }
.fc-hint { position: absolute; bottom: 20px; font-size: 0.85rem; color: var(--ink-3); }
.fc-note { margin: 10px 0 0; font-style: italic; opacity: 0.85; }
.fc-note:empty { display: none; }
.fc-example { margin-top: 18px; padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.16); max-width: 92%; }
.fc-example:empty { display: none; }
.fc-example p { margin: 0; font-weight: 600; }
.fc-example small { opacity: 0.85; }
.fc-speak { position: absolute; top: 14px; right: 14px; z-index: 2; }
.fc-actions { display: flex; gap: 12px; width: min(620px, 100%); }
.fc-actions[hidden] { display: none; }
.grade { flex: 1; border: 0; padding: 14px 10px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; transition: transform 0.2s var(--spring), box-shadow 0.2s; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12); }
.grade:hover { transform: translateY(-3px); }
.grade:active { transform: translateY(2px); box-shadow: none; }
.grade small { font-weight: 500; opacity: 0.6; }
.g-again { background: var(--bad-l); color: #a3271d; }
.g-hard { background: #fff0d4; color: #9a5a00; }
.g-good { background: var(--green-l); color: #1f6e4a; }
.fc-done { text-align: center; padding: 50px 24px; border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); width: min(620px, 100%); }
.fc-done .big { font-family: var(--display); font-weight: 800; font-size: 1.8rem; margin: 0 0 10px; }

/* --- Memory --------------------------------------------------------------- */
.memory { background: radial-gradient(circle at 15% 0%, #4a250e, transparent 50%), radial-gradient(circle at 90% 100%, #5a2a0c, transparent 45%), #23110a; color: #fff; }
.memory .sub, .memory .field { color: rgba(255, 255, 255, 0.72); }
.memory .kicker { color: var(--orange-l); }
.memory .field-inline select { background-color: rgba(255, 255, 255, 0.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E"); }
.memory .field select option { color: var(--ink); }
.mem-bar { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.memory .seg { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.memory .seg button { color: rgba(255, 255, 255, 0.75); }
.memory .seg button.on { background: var(--orange); color: #fff; }
.mem-stats { display: flex; gap: 22px; color: rgba(255, 255, 255, 0.7); font-size: 0.95rem; flex-wrap: wrap; }
.mem-stats b { color: #fff; font-family: var(--display); margin-left: 6px; }
.memory .btn-ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2); }
.memory .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 2px var(--orange); }
.mem-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: clamp(8px, 1.4vw, 16px); }
.mem-card { aspect-ratio: 4 / 3; border: 0; padding: 0; background: none; perspective: 900px; animation: dealIn 0.5s var(--spring) both; animation-delay: var(--d); }
@keyframes dealIn { from { opacity: 0; transform: translateY(-40px) rotate(-8deg) scale(0.7); } }
.mem-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.55s var(--spring); }
.mem-card.open .mem-inner, .mem-card.found .mem-inner { transform: rotateY(180deg); }
.mem-back, .mem-front { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.mem-back { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect x='17' y='17' width='6' height='6' fill='%23fff' fill-opacity='.25' transform='rotate(45 20 20)'/%3E%3C/svg%3E"), linear-gradient(150deg, #ffa443, #d9690b); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25), 0 8px 0 #7a2e08, 0 14px 24px -8px rgba(0, 0, 0, 0.6); transition: transform 0.25s var(--spring); }
.mem-back svg { width: 46%; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.2)); }
.mem-card:hover .mem-back { transform: translateY(-4px) rotate(-1.5deg); }
.mem-front { transform: rotateY(180deg); padding: 10px; text-align: center; font-weight: 700; font-size: clamp(0.72rem, 1.35vw, 1rem); line-height: 1.2; color: var(--ink); background: var(--paper); box-shadow: 0 8px 0 #c9b49a, 0 14px 24px -8px rgba(0, 0, 0, 0.6); }
.mem-front.de { font-family: var(--display); font-size: clamp(0.66rem, 1.2vw, 0.92rem); color: var(--crust); }
.mem-front.ru { background: #fff4e3; }
.mem-front small { position: absolute; top: 8px; left: 10px; font-family: var(--display); font-size: 0.62rem; letter-spacing: 0.08em; color: var(--ink-3); }
.mem-card.found .mem-front { background: var(--green-l); box-shadow: 0 8px 0 #8cc9a7, 0 0 0 3px var(--green), 0 0 30px rgba(47, 158, 107, 0.6); }
.mem-card.found { animation: found 0.6s var(--spring); }
@keyframes found { 40% { transform: scale(1.08); } }
.mem-card.shake { animation: shake 0.4s; }
@keyframes shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }

/* --- Exercises ------------------------------------------------------------ */
.ex-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ex-modes[hidden], .ex-stage[hidden] { display: none; }
.mode { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 26px 22px; border: 0; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); text-align: left; overflow: hidden; transition: transform 0.35s var(--spring), box-shadow 0.3s; }
.mode::after { content: ''; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 138, 30, 0.22), transparent 70%); transition: transform 0.5s var(--ease); }
.mode:hover { transform: translateY(-6px) rotate(-0.6deg); box-shadow: var(--shadow); }
.mode:hover::after { transform: scale(2.2); }
.mode:first-child { background: linear-gradient(150deg, #ffa443, var(--orange-d)); color: #fff; }
.mode:first-child small { color: rgba(255, 255, 255, 0.85); }
.mode-ic { font-size: 2rem; margin-bottom: 8px; transition: transform 0.4s var(--spring); }
.mode:hover .mode-ic { transform: scale(1.2) rotate(-10deg); }
.mode b { font-family: var(--display); font-size: 1.15rem; }
.mode small { color: var(--ink-3); font-size: 0.9rem; }
.ex-stage, .pp-stage:not(:empty) { position: relative; padding: clamp(20px, 3vw, 36px); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); }
.ex-stage { max-width: 860px; margin: 0 auto; }
.ex-top { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.ex-score { font-family: var(--display); font-weight: 700; font-size: 0.95rem; color: var(--ink-2); min-width: 50px; text-align: right; }
.ex-body.enter { animation: exIn 0.45s var(--ease); }
@keyframes exIn { from { opacity: 0; transform: translateX(30px); } }
.ex-tag { display: inline-block; padding: 5px 12px; border-radius: 99px; background: var(--cream); font-size: 0.8rem; font-weight: 600; color: var(--ink-2); margin-bottom: 18px; }
.ex-q { font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.1rem); margin: 0; line-height: 1.2; }
.ex-q-sub { color: var(--ink-3); margin: 10px 0 22px; }
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.opts-chips { display: flex; flex-wrap: wrap; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 15px 18px; border: 0; border-radius: 16px; background: var(--cream); box-shadow: inset 0 0 0 2px transparent, 0 3px 0 rgba(43, 22, 9, 0.08); font-weight: 600; transition: transform 0.2s var(--spring), box-shadow 0.2s, background 0.2s; }
.opt:hover:not([disabled]) { transform: translateY(-2px); box-shadow: inset 0 0 0 2px var(--orange), 0 5px 0 rgba(43, 22, 9, 0.08); }
.opt kbd { flex: none; }
.opt.right { background: var(--green-l); box-shadow: inset 0 0 0 2px var(--green); animation: bump 0.4s var(--spring); }
.opt.wrong { background: var(--bad-l); box-shadow: inset 0 0 0 2px var(--red); animation: shake 0.4s; }
.opt[disabled] { cursor: default; color: var(--ink); }
.opt[disabled]:not(.right):not(.wrong) { opacity: 0.55; }
.listen-btn { width: 110px; height: 110px; border-radius: 50%; border: 0; background: linear-gradient(150deg, #ffa443, var(--orange-d)); box-shadow: 0 8px 0 var(--crust), 0 20px 40px -14px rgba(217, 105, 11, 0.8); font-size: 2.6rem; display: grid; place-items: center; margin: 4px auto 8px; transition: transform 0.25s var(--spring); }
.listen-btn:hover { transform: scale(1.06); }
.listen-btn:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--crust); }
.listen-btn + .ex-q-sub { text-align: center; }
.ex-gap { font-size: clamp(1.15rem, 2.4vw, 1.6rem); font-weight: 600; line-height: 1.7; margin: 0; }
.slot { display: inline-block; min-width: 110px; padding: 0 10px; margin: 0 4px; border-bottom: 3px dashed var(--orange); color: var(--orange-d); text-align: center; transition: all 0.3s; }
.slot.ok { color: var(--green); border-color: var(--green); border-bottom-style: solid; }
.slot.bad { color: var(--red); border-color: var(--red); }
.build { min-height: 68px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border-radius: 16px; background: var(--cream); box-shadow: inset 0 0 0 2px var(--line); margin-bottom: 16px; transition: box-shadow 0.2s; }
.build.ok { box-shadow: inset 0 0 0 2px var(--green); background: var(--green-l); }
.build.bad { box-shadow: inset 0 0 0 2px var(--red); background: var(--bad-l); }
.build-ph { color: var(--ink-3); font-size: 0.92rem; padding-left: 6px; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tok { border: 0; padding: 10px 14px; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 rgba(43, 22, 9, 0.1); font-weight: 600; transition: transform 0.2s var(--spring), opacity 0.2s; }
.tok:hover { transform: translateY(-2px); }
.tok.in { background: #fff; box-shadow: inset 0 0 0 2px var(--orange); animation: popIn 0.3s var(--spring); }
.tok.used { opacity: 0.25; pointer-events: none; transform: scale(0.94); }
.ex-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.write-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.write-in { flex: 1; min-width: 220px; font: inherit; font-size: 1.2rem; font-weight: 600; padding: 15px 18px; border: 0; border-radius: 16px; background: var(--cream); box-shadow: inset 0 0 0 2px var(--line); outline: 0; color: var(--ink); }
.write-in:focus { box-shadow: inset 0 0 0 2px var(--orange), 0 0 0 5px rgba(242, 138, 30, 0.15); }
.write-in.ok { box-shadow: inset 0 0 0 2px var(--green); background: var(--green-l); }
.write-in.bad { box-shadow: inset 0 0 0 2px var(--red); background: var(--bad-l); }
.umlauts { display: flex; gap: 6px; }
.uml { width: 48px; border: 0; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--line); font-weight: 700; font-size: 1.1rem; }
.uml:hover { box-shadow: inset 0 0 0 2px var(--orange); }
.hint-line { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.12em; color: var(--orange-d); font-weight: 700; margin: 0 0 14px; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.match .col { display: flex; flex-direction: column; gap: 10px; }
.m-item { border: 0; padding: 14px 16px; border-radius: 14px; background: var(--cream); box-shadow: inset 0 0 0 2px transparent, 0 3px 0 rgba(43, 22, 9, 0.08); font-weight: 600; text-align: left; transition: transform 0.2s var(--spring), box-shadow 0.2s, background 0.2s, opacity 0.3s; }
.m-item:hover { transform: translateY(-2px); }
.m-item.sel { box-shadow: inset 0 0 0 2px var(--orange); background: #fff3e2; }
.m-item.done { background: var(--green-l); box-shadow: inset 0 0 0 2px var(--green); opacity: 0.6; pointer-events: none; }
.m-item.nope { background: var(--bad-l); animation: shake 0.4s; }
.ex-feedback { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding: 0 20px; max-height: 0; overflow: hidden; border-radius: 18px; opacity: 0; transition: max-height 0.4s var(--ease), opacity 0.3s, padding 0.3s; }
.ex-feedback.show { max-height: 260px; opacity: 1; padding: 16px 20px; }
.ex-feedback.ok { background: var(--green-l); color: #1f6e4a; }
.ex-feedback.bad { background: var(--bad-l); color: #8f2219; }
.ex-feedback b { font-family: var(--display); font-size: 1.1rem; }
.ex-feedback p { margin: 4px 0 0; color: var(--ink-2); }
.ex-result { text-align: center; padding: 10px 0; }
.stars { display: flex; justify-content: center; gap: 12px; font-size: 3rem; }
.stars span { filter: grayscale(1); opacity: 0.25; transform: scale(0.7); }
.stars span.on { filter: none; opacity: 1; animation: starIn 0.6s var(--spring) both; animation-delay: var(--d); transform: none; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1); } }
.ex-big { font-family: var(--display); font-weight: 900; font-size: 3rem; margin: 10px 0 0; }
.ex-result-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.ex-empty { text-align: center; color: var(--ink-2); padding: 30px; }

/* --- Dictionary ----------------------------------------------------------- */
.dict { display: grid; gap: 8px; }
.dict-row { display: grid; grid-template-columns: auto 1.2fr 1fr auto 24px; gap: 16px; align-items: center; padding: 12px 18px 12px 12px; border-radius: 16px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.dict-row:hover { transform: translateX(4px); box-shadow: inset 0 0 0 1px var(--orange), var(--shadow-sm); }
.dict-de { font-weight: 700; color: var(--crust); }
.dict-de i { font-weight: 500; color: var(--ink-3); font-size: 0.85em; }
.dict-ru { color: var(--ink-2); }
.dict-src { border: 0; background: var(--cream); padding: 6px 12px; border-radius: 99px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dict-src:hover { background: var(--orange); color: #fff; }
.known { color: var(--green); font-weight: 800; }

/* --- CTA + footer --------------------------------------------------------- */
.cta-band { position: relative; padding: 70px 0; background: radial-gradient(circle at 80% 20%, rgba(255, 200, 120, 0.45), transparent 45%), linear-gradient(135deg, var(--orange) 0%, var(--orange-d) 55%, var(--crust) 100%); color: #fff; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70'%3E%3Crect x='30' y='30' width='7' height='7' fill='%23fff' fill-opacity='.18' transform='rotate(45 33 33)'/%3E%3C/svg%3E"); }
.cta-inner { position: relative; display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: center; }
.cta-inner h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
.cta-inner p { max-width: 40em; margin: 18px 0 26px; color: rgba(255, 255, 255, 0.88); font-size: 1.08rem; }
.cta-mascot { width: 100%; filter: drop-shadow(0 20px 20px rgba(60, 20, 0, 0.35)); }
.footer { background: var(--ink); color: rgba(255, 255, 255, 0.75); padding: 40px 0 50px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: center; justify-content: space-between; }
.footer p { margin: 0; }
.footer a { color: var(--orange-l); }
.brand-foot { color: #fff; }
.footer .muted { color: rgba(255, 255, 255, 0.5); }

/* --- Buddy ---------------------------------------------------------------- */
.buddy { position: fixed; right: 18px; bottom: 0; z-index: 90; display: flex; align-items: flex-end; gap: 6px; transform: translateY(110%); transition: transform 0.6s var(--spring); pointer-events: none; }
.buddy.visible { transform: translateY(34%); }
.buddy.visible.talking, .buddy.visible:hover { transform: translateY(8%); }
.buddy-body { width: 104px; border: 0; background: none; padding: 0; pointer-events: auto; filter: drop-shadow(0 8px 14px rgba(80, 30, 0, 0.35)); }
.buddy-bubble { pointer-events: none; max-width: 240px; margin-bottom: 92px; padding: 12px 16px; border-radius: 18px 18px 4px 18px; background: var(--ink); color: #fff; font-weight: 600; font-size: 0.92rem; line-height: 1.35; box-shadow: var(--shadow); opacity: 0; transform: scale(0.6) translateY(10px); transform-origin: 100% 100%; transition: opacity 0.2s, transform 0.4s var(--spring); }
.buddy-bubble.show { opacity: 1; transform: none; }
.buddy-bubble kbd { color: var(--ink); }

/* --- Toast, confetti, crumbs ---------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 150; translate: -50% 0; max-width: min(520px, 100% - 30px); padding: 14px 22px; border-radius: 18px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(30px) scale(0.9); transition: opacity 0.3s, transform 0.45s var(--spring); pointer-events: none; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 160; }
.crumb { position: fixed; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: #fff; border-radius: 1px; box-shadow: 0 0 0 1px rgba(142, 59, 18, 0.35); pointer-events: none; z-index: 170; transform: rotate(45deg); animation: crumb 0.65s var(--ease) forwards; }
@keyframes crumb { to { transform: translate(var(--dx), calc(var(--dy) + 24px)) rotate(225deg) scale(0.4); opacity: 0; } }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  .nav-links { position: absolute; top: calc(100% + 10px); left: 0; right: 0; flex-direction: column; gap: 2px; padding: 12px; border-radius: 24px; background: rgba(255, 250, 242, 0.97); backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-10px) scale(0.98); pointer-events: none; transition: opacity 0.25s, transform 0.35s var(--ease); }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 14px 18px; font-size: 1.05rem; }
  .burger { display: block; }
  .nav.open { background: rgba(255, 250, 242, 0.95); box-shadow: var(--shadow); }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { order: 2; }
  .hero-stage { order: 1; min-height: 380px; }
  .wortzel-wrap { width: min(320px, 68%); }
  .eyebrow, .lead { margin-inline: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
  .bubble { left: 50%; top: -2%; translate: -50% 0; transform-origin: 50% 100%; border-radius: 22px; width: max-content; max-width: 86vw; }
  .scroll-cue { display: none; }
  .cards-layout { grid-template-columns: minmax(0, 1fr); }
  .deck-panel { position: static; }
  .wotd { grid-template-columns: 1fr; grid-template-areas: 'label' 'body' 'actions'; padding-bottom: 120px; }
  .wotd-mascot { position: absolute; right: 0; bottom: -28px; width: 140px; }
  .cta-inner { grid-template-columns: 1fr; text-align: center; }
  .cta-mascot { width: 180px; margin: 0 auto; }
  .cta-inner p { margin-inline: auto; }
  .dict-row { grid-template-columns: auto 1fr; gap: 6px 12px; }
  .dict-row .icon-btn { grid-row: span 3; align-self: start; }
  .dict-src { justify-self: start; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --nav-h: 62px; }
  .wrap, .hero-inner { width: min(1220px, 100% - 28px); }
  .brand-text small { display: none; }
  .stat-pill { padding: 7px 10px; font-size: 0.8rem; gap: 6px; }
  .btn-tg span { display: none; }
  .btn-tg { padding: 0.6em; }
  .hero { padding-top: calc(var(--nav-h) + 30px); }
  .hero h1 { font-size: clamp(2.5rem, 12.5vw, 4rem); }
  .hero-stats { gap: 22px; }
  .opts { grid-template-columns: 1fr; }
  .match { gap: 8px; }
  .m-item { padding: 12px; font-size: 0.88rem; }
  .mem-grid { grid-template-columns: repeat(3, 1fr); }
  .mem-front { font-size: 0.7rem; padding: 6px; }
  .mem-front.de { font-size: 0.64rem; }
  .field-inline { flex-direction: column; align-items: stretch; width: 100%; }
  .field-inline select { min-width: 0; max-width: none; }
  .search, .search-lg { min-width: 0; width: 100%; }
  .mq-item { width: 220px; }
  .fc-face { padding: 34px 20px; }
  .flashcard { aspect-ratio: 4 / 3.4; }
  .ex-feedback.show { flex-direction: column; align-items: stretch; }
  .buddy-body { width: 80px; }
  .buddy-bubble { margin-bottom: 70px; max-width: 200px; }
  .modal { width: 100%; max-height: 94vh; border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .mq-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .reveal { opacity: 1; transform: none; }
}

/* never let long option text widen a layout */
select { max-width: 100%; min-width: 0; }
.stat-pill, .stat-pill * { white-space: nowrap; }
@media (hover: none) { .kbd-help { display: none; } }

/* ---------- Wörtzel images in sections ---------- */
.brand-mark, #scrollPretzel { object-fit: contain; }
.section-head { position: relative; }
.sec-mascot { width: clamp(120px, 12vw, 176px); height: auto; margin: -30px 0 -26px; flex: none; filter: drop-shadow(0 14px 16px rgba(90, 36, 6, 0.22)); animation: secFloat 4.5s ease-in-out infinite; transform-origin: 50% 95%; transition: scale 0.4s var(--spring); }
.sec-mascot:hover { scale: 1.08; animation-play-state: paused; }
@keyframes secFloat { 50% { transform: translateY(-8px) rotate(-2deg); } }
.section-dark .sec-mascot, #memory .sec-mascot { filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.5)); }
.mem-back img { width: 54%; height: auto; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.18)); pointer-events: none; }
.done-mascot { width: 170px; height: auto; margin: -20px auto 4px; display: block; animation: hop 0.6s ease-in-out 3; }
.result-mascot { width: 150px; height: auto; display: block; margin: 0 auto -6px; animation: poseIn 0.5s var(--spring); }
.empty::before { content: ''; display: block; width: 130px; aspect-ratio: 1; margin: -20px auto 8px; background: url('/assets/img/w/empty.webp') center / contain no-repeat; }
.wotd { background: linear-gradient(100deg, rgba(43, 22, 9, 0.97) 0%, rgba(43, 22, 9, 0.9) 45%, rgba(43, 22, 9, 0.55) 100%), url('/assets/img/w/wotd-bg.webp') center / cover, #2b1609; }
.wotd-mascot .w-prop { top: -4%; right: auto; left: -18%; }
.cta-mascot .wortzel { aspect-ratio: 900 / 894; }
@media (max-width: 640px) {
  .section-head > div:first-child { padding-right: 92px; }
  .sec-mascot { position: absolute; top: -18px; right: -6px; width: 96px; margin: 0; }
}

/* ---------- Loader, retuned for the 3D Wörtzel ---------- */
.js .loader {
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 46%, #fff6e8 0%, rgba(255, 246, 232, 0) 46%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='%23f28a1e' fill-opacity='.16'%3E%3Crect x='14' y='18' width='6' height='6' transform='rotate(45 17 21)'/%3E%3Crect x='62' y='52' width='5' height='5' transform='rotate(45 64 54)'/%3E%3Crect x='40' y='78' width='4' height='4' transform='rotate(45 42 80)'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(170deg, #fff3e2 0%, #ffe2bd 55%, #ffcf96 100%);
}
.loader-stage { width: min(460px, 88vw); }
.loader-glow { position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 236, 205, 0.6) 45%, transparent 70%); animation: glowIn 1.2s var(--ease) both, glowPulse 3.2s 1.2s ease-in-out infinite; }
@keyframes glowIn { from { transform: scale(0.4); opacity: 0; } }
@keyframes glowPulse { 50% { transform: scale(1.06); opacity: 0.8; } }
.loader-hero { width: 82%; filter: drop-shadow(0 22px 24px rgba(120, 50, 10, 0.25)); }
.loader-bubble { top: -10%; background: var(--ink); color: #fff; }
.loader-bubble::after { background: var(--ink); }
.loader-bar { background: rgba(142, 59, 18, 0.15); }
.loader-bar span { background: linear-gradient(90deg, var(--orange-l), var(--orange), var(--crust)); }
.loader-skip { color: var(--ink-2); }

/* =====================================================================
   MOTION LAYER — effects added by js/motion.js
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* hero title: lines rise out of a blur, letters are springy */
.js body:not(.entered) .hero h1 { opacity: 1; transform: none; }
.hero h1 .li { display: inline-block; }
.js body:not(.entered) .hero h1 .li { opacity: 0; transform: translateY(0.45em) rotate(2.5deg); filter: blur(12px); }
.js .hero h1 .li { transition: opacity 0.8s var(--ease), transform 1.1s var(--spring), filter 0.9s var(--ease); transition-delay: calc(0.05s + var(--l) * 0.18s); }
.hero h1 .ch { display: inline-block; transition: transform 0.4s var(--spring), color 0.25s; }
.js body.entered .hero h1 .ch { animation: chIn 0.8s var(--spring) backwards; animation-delay: calc(0.1s + var(--c) * 0.045s); }
@keyframes chIn { from { opacity: 0; transform: translateY(0.6em) rotate(8deg) scale(0.6); } }
@media (hover: hover) { .hero h1 .ch:hover { transform: translateY(-0.12em) rotate(-6deg) scale(1.1); color: var(--orange); } }
.hero h1 em.bitten { cursor: pointer; }
.hero h1 em.bitten.crunch { animation: crunch 0.5s var(--spring); }
@keyframes crunch { 20% { transform: scale(1.08, 0.9) rotate(-2deg); } 45% { transform: scale(0.96, 1.05) rotate(1.5deg); } 70% { transform: scale(1.02) rotate(-0.5deg); } }

/* hero: cursor spotlight + salt sparkles */
.spotlight { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(520px circle at var(--sx, 72%) var(--sy, 45%), rgba(255, 255, 255, 0.6), rgba(255, 205, 140, 0.16) 42%, transparent 66%); }
.spark { position: fixed; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; border-radius: 1px; box-shadow: 0 0 0 1px rgba(142, 59, 18, 0.22), 0 0 10px rgba(255, 190, 107, 0.95); transform: rotate(45deg) scale(var(--ss, 1)); pointer-events: none; z-index: 60; animation: spark 0.8s var(--ease) forwards; }
@keyframes spark { to { transform: translate(var(--kx), var(--ky)) rotate(225deg) scale(0); opacity: 0; } }

/* hero bubble can hold links (section tour) */
.bubble a { color: var(--orange-d); font-weight: 700; text-decoration: none; border-bottom: 2px solid rgba(217, 105, 11, 0.35); pointer-events: auto; white-space: nowrap; }
.bubble a:hover { border-bottom-color: currentColor; }
.bubble:not(.show) a { pointer-events: none; }

/* magnetic buttons + shine */
.btn { translate: var(--tx, 0) var(--ty, 0); transition: transform 0.25s var(--spring), box-shadow 0.25s, background 0.2s, translate 0.35s var(--ease); }
.icon-btn { translate: var(--tx, 0) var(--ty, 0); transition: transform 0.25s var(--spring), translate 0.35s var(--ease); }
.btn-primary { overflow: hidden; isolation: isolate; }
.btn-primary::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.5) 50%, transparent 65%); transform: translateX(-130%); transition: transform 0.75s var(--ease); pointer-events: none; }
.btn-primary:hover::after { transform: translateX(130%); }
.hero-cta .btn-primary::after { animation: shine 4.5s 3s ease-in-out infinite; }
@keyframes shine { 0%, 72% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }

/* section mascots: pop in, hop on click, speech bubble */
.sec-mascot { cursor: pointer; }
.sec-mascot.will-pop:not(.pop) { opacity: 0; }
.sec-mascot.pop { animation: secPop 0.85s var(--spring) 0.25s backwards, secFloat 4.5s 1.1s ease-in-out infinite; }
.sec-mascot.hop { animation: secHop 0.65s var(--spring); }
@keyframes secPop { from { opacity: 0; scale: 0.3; rotate: -22deg; } }
@keyframes secHop { 30% { transform: translateY(-24px) rotate(7deg); } 62% { transform: translateY(0) rotate(-3deg) scale(1.06, 0.94); } }
.sec-bubble { position: absolute; z-index: 4; right: calc(clamp(120px, 12vw, 176px) - 22px); top: -40px; max-width: 260px; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: #fff; color: var(--ink); box-shadow: var(--shadow); font-weight: 600; font-size: 0.88rem; line-height: 1.3; opacity: 0; transform: scale(0.6) translateY(10px); transform-origin: 100% 100%; transition: opacity 0.2s, transform 0.4s var(--spring); pointer-events: none; }
.sec-bubble.show { opacity: 1; transform: none; }
.sec-bubble b { display: block; font-family: var(--display); font-size: 0.9rem; color: var(--crust); }
.sec-bubble small { color: var(--ink-3); }

/* section titles: hand-drawn underline */
.section-head h2.scribble { display: inline-block; padding-bottom: 0.2em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 7Q12 1 22 6T42 6T62 6T82 6T102 6T122 6T142 6T162 6T182 6T198 5' fill='none' stroke='%23f28a1e' stroke-width='3.5' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") left bottom / 0% 0.34em no-repeat; transition: background-size 1.1s var(--ease) 0.4s; }
.section-head.in h2.scribble, html:not(.js) .section-head h2.scribble { background-size: 100% 0.34em; }

/* CTA: Wörtzel rides in on his bike; click rings the bell */
.cta-mascot { position: relative; cursor: pointer; }
.cta-mascot.will-ride:not(.ride) { opacity: 0; transform: translateX(-70vw); }
.cta-mascot.ride { animation: rideIn 1.6s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
@keyframes rideIn { 0% { opacity: 0; transform: translateX(-70vw) rotate(-2deg); } 12% { opacity: 1; } 68% { transform: translateX(16px) rotate(1.6deg); } 84% { transform: translateX(-6px) rotate(-0.6deg); } 100% { opacity: 1; transform: none; } }
.cta-mascot.ride::before { content: ''; position: absolute; left: -45%; top: 38%; width: 70%; height: 38%; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0 3px, transparent 3px 15px); -webkit-mask: linear-gradient(90deg, transparent, #000 55%, transparent); mask: linear-gradient(90deg, transparent, #000 55%, transparent); animation: speed 1.4s ease-out forwards; }
@keyframes speed { 0% { opacity: 0; transform: translateX(-30%) scaleX(0.6); } 20% { opacity: 0.9; } 100% { opacity: 0; transform: translateX(10%) scaleX(1.2); } }
.cta-mascot.bell .wortzel { animation: bell 0.7s var(--spring); }
@keyframes bell { 20% { transform: translateY(-10px) rotate(-4deg); } 45% { transform: translateY(0) rotate(3deg); } 70% { transform: rotate(-1.5deg); } }

/* footer: Wörtzel peeks over the edge */
.footer { position: relative; }
.footer-peek { position: absolute; right: clamp(16px, 7vw, 110px); bottom: 100%; width: 118px; height: 76px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 2; -webkit-tap-highlight-color: transparent; }
.peek-clip { position: absolute; inset: 0; overflow: hidden; }
.peek-clip img { position: absolute; left: 0; top: 0; width: 118px; height: auto; transform: translateY(105%); transition: transform 0.8s var(--spring); filter: drop-shadow(0 -4px 10px rgba(0, 0, 0, 0.25)); }
.footer-peek.up .peek-clip img { transform: translateY(8%); }
.footer-peek:hover .peek-clip img { transform: translateY(0) rotate(-4deg); }
.footer-peek.wave .peek-clip img { animation: peekWave 0.8s var(--spring); }
@keyframes peekWave { 30% { transform: translateY(-2%) rotate(-8deg); } 60% { transform: translateY(4%) rotate(5deg); } }
.peek-bubble { position: absolute; right: 100%; top: 0; margin-right: 4px; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: #fff; color: var(--ink); font-weight: 700; font-size: 0.85rem; white-space: nowrap; box-shadow: var(--shadow); opacity: 0; transform: scale(0.6); transform-origin: 100% 100%; transition: opacity 0.2s, transform 0.35s var(--spring); pointer-events: none; }
.footer-peek:hover .peek-bubble, .footer-peek.wave .peek-bubble { opacity: 1; transform: none; }

/* XP float + level progress inside the stat pill */
.stat-pill { position: relative; background: linear-gradient(90deg, rgba(242, 138, 30, 0.2) calc(var(--lv, 0) * 100%), transparent 0), var(--paper); }
.xp-float { position: absolute; right: 10px; top: 4px; font: 800 0.82rem var(--display); color: var(--orange-d); pointer-events: none; animation: xpUp 1.1s var(--ease) forwards; }
@keyframes xpUp { 0% { opacity: 0; transform: translateY(8px) scale(0.8); } 20% { opacity: 1; transform: translateY(-4px) scale(1.12); } 100% { opacity: 0; transform: translateY(-26px); } }

/* level up overlay */
.levelup { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle, rgba(43, 22, 9, 0.62), rgba(28, 13, 5, 0.88)); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); cursor: pointer; animation: luIn 0.3s ease both; }
.levelup.out { animation: luOut 0.4s ease forwards; }
@keyframes luIn { from { opacity: 0; } }
@keyframes luOut { to { opacity: 0; } }
.lu-card { text-align: center; color: #fff; animation: luPop 0.75s var(--spring) both; }
@keyframes luPop { from { opacity: 0; transform: scale(0.4) translateY(40px); } }
.lu-card img { width: min(260px, 62vw); height: auto; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.45)); animation: hop 0.7s ease-in-out 0.5s 2; }
.lu-kicker { margin: 0; font: 700 0.85rem var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange-l); }
.lu-level { margin: 4px 0 6px; font: 900 clamp(2.6rem, 8vw, 4.6rem) / 1 var(--display); color: transparent; background: linear-gradient(180deg, #fff 20%, var(--orange-l)); -webkit-background-clip: text; background-clip: text; }
.lu-name { margin: 0; font: 800 1.35rem var(--display); }
.lu-name small { display: block; margin-top: 4px; font: 500 1rem var(--font); opacity: 0.8; }

/* pretzel rain (easter eggs, celebrations) */
.pretzel-rain { position: fixed; inset: 0; z-index: 180; pointer-events: none; overflow: hidden; }
.pretzel-rain img { position: absolute; top: -100px; height: auto; filter: drop-shadow(0 6px 6px rgba(80, 30, 0, 0.3)); animation: rain var(--dur) var(--del) cubic-bezier(0.4, 0.1, 0.7, 1) both; }
@keyframes rain { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(var(--sway), calc(100vh + 160px)) rotate(var(--rot)); } }
body.party .glow { animation: partyGlow 0.7s ease-in-out infinite alternate; }
body.party .halo { animation-duration: 4s; }
@keyframes partyGlow { to { filter: hue-rotate(40deg) saturate(1.5); scale: 1.15; } }

/* post modal grows out of the clicked card and shrinks away */
.modal[open] { transform-origin: var(--ox, 50%) var(--oy, 85%); animation: modalGrow 0.55s var(--spring); }
@keyframes modalGrow { from { opacity: 0; transform: scale(0.3); } 35% { opacity: 1; } }
.modal.closing { animation: modalShrink 0.23s var(--ease) forwards; }
@keyframes modalShrink { to { opacity: 0; transform: translateY(24px) scale(0.92); } }
.modal[open]::backdrop { animation: luIn 0.35s ease both; }
.modal.closing::backdrop { animation: luOut 0.23s ease forwards; }

/* pretzel stars on the result screen */
.stars span img { display: block; width: clamp(48px, 9vw, 66px); height: auto; filter: drop-shadow(0 6px 8px rgba(120, 50, 10, 0.3)); }

/* search empty states: Wörtzel with the magnifier */
.empty.search::before { background-image: url('/assets/img/w/404.webp'); }

/* Memory: win overlay */
.mem-grid { position: relative; }
.mem-win { position: absolute; inset: -6px; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; text-align: center; border-radius: 22px; background: radial-gradient(circle at 50% 35%, rgba(255, 190, 107, 0.28), transparent 60%), rgba(35, 17, 10, 0.88); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: luIn 0.4s ease both; }
.mem-win img { width: min(220px, 46%); height: auto; animation: luPop 0.8s var(--spring) both, hop 0.7s ease-in-out 0.8s 2; }
.mem-win b { font: 800 clamp(1.25rem, 3vw, 2rem) var(--display); color: #fff; }
.mem-win span { color: rgba(255, 255, 255, 0.78); font-weight: 600; }
.mem-win em { color: var(--orange-l); font-style: normal; }
.mem-win .btn { margin-top: 8px; }

/* flashcards: swipe to grade */
.flashcard { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.fc-inner { translate: var(--dx, 0) 0; rotate: var(--drot, 0deg); transition: transform 0.7s var(--spring), translate 0.35s var(--spring), rotate 0.35s var(--spring), opacity 0.25s; }
.flashcard.dragging .fc-inner { transition: transform 0.7s var(--spring); }
.flashcard.reset .fc-inner { transition: none !important; }
.flashcard.fly-right .fc-inner { translate: 130% 0; rotate: 16deg; opacity: 0; transition: translate 0.26s ease-in, rotate 0.26s ease-in, opacity 0.26s; }
.flashcard.fly-left .fc-inner { translate: -130% 0; rotate: -16deg; opacity: 0; transition: translate 0.26s ease-in, rotate 0.26s ease-in, opacity 0.26s; }
.flashcard::after { position: absolute; top: 18px; z-index: 3; padding: 6px 14px; border: 3px solid; border-radius: 10px; background: #fff; font: 800 1rem var(--display); pointer-events: none; }
.flashcard[data-swipe='good']::after { content: 'Знаю ✓'; left: 18px; color: var(--green); transform: rotate(-10deg); }
.flashcard[data-swipe='again']::after { content: 'Ещё раз ↺'; right: 18px; color: var(--red); transform: rotate(10deg); }

@media (max-width: 640px) {
  .sec-bubble { right: 74px; top: -54px; max-width: 210px; }
  .footer-peek { width: 96px; height: 62px; }
  .peek-clip img { width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .js body:not(.entered) .hero h1 .li { opacity: 1; transform: none; filter: none; }
  .sec-mascot.will-pop:not(.pop) { opacity: 1; }
  .cta-mascot.will-ride:not(.ride) { opacity: 1; transform: none; }
  .pretzel-rain, .spark { display: none; }
}

/* the title always fits its column (both words are long in Unbounded 900) */
.hero-copy { container-type: inline-size; }
.hero h1 { font-size: clamp(2.4rem, 6.2vw, 5.6rem); font-size: clamp(2.4rem, 13.9cqi, 6.6rem); }
.hero h1 .li { white-space: nowrap; }

/* narrow phones: keep the brand readable next to the stats */
@media (max-width: 420px) {
  .nav { gap: 10px; }
  .brand { flex: none; }
  .stat-pill #streak { display: none; }
}
body.footer-in .buddy.visible { transform: translateY(115%); }

/* desktop/tablet: section mascots sit on the top-right corner of the heading
   instead of wrapping onto their own row */
@media (min-width: 641px) {
  .section-head .sec-mascot { position: absolute; right: 0; bottom: calc(100% - 64px); margin: 0; width: clamp(130px, 11vw, 170px); }
  .sec-bubble { right: clamp(124px, 11.5vw, 176px); top: -96px; }
}
