/* Nùkún IA — shared styles for the MVP skeleton.
   Plain CSS, no build step. Keep this file the single source of visual truth
   across index.html, quiz.html, and lesson.html. */

:root {
  --bg: #F4F1E8;
  --surface: #FFFFFF;
  --ink: #201C16;
  --ink-muted: #6B6357;
  --indigo: #2B3A67;
  --indigo-light: #445790;
  --gold: #B8862E;
  --gold-light: #E4B15A;
  --border: #E0DACB;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512;
    --surface: #201D18;
    --ink: #F1EDE3;
    --ink-muted: #A69E8D;
    --indigo: #7C90C9;
    --indigo-light: #9DAEDA;
    --gold: #E4B15A;
    --gold-light: #F0CB8A;
    --border: #35312A;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--indigo);
}
@media (prefers-color-scheme: dark) {
  a { color: var(--indigo-light); }
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Site header / nav --- */

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  max-width: 780px;
  margin: 0 auto;
}

/* Large screens only — give the content column more room instead of
   leaving it stranded in the middle of the viewport. Mobile/tablet
   (everything below 1600px) is untouched. */
@media (min-width: 1600px) {
  .wrap,
  .site-nav {
    max-width: 1400px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ink);
}

.brand .mark {
  color: var(--gold);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-tagline {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--ink-muted);
}

.nav-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-muted);
  white-space: nowrap;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

/* Tighten spacing before the header switches to a stacked layout,
   so links keep shrinking room rather than wrapping mid-text. */
@media (max-width: 860px) {
  .site-nav ul {
    gap: 0.85rem;
    font-size: 0.86rem;
  }
  .nav-controls {
    gap: 0.85rem;
  }
}

@media (max-width: 768px) {
  .site-nav {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }
  .brand-block {
    align-items: center;
  }
  .nav-controls {
    justify-content: center;
    width: 100%;
  }
  .site-nav ul {
    justify-content: center;
  }
}

/* --- Language toggle (FR default, EN secondary) --- */

.lang-toggle {
  display: flex;
  gap: 0.2rem;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem;
}

.lang-btn {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn[aria-pressed="true"] {
  background: var(--indigo);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .lang-btn[aria-pressed="true"] { background: var(--indigo-light); color: #171512; }
}

.lang-btn:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* --- Sound toggle --- */

.sound-toggle {
  flex: none;
  font-size: 1rem;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.sound-toggle:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* --- Footer --- */

footer.site {
  margin-top: 3rem;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* --- Hero --- */

.hero {
  padding: 3rem 0 2rem;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
  margin: 0 0 0.6rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.hero p.lede {
  color: var(--ink-muted);
  max-width: 52ch;
  margin: 0 0 1.5rem;
}

.hero .lesson-duration {
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.9rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--indigo);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #171512; background: var(--indigo-light); }
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
  margin-left: 0.6rem;
}

/* --- Sections / cards --- */

section {
  padding: 2rem 0;
}

section h2 {
  font-size: 1.3rem;
  margin: 0 0 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}

.card + .card {
  margin-top: 0.75rem;
}

/* --- Journey / week list --- */

.journey-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.journey-item {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}

.journey-item .weeks {
  flex: none;
  width: 4.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.journey-item .theme {
  font-weight: 600;
}

.journey-status {
  margin-left: auto;
  flex: none;
  font-size: 1rem;
}

.journey-item.is-locked {
  opacity: 0.5;
  pointer-events: none;
}

/* --- Badges --- */

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
}

.badge .icon {
  font-size: 1rem;
}

.badge.is-locked {
  color: var(--ink-muted);
  opacity: 0.55;
}

/* --- Certificate --- */

.text-input {
  display: block;
  width: 100%;
  max-width: 24rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 5px);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
}

.text-input:focus {
  outline: 2px solid var(--indigo);
  outline-offset: 1px;
}

@media print {
  body * {
    visibility: hidden;
  }
  #cert-preview, #cert-preview * {
    visibility: visible;
  }
  #cert-preview {
    position: fixed;
    top: 2rem;
    left: 0;
    width: 100%;
  }
  .no-print {
    display: none !important;
  }
}

.cert-preview {
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  background: var(--surface);
}

.cert-preview .cert-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 0.6rem;
}

.cert-preview .cert-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
}

.cert-preview .cert-sub {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin: 0 0 0.9rem;
}

.cert-preview .cert-brand {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin: 0;
}

/* --- Placeholder tag: marks anything not yet real content --- */

.placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 10px,
    rgba(184, 134, 46, 0.06) 10px,
    rgba(184, 134, 46, 0.06) 20px
  );
}

.placeholder-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-bottom: 0.6rem;
}

/* --- Lesson template: step-by-step accordion (Context.md §6bis) --- */

