/* ---------- Roadmap page: header & counters ---------- */
.rmp-head {
  position: relative;
  overflow: hidden;
  padding: 72px 0 8px;
}
.rmp-head::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.rmp-head .container { position: relative; }
.rmp-head h1 {
  margin: 4px 0 12px;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.rmp-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}
.rmp-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  font-weight: 700;
}
.rmp-chip.st-done { color: #3ddc84; border-color: rgba(61, 220, 132, 0.35); }
.rmp-chip.st-wip { color: var(--accent); border-color: rgba(255, 61, 127, 0.4); }
.rmp-chip.st-next { color: #8ab4ff; border-color: rgba(138, 180, 255, 0.35); }
.rmp-updated { margin-left: auto; font-size: 0.85rem; color: var(--text-muted); }
.rmp-hint { font-size: 0.88rem; color: var(--text-muted); }

.rmp-counters {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding-top: 36px;
}
.rmp-counter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.rmp-counter-value {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rmp-counter-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rmp-counter .rmp-segs { margin-top: 10px; }
.rmp-counter-note { margin-top: 4px; font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Investigation board ---------- */
.ev-board {
  --paper: #f2ece0;
  --ink: #2a2027;
  --ink-muted: #75666d;
  --red: #c8102e;
  position: relative;
  isolation: isolate;
  padding: 46px 40px 40px;
  border-radius: 18px;
  border: 10px solid #130c0f;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 220, 190, 0.07), transparent 60%),
    radial-gradient(ellipse at 50% 110%, rgba(0, 0, 0, 0.55), transparent 60%),
    #2b1f20;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 90px rgba(0, 0, 0, 0.6),
    0 30px 60px rgba(0, 0, 0, 0.45);
}
/* cork grain */
.ev-board::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.3 0 0 0 0 0.22 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E");
}

.ev-strip-scroll { margin: 0 -12px; padding: 0 12px 10px; }
.ev-strip {
  --gap: 26px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px var(--gap);
  align-items: start;
}
.ev-strip.has-milestones .ev-item { grid-row: 2; }

/* Milestone card spanning several chapters, with a bracket down to their pins */
.ev-milestone {
  --mc: #8ab4ff;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-self: end;
}
.ev-milestone.st-done { --mc: #3ddc84; }
.ev-milestone.st-wip { --mc: var(--accent); }
.ev-milestone-card {
  position: relative;
  margin: 0 6px;
  padding: 14px 18px 14px;
  border-radius: 3px;
  rotate: -0.8deg;
  background: #fffdf6;
  color: var(--ink);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.45);
}
.ev-milestone-card::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  width: 90px;
  height: 22px;
  translate: -50% 0;
  rotate: -2deg;
  background: rgba(255, 240, 200, 0.6);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.ev-milestone-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ev-milestone-icon { font-size: 1.05rem; }
.ev-milestone-head b { font-family: var(--font-display); font-size: 1.02rem; }
.ev-milestone-scope {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--mc);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.ev-milestone p { margin: 8px 0 0; font-size: 0.86rem; line-height: 1.45; color: var(--ink-muted); }
.ev-bracket {
  position: relative;
  height: 14px;
  margin: 12px calc((100% - var(--gap)) / 4) 0;
  border: 2px dashed var(--mc);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}
.ev-bracket::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  height: 12px;
  border-left: 2px dashed var(--mc);
}
.ev-item { position: relative; padding-top: 12px; }
.ev-pin {
  position: absolute;
  top: 2px;
  left: 50%;
  z-index: 3;
  width: 18px;
  height: 18px;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9a9a, var(--red) 55%, #6e0515);
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.55);
}
.ev-polaroid {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 10px 10px 0;
  border: none;
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  rotate: var(--rot, 0deg);
  transform-origin: 50% 0;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: rotate 0.4s var(--ease), scale 0.4s var(--ease), box-shadow 0.4s;
}
.ev-polaroid:hover { rotate: 0deg; }
.ev-polaroid.is-active {
  rotate: 0deg;
  scale: 1.06;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.55), 0 0 0 3px var(--accent), 0 0 34px rgba(255, 61, 127, 0.5);
}
.ev-photo {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 50% 40%, #2b2030, #0c0910);
}
.ev-photo img,
.ev-dossier-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ev-q {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-hand);
  font-size: 4.6rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.22);
}
/* chapter in progress: a dark black-and-white still */
.st-wip .ev-photo img,
.ev-dossier.st-wip .ev-dossier-photo img { filter: grayscale(1) brightness(0.55) contrast(0.95) blur(1px); }
.ev-caption {
  padding: 8px 2px 12px;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.1;
}
.ev-sticker {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  rotate: 12deg;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  font-size: 0.95rem;
}
.ev-tape {
  position: absolute;
  top: 2px;
  left: -10px;
  padding: 1px 12px;
  rotate: -10deg;
  background: rgba(255, 61, 127, 0.88);
  color: #fff;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Dossier sheet */
.ev-dossier {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 36px;
  margin-top: 46px;
  padding: 36px;
  border-radius: 4px;
  rotate: -0.4deg;
  color: var(--ink);
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, rgba(60, 90, 160, 0.12) 31px 32px),
    var(--paper);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.5);
  animation: ev-dossier-in 0.45s var(--ease);
}
.ev-dossier::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  width: 130px;
  height: 28px;
  translate: -50% 0;
  rotate: 2deg;
  background: rgba(255, 240, 200, 0.55);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.ev-dossier[hidden] { display: none; }
