/* OpenDyslexic font */
@import url('https://cdn.jsdelivr.net/npm/opendyslexic@3.0.0/opendyslexic-regular.min.css');

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #444444;
  --accent: #0b5fff;
  --card: #f4f4f5;
  --focus: #ffbf47;
  --fontScale: 1;
}

html { font-size: calc(16px * var(--fontScale)); }
body {
  margin: 0;
  font-family: Arial, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1040px; margin: 0 auto; padding: 16px; }
.header { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.card { background: var(--card); border-radius: 14px; padding: 14px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

button, .btn {
  border: 1px solid #ccc;
  background: #fff;
  color: #111;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-block;
}
button:focus, a:focus, select:focus, input:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.small { font-size: 0.95rem; color: var(--muted); }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .grid { grid-template-columns: 2fr 1fr; } }

label { display: inline-flex; gap: 8px; align-items: center; }
hr { border: 0; border-top: 1px solid #ddd; margin: 16px 0; }
kbd { background: #eee; padding: 2px 6px; border-radius: 6px; }

.notice { border-left: 4px solid var(--accent); padding: 10px 12px; background: rgba(11,95,255,0.06); border-radius: 10px; }
.footer { margin-top: 24px; padding-top: 12px; border-top: 1px solid #ddd; }
ul.clean { margin: 8px 0; padding-left: 18px; }
li { margin: 6px 0; }

/* Accessibility modes */
body.contrast {
  --bg: #000000;
  --fg: #ffffff;
  --muted: #d0d0d0;
  --card: #111111;
  --accent: #7db3ff;
  background: #000;
  color: #fff;
}
body.contrast a { color: #9ad1ff; }
body.contrast button, body.contrast .btn {
  background: #111;
  color: #fff;
  border-color: #555;
}

body.greyscale { filter: grayscale(1); }

body.dyslexic-font {
  font-family: 'OpenDyslexic', Arial, sans-serif;
  letter-spacing: 0.05em;
  word-spacing: 0.16em;
  line-height: 1.75;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ============================================================
   PROGRESS BAR — thin strip at very top of every page
   ============================================================ */

#nj-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.08);
  z-index: 9999;
  overflow: hidden;
}

#nj-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.5s ease;
  min-width: 0%;
}

#nj-progress-label {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  /* Sits just below the bar */
  transform: translateY(6px);
}

/* Push page content down so it isn't hidden under the fixed bar */
body { padding-top: 6px; }

/* Resume button — distinct from regular .btn */
.btn-resume {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: bold;
}
.btn-resume:hover { opacity: 0.88; text-decoration: none; }

/* High contrast overrides for progress bar */
body.contrast #nj-progress-bar { background: #333; }
body.contrast #nj-progress-fill { background: #7db3ff; }
body.contrast .btn-resume { background: #7db3ff; color: #000; border-color: #7db3ff; }

/* ============================================================
   VIDEO CONTAINER — fixed 9:16 ratio, letterboxes all variants
   ============================================================ */

.video-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