.lesson-progress {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.lesson-progress-text {
  flex: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
  white-space: nowrap;
}

.accordion-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.accordion-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.accordion-step.is-active {
  border-color: var(--gold);
}

.accordion-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;
}

.accordion-trigger:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: -2px;
}

.accordion-trigger:disabled {
  cursor: default;
  opacity: 0.5;
}

.step-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  font-size: 1.05rem;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.accordion-step.is-active .step-icon {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-light);
  transform: scale(1.06);
}
@media (prefers-color-scheme: dark) {
  .accordion-step.is-active .step-icon { box-shadow: 0 0 0 3px rgba(228, 177, 90, 0.35); }
}

.accordion-step.is-done .step-icon {
  border-color: var(--gold);
  background: var(--bg);
}

.step-label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.95rem;
  overflow-wrap: break-word;
}

.accordion-step.is-active .step-label {
  color: var(--ink);
}

.step-chevron {
  flex: none;
  color: var(--ink-muted);
  transition: transform 0.2s ease;
}

.accordion-step.is-active .step-chevron {
  transform: rotate(180deg);
  color: var(--gold);
}

.accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.accordion-step.is-active .accordion-body {
  grid-template-rows: 1fr;
}

.accordion-body-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 1rem;
}

.accordion-step.is-active .accordion-body-inner {
  padding: 0 1rem 1.1rem;
}

.accordion-body-inner .card {
  margin-top: 0.25rem;
}

.accordion-body-inner p {
  margin: 0 0 0.75rem;
  max-width: 70ch;
}

.accordion-body-inner p:last-of-type {
  margin-bottom: 0;
}

.accordion-body-inner ul,
.accordion-body-inner ol {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  max-width: 70ch;
}

.accordion-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.accordion-nav .btn {
  flex: 1;
  text-align: center;
  margin-left: 0;
}

/* --- Lesson media: per-week illustration, video slot, concept animation --- */

.lesson-illustration {
  display: flex;
  justify-content: center;
  margin: 0.25rem 0 1.1rem;
}

.lesson-illustration img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem;
}

.media-video {
  margin: 1.1rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.media-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.media-video-frame iframe,
.media-video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.media-video-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--surface);
  color: var(--ink-muted);
  text-align: center;
  padding: 1rem;
}

.media-video-placeholder .media-video-icon {
  font-size: 1.7rem;
}

.media-video-placeholder p {
  font-size: 0.85rem;
  margin: 0 !important;
}

.concept-flow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 1.1rem 0;
  padding: 1rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.concept-flow-step {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink);
  opacity: 0;
  animation: flow-reveal 0.5s ease forwards;
}

.concept-flow-step:nth-child(1) { animation-delay: 0.1s; }
.concept-flow-step:nth-child(3) { animation-delay: 0.6s; }
.concept-flow-step:nth-child(5) { animation-delay: 1.1s; }

.concept-flow-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.35rem;
  border-radius: 50%;
  background: var(--gold-light);
  color: var(--indigo);
  font-weight: 700;
  font-size: 0.9rem;
}

.concept-flow-arrow {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 1.1rem;
  margin-top: 0.5rem;
  opacity: 0;
  animation: flow-reveal 0.5s ease forwards;
}

.concept-flow-arrow:nth-child(2) { animation-delay: 0.4s; }
.concept-flow-arrow:nth-child(4) { animation-delay: 0.9s; }

@keyframes flow-reveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .concept-flow { flex-direction: column; }
  .concept-flow-arrow { transform: rotate(90deg); margin: 0.1rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .accordion-body,
  .step-icon,
  .step-chevron {
    transition: none;
  }
  .concept-flow-step,
  .concept-flow-arrow {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .accordion-trigger {
    padding: 0.75rem 0.85rem;
    gap: 0.6rem;
  }
  .step-icon {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.95rem;
  }
  .step-label {
    font-size: 0.9rem;
  }
  .accordion-nav {
    flex-direction: column;
  }
}

/* --- Unlock celebration (Context.md §6ter) --- */

.celebration {
  text-align: center;
  padding: 2rem 1.5rem;
}

.celebration-stars {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  animation: celebration-pop 0.6s ease;
}

@keyframes celebration-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .celebration-stars { animation: none; }
}

.celebration-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.celebration-sub {
  color: var(--ink-muted);
  margin: 0 0 1.25rem;
}

/* --- Quiz form --- */

.quiz-progress {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.q {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 1rem;
  max-width: 70ch;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-options label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
}

.quiz-options input {
  accent-color: var(--indigo);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quiz-summary-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.quiz-summary p {
  color: var(--ink-muted);
  margin: 0 0 1.25rem;
}

.xp-track {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.xp-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: var(--gold);
  width: var(--xp, 0%);
}