@keyframes ev-dossier-in {
  from { opacity: 0; translate: 0 14px; }
  to { opacity: 1; translate: 0 0; }
}
.ev-dossier-photo {
  position: relative;
  align-self: start;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  rotate: 1.2deg;
  border: 10px solid #fff;
  border-bottom-width: 34px;
  background: radial-gradient(circle at 50% 40%, #2b2030, #0c0910);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}
.ev-dossier-photo .ev-q { font-size: 7rem; }
.ev-dossier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.ev-dossier-num {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ev-stamp {
  padding: 4px 12px;
  rotate: -5deg;
  border: 2px solid currentColor;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ev-stamp.st-done { color: #1d8a4c; }
.ev-stamp.st-wip { color: var(--red); }
.ev-stamp.st-next { color: #2f5fb3; }
.ev-dossier h3 {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  color: var(--ink);
}
.ev-en { display: block; margin-top: 4px; font-style: italic; color: var(--ink-muted); }
.ev-quote {
  margin: 14px 0 10px;
  font-family: var(--font-hand);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: #b0122c;
}
.ev-label {
  display: block;
  margin: 16px 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ev-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-tag {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(42, 32, 39, 0.18);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}
.ev-tag.is-place { background: #fff7f0; }
.ev-tag.is-stat {
  border-color: transparent;
  border-radius: 999px;
  background: rgba(200, 16, 46, 0.1);
  color: #b0122c;
  font-family: var(--font-display);
  font-weight: 700;
}
.ev-text { margin: 0 0 6px; font-size: 0.98rem; line-height: 1.6; color: #43363d; }
.ev-faces {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 10px 6px;
}
.ev-face { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.ev-face-name { font-size: 0.72rem; font-weight: 700; line-height: 1.2; color: var(--ink); }
.ev-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #1a1020;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.ev-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Semester strip */
.ev-semester {
  position: relative;
  margin-top: 46px;
  padding: 20px 26px 26px;
  border-radius: 4px;
  rotate: 0.3deg;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
}
.ev-semester-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.ev-hand {
  font-family: var(--font-hand);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: #b0122c;
}
.ev-weeks {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.ev-week-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ev-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 6px;
}
.ev-day {
  display: grid;
  place-items: center;
  height: 34px;
  border-radius: 4px;
  border: 1px dashed rgba(42, 32, 39, 0.25);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
}
.ev-day.is-done {
  border: 2px solid var(--red);
  background: rgba(255, 61, 127, 0.16);
  color: #b0122c;
}
.ev-day.is-wip {
  border: 2px dashed var(--red);
  background: repeating-linear-gradient(135deg, rgba(255, 61, 127, 0.16) 0 4px, transparent 4px 8px);
  color: #b0122c;
}
.ev-week-note {
  display: block;
  margin-top: 6px;
  font-family: var(--font-hand);
  font-size: 1.2rem;
  font-weight: 700;
  color: #b0122c;
}
.ev-release {
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  margin: 34px auto 0;
  padding: 16px 24px;
  rotate: -1.2deg;
  background: #ffe27a;
  color: var(--ink);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.45);
}
.ev-release-flag { font-size: 1.8rem; }
.ev-release b { display: block; margin-bottom: 2px; font-family: var(--font-display); font-size: 1.05rem; }
.ev-release span { font-size: 0.9rem; }

/* ---------- Chapter progress segments (counter) ---------- */
.rmp-segs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.seg { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); }
.seg-on { background: var(--gradient); box-shadow: 0 0 8px rgba(255, 61, 127, 0.4); }
.seg-wip { background: repeating-linear-gradient(135deg, rgba(255, 61, 127, 0.75) 0 4px, rgba(255, 61, 127, 0.25) 4px 8px); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .ev-strip-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  }
  .ev-strip { width: max-content; grid-template-columns: repeat(6, 170px); }
}
@media (max-width: 960px) {
  .rmp-counters { grid-template-columns: repeat(3, 1fr); }
  .ev-dossier { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 760px) {
  .rmp-updated { margin-left: 0; width: 100%; }
  .ev-board { padding: 34px 16px 24px; border-width: 6px; }
  .ev-strip { --gap: 20px; grid-template-columns: repeat(6, 150px); }
  .rmp-counters { grid-template-columns: repeat(2, 1fr); }
  .rmp-counter { padding: 18px; }
  .rmp-counter-value { font-size: 1.9rem; }
  .ev-dossier { padding: 22px; rotate: 0deg; }
  .ev-weeks { grid-template-columns: 1fr; }
}
