/* ==========================================================================
   TariQA — Moroccan Traffic Law Question Answering Shared Task (AbjadNLP)
   Visual language: traditional Moroccan craft (zellige stars, horseshoe
   arches, saffron / cobalt / terracotta / emerald) fused with road signs,
   traffic lights and asphalt road motifs.
   Plain CSS, no build step. Edit tokens in :root to retheme.
   ========================================================================== */

:root {
  /* --- Palette ---------------------------------------------------------- */
  --cream: #FBF3E3;
  --sand: #F1E3C8;
  --paper: #FFFDF7;
  --ink: #2B1F18;
  --ink-2: #4E3B30;
  --muted: #7A675A;
  --terracotta: #BD5A2C;
  --terracotta-deep: #96421C;
  --cobalt: #1F4E9A;
  --majorelle: #4F4BC9;
  --emerald: #0E7A5A;
  --flag-red: #C1272D;
  --flag-green: #006233;
  --saffron: #E9A632;
  --gold: #C9A03B;
  --asphalt: #2E2F34;
  --asphalt-2: #3B3C42;
  --lane-yellow: #F5CF4B;

  /* Road-sign colours (Vienna-convention style, as used in Morocco) */
  --sign-red: #D9252D;
  --sign-blue: #0D5CAB;
  --sign-yellow: #F4B400;
  --sign-green: #0B8A42;

  /* --- Semantic tokens -------------------------------------------------- */
  --bg: var(--cream);
  --bg-alt: var(--sand);
  --surface: var(--paper);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --link: var(--cobalt);
  --line: rgba(43, 31, 24, 0.14);
  --shadow: 0 10px 30px rgba(43, 31, 24, 0.10);
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1140px;
  --gutter: 16px;

  --font-display: "Marcellus", "Georgia", "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-arabic: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", "Times New Roman", serif;

  /* Zellige lattice (thin gold lines): subtle texture for backgrounds */
  --zellige-lines: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23C9A03B' stroke-width='1.2'%3E%3Cpolygon points='22,22 58,22 58,58 22,58'/%3E%3Cpolygon points='40,14.5 65.5,40 40,65.5 14.5,40'/%3E%3Cpolygon points='-18,-18 18,-18 18,18 -18,18'/%3E%3Cpolygon points='0,-25.5 25.5,0 0,25.5 -25.5,0'/%3E%3Cpolygon points='62,-18 98,-18 98,18 62,18'/%3E%3Cpolygon points='80,-25.5 105.5,0 80,25.5 54.5,0'/%3E%3Cpolygon points='-18,62 18,62 18,98 -18,98'/%3E%3Cpolygon points='0,54.5 25.5,80 0,105.5 -25.5,80'/%3E%3Cpolygon points='62,62 98,62 98,98 62,98'/%3E%3Cpolygon points='80,54.5 105.5,80 80,105.5 54.5,80'/%3E%3C/g%3E%3Cg fill='%23C9A03B' opacity='.7'%3E%3Cpolygon points='40,-5 45,0 40,5 35,0'/%3E%3Cpolygon points='75,40 80,35 85,40 80,45'/%3E%3Cpolygon points='40,75 45,80 40,85 35,80'/%3E%3Cpolygon points='-5,40 0,35 5,40 0,45'/%3E%3C/g%3E%3C/svg%3E");
}

