/* Kamka IT · Formation live
   The AI holds the pen: Kamka teal is its ink (right ideas, the circled mark),
   amber is the marker for what to fix. Navy is the board, paper is the copy. */

:root {
  --navy: #23296b;
  --navy-deep: #1b2057;
  --navy-line: rgba(116, 180, 193, 0.22);
  --paper: #f8f9f9;
  --paper-shade: #eef2f4;
  --paper-line: #d9e5ea;
  --text: #1c2150;
  --muted: #5a5e8c;
  --mist: #74b4c1;
  --current: #207ca9;
  --current-strong: #1a6a91;
  --ink: #20adae;
  --ink-text: #127a86;
  --ink-bright: #22b5af;
  --amber: #f2b544;
  --amber-soft: rgba(242, 181, 68, 0.38);
  --danger: #b23a48;

  --f-display: 'Unbounded', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --f-body: 'Onest', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-hand: 'Kalam', 'Aref Ruqaa', cursive;

  --radius: 14px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --ink-u: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6.5 C 22 3.5, 44 8, 64 5.2 S 104 3.6, 118 6' fill='none' stroke='%2320ADAE' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
  --ink-strike: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' preserveAspectRatio='none'%3E%3Cpath d='M2 7 C 30 4, 60 9, 118 4.5' fill='none' stroke='%23F2B544' stroke-width='3.2' stroke-linecap='round'/%3E%3Cpath d='M4 9.5 C 40 6.5, 80 10, 116 7' fill='none' stroke='%23F2B544' stroke-width='2' stroke-linecap='round' opacity='.75'/%3E%3C/svg%3E");
}

/* Arabic: the Latin faces have no Arabic glyphs, so each script falls back on its
   own: a clean sans for titles (legible on a projector) and Ruqaa, the everyday
   handwriting style, for the AI's ink. Latin text inside Arabic keeps Kalam. */
:lang(ar) {
  --f-display: 'IBM Plex Sans Arabic', 'Onest', system-ui, sans-serif;
  --f-body: 'Onest', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --f-hand: 'Kalam', 'Aref Ruqaa', cursive;
}
:lang(ar) .display,
:lang(ar) h1,
:lang(ar) .q-text,
:lang(ar) .belief {
  font-weight: 600;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--f-body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--current);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- ink */

.hand {
  font-family: var(--f-hand);
  font-weight: 700;
  color: var(--ink-text);
  line-height: 1.25;
}

/* An underline drawn in teal ink under the right ideas. */
.ink-u {
  background-image: var(--ink-u);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.42em;
  padding-bottom: 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
:dir(rtl) .ink-u,
[dir='rtl'] .ink-u {
  background-position: 100% 100%;
}
.animate .ink-u {
  animation: ink-draw 700ms var(--ease-out) both;
  animation-delay: calc(var(--d, 0) * 1ms + 500ms);
}

/* The amber marker crossing out a wrong belief. */
.ink-strike {
  background-image: var(--ink-strike);
  background-repeat: no-repeat;
  background-position: 0 58%;
  background-size: 100% 0.5em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
[dir='rtl'] .ink-strike {
  background-position: 100% 58%;
}
.animate .ink-strike {
  animation: strike-draw 800ms var(--ease-out) both;
  animation-delay: calc(var(--d, 0) * 1ms + 400ms);
}

@keyframes ink-draw {
  from {
    background-size: 0% 0.42em;
  }
}
@keyframes strike-draw {
  from {
    background-size: 0% 0.5em;
  }
}

/* The circled mark. */
.mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.mark svg {
  position: absolute;
  inset: -18% -22%;
  width: 144%;
  height: 136%;
  overflow: visible;
}
.mark path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.mark .num {
  font-family: var(--f-hand);
  font-weight: 700;
  color: var(--ink-text);
  line-height: 1;
  white-space: nowrap;
  direction: ltr;
}
.mark .num small {
  font-size: 0.5em;
  opacity: 0.8;
  margin-inline-start: 0.08em;
}
.mark.low path {
  stroke: var(--amber);
}
.animate .mark path {
  animation: circle-draw 900ms var(--ease-out) both;
  animation-delay: 150ms;
}
.animate .mark .num {
  animation: fade-in 400ms ease-out both;
  animation-delay: 650ms;
}
@keyframes circle-draw {
  from {
    stroke-dashoffset: 1;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* A sheet of exam paper. */
.sheet {
  background: var(--paper);
  color: var(--text);
  border-radius: 6px;
  box-shadow:
    0 1px 0 rgba(28, 33, 80, 0.06),
    0 10px 30px -12px rgba(16, 20, 64, 0.35);
}
.ruled {
  background-image: linear-gradient(to bottom, transparent calc(1.6em - 1px), var(--paper-line) calc(1.6em - 1px));
  background-size: 100% 1.6em;
  line-height: 1.6em;
}

/* ---------------------------------------------------------------- shared bits */

.k-mark {
  width: auto;
  height: 1.6em;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  font-size: 0.8rem;
  font-weight: 600;
}
.lang-switch button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  min-width: 2.6em;
  min-height: 2.1em;
  padding: 0 0.6em;
  letter-spacing: 0.04em;
}
.lang-switch button[aria-pressed='true'] {
  background: currentColor;
}
.lang-switch button[aria-pressed='true'] span {
  color: var(--navy);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}
