/* Kitaab loaders "C+": the AacharyaG ink drop with its red flame (chosen 2026-11-14, sample sheet
   https://claude.ai/artifact/CsYCEEDFKCVdaGst7LNVoS). Built by inkFlame() in js/dom.js. Since 2026-11-21 the
   only loaders are the wait screen (js/wait.js, filling flame), the lesson "Thinking…" flame and the editor
   placeholder; the drip / writing / spinner rules below are unused. Loaded last. With reduced motion every
   loader holds still; the words stay. */

.ink-flame { flex: none; overflow: visible; display: inline-block; vertical-align: middle; }
.ink-s { width: 18px; height: 18px; }
.ink-m { width: 26px; height: 26px; }
.ink-l { width: 64px; height: 64px; }

/* Small flames take the text colour, so they read on white, ink and red buttons alike. */
.ink-drop { fill: var(--ink); }
.ink-s .ink-drop { fill: currentColor; }
.ink-core { fill: var(--accent); }
.ink-m .ink-core, .ink-l .ink-core { stroke: #FFFFFF; stroke-width: 1.6; }

/* C1 Flicker: the flame licks up and sways like a wick, on an uneven rhythm. */
.ink-flicker .ink-core { transform-origin: 32px 43px; animation: ink-lick 2.3s ease-in-out infinite; }
@keyframes ink-lick {
  0%   { transform: scale(.9, .86) rotate(0deg); }
  18%  { transform: scale(.94, 1.04) rotate(-3deg); }
  34%  { transform: scale(.88, .92) rotate(2deg); }
  52%  { transform: scale(.96, 1.1) rotate(-1deg); }
  70%  { transform: scale(.9, .95) rotate(3deg); }
  86%  { transform: scale(.95, 1.02) rotate(-2deg); }
  100% { transform: scale(.9, .86) rotate(0deg); }
}

/* C2 Filling: ink rises inside the outlined drop, the flame lights, then it starts again. */
.ink-fill { fill: var(--ink); transform-origin: 32px 54px; animation: ink-rise 2.6s cubic-bezier(.5, 0, .3, 1) infinite; }
.ink-outline { fill: none; stroke: var(--ink); stroke-width: 2.4; }
.ink-s .ink-fill { fill: currentColor; }
.ink-s .ink-outline { stroke: currentColor; }
.ink-fill ~ .ink-core { transform-origin: 32px 43px; animation: ink-light 2.6s ease-out infinite; }
@keyframes ink-rise { 0% { transform: scaleY(0); } 55%, 88% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
@keyframes ink-light { 0%, 50% { transform: scale(0); } 62% { transform: scale(1.12); } 72%, 88% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* C3 Drip: the drop bobs and lands, sending two ripples across the page line. */
.ink-bob { transform-origin: 32px 54px; animation: ink-bob 1.8s cubic-bezier(.45, 0, .55, 1) infinite; }
.ink-drip .ink-core { transform-origin: 32px 43px; animation: ink-breathe 1.8s ease-in-out infinite; }
.ink-ripple { fill: none; stroke: var(--ink); stroke-width: 1.4; transform-origin: 32px 60px; opacity: 0; animation: ink-ripple 1.8s ease-out infinite; }
.ink-ripple-2 { animation-delay: .25s; }
@keyframes ink-bob { 0%, 100% { transform: translateY(-3px); } 45% { transform: translateY(0) scale(1.04, .96); } 60% { transform: translateY(-1px); } }
@keyframes ink-breathe { 0%, 100% { transform: scale(.85); } 50% { transform: scale(1.04); } }
@keyframes ink-ripple { 0%, 40% { opacity: 0; transform: scale(.3, .3); } 50% { opacity: .8; } 100% { opacity: 0; transform: scale(1.5, 1); } }

/* C4 Writing: small flame plus a pen line that draws and lifts. */
.ink-writing { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.ink-stroke { position: relative; display: inline-block; width: 36px; height: 2px; background: #D9D9D4; overflow: hidden; }
.ink-stroke::after { content: ""; position: absolute; inset: 0; background: currentColor; transform-origin: left; animation: ink-draw 1.4s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes ink-draw { 0% { transform: scaleX(0); } 60% { transform: scaleX(1); transform-origin: left; } 61% { transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }

/* Whole-page loader: drop centred, small caps under it. */
.ink-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 72px 24px; text-align: center; }
.ink-loading-text { font-family: var(--font-ui); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

/* Tutor typing line in the lesson. */
.typing .ink-flame { margin-right: 2px; }

/* Long-wait boxes on the goal and clarify pages keep their rules; the flame replaces the old ring. */
.kg-busy .ink-flame { flex: none; }

/* Reduced motion: still flame, full ink, words carry the meaning. */
.reduce-motion .ink-flame *, .reduce-motion .ink-stroke::after { animation: none !important; }
.reduce-motion .ink-fill, .reduce-motion .ink-fill ~ .ink-core { transform: none; opacity: 1; }
.reduce-motion .ink-ripple { opacity: 0; }
.reduce-motion .ink-stroke::after { transform: scaleX(.6); }
@media (prefers-reduced-motion: reduce) {
  .ink-flame *, .ink-stroke::after { animation: none !important; }
  .ink-fill, .ink-fill ~ .ink-core { transform: none; opacity: 1; }
  .ink-ripple { opacity: 0; }
  .ink-stroke::after { transform: scaleX(.6); }
}

/* Wait screen for slow AI calls (js/wait.js, option A of docs/design/overlay-loader-options-2026-11-21.html):
   the page dimmed, a Kitaab card in the middle with the filling ink flame, a message that changes with time, a clock
   and Cancel. Prefix kwait-. */
.kwait { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(20, 20, 20, .55); animation: kwait-in .2s ease both; }
@keyframes kwait-in { from { opacity: 0; } }
.kwait-card:focus { outline: none; }
.kwait-card { width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 22px 18px; border: 2px solid var(--ink); background: #FFFFFF; box-shadow: 6px 6px 0 var(--ink); text-align: center; }
.kwait-title { margin: 4px 0 0; font-family: var(--font-serif); font-size: 22px; font-weight: 600; line-height: 1.25; }
.kwait-msg { margin: 0; min-height: 42px; font-size: 14px; line-height: 1.5; color: #3D3D3D; }
.kwait-time { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; }
.kwait-cancel { margin-top: 4px; min-height: 42px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 0; background: #FFFFFF; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.kwait-cancel:hover { background: var(--soft); }
.kwait-cancel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root.kwait-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .kwait { animation: none; } }
:root.reduce-motion .kwait { animation: none; }
