/* The Biggest Battles I Face As an African Technology Entrepreneur are in The Mirror
   Concept: a reflection. The title stands on a mirror; what the mirror shows back are the three battles. */

html.theme-mirror {
  --fg: #14171c;
  --muted: #5f6672;
  --accent: #4f6f9c;
  --rule: #e3e7ee;
  --surface: #f3f5f9;
  --selection: #d6e1f2;
  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
}

/* ---------------------------------------------------------------- hero */

.mr-title, .mirror-reflection {
  font: 400 clamp(2.4rem, 1rem + 4.6vw, 5rem)/1 var(--font-display);
  letter-spacing: -0.02em; max-width: 15em;
}
.mr-title em, .mirror-reflection em { font-style: italic; color: var(--accent); }
.mr-title { animation: settle 1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes settle { from { opacity: 0; translate: 0 -0.3em; } }

.mirror {
  position: relative; overflow: hidden;
  height: clamp(7rem, 3rem + 10vw, 11rem);
  margin-top: 0.5rem;
  border-top: 1px solid #cfd6e1;
  background: linear-gradient(#f1f4f8, rgb(241 244 248 / 0) 75%);
  -webkit-mask-image: linear-gradient(90deg, #000 65%, transparent);
          mask-image: linear-gradient(90deg, #000 65%, transparent);
}
.mirror-reflection {
  margin: 0; position: absolute; inset: 0 auto auto 0; width: 100%;
  transform: scaleY(-1); /* flipped in place: the title's last line sits on the mirror line */
  opacity: 0.22; filter: blur(0.5px);
  /* the flipped title hangs from the mirror line, so fade it out downwards */
  -webkit-mask-image: linear-gradient(to top, #000, transparent 0.85em);
          mask-image: linear-gradient(to top, #000, transparent 0.85em);
  animation: reflect 1.2s ease-out 0.4s both;
}
@keyframes reflect { from { opacity: 0; } }

.mirror-words { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.mirror-words li {
  position: absolute; left: 0; top: 50%; translate: 0 -50%;
  font: italic 400 clamp(2rem, 1rem + 3.4vw, 3.6rem)/1 var(--font-display);
  color: var(--fg); opacity: 0;
  animation: surface 9s ease-in-out infinite;
  animation-delay: calc(1.4s + var(--i) * 3s);
}
@keyframes surface {
  0%   { opacity: 0; filter: blur(8px); translate: 0 -30%; }
  8%   { opacity: 1; filter: blur(0); translate: 0 -50%; }
  28%  { opacity: 1; filter: blur(0); translate: 0 -50%; }
  36%  { opacity: 0; filter: blur(6px); translate: 0 -70%; }
  100% { opacity: 0; }
}
.mirror-sheen {
  position: absolute; inset: -20% auto -20% -30%; width: 18%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.85), transparent);
  rotate: 18deg; animation: sheen 6s ease-in-out 1s infinite;
}
@keyframes sheen { 0% { left: -30%; } 35%, 100% { left: 120%; } }

@media (prefers-reduced-motion: reduce) {
  .mirror-words li { animation: none; opacity: 0; }
  .mirror-words li:first-child { opacity: 1; translate: 0 -50%; }
}

.theme-mirror .hero-meta a { color: var(--accent); }
.theme-mirror .hero-dek { font-style: normal; }

/* ---------------------------------------------------------------- prose */

.theme-mirror .prose h2 {
  font: 400 clamp(2.2rem, 1.4rem + 2.6vw, 3.4rem)/1 var(--font-display);
  display: flex; align-items: baseline; gap: 0.5em;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule);
}
.theme-mirror .prose h2 .battle-no { font-style: italic; color: var(--accent); }

/* Medium-era pull statements, as reflections: a quiet double rule like the edge of a pane of glass */
.theme-mirror .prose blockquote {
  border-left: 0; padding: 0.2em 0 0.2em 1.4em;
  font: italic 400 1.45em/1.3 var(--font-display);
  background: linear-gradient(90deg, var(--fg) 0 1px, transparent 1px 4px, #b9c3d3 4px 5px, transparent 5px) no-repeat;
}

.theme-mirror .prose s { text-decoration-color: var(--accent); color: var(--muted); }
