/* Reel mode (?reel): a fixed 1080x1920 stage, scaled to fit the window, ready for screen recording. */
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;
  /* Safe zone for Reels and TikTok: nothing important in the top 250px, the bottom 450px
     (username, caption, audio) or the right 140px (like, comment, share). */
  padding: 262px 140px 452px 64px;
  background: var(--bg);
}

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

.reel-eyebrow {
  display: inline-block;
  margin-bottom: 26px;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--ink2);
  font: 700 22px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink1);
}

/* Title in Bridal with a peach copy printed off register behind it. */
.reel-title h1 {
  margin: 0;
  font: 800 136px/0.9 var(--font);
  letter-spacing: -0.05em;
  color: var(--text);
  text-shadow: 7px 6px 0 var(--ink2);
}

.reel-title h1 span { font-style: italic; }

/* One-line title ("Leave a like.") so the tall post card gets more of the safe zone. */
.reel-stage:not(.compact) .reel-title h1 { font-size: 118px; white-space: nowrap; }
.reel-stage:not(.compact) .reel-title h1 br { display: none; }
.reel-stage:not(.compact) .reel-title h1 span::before { content: " "; }

.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: 22px;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--line);
  overflow: hidden;
}

.reel-code header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 26px;
  background: var(--ink2);
  color: var(--ink1);
  font: 700 21px/1 var(--mono);
}

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

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

/* Token colours used by highlight() in reel.js: two inks only, weight and italics do the rest. */
.tk-k { color: var(--ink1); font-weight: 700; }
.tk-s { color: var(--ink1); background: color-mix(in srgb, var(--ink2) 45%, transparent); border-radius: 4px; }
.tk-n { color: var(--ink1); font-weight: 700; text-decoration: underline 2px var(--ink2); text-underline-offset: 4px; }
.tk-c { color: var(--muted); font-style: italic; }
.tk-f { color: var(--ink1); font-weight: 700; }
.tk-p { color: var(--text); opacity: 0.85; }

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

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

/* 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 6px var(--line), 16px 14px 0 6px var(--ink2); }
.reel-outro strong { font: 800 84px/1 var(--font); letter-spacing: -0.04em; color: var(--text); }
.reel-outro p { margin: 0; color: var(--muted); font: 500 36px/1.2 var(--font); }
.reel-outro b { color: var(--ink1); 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(--ink1);
  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; }
