/* Kashuv design: soft peach and lilac pastels, plum ink, rounded Fredoka headings and Rubik text (like Okeat). */
:root {
  --bg: #FFF7F3; --surface: #FFFFFF; --surface-2: #FCF1EE; --ink: #2B2140; --muted: #7A6B88; --line: #F1E2E6;
  --peach: #FFB4A2; --peach-soft: #FFE6DE; --peach-deep: #E36E57;
  --lilac: #8B7BFF; --lilac-soft: #E8E4FF; --mint: #2A9A66; --mint-soft: #D4F4E3; --butter: #B97B05; --butter-soft: #FFEEBD;
  --sky: #2F86C9; --sky-soft: #DCEFFF; --warn: #D2443E; --warn-soft: #FFE3E0;
  --shadow: 0 18px 44px rgba(76, 46, 90, .14), 0 3px 10px rgba(76, 46, 90, .07);
  --shadow-sm: 0 4px 14px rgba(76, 46, 90, .09);
  --font-display: "Fredoka", "Varela Round", "Arial Rounded MT Bold", sans-serif;
  --font-ui: "Rubik", "Assistant", "Segoe UI", Arial, sans-serif;
  --scale: 1; --r: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1D1729; --surface: #271F36; --surface-2: #30273F; --ink: #F4ECFA; --muted: #B6A8C8; --line: #3B3150;
    --peach: #FF9C86; --peach-soft: #43303A; --peach-deep: #FF9C86; --lilac: #ABA2FF; --lilac-soft: #2F2A57;
    --mint: #71D8A5; --mint-soft: #1E3C30; --butter: #F2C258; --butter-soft: #45381A; --sky: #8CC8FF; --sky-soft: #1F3347;
    --warn: #FF8A80; --warn-soft: #452325;
    --shadow: 0 18px 44px rgba(0, 0, 0, .5), 0 3px 10px rgba(0, 0, 0, .3); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1D1729; --surface: #271F36; --surface-2: #30273F; --ink: #F4ECFA; --muted: #B6A8C8; --line: #3B3150;
  --peach: #FF9C86; --peach-soft: #43303A; --peach-deep: #FF9C86; --lilac: #ABA2FF; --lilac-soft: #2F2A57;
  --mint: #71D8A5; --mint-soft: #1E3C30; --butter: #F2C258; --butter-soft: #45381A; --sky: #8CC8FF; --sky-soft: #1F3347;
  --warn: #FF8A80; --warn-soft: #452325;
  --shadow: 0 18px 44px rgba(0, 0, 0, .5), 0 3px 10px rgba(0, 0, 0, .3); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: calc(100% * var(--scale)); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font-family: var(--font-ui); line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--lilac); }
:focus-visible { outline: 3px solid var(--lilac); outline-offset: 2px; border-radius: 10px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 99; }
.skip:focus { top: 12px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* floating pastel blobs */
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blobs i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .45; animation: float 22s ease-in-out infinite alternate; }
.blobs i:nth-child(1) { background: var(--peach-soft); top: -18vmax; inset-inline-end: -10vmax; }
.blobs i:nth-child(2) { background: var(--lilac-soft); bottom: -22vmax; inset-inline-start: -14vmax; animation-delay: -7s; }
.blobs i:nth-child(3) { background: var(--mint-soft); top: 40%; left: 40%; width: 26vmax; height: 26vmax; animation-delay: -12s; opacity: .3; }
@keyframes float { to { transform: translate(6vmax, 4vmax) scale(1.12); } }