/* Dark theme: Marrakech-night indigo with the same accents */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17151F;
    --bg-alt: #1F1C2B;
    --surface: #242033;
    --text: #F3EAD9;
    --text-2: #D8CCB8;
    --muted: #B3A694;
    --link: #8FB4F5;
    --line: rgba(243, 234, 217, 0.14);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --terracotta-deep: #E58A5A;
  }
}
:root[data-theme="dark"] {
  --bg: #17151F;
  --bg-alt: #1F1C2B;
  --surface: #242033;
  --text: #F3EAD9;
  --text-2: #D8CCB8;
  --muted: #B3A694;
  --link: #8FB4F5;
  --line: rgba(243, 234, 217, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --terracotta-deep: #E58A5A;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--terracotta-deep); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text);
  letter-spacing: 0.01em;
}
h2 { font-size: clamp(1.75rem, 2.8vw, 2.4rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.35em; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 6px;
}
pre {
  background: var(--asphalt);
  color: #F3EAD9;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.55;
  border-left: 6px solid var(--lane-yellow);
  margin: 0 0 1em;
}
pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.container.narrow { max-width: 880px; }
.ar { font-family: var(--font-arabic); direction: rtl; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.prose { max-width: 74ch; }
.prose li { margin-bottom: 0.45em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.mt-1 { margin-top: 12px; } .mt-2 { margin-top: 40px; } .mt-3 { margin-top: 64px; }
.mb-0 { margin-bottom: 0; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--flag-red); color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { left: 8px; }

/* Placeholder values the organisers still have to fill in */
.tba {
  border: 1.5px dashed var(--gold);
  border-radius: 6px;
  padding: 0 6px;
  color: var(--terracotta-deep);
  font-weight: 600;
  white-space: nowrap;
}

/* ==========================================================================
   Top ribbon + navigation
   ========================================================================== */
.topbar { background: var(--flag-green); color: #fff; font-weight: 600; font-size: 0.95rem; }
.topbar .container {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  padding: 8px 0; flex-wrap: wrap; text-align: center;
}
.topbar a { color: #fff; }
.topbar a:hover { color: #FFE39A; }
.topbar a.is-tba:not(.btn) { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.6); }
.pulse {
  flex: none; width: 12px; height: 12px; border-radius: 50%; background: #5CFF8A;
  box-shadow: 0 0 0 0 rgba(92, 255, 138, 0.7); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(92, 255, 138, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(92, 255, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(92, 255, 138, 0); }
}

.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
.nav .container { display: flex; align-items: center; gap: 12px; min-height: 68px; position: relative; }
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  font-family: var(--font-display); font-size: 1.45rem; margin-right: auto; line-height: 1;
}
.brand:hover { color: var(--text); }
.brand svg { width: 26px; height: 60px; }
.brand .brand-ar { font-family: var(--font-arabic); color: var(--terracotta); font-size: 1.4rem; margin-top: -4px; }
.nav-links { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; }
.nav-links li { margin: 0; }
.nav-links a {
  display: block; padding: 8px 11px; border-radius: 999px; color: var(--text-2);
  text-decoration: none; font-weight: 600; font-size: 0.93rem; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { background: var(--bg-alt); color: var(--terracotta-deep); }
.nav-links a.nav-cta { background: var(--flag-red); color: #fff; }
.nav-links a.nav-cta:hover { background: #a51f24; color: #fff; }
.nav-links a.nav-cta.is-tba { border: 0; color: #fff; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; flex: none; padding: 0;
}
.icon-btn:hover { background: var(--bg-alt); }
.icon-btn svg { width: 20px; height: 20px; }
.nav-toggle { display: none; }
.nav-toggle .bars { display: flex; flex-direction: column; gap: 4px; }
.nav-toggle .bars span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0;
    flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 10px 12px 14px; box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12); gap: 8px;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 10px 14px; border-radius: 10px; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 700; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; font-family: var(--font-body); font-size: 1rem;
  line-height: 1.2; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-primary { background: var(--flag-red); color: #fff; box-shadow: 0 8px 20px rgba(193, 39, 45, 0.3); }
.btn-primary:hover { background: #a81f25; color: #fff; }
.btn-go { background: var(--sign-green); color: #fff; box-shadow: 0 8px 20px rgba(11, 138, 66, 0.3); }
.btn-go:hover { background: #086b33; color: #fff; }
.btn-go:disabled { background: #8d9a92; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-blue { background: var(--sign-blue); color: #fff; box-shadow: 0 8px 20px rgba(13, 92, 171, 0.3); }
.btn-blue:hover { background: #0a4a8a; color: #fff; }
.btn-outline { border-color: var(--gold); color: var(--text); background: transparent; }
.btn-outline:hover { background: var(--bg-alt); color: var(--text); }
.btn-outline.on-dark { color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.btn-outline.on-dark:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 0.92rem; }
.btn-sm svg { width: 18px; height: 18px; }
.btn.is-tba { opacity: 0.8; cursor: not-allowed; }
.btn.is-tba:hover { transform: none; }
.tba-badge {
  font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.4;
  background: var(--saffron); color: #2B1F18; border-radius: 999px; padding: 2px 7px; margin-left: 2px;
}
a.is-tba:not(.btn) { text-decoration: none; border-bottom: 1.5px dashed var(--gold); color: var(--text-2); cursor: not-allowed; }
a.is-tba:not(.btn) .tba-badge { margin-left: 5px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; overflow: hidden; color: #FBF3E3;
  background: radial-gradient(900px 500px at 85% -10%, #5A4AA8 0%, rgba(90, 74, 168, 0) 60%),
              linear-gradient(160deg, #1C1F5C 0%, #22265F 40%, #141737 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; background-image: var(--zellige-lines);
  background-size: 80px 80px; opacity: 0.14; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; left: -10%; bottom: -30%; width: 55%; height: 75%;
  background: radial-gradient(closest-side, rgba(233, 166, 50, 0.32), rgba(233, 166, 50, 0)); pointer-events: none;
}
.hero .container {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: 40px; align-items: center; padding: 56px 0 40px;
}
.hero h1 { color: #fff; margin: 14px 0 16px; }
.hero .h1-name { display: block; font-size: clamp(2.8rem, 7vw, 4.8rem); line-height: 1; }
.hero .h1-name .ar { font-size: 0.8em; color: var(--saffron); margin-left: 0.12em; }
.hero .h1-sub { display: block; font-size: clamp(1.2rem, 2.4vw, 1.7rem); color: #F3EAD9; margin-top: 12px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.06);
  font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600;
}
.eyebrow .ico { width: 26px; height: 26px; }
.hero .lead { font-size: 1.2rem; max-width: 58ch; color: rgba(251, 243, 227, 0.9); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.hero-meta {
  list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-size: 0.95rem; color: rgba(251, 243, 227, 0.85);
}
.hero-meta li { margin: 0; display: flex; align-items: center; gap: 8px; }
.hero-meta li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--saffron); flex: none; }
.hero-meta strong { color: #fff; }
.hero-meta .tba { border-color: rgba(255, 255, 255, 0.5); color: var(--saffron); }
.hero-art { display: flex; justify-content: center; }
.hero-svg { width: 100%; max-width: 440px; height: auto; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45)); }
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; padding: 40px 0 28px; }
  .hero-art { order: 2; }
  .hero-svg { max-width: 380px; }
}

/* Animated traffic light (hero illustration) */
.tl-red { fill: #5A1414; }
.tl-amber { fill: #5A4310; }
.tl-green { fill: #0F4A24; }
.anim-tl .tl-red { animation: tlRed 9s infinite; }
.anim-tl .tl-amber { animation: tlAmber 9s infinite; }
.anim-tl .tl-green { animation: tlGreen 9s infinite; }
@keyframes tlRed {
  0%, 44% { fill: #FF3B30; filter: drop-shadow(0 0 6px #FF3B30); }
  45%, 100% { fill: #5A1414; filter: none; }
}
@keyframes tlAmber {
  0%, 34% { fill: #5A4310; filter: none; }
  35%, 44% { fill: #FFC247; filter: drop-shadow(0 0 6px #FFC247); }
  45%, 89% { fill: #5A4310; filter: none; }
  90%, 100% { fill: #FFC247; filter: drop-shadow(0 0 6px #FFC247); }
}
@keyframes tlGreen {
  0%, 44% { fill: #0F4A24; filter: none; }
  45%, 89% { fill: #34E36B; filter: drop-shadow(0 0 6px #34E36B); }
  90%, 100% { fill: #0F4A24; filter: none; }
}

/* ==========================================================================
   Scrolling road of signs
   ========================================================================== */
.sign-road {
  background: var(--asphalt); position: relative; overflow: hidden; padding: 18px 0 16px;
  border-top: 7px solid var(--saffron); box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.35);
}
.sign-road::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 3px; background: #ECECEC; opacity: 0.7; }
.sign-road::after { content: ""; position: absolute; left: 0; right: 0; bottom: 12px; border-top: 4px dashed var(--lane-yellow); opacity: 0.9; }
.sign-track { display: flex; gap: 40px; width: max-content; animation: marquee 70s linear infinite; }
.sign-road:hover .sign-track { animation-play-state: paused; }
.signpost { display: flex; flex-direction: column; align-items: center; width: 92px; position: relative; z-index: 1; }
.signpost svg { width: 64px; height: 64px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); }
.signpost .post { width: 6px; height: 30px; background: linear-gradient(90deg, #D5D8DC, #8A8D93); border-radius: 0 0 2px 2px; }
.signpost .label { font-size: 0.68rem; color: #D9D1C2; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; white-space: nowrap; }
/* two identical sets of 18 posts with a 40px gap: shift by exactly one set */
@keyframes marquee { to { transform: translateX(calc(-50% - 20px)); } }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 72px 0; position: relative; }
.section.alt { background: var(--bg-alt); }
.section.alt::before {
  content: ""; position: absolute; inset: 0; background-image: var(--zellige-lines);
  background-size: 80px 80px; opacity: 0.22; pointer-events: none;
}
.section > .container { position: relative; }
#overview .overview-glance { align-self: start; }
.section-head { display: flex; align-items: center; gap: 20px; }
.section-head .sign-icon { width: 68px; height: 68px; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18)); }
.section-head h2 { margin: 0; }
.section-head .num { display: block; font-family: var(--font-display); color: var(--gold); font-size: 0.95rem; letter-spacing: 0.22em; }
.section-head .ar-sub {
  display: block; font-family: var(--font-arabic); color: var(--terracotta); font-size: 1.4rem;
  direction: rtl; text-align: left; line-height: 1.3; margin-top: 2px;
}
.frieze {
  height: 10px; margin-top: 18px; border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--cobalt) 0 14px, var(--saffron) 14px 28px, var(--emerald) 28px 42px, var(--terracotta) 42px 56px);
}
.road-divider { height: 28px; background: var(--asphalt); position: relative; box-shadow: inset 0 6px 10px rgba(0, 0, 0, 0.3); }
.road-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; margin-top: -2px; border-top: 4px dashed var(--lane-yellow); opacity: 0.95; }

/* ==========================================================================
   Grid, cards, lists
   ========================================================================== */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.card::after {
  content: ""; position: absolute; top: -10px; right: -10px; width: 96px; height: 96px;
  background-image: var(--zellige-lines); background-size: 60px 60px; opacity: 0.45; pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at top right, #000 10%, transparent 70%);
  mask-image: radial-gradient(circle at top right, #000 10%, transparent 70%);
}
.card > * { position: relative; z-index: 1; }
.card h3 { display: flex; align-items: center; gap: 10px; }
.card-icon { width: 36px; height: 36px; flex: none; }
.card p:last-child { margin-bottom: 0; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding-left: 28px; position: relative; margin-bottom: 0.55em; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.38em; width: 15px; height: 15px; border-radius: 50%;
  background: var(--sign-blue); box-shadow: inset 0 0 0 2px #fff, 0 0 0 1.5px var(--sign-blue);
}

/* ==========================================================================
   Dataset statistics drawn as road signs
   ========================================================================== */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; margin: 36px 0 12px; }
#data .stats + h3 { margin-top: 64px; }
#data .grid.grid-2 + .grid.grid-2 { margin-top: 64px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.stat .figure {
  width: 140px; height: 140px; position: relative; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 2rem; line-height: 1; color: #1a1a1a;
}
.stat .figure > span { position: relative; z-index: 1; }
.stat .label { font-size: 0.92rem; color: var(--muted); max-width: 170px; line-height: 1.35; }
.sign-oct { background: #fff; color: #fff; clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.sign-oct::before { content: ""; position: absolute; inset: 6px; background: var(--sign-red); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.sign-circle { border-radius: 50%; background: #fff; border: 11px solid var(--sign-red); font-size: 3.2rem; box-shadow: 0 8px 14px rgba(0, 0, 0, 0.18); }
.sign-square { border-radius: 14px; background: var(--sign-blue); color: #fff; border: 5px solid #fff; outline: 2px solid var(--sign-blue); box-shadow: 0 8px 14px rgba(0, 0, 0, 0.18); }
.sign-square .stack { display: flex; flex-direction: column; font-size: 1.05rem; font-family: var(--font-body); font-weight: 700; letter-spacing: 0.04em; line-height: 1.35; }
.sign-diamond { background: #fff; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.sign-diamond::before { content: ""; position: absolute; inset: 7px; background: var(--sign-yellow); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.sign-tri { background: var(--sign-red); clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 38%; font-size: 1.5rem; }
.sign-tri::before { content: ""; position: absolute; inset: 18px 11px 7px; background: #fff; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

.bar { display: flex; height: 36px; border-radius: 8px; overflow: hidden; font-size: 0.82rem; font-weight: 700; color: #fff; margin: 8px 0 12px; }
.bar span { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; padding: 0 4px; }
.b-msa { background: var(--cobalt); } .b-darija { background: var(--terracotta); }
.b-a { background: var(--flag-red); } .b-b { background: var(--cobalt); } .b-c { background: var(--emerald); }

/* ==========================================================================
   Multiple-choice cards and the sample quiz
   ========================================================================== */
.mcq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.tag {
  display: inline-block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 10px;
  border-radius: 999px; background: var(--bg-alt); color: var(--terracotta-deep); font-weight: 700;
  margin-bottom: 10px; font-family: var(--font-body);
}
.q { font-weight: 700; font-size: 1.1rem; margin: 0 0 12px; line-height: 1.5; }
.mcq[dir="rtl"] .q, .mcq[dir="rtl"] .opt, .quiz-main.is-rtl .q, .quiz-main.is-rtl .opt { font-family: var(--font-arabic); font-size: 1.3rem; line-height: 1.8; }
.opts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.opts li { margin: 0; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); width: 100%; text-align: start; font: inherit;
}
.opt .k {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  font-family: var(--font-body); font-size: 0.9rem; background: var(--bg-alt); color: var(--text); line-height: 1; margin-top: 3px;
}
.opt.correct { border-color: var(--sign-green); background: rgba(11, 138, 66, 0.10); }
.opt.correct .k { background: var(--sign-green); color: #fff; }
.opt.wrong { border-color: var(--sign-red); background: rgba(217, 37, 45, 0.10); }
.opt.wrong .k { background: var(--sign-red); color: #fff; }

.quiz-wrap h3 .ar { font-size: 1.25rem; margin-left: 10px; color: var(--terracotta); }
.quiz { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 20px; align-items: start; border-top: 6px solid var(--saffron); }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.quiz-progress { font-size: 0.85rem; color: var(--muted); font-family: var(--font-body); }
button.opt { cursor: pointer; transition: background 0.15s, border-color 0.15s; }
button.opt:hover:not(:disabled) { border-color: var(--gold); background: var(--bg-alt); }
button.opt:disabled { cursor: default; }
.quiz-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.quiz-feedback { font-weight: 700; font-family: var(--font-body); }
.quiz-feedback.ok { color: var(--sign-green); }
.quiz-feedback.ko { color: var(--sign-red); }
.quiz-light { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.quiz-light svg { width: 64px; height: auto; }
.quiz-light .lamp { fill: #2A2A30; transition: fill 0.2s; }
.quiz-light.is-red .lamp.red { fill: #FF3B30; filter: drop-shadow(0 0 6px #FF3B30); }
.quiz-light.is-amber .lamp.amber { fill: #FFC247; filter: drop-shadow(0 0 6px #FFC247); }
.quiz-light.is-green .lamp.green { fill: #34E36B; filter: drop-shadow(0 0 6px #34E36B); }
.quiz-score { font-family: var(--font-display); font-size: 1.3rem; }
@media (max-width: 560px) {
  .quiz { grid-template-columns: 1fr; }
  .quiz-light { flex-direction: row; justify-content: center; }
}

/* ==========================================================================
   Task: input/output, tracks, tables
   ========================================================================== */
.io { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.io-label { display: block; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.io code { margin: 2px 4px 6px 0; display: inline-block; }
.io-arrow svg { width: 56px; height: 56px; }
@media (max-width: 560px) {
  .io { grid-template-columns: 1fr; }
  .io-arrow { transform: rotate(90deg); justify-self: center; }
}
.track { display: grid; grid-template-columns: 84px 1fr; gap: 18px; align-items: start; border-top: 6px solid var(--sign-blue); }
.track:first-child { border-top-color: var(--sign-red); }
.track-icon { width: 84px; height: 84px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18)); }
.track .num { font-family: var(--font-display); color: var(--gold); letter-spacing: 0.2em; font-size: 0.9rem; }
.track h3 { margin: 2px 0 8px; display: block; }
@media (max-width: 480px) { .track { grid-template-columns: 1fr; } }

.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); font-size: 0.97rem;
}
.tbl th, .tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--cobalt); color: #fff; font-weight: 700; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-alt) 50%, transparent); }

/* ==========================================================================
   Timeline drawn as a road with numbered signs
   ========================================================================== */
.road { list-style: none; padding: 20px 0 10px; margin: 24px 0 0; position: relative; }
.road::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 40px; margin-left: -20px;
  background: var(--asphalt); border-left: 3px solid #E6E6E6; border-right: 3px solid #E6E6E6; border-radius: 10px;
}
.road::after { content: ""; position: absolute; top: 12px; bottom: 12px; left: 50%; margin-left: -2px; border-left: 4px dashed var(--lane-yellow); }
.milestone { position: relative; width: 50%; padding: 0 56px 32px 0; margin: 0; }
.milestone:nth-child(even) { margin-left: 50%; padding: 0 0 32px 56px; }
.milestone .marker {
  position: absolute; top: 18px; right: -22px; width: 44px; height: 44px; border-radius: 50%;
  background: #fff; border: 6px solid var(--sign-red); color: #1a1a1a; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.05rem; z-index: 2; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}
.milestone:nth-child(even) .marker { right: auto; left: -22px; }
.milestone .marker.finish { background: repeating-conic-gradient(#1a1a1a 0 25%, #fff 0 50%) 0 0 / 14px 14px; border-color: #1a1a1a; color: transparent; }
.milestone .card { padding: 18px 20px; }
.milestone .date { font-family: var(--font-display); color: var(--terracotta-deep); font-size: 1rem; letter-spacing: 0.03em; margin-bottom: 4px; }
.milestone h3 { font-size: 1.15rem; margin-bottom: 6px; }
.milestone p { margin: 0; font-size: 0.95rem; color: var(--text-2); }
@media (max-width: 760px) {
  .road::before { left: 22px; margin-left: 0; width: 36px; }
  .road::after { left: 40px; margin-left: -2px; }
  .milestone, .milestone:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 24px 72px; }
  .milestone .marker, .milestone:nth-child(even) .marker { left: 18px; right: auto; }
}

/* ==========================================================================
   Organizers, steps, news
   ========================================================================== */
.people { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.person { width: 270px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 18px 20px; box-shadow: var(--shadow); }
@media (max-width: 600px) { .person { width: 100%; max-width: 340px; } }
.people-msg { text-align: center; color: var(--muted); max-width: 62ch; margin: 0 auto; }
.person .name { font-weight: 700; font-size: 1.08rem; }
.person .role { color: var(--terracotta-deep); font-weight: 600; font-size: 0.92rem; margin-top: 2px; }
.person .aff { color: var(--muted); font-size: 0.9rem; line-height: 1.4; margin-top: 4px; }

.step { text-align: center; }
.step h3 { justify-content: center; }
.step-sign { position: relative; width: 72px; height: 72px; margin: 0 auto 12px; }
.step-sign svg { width: 72px; height: 72px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18)); }
.step-sign span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.8rem; color: #1a1a1a; }

.news { list-style: none; padding: 0; margin: 0; }
.news li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 100px 1fr; gap: 12px; }
.news .date { font-family: var(--font-display); color: var(--terracotta-deep); font-size: 0.95rem; }

/* ==========================================================================
   Sub-pages (guidelines, paper)
   ========================================================================== */
.page-hero { background: linear-gradient(160deg, #1C1F5C, #141737); color: #FBF3E3; position: relative; overflow: hidden; padding: 44px 0; }
.page-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--zellige-lines); background-size: 80px 80px; opacity: 0.14; }
.page-hero .container { position: relative; display: flex; gap: 26px; align-items: center; }
.page-hero .sign-icon { width: 96px; height: 96px; flex: none; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.4)); }
.page-hero h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3rem); margin: 8px 0 10px; }
.page-hero .lead { font-size: 1.1rem; color: rgba(251, 243, 227, 0.9); margin: 0; max-width: 70ch; }
.page-hero a { color: var(--saffron); }
@media (max-width: 600px) { .page-hero .container { flex-direction: column; align-items: flex-start; } }
.subpage h2 { display: flex; align-items: center; gap: 12px; margin-top: 44px; padding-bottom: 8px; border-bottom: 2px solid var(--line); font-size: 1.6rem; }
.subpage .toc + h2 { margin-top: 0; }
.h-icon { width: 36px; height: 36px; flex: none; }
.toc {
  display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 28px; font-size: 0.95rem;
}
.toc strong { width: 100%; font-family: var(--font-display); font-weight: 400; color: var(--muted); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; }
.toc a { text-decoration: none; font-weight: 600; }
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 18px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--terracotta); line-height: 1; }
details.faq[open] summary::after { content: "\2212"; }
details.faq p { margin: 10px 0 4px; color: var(--text-2); }
.paper-structure li { margin-bottom: 0.8em; }
.paper-structure li strong { display: block; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: #1B1A24; color: #D9D1C2; padding: 48px 0 28px; position: relative; }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: linear-gradient(90deg, var(--flag-red) 0 50%, var(--flag-green) 50% 100%); }
.footer a { color: var(--saffron); }
.footer a:hover { color: #fff; }
.footer a.is-tba:not(.btn) { color: #D9D1C2; }
.footer h4 { color: #fff; margin-bottom: 10px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.footer .brand { color: #fff; margin: 0 0 10px; }
.footer .brand:hover { color: #fff; }
.foot-links { list-style: none; padding: 0; margin: 0; }
.foot-links li { margin-bottom: 6px; }
.footer .tiny { font-size: 0.85rem; opacity: 0.8; margin-top: 28px; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer .tba { color: var(--saffron); }
@media (max-width: 760px) { .footer .cols { grid-template-columns: 1fr; } }

/* ==========================================================================
   Scroll reveal + motion preferences
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view, .no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .sign-track, .pulse { animation: none; }
  .anim-tl .tl-red, .anim-tl .tl-amber, .anim-tl .tl-green { animation: none; }
  .anim-tl .tl-green { fill: #34E36B; }
  .btn:hover { transform: none; }
}
