/* =========================================================
   Daouda Kanoute — Portfolio styles
   Only what the current (May 2026) Tailwind-based design uses:
   - CSS variable tokens (referenced by quiz modal CSS)
   - Global resets
   - .reveal animation
   - Quiz modal CSS (quizzes.jsx uses these class names)
   - .double-text effect
   - Dark-theme quiz overrides
   - prefers-reduced-motion
   ========================================================= */

:root,
[data-theme="ink"] {
  --bg: oklch(1 0 0);
  --bg-elev: oklch(0.985 0 0);
  --bg-soft: oklch(0.955 0.003 250);
  --fg: oklch(0.14 0.012 260);
  --fg-mute: oklch(0.35 0.012 260);
  --fg-soft: oklch(0.58 0.012 260);
  --line: oklch(0.86 0.006 260);
  --line-soft: oklch(0.93 0.004 260);
  --accent: oklch(0.50 0.22 260);
  --accent-ink: oklch(1 0 0);

  --serif: "Instrument Serif", "Times New Roman", serif;
  --display: "Geist", "Sora", -apple-system, sans-serif;
  --sans: "Geist", "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --col-max: 1320px;

  color-scheme: light;
}

[data-theme="lime"] {
  --bg: oklch(1 0 0);
  --bg-elev: oklch(0.985 0 0);
  --bg-soft: oklch(0.955 0.004 130);
  --fg: oklch(0.14 0.008 130);
  --fg-mute: oklch(0.35 0.010 130);
  --fg-soft: oklch(0.58 0.010 130);
  --line: oklch(0.86 0.006 130);
  --line-soft: oklch(0.93 0.004 130);
  --accent: oklch(0.78 0.22 130);
  --accent-ink: oklch(0.18 0.008 130);
  color-scheme: light;
}

[data-theme="magenta"] {
  --bg: oklch(0.99 0.002 320);
  --bg-elev: oklch(1 0 0);
  --bg-soft: oklch(0.955 0.006 320);
  --fg: oklch(0.16 0.010 320);
  --fg-mute: oklch(0.35 0.012 320);
  --fg-soft: oklch(0.60 0.012 320);
  --line: oklch(0.86 0.008 320);
  --line-soft: oklch(0.93 0.005 320);
  --accent: oklch(0.58 0.24 350);
  --accent-ink: oklch(1 0 0);
  color-scheme: light;
}

* { box-sizing: border-box; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--delay, 0ms);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Quiz modal */
.quiz-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.quiz-modal {
  width: min(720px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  position: relative;
  animation: rise 0.4s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.quiz-modal__close {
  position: absolute; top: 18px; right: 18px;
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--mono);
  color: var(--fg-mute);
  transition: background 0.2s, color 0.2s;
}
.quiz-modal__close:hover { background: var(--accent); color: var(--accent-ink); }
.quiz-progress {
  display: flex; gap: 6px;
  margin-bottom: 28px;
}
.quiz-progress__seg {
  flex: 1; height: 3px;
  border-radius: 99px;
  background: var(--line-soft);
  overflow: hidden;
}
.quiz-progress__seg.active { background: var(--accent); }
.quiz-progress__seg.done { background: var(--fg-mute); }
.quiz-modal__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin-bottom: 16px;
  line-height: 1.4;
}
.quiz-modal__q {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.22;
  letter-spacing: -0.03em;
  margin: 0 0 26px;
}
.quiz-options { display: grid; gap: 10px; }
.quiz-option {
  display: grid;
  grid-template-columns: 28px 1fr 24px;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  font-family: var(--sans);
  color: var(--fg);
}
.quiz-option > span:nth-child(2) { line-height: 1.45; }
.quiz-option:hover { border-color: var(--fg-mute); transform: translateX(2px); }
.quiz-option .key {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono); font-size: 11px;
  color: var(--fg-mute);
  flex-shrink: 0;
}
.quiz-option .check {
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
  display: inline-block;
  width: 24px;
}
.quiz-option.correct {
  border-color: oklch(0.72 0.18 145);
  background: color-mix(in oklab, oklch(0.72 0.18 145) 12%, var(--bg));
}
.quiz-option.correct .key { background: oklch(0.72 0.18 145); color: var(--bg); border-color: transparent; }
.quiz-option.wrong {
  border-color: oklch(0.65 0.22 25);
  background: color-mix(in oklab, oklch(0.65 0.22 25) 12%, var(--bg));
}
.quiz-option.wrong .key { background: oklch(0.65 0.22 25); color: var(--bg); border-color: transparent; }
.quiz-option.correct .check, .quiz-option.wrong .check {
  font-family: var(--mono); font-size: 13px;
  font-weight: 600;
}
.quiz-option.correct .check { color: oklch(0.72 0.18 145); }
.quiz-option.wrong .check { color: oklch(0.65 0.22 25); }
.quiz-explain {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  border-radius: 4px;
  font-size: 14px;
  color: var(--fg-mute);
  line-height: 1.5;
}
.quiz-explain b { color: var(--fg); font-weight: 500; }
.quiz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn--primary {
  background: var(--fg); color: var(--bg); border-color: var(--fg);
}
.btn--primary:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--ghost:hover { background: var(--bg-soft); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.quiz-result { text-align: center; padding: 12px 0 4px; }
.quiz-result__score {
  font-family: var(--serif);
  font-size: clamp(80px, 12vw, 140px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-style: italic;
  margin: 8px 0 4px;
}
.quiz-result__score .total { color: var(--fg-mute); font-style: normal; font-size: 0.4em; }
.quiz-result__verdict {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.2;
  margin: 0 0 8px;
}
.quiz-result__msg { color: var(--fg-mute); margin: 0 auto 26px; max-width: 44ch; font-size: 15px; }
.quiz-result__breakdown {
  display: grid; gap: 8px;
  margin: 26px 0;
  text-align: left;
}
.quiz-result__row {
  display: grid;
  grid-template-columns: 24px 1fr 32px;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px dashed var(--line-soft);
  font-size: 13px;
  color: var(--fg-mute);
  line-height: 1.45;
}
.quiz-result__row .ico {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding-top: 1px;
}
.quiz-result__row .ico.ok { color: oklch(0.72 0.18 145); }
.quiz-result__row .ico.no { color: oklch(0.65 0.22 25); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* =========================================================
   Sidebar + scroll layout (May 2026 redesign)
   ========================================================= */

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}


/* Quiz modal — dark theme overrides (portfolio forces data-theme="dark"). */
[data-theme="dark"] .quiz-overlay { background: rgba(0, 0, 0, 0.85); }
[data-theme="dark"] .quiz-modal { background: #0a0a0a; color: #fff; border: 1px solid #1f1f1f; }
[data-theme="dark"] .quiz-option { background: rgba(255,255,255,0.04); border-color: #1f1f1f; color: #fff; }
[data-theme="dark"] .quiz-option:hover { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .quiz-option.correct { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.4); }
[data-theme="dark"] .quiz-option.wrong { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); }
[data-theme="dark"] .quiz-explain { background: rgba(234,88,12,0.12); border-color: rgba(234,88,12,0.3); color: #fdba74; }
[data-theme="dark"] .quiz-modal__close { color: #fff; }