/* header and footer */
.site-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 12px clamp(14px, 4vw, 40px); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; }
.brand img { transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover img { transform: rotate(-14deg) scale(1.08); }
.site-head nav { display: flex; gap: 6px; margin-inline-start: auto; flex-wrap: wrap; }
.site-head nav a { text-decoration: none; color: var(--ink); padding: 8px 14px; border-radius: 999px; font-weight: 500; transition: background .2s; }
.site-head nav a:hover { background: var(--surface-2); }
.site-head nav a[aria-current="page"] { background: var(--lilac-soft); color: var(--lilac); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 1.15rem; display: grid; place-items: center; transition: transform .3s; }
.icon-btn:hover { transform: rotate(20deg); }
main { flex: 1; width: min(1180px, 100%); margin: 0 auto; padding: clamp(18px, 4vw, 44px) clamp(14px, 4vw, 40px) 60px; outline: none; }
.site-foot { padding: 26px clamp(14px, 4vw, 40px); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.foot-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.foot-note { margin: 0; }
.foot-credit { margin: 0; display: flex; align-items: center; gap: 6px; }
.foot-name { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--lilac-soft); text-decoration: none; font-weight: 600; transition: transform .2s; }
.foot-name:hover { transform: translateY(-2px); }

/* building blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: clamp(18px, 3vw, 28px); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 600; background: var(--ink); color: var(--bg); text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.97); }
.btn.soft { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn.lilac { background: var(--lilac); color: #fff; }
.btn.peach { background: var(--peach); color: #2B2140; }
.btn.danger { background: var(--warn-soft); color: var(--warn); }
.btn.small { padding: 8px 14px; font-size: .9rem; }
.btn:disabled { opacity: .55; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--c-soft, var(--lilac-soft)); color: var(--c, var(--lilac)); font-weight: 500; font-size: .875rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.field { display: grid; gap: 6px; font-weight: 500; }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 12px 14px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--lilac); }
.muted { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.pop { animation: pop .55s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* home */
.hero { text-align: center; padding: 30px 0 34px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 700; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--peach-deep), var(--lilac)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 640px; margin: 16px auto 0; }
.wave { display: inline-flex; gap: 5px; align-items: center; height: 44px; margin-bottom: 16px; }
.wave b { width: 7px; border-radius: 9px; background: linear-gradient(var(--peach), var(--lilac)); animation: bar 1.1s ease-in-out infinite; }
.wave b:nth-child(odd) { animation-delay: -.4s; } .wave b:nth-child(3n) { animation-delay: -.7s; }
@keyframes bar { 0%, 100% { height: 10px; } 50% { height: 42px; } }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.choice { position: relative; overflow: hidden; display: grid; gap: 12px; align-content: start; transition: transform .3s, box-shadow .3s; }
.choice:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.choice .big { font-size: 2.6rem; width: 74px; height: 74px; border-radius: 24px; display: grid; place-items: center; background: var(--c-soft); }
.choice h2 { font-size: 1.6rem; }
.choice.peachy { --c-soft: var(--peach-soft); }
.choice.lilacy { --c-soft: var(--lilac-soft); }
.drop { border: 2px dashed var(--line); border-radius: 18px; padding: 22px; text-align: center; background: var(--surface-2); transition: border-color .2s, background .2s; cursor: pointer; }
.drop.over { border-color: var(--lilac); background: var(--lilac-soft); }
.status-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 34px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .n { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; background: var(--butter-soft); color: var(--butter); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 44px 0 16px; }
.section-title h2 { font-size: 1.6rem; }

/* library cards */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.lib a { text-decoration: none; color: inherit; display: grid; gap: 8px; transition: transform .25s, box-shadow .25s; }
.lib a:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow); }
.lib .emo { font-size: 2rem; }
.lib h3 { font-size: 1.2rem; }
.lib p { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.empty { text-align: center; padding: 40px; color: var(--muted); }
.search { width: min(360px, 100%); border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 18px; }

/* progress */
.progress-view { display: grid; place-items: center; gap: 18px; text-align: center; padding: 50px 0; }
.ring { --p: 0; width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--lilac) calc(var(--p) * 1%), var(--lilac-soft) 0); transition: --p .4s; position: relative; }
.ring::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--bg); }
.ring span { position: relative; font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; }
.bar { width: min(420px, 90%); height: 12px; border-radius: 9px; background: var(--lilac-soft); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--peach), var(--lilac)); border-radius: 9px; transition: width .4s; }

