/* MARK FUEL homepage lab: shared base. Each concept defines its own tokens. */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: clip; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
p, h1, h2, h3, h4, ul, ol, figure, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
[hidden] { display: none !important; }

/* Language: both versions live in the markup; only the active one is rendered. */
html[lang="ar"] .en, html[lang="en"] .ar { display: none !important; }
.ltr-iso { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--focus, #378AE6); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--bg); border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }
.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; }

/* Prototype notes, shown only from the preview hub (?notes=1). */
.lab { display: none; }
.show-lab .lab { display: block; margin: 10px 0; padding: 8px 12px; border: 1.5px dashed #d97706; border-radius: 8px; background: rgba(217,119,6,.08); color: inherit; font: 500 13px/1.6 system-ui, sans-serif; }
.show-lab .lab::before { content: "LAB · "; font-weight: 800; color: #b45309; }

.mf-toast { position: fixed; inset-inline: 16px; bottom: max(16px, env(safe-area-inset-bottom)); margin-inline: auto; max-width: 460px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.55; box-shadow: 0 12px 30px rgba(0,0,0,.25); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; }
.mf-toast.is-on { opacity: 1; transform: none; }

/* ---------- Try-a-card demo: structure only. Concepts style the skin. ---------- */
.mfd { --mfd-radius: 18px; display: grid; gap: 14px; }
.mfd-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.mfd-lesson { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfd-count { flex: none; font-variant-numeric: tabular-nums; }
.mfd-stage { perspective: 1400px; }
.mfd-card { display: grid; position: relative; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.8,.2,1), opacity .26s; cursor: pointer; }
.mfd-card[data-side="back"] { transform: rotateY(180deg); cursor: default; }
html[dir="rtl"] .mfd-card[data-side="back"] { transform: rotateY(-180deg); }
.mfd-card.is-leaving { opacity: 0; }
.mfd-face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; min-height: 248px; padding: 22px 22px 20px; border-radius: var(--mfd-radius); display: flex; flex-direction: column; gap: 10px; }
.mfd-back { transform: rotateY(180deg); }
.mfd-side-label { font-size: 12px; font-weight: 700; letter-spacing: 0; opacity: .7; }
.mfd-q { font-size: clamp(19px, 2.2vw, 23px); line-height: 1.65; font-weight: 700; text-align: right; }
.mfd-a { font-size: clamp(17px, 2vw, 20px); line-height: 1.7; font-weight: 700; text-align: right; }
.mfd-gloss { font-size: 14px; line-height: 1.5; opacity: .75; }
.mfd-source { margin-top: auto; display: grid; gap: 6px; padding-top: 12px; border-top: 1px dashed currentColor; border-color: color-mix(in srgb, currentColor 25%, transparent); }
.mfd-source-tag { font-size: 12.5px; font-weight: 700; }
.mfd-excerpt { font-size: 14px; line-height: 1.8; text-align: right; }
.mfd-excerpt mark { background: var(--mark, #FDE68A); color: inherit; padding: 1px 3px; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.mfd-actions { min-height: 64px; }
.mfd-reveal { width: 100%; min-height: 52px; border-radius: 14px; border: 0; font-weight: 700; font-size: 16px; }
.mfd-rates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mfd-rate { position: relative; min-height: 60px; padding: 8px 4px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1.5px solid transparent; }
.mfd-wait { font-size: 12px; font-weight: 600; opacity: .85; white-space: nowrap; }
.mfd-rname { font-size: 15px; font-weight: 800; }
.mfd-rate kbd { position: absolute; top: 4px; inset-inline-end: 6px; font: 600 10px/1 system-ui; opacity: .45; }
@media (hover: none) { .mfd-rate kbd { display: none; } }
.mfd-feedback { min-height: 3.2em; font-size: 14.5px; line-height: 1.65; }
.mfd-note { font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.mfd-summary { padding: 20px; border-radius: var(--mfd-radius); display: grid; gap: 10px; line-height: 1.7; }
.mfd-summary ul { padding-inline-start: 1.2em; margin: 0; }
.mfd-sum-title { font-size: 20px; font-weight: 800; }
.mfd-sum-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.mfd-sum-actions > * { min-height: 46px; padding: 0 18px; border-radius: 12px; display: inline-flex; align-items: center; text-decoration: none; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .mfd-card, .mfd-card[data-side="back"], html[dir="rtl"] .mfd-card[data-side="back"] { transform: none; }
  .mfd-back { transform: none; }
  .mfd-card[data-side="front"] .mfd-back, .mfd-card[data-side="back"] .mfd-front { visibility: hidden; }
}
.mfd { min-width: 0; grid-template-columns: minmax(0, 1fr); }
@media (max-width: 360px) { .mfd-rates { gap: 5px; } .mfd-rate { padding: 6px 2px; } .mfd-wait { font-size: 11px; } .mfd-rname { font-size: 13.5px; } .mfd-face { padding: 18px 16px; } }
/* Reserve the demo's height before JS mounts it (prevents layout shift). Measured 457–554px across widths. */
#demo { min-height: 456px; }
