/* Reel mode (?reel): a fixed 1080x1920 stage, scaled to fit the window, ready for screen recording.
   Every colour comes from theme.css, so the whole stage flips between day and night too. */
body.reel { overflow: hidden; background: var(--bg); }
body.reel .toolbar { display: none; }

.reel-stage {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 1080px;
  height: 1920px;
  transform-origin: center;
  transform: translate(-50%, -50%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 110px 64px 56px;
  background:
    radial-gradient(900px 760px at 50% 46%, var(--glow), transparent 70%),
    var(--bg);
}

.reel-title { position: relative; text-align: center; }

.reel-eyebrow {
  display: inline-block;
  margin-bottom: 30px;
  padding: 10px 24px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font: 600 22px/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.reel-title h1 { margin: 0; font: 400 168px/0.92 var(--serif); letter-spacing: -0.02em; color: var(--ink); }
.reel-title h1 span { color: var(--mantis); }

.reel-demo {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

.reel-demo > * { transform: scale(var(--demo-scale, 1.6)); }

.reel-code {
  position: relative;
  border-radius: 28px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 40px 80px -40px rgb(11 22 9 / 0.45);
  overflow: hidden;
}

.reel-code header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 26px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font: 500 22px/1 var(--mono);
}

.reel-code header i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; background: var(--line); }
.reel-code header i:nth-child(1) { background: var(--mantis); }
.reel-code header i:nth-child(3) { margin-right: 10px; }

.reel-code pre { margin: 0; padding: 24px 30px 30px; font: 400 23px/1.5 var(--mono); color: var(--ink); white-space: pre; }

/* Token colours used by highlight() in reel.js: ink and mantis only */
.tk-k { color: var(--mantis-deep); font-weight: 700; }
:root[data-theme="night"] .tk-k { color: var(--mantis); }
.tk-s { color: var(--mantis); }
.tk-n { color: var(--mantis); font-weight: 600; }
.tk-c { color: var(--muted); font-style: italic; }
.tk-f { color: var(--ink); font-weight: 700; }
.tk-p { color: var(--ink); opacity: 0.85; }

.reel-handle {
  position: relative;
  margin-top: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  color: var(--ink);
  font: 600 30px/1 var(--font);
}

.reel-handle img { width: 50px; height: 50px; border-radius: 50%; box-shadow: 0 0 0 3px var(--mantis); }

/* End card */
.reel-outro {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 30px;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  text-align: center;
}

.reel-outro.show { opacity: 1; }
.reel-outro img { width: 210px; height: 210px; border-radius: 50%; box-shadow: 0 0 0 8px var(--mantis), 0 30px 60px rgb(11 22 9 / 0.3); }
.reel-outro strong { font: 400 84px/1 var(--serif); color: var(--ink); }
.reel-outro p { margin: 0; color: var(--muted); font: 500 36px/1.2 var(--font); }
.reel-outro b { color: var(--mantis); font-weight: 800; }

/* Fake cursor used by the autoplay script */
.reel-cursor {
  position: absolute;
  z-index: 50;
  width: 44px;
  height: 44px;
  margin: -6px 0 0 -6px;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.35));
}

.reel-cursor::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border: 3px solid var(--mantis);
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
}

.reel-cursor.press::after { animation: cursor-press 0.45s ease-out; }

@keyframes cursor-press {
  from { transform: scale(0.2); opacity: 1; }
  to { transform: scale(1.4); opacity: 0; }
}

.reel .reel-hide, .autoplay .reel-hide, body.autoplay .toolbar { display: none !important; }

.reel-stage.compact { padding: 70px 60px 44px; }
.reel-stage.compact .reel-title h1 { font-size: 132px; }
.reel-stage.compact .reel-eyebrow { margin-bottom: 18px; }