/* live */
.live-setup { max-width: 640px; margin: 0 auto; display: grid; gap: 16px; }
.sources { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.sources legend { font-weight: 500; margin-bottom: 8px; }
.source { position: relative; display: grid; gap: 2px; justify-items: center; text-align: center; padding: 16px 12px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; transition: transform .2s, border-color .2s, background .2s; }
.source:hover { transform: translateY(-3px); }
.source input { position: absolute; opacity: 0; pointer-events: none; }
.source .ico { font-size: 1.9rem; transition: transform .4s cubic-bezier(.2, 1.6, .4, 1); }
.source small { color: var(--muted); }
.source:has(input:checked) { border-color: var(--lilac); background: var(--lilac-soft); }
.source:has(input:checked) .ico { transform: scale(1.2) rotate(-8deg); }
.source:has(input:focus-visible) { outline: 3px solid var(--lilac); outline-offset: 2px; }
.note { background: var(--butter-soft); color: var(--ink); border-radius: 16px; padding: 12px 16px; font-size: .93rem; }
.note.warn { background: var(--warn-soft); }
.live-top { position: sticky; top: 72px; z-index: 10; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; padding: 14px 18px; }
.orb { width: 18px; height: 18px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 60%, transparent); animation: ping 1.6s infinite; }
.orb.idle { background: var(--muted); animation: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 14px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.timer { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.meter { display: flex; gap: 3px; align-items: flex-end; height: 26px; }
.meter b { width: 5px; border-radius: 4px; background: var(--lilac); height: 4px; transition: height .15s; }
.live-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.live-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.stream { max-height: 64vh; overflow-y: auto; display: grid; gap: 6px; scroll-behavior: smooth; }
.line { display: flex; gap: 12px; padding: 8px 10px; border-radius: 12px; animation: pop .5s both; }
.line time { flex: none; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; padding-top: 3px; }
.line.hit { background: var(--butter-soft); }
.side { display: grid; gap: 16px; position: sticky; top: 160px; }
.now { background: linear-gradient(135deg, var(--peach-soft), var(--lilac-soft)); border: 0; }
.now h3 { font-size: 1rem; color: var(--muted); font-family: var(--font-ui); font-weight: 500; }
.now p { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; margin: 6px 0 0; }
.ticks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.ticks li { display: flex; gap: 10px; animation: pop .5s both; }
.ticks li::before { content: "✦"; color: var(--lilac); }
.missed-box { white-space: pre-line; }
.keys { font-size: .85rem; margin: -6px 0 14px; text-align: center; }
.rename { display: inline-grid; width: 38px; height: 38px; font-size: 1rem; vertical-align: middle; opacity: .55; }
.rename:hover, .rename:focus-visible { opacity: 1; }
body.focus .stream-card, body.focus .site-head nav, body.focus .site-foot { display: none; }
body.focus .live-grid { grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; }
body.focus .now p { font-size: 2rem; }
.flash { animation: flash 1s 3; }
@keyframes flash { 50% { box-shadow: 0 0 0 6px var(--butter); } }

/* summary page */
.sum-hero { position: relative; overflow: hidden; display: grid; gap: 14px; background: linear-gradient(135deg, var(--peach-soft), var(--surface) 45%, var(--lilac-soft)); }
.sum-hero .emo { display: block; width: max-content; font-size: 3.4rem; line-height: 1.3; padding-top: 4px; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-5deg); } }
.sum-hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
.tldr { font-size: 1.15rem; margin: 0; max-width: 820px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.player { position: sticky; top: 72px; z-index: 9; margin: 16px 0; display: flex; gap: 12px; align-items: center; padding: 10px 16px; }
.player audio { width: 100%; height: 40px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin: 22px 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; scrollbar-width: none; }
.tabs button { flex: none; border: 0; background: none; padding: 9px 16px; border-radius: 999px; font-weight: 500; transition: background .2s, color .2s; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.panel[hidden] { display: none; }
.secs { columns: 2 340px; column-gap: 18px; }
.sec { break-inside: avoid; margin-bottom: 18px; border-top: 5px solid var(--c, var(--lilac)); }
.sec:nth-child(4n+1) { --c: var(--peach); } .sec:nth-child(4n+2) { --c: var(--lilac); } .sec:nth-child(4n+3) { --c: var(--mint); } .sec:nth-child(4n) { --c: var(--butter); }
.sec h3 { display: flex; gap: 10px; align-items: center; font-size: 1.3rem; margin-bottom: 10px; }
.sec ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; }
.sec li::marker { color: var(--c); }
.tips { margin-bottom: 18px; background: var(--butter-soft); border: 0; }
.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.concept b { display: block; font-family: var(--font-display); font-size: 1.15rem; color: var(--lilac); margin-bottom: 4px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.todo { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.todo label { display: flex; gap: 10px; align-items: flex-start; }
.todo input { width: 20px; height: 20px; accent-color: var(--mint); margin-top: 3px; }
.todo input:checked + span { text-decoration: line-through; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.flip { perspective: 1000px; height: 200px; border: 0; background: none; padding: 0; text-align: inherit; }
.flip .in { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.3, 1.3, .5, 1); transform-style: preserve-3d; }
.flip.on .in { transform: rotateY(180deg); }
.flip .f, .flip .b { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r); padding: 20px; display: grid; place-content: center; text-align: center; gap: 8px; overflow: auto; }
.flip .f { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-weight: 600; }
.flip .b { background: linear-gradient(135deg, var(--mint-soft), var(--lilac-soft)); transform: rotateY(180deg); }
.flip small { color: var(--muted); font-weight: 400; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 14px; }
.tl::before { content: ""; position: absolute; inset-inline-start: 46px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: linear-gradient(var(--peach), var(--lilac)); }
.tl li { display: flex; gap: 22px; align-items: center; }
.tl button { flex: none; width: 92px; border: 0; border-radius: 999px; padding: 6px; background: var(--surface); box-shadow: var(--shadow-sm); font-variant-numeric: tabular-nums; font-weight: 600; position: relative; }
.transcript { display: grid; gap: 2px; max-height: 70vh; overflow-y: auto; }
.seg { display: flex; gap: 12px; padding: 8px 10px; border-radius: 12px; border: 0; background: none; text-align: inherit; transition: background .2s; }
.seg:hover { background: var(--surface-2); }
.seg.cur { background: var(--lilac-soft); }
.seg time { flex: none; color: var(--muted); font-size: .8rem; padding-top: 3px; font-variant-numeric: tabular-nums; }
mark { background: var(--butter-soft); color: inherit; border-radius: 4px; padding: 0 2px; }
.chat { display: grid; gap: 12px; }
.bubble { padding: 12px 16px; border-radius: 18px; max-width: 85%; white-space: pre-line; animation: pop .4s both; }
.bubble.me { background: var(--lilac); color: #fff; justify-self: start; border-end-start-radius: 4px; }
.bubble.ai { background: var(--surface-2); justify-self: end; border-end-end-radius: 4px; }
.ask-row { display: flex; gap: 8px; }
.ask-row input { flex: 1; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 12px 18px; }
.dots::after { content: "..."; animation: dots 1.2s steps(4) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } }

/* toasts */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 10px; z-index: 60; width: min(440px, 92vw); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 16px; box-shadow: var(--shadow); animation: pop .4s both; }
.toast.alert { background: var(--butter); color: #2B2140; font-weight: 600; }

/* accessibility menu */
.a11y-btn { position: fixed; bottom: 22px; right: 22px; z-index: 70; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--lilac); color: #fff; box-shadow: var(--shadow); display: grid; place-items: center; touch-action: none; cursor: grab; }
.a11y-btn:active { cursor: grabbing; }
.a11y-panel { position: fixed; bottom: 90px; right: 22px; z-index: 70; width: 250px; display: grid; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.a11y-panel h2 { font-size: 1.2rem; }
.a11y-panel button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 9px 12px; text-align: start; }
.a11y-panel button[aria-pressed="true"] { background: var(--lilac-soft); border-color: var(--lilac); color: var(--lilac); font-weight: 600; }
.a11y-size { display: flex; align-items: center; gap: 8px; }
.a11y-size span { flex: 1; }
.a11y-size button { width: 46px; text-align: center; }
.a11y-panel .ghost { background: none; text-align: center; }
.a11y-link { text-align: center; font-size: .9rem; }
.a11y-hint { margin: 0; font-size: .78rem; color: var(--muted); text-align: center; }
.foot-link { color: var(--muted); }
.a11y-btn { transition: transform .25s, box-shadow .25s; animation: a11y-in .8s cubic-bezier(.2, 1.4, .4, 1) both; }
.a11y-btn:hover { transform: scale(1.08) rotate(-8deg); }
.a11y-btn.dragging { transform: scale(1.12); box-shadow: 0 0 0 8px color-mix(in srgb, var(--lilac) 30%, transparent), var(--shadow); transition: none; }
@keyframes a11y-in { from { opacity: 0; transform: scale(.4); } }
html.a11y-contrast { --muted: var(--ink); --line: var(--ink); }
html.a11y-contrast .blobs { display: none; }
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after { animation: none !important; transition: none !important; }
html.a11y-links a { text-decoration: underline !important; text-underline-offset: 3px; }
html.a11y-plain body, html.a11y-plain h1, html.a11y-plain h2, html.a11y-plain h3 { font-family: Arial, sans-serif; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 860px) {
  .live-grid { grid-template-columns: 1fr; }
  .side { position: static; }
  .site-head { flex-wrap: wrap; }
  .site-head nav { order: 3; width: 100%; justify-content: center; margin: 0; }
  .live-top, .player { top: 118px; }
}

/* print and PDF: every part of the summary, one after another */
@media print {
  .site-head, .site-foot, .a11y-btn, .a11y-panel, .blobs, .actions, .tabs, .player, .toasts, .no-print { display: none !important; }
  body { background: #fff; color: #2B2140; }
  .panel[hidden] { display: block !important; }
  .panel { margin-bottom: 26px; }
  .panel::before { content: attr(data-title); display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
  .card, .sec { box-shadow: none; break-inside: avoid; }
  .flip { height: auto; } .flip .in { transform: none !important; }
  .flip .f, .flip .b { position: static; transform: none; display: block; }
  .transcript { max-height: none; overflow: visible; }
  * { animation: none !important; }
}

/* ===== Mobile stability: no sideways drift, pinch-zoom stays allowed ===== */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{max-width:100%;overflow-x:hidden;overflow-x:clip;overscroll-behavior-x:none}
:where(img,svg,video,canvas,iframe,table){max-width:100%}
:where(img,video){height:auto}
:where(h1,h2,h3,h4,p,li,a,span,td,th,label,button){overflow-wrap:break-word}
@media (pointer:coarse){input,select,textarea{font-size:max(16px,1em)}}

/* ---------- extras: hero demo, live wave, lecture map, practice deck, search hits, progress, tour ---------- */
.hero-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 34px; align-items: center; text-align: start; }
.hero-split .wave { justify-content: flex-start; }
.hero-split p { margin-inline: 0; }
.hero-split .status-row { justify-content: flex-start; }
.hero-demo { position: relative; padding: 18px; overflow: hidden; transform: rotate(-1.2deg); transition: transform .4s; background: linear-gradient(160deg, var(--surface), var(--lilac-soft)); }
.hero-demo:hover { transform: rotate(0) translateY(-4px); }
.hd-top { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.hd-top .orb { width: 12px; height: 12px; }
.hd-t { font-variant-numeric: tabular-nums; color: var(--muted); }
.hd-wave { flex: 1; height: 34px; min-width: 60px; }
.hd-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; margin-top: 12px; min-height: 196px; }
.hd-tr { display: grid; align-content: start; gap: 6px; }
.hd-line { display: flex; gap: 8px; font-size: .92rem; padding: 6px 10px; border-radius: 12px; background: var(--surface); animation: pop .4s both; }
.hd-line time { color: var(--muted); font-size: .78rem; padding-top: 2px; font-variant-numeric: tabular-nums; }
.hd-line span::after { content: "▍"; color: var(--lilac); animation: blink 1s steps(2) infinite; }
.hd-line:not(:last-child) span::after { content: none; }
.hd-line.hit { background: var(--butter-soft); box-shadow: 0 0 0 2px var(--butter); }
@keyframes blink { 50% { opacity: 0; } }
.hd-sum { background: var(--surface); border-radius: 16px; padding: 10px 12px; font-size: .88rem; }
.hd-sum small { color: var(--lilac); font-weight: 700; }
.hd-sum ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.hd-sum li { background: var(--peach-soft); border-radius: 10px; padding: 5px 8px; }
.hd-alert { position: absolute; inset-inline-end: 16px; bottom: 14px; background: var(--butter); color: #2B2140; font-weight: 700; padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow-sm); animation: pop .5s both, bob 1.2s ease-in-out infinite .5s; }

.live-wave { flex-basis: 100%; width: 100%; height: 46px; margin-top: 2px; }

.tbar-card { margin: 16px 0; }
.tbar-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; }
.tbar-head h3 { font-size: 1.1rem; }
.tbar-head .muted { font-size: .88rem; }
.tbar { position: relative; height: 54px; border-radius: 16px; background: var(--surface-2); }
.tb-seg { position: absolute; top: 6px; bottom: 6px; inset-inline-start: var(--s); width: max(var(--w), 6px); border: 0; border-radius: 10px; background: var(--c-soft); color: var(--ink); box-shadow: inset 0 -4px 0 var(--c); overflow: hidden; padding: 0 8px; font-size: .8rem; font-weight: 600; text-align: start; white-space: nowrap; transform-origin: inline-start; animation: grow .7s cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: calc(var(--i) * 90ms); transition: transform .2s, filter .2s; }
.tb-seg span { display: block; overflow: hidden; text-overflow: ellipsis; }
.tb-seg:hover, .tb-seg:focus-visible { transform: translateY(-3px); filter: saturate(1.4); z-index: 2; }
@keyframes grow { from { transform: scaleX(0); opacity: 0; } }
.tb-pin { position: absolute; top: -12px; inset-inline-start: var(--s); translate: 50% 0; border: 0; background: var(--surface); border-radius: 50%; width: 30px; height: 30px; box-shadow: var(--shadow-sm); font-size: .95rem; z-index: 3; transition: transform .2s; animation: pop .5s both .6s; }
[dir=ltr] .tb-pin { translate: -50% 0; }
.tb-pin.bell { top: auto; bottom: -12px; }
.tb-pin:hover, .tb-pin:focus-visible { transform: scale(1.25); }
.tb-head { position: absolute; top: 0; bottom: 0; inset-inline-start: var(--s, 0%); width: 3px; border-radius: 3px; background: var(--peach-deep); opacity: 0; transition: inset-inline-start .25s linear, opacity .3s; pointer-events: none; z-index: 4; }
.tb-head.on { opacity: 1; }
.tbar-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-top: 16px; font-variant-numeric: tabular-nums; }

.deck { max-width: 560px; margin: 0 auto; display: grid; gap: 16px; }
.deck-top { display: flex; align-items: center; gap: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.deck-bar { flex: 1; height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.deck-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--mint), var(--lilac)); transition: width .5s cubic-bezier(.2, 1.2, .4, 1); }
.deck-card { width: 100%; height: 260px; }
.deck-card .f, .deck-card .b { font-size: 1.2rem; text-align: center; place-content: center; gap: 10px; }
.deck-card em { font-style: normal; font-size: .8rem; color: var(--muted); font-weight: 400; }
.deck-card.enter { animation: pop .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.deck-card.out-yes { transition: transform .28s, opacity .28s; transform: translateX(-60px) rotate(-8deg); opacity: 0; }
.deck-card.out-no { transition: transform .28s, opacity .28s; transform: translateX(60px) rotate(8deg); opacity: 0; }
[dir=ltr] .deck-card.out-yes { transform: translateX(60px) rotate(8deg); }
[dir=ltr] .deck-card.out-no { transform: translateX(-60px) rotate(-8deg); }
.deck-actions { display: flex; justify-content: center; gap: 12px; }
.deck-keys { text-align: center; font-size: .85rem; margin: 0; }
.deck-done { text-align: center; padding: 30px; display: grid; gap: 8px; justify-items: center; }
.deck-done .big { font-size: 3rem; animation: bob 1.4s ease-in-out infinite; }
.all-cards { margin-top: 26px; }
.all-cards summary { cursor: pointer; font-weight: 700; margin-bottom: 14px; color: var(--lilac); }

.lib-hint { margin: -6px 0 16px; font-size: .9rem; }
.hits { margin-top: 26px; display: grid; gap: 10px; }
.hits-title { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.hit { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.hit:hover, .hit:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow); }
.hit .emo { font-size: 1.6rem; }
.hit > span:nth-child(2) { flex: 1; display: grid; }
.hit-text { color: var(--muted); font-size: .92rem; }
.hit time { flex: none; background: var(--lilac-soft); color: var(--lilac); font-weight: 700; padding: 4px 12px; border-radius: 99px; font-variant-numeric: tabular-nums; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi { display: grid; gap: 2px; background: linear-gradient(150deg, var(--surface), var(--c-soft)); }
.kpi-e { font-size: 1.6rem; }
.kpi b { font-family: var(--font-display); font-size: 2.1rem; line-height: 1.1; color: var(--c); }
.kpi small { color: var(--muted); }
.week { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.wk { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.wk i { width: 100%; max-width: 38px; height: var(--h); min-height: 4px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--lilac), var(--peach)); transform-origin: bottom; animation: rise .8s cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: calc(var(--i) * 70ms); }
.wk small { color: var(--muted); font-size: .8rem; }
.wk.today small { color: var(--lilac); font-weight: 700; }
@keyframes rise { from { transform: scaleY(0); } }
.split { display: grid; gap: 14px; margin-top: 10px; }
.sp { display: grid; grid-template-columns: 120px 1fr 30px; align-items: center; gap: 10px; }
.sp-bar { height: 14px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.sp-bar i { display: block; height: 100%; width: var(--w); border-radius: 99px; background: linear-gradient(90deg, var(--peach), var(--lilac)); animation: grow .9s cubic-bezier(.2, 1.2, .4, 1) both; transform-origin: inline-start; }
.cloud { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.cloud .chip { text-decoration: none; transition: transform .2s; }
.cloud .chip:hover { transform: translateY(-3px) rotate(-2deg); }
.cloud small { opacity: .6; }

.tour-ring { position: fixed; z-index: 9998; border-radius: 22px; box-shadow: 0 0 0 4px var(--lilac), 0 0 0 9999px rgba(29, 23, 41, .45); pointer-events: none; transition: all .35s cubic-bezier(.2, 1.1, .4, 1); }
.tour { position: fixed; z-index: 9999; width: min(340px, calc(100vw - 24px)); background: var(--surface); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); animation: pop .4s both; transition: top .35s, left .35s; }
.tour small { color: var(--lilac); font-weight: 700; }
.tour h3 { margin: 4px 0 6px; font-size: 1.2rem; }
.tour p { margin: 0 0 14px; color: var(--muted); }
.tour-btns { display: flex; justify-content: space-between; gap: 10px; }

@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; text-align: center; }
  .hero-split .wave, .hero-split .status-row { justify-content: center; }
  .hero-split p { margin-inline: auto; }
  .hero-demo { transform: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .hd-body { grid-template-columns: 1fr; }
  .hd-sum { display: none; }
  .sp { grid-template-columns: 96px 1fr 24px; }
  .tb-seg span { display: none; }
}
@media print { .hero-demo, .tbar-card, .deck, .tour, .tour-ring { display: none !important; } .all-cards { display: block; } }

/* ---------- motion layer (motion.js) ---------- */
::selection { background: var(--lilac-soft); color: var(--ink); }
html { scrollbar-color: var(--lilac-soft) transparent; }
.site-head { transition: box-shadow .3s, background .3s; }
.site-head.scrolled { box-shadow: 0 6px 24px rgba(76, 46, 90, .08); }
.site-head nav { position: relative; }
.site-head nav a { position: relative; z-index: 1; transition: color .25s, background .2s; }
.site-head nav a[aria-current="page"] { background: transparent; }
.nav-pill { position: absolute; top: 0; left: 0; z-index: 0; border-radius: 999px; background: var(--lilac-soft); box-shadow: 0 4px 14px color-mix(in srgb, var(--lilac) 22%, transparent); transition: transform .45s cubic-bezier(.3, 1.4, .5, 1), width .45s cubic-bezier(.3, 1.4, .5, 1), opacity .3s; pointer-events: none; }

main.page-in > * { animation: page-in .55s cubic-bezier(.2, 1, .4, 1) both; }
main.page-in > *:nth-child(2) { animation-delay: .06s; } main.page-in > *:nth-child(3) { animation-delay: .12s; } main.page-in > *:nth-child(n+4) { animation-delay: .18s; }
@keyframes page-in { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
.rv { opacity: 0; transform: translateY(34px) scale(.98); animation: none !important; transition: opacity .7s ease, transform .8s cubic-bezier(.2, 1.2, .4, 1); transition-delay: var(--d, 0ms); }
.rv.in { opacity: 1; transform: none; }

.rippling { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .18; transform: scale(0); animation: ripple .65s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.btn.lilac { background-size: 200% 100%; background-image: linear-gradient(100deg, var(--lilac) 0%, var(--lilac) 52%, color-mix(in srgb, var(--lilac) 65%, var(--peach)) 76%, var(--lilac) 100%); background-position: 0 0; transition: background-position .8s ease, transform .2s, box-shadow .2s; }
.btn.lilac:hover { background-position: 100% 0; }

.lib a, .choice, .kpi, .concept, .hero-demo { transform-style: preserve-3d; }
.tilting { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-4px) !important; transition: transform .12s ease-out !important; box-shadow: var(--shadow); }
.lib a, .choice, .kpi, .concept { position: relative; }
.lib a::after, .choice::after, .kpi::after, .concept::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .45), transparent 55%); }
.tilting::after { opacity: 1; }
[data-theme=dark] .tilting::after { opacity: .25; }

.hero-split { position: relative; }
.hero-split .hero-text > .wave { display: none; }
.sparkles { position: absolute; inset: -20px 0 -40px; pointer-events: none; z-index: -1; overflow: hidden; }
.sparkles span { position: absolute; left: var(--x); bottom: -40px; font-size: 1.3rem; opacity: 0; animation: drift var(--t) linear infinite; animation-delay: var(--dl); filter: saturate(.7); }
@keyframes drift { 10% { opacity: .55; } 90% { opacity: .35; } to { transform: translate(30px, -520px) rotate(25deg); opacity: 0; } }

.section-title h2, .section-title h1 { position: relative; }
.section-title h2::after { content: ""; position: absolute; inset-inline-start: 0; bottom: -6px; height: 4px; width: 46px; border-radius: 4px; background: linear-gradient(90deg, var(--peach), var(--lilac)); transform-origin: inline-start; animation: grow .9s cubic-bezier(.2, 1.2, .4, 1) both .3s; }
.toast { animation: toast-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(30px) scale(.9); } }
.empty::first-letter { display: inline-block; }
.progress-view .ring { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); box-shadow: 0 0 0 14px color-mix(in srgb, var(--lilac) 12%, transparent); } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 10000; }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: circle-in .65s cubic-bezier(.4, 0, .2, 1); }
@keyframes circle-in { from { clip-path: circle(0 at var(--vx) var(--vy)); } to { clip-path: circle(150vmax at var(--vx) var(--vy)); } }

html.a11y-still .rv, html.a11y-still .sparkles { opacity: 1; transform: none; }
html.a11y-still .sparkles { display: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; } .sparkles { display: none; } }
