/* ============================================
   DESIGN TOKENS & VARIABLES
   ============================================ */
:root {
  /* Sticker Configuration */
  --sticker-rotate: 15deg;
  --sticker-p: 10px;
  --sticker-peelback-hover: 30%;
  --sticker-peelback-active: 60%;
  --sticker-peel-easing: 2s
    linear(
      0,
      0.002 0.4%,
      0.008 0.9%,
      0.02 1.4%,
      0.035 1.9%,
      0.055 2.4%,
      0.083 3%,
      0.11 3.5%,
      0.146 4.1%,
      0.214 5.1%,
      0.297 6.2%,
      0.624 10.2%,
      0.756 11.9%,
      0.821 12.8%,
      0.874 13.6%,
      0.93 14.5%,
      0.975 15.3%,
      1.016 16.1%,
      1.053 16.9%,
      1.085 17.7%,
      1.116 18.6%,
      1.139 19.4%,
      1.16 20.3%,
      1.176 21.2%,
      1.187 22.1%,
      1.195 23.2%,
      1.197 24.4%,
      1.193 25.6%,
      1.183 26.9%,
      1.17 28.1%,
      1.153 29.4%,
      1.055 35.6%,
      1.031 37.3%,
      1.012 38.8%,
      0.994 40.6%,
      0.98 42.3%,
      0.97 44.1%,
      0.964 45.9%,
      0.961 48.3%,
      0.964 51.1%,
      0.97 53.7%,
      0.997 62.7%,
      1.003 66%,
      1.007 69.3%,
      1.007 74.4%,
      1 89.2%,
      1
    );
  --sticker-peel-hover-easing: 1s
    linear(
      0,
      0.008 1.1%,
      0.031 2.2%,
      0.129 4.8%,
      0.257 7.2%,
      0.671 14.2%,
      0.789 16.5%,
      0.881 18.6%,
      0.957 20.7%,
      1.019 22.9%,
      1.063 25.1%,
      1.094 27.4%,
      1.114 30.7%,
      1.112 34.5%,
      1.018 49.9%,
      0.99 59.1%,
      1
    );

  /* Helpers */
  --sticker-start: calc(-1 * var(--sticker-p));
  --sticker-end: calc(100% + var(--sticker-p));

  /* Retro UI Colors */
  --retro-pink: #ff6ec7;
  --retro-pink-dim: #cc3a8e;
  --retro-pink-glow: #ff8ed4;
  --retro-bg: #0a0a0a;
  --retro-scanline: rgba(255, 110, 199, 0.04);

  /* Mac entrance animation timing */
  --entrance-duration: 1.8s;
  --entrance-delay: 0.2s;
  --ui-reveal-delay: 3.2s; /* entrance + static noise duration */
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  min-height: 100dvh;
  overflow: hidden;
  font-family: "Courier New", Courier, monospace;
}

#mac-background-shader {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}

/* ============================================
   MAIN STAGE
   ============================================ */
#main-stage {
  width: 100dvw;
  height: 100dvh;
  position: relative;
  z-index: 1;
}

/* ============================================
   MAC SCENE — STATIC VIEWPORT-FILLING PLACEMENT
   ============================================ */
.mac-scene {
  width: calc(100vw - 24px);
  height: calc(100vh - 12px);
  position: absolute;
  top: 12px;
  left: 12px;
  animation: none;
}

/* ============================================
   MACINTOSH — HARDWARE
   ============================================ */
.macintosh {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  box-shadow: 0 80px 60px -60px rgba(0, 0, 0, 0.4);
  transform: scale(1);
  transform-origin: center center;
}

.monitor {
  z-index: 2;
  display: block;
  width: 100%;
  position: absolute;
  top: 0;
  bottom: 50px;
  border-radius: 15px;
  background-color: #d5d0c0;
  position: absolute;
  background-image: conic-gradient(
    #d5d0c0 0 10.5%,
    #e2ded2 11% 11.5%,
    #c5c0ad 12% 38%,
    #bfbba5 39% 61.5%,
    #bebaa4 62% 88%,
    #d6d0c0 88.5% 89%,
    #d5d0c0 89.25%
  );
  box-shadow: 0 60px 20px -20px rgba(130, 125, 100, 0.5);
}

.monitor-inner {
  display: block;
  position: absolute;
  top: 22px;
  bottom: 28px;
  left: 10px;
  right: 10px;
  background-image: linear-gradient(#c3bba8, #c7c3ad);

  border-radius: 5px;
}

.screen-cutout {
  display: block;
  position: absolute;
  top: 20px;
  bottom: 75px;
  left: 32px;
  right: 32px;
  background-color: #d5d0c0;

  border-radius: 5px;
  background-image: conic-gradient(
    #8a8670 12.5%,
    #adaa90 15.5% 33%,
    #d8d5bf 34% 65.5%,
    #b9b69e 66.5% 83.5%,
    #8a8670 86.5%
  );
}

.screen {
  display: block;
  position: absolute;
  top: 8px;
  bottom: 14px;
  left: 10px;
  right: 10px;
  background: radial-gradient(circle at center, #2a0808 0%, #0a0101 100%);

  border-radius: 12px;
  box-shadow: 0 0 20px 10px #0d0d0d inset;
  overflow: hidden;
}

/* ============================================
   SCREEN CONTENT — FLICKER + RETRO UI
   ============================================ */
.screen-content {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Red static overlay (canvas) — fades out when UI reveals */
.static-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  border-radius: inherit;
  animation: staticFadeOut 0.4s ease var(--ui-reveal-delay) forwards;
}

@keyframes staticFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* CRT Scanlines */
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    var(--retro-scanline) 2px,
    var(--retro-scanline) 4px
  );
  pointer-events: none;
  z-index: 5;
  border-radius: 20px;
  opacity: 0;
  animation: scanlinesFadeIn 0.5s ease var(--ui-reveal-delay) forwards;
}

@keyframes scanlinesFadeIn {
  to {
    opacity: 1;
  }
}

/* Retro UI Container */
.retro-ui {
  position: absolute;
  inset: 12px;
  border: 1px solid var(--retro-pink);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  z-index: 3;
  animation: retroReveal 0.6s ease var(--ui-reveal-delay) forwards;
}

@keyframes retroReveal {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.retro-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-bottom: 1px solid var(--retro-pink);
  background: var(--retro-pink);
}

.retro-close-box {
  width: 10px;
  height: 10px;
  border: 1px solid var(--retro-bg);
  background: var(--retro-bg);
  border-radius: 1px;
  flex-shrink: 0;
}

.retro-title {
  font-family: "Courier New", monospace;
  font-size: 9px;
  font-weight: bold;
  color: var(--retro-bg);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.retro-body {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}

.retro-line {
  font-family: "Courier New", monospace;
  font-size: 9px;
  color: var(--retro-pink);
  text-shadow:
    0 0 4px var(--retro-pink-dim),
    0 0 10px rgba(255, 110, 199, 0.3);
  white-space: nowrap;
  overflow: hidden;
  width: 0;
  animation: typeLine 0.6s steps(24) forwards;
  animation-delay: calc(var(--ui-reveal-delay) + 0.3s);
}

.retro-line.delay-1 {
  animation-delay: calc(var(--ui-reveal-delay) + 1s);
}
.retro-line.delay-2 {
  animation-delay: calc(var(--ui-reveal-delay) + 1.7s);
}
.retro-line.delay-3 {
  animation-delay: calc(var(--ui-reveal-delay) + 2.4s);
}
.retro-line.delay-4 {
  animation-delay: calc(var(--ui-reveal-delay) + 3s);
}

@keyframes typeLine {
  to {
    width: 100%;
  }
}

/* Blinking cursor on last line */
.retro-line.delay-4::after {
  content: "█";
  animation: cursorBlink 0.7s step-end infinite;
  animation-delay: calc(var(--ui-reveal-delay) + 3.6s);
}

@keyframes cursorBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ============================================
   CRT RADAR UI (inside Mac screen)
   ============================================ */
.crt-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  z-index: 3;
  font-family: "Courier New", monospace;
  font-size: 7px;
  letter-spacing: 0.5px;
  opacity: 0;
  animation: retroReveal 0.6s ease var(--ui-reveal-delay) forwards;
}

.crt-scanline-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.15) 50%,
    rgba(0, 0, 0, 0.15)
  );
  background-size: 100% 3px;
  animation: crtFlicker 3s ease-in-out infinite;
  will-change: opacity;
}

@keyframes crtFlicker {
  0%,
  100% {
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
}

.crt-text-cyan {
  color: #ff4433;
  text-shadow:
    0 0 4px #ff4433,
    0 0 8px rgba(255, 68, 51, 0.4);
}
.crt-text-orange {
  color: #ff9900;
  text-shadow:
    0 0 4px #ff9900,
    0 0 8px rgba(255, 153, 0, 0.4);
}

.crt-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 68, 51, 0.3);
  padding-bottom: 3px;
  margin-bottom: 3px;
}

.crt-radar-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
}

.crt-radar-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crt-footer {
  display: flex;
  gap: 4px;
  align-items: center;
  border-top: 1px solid rgba(255, 68, 51, 0.3);
  padding-top: 3px;
  margin-top: 3px;
}

.crt-progress {
  flex: 1;
  height: 2px;
  background: rgba(255, 68, 51, 0.3);
  position: relative;
}
.crt-progress::after {
  content: "";
  position: absolute;
  left: 20%;
  top: -1px;
  width: 30%;
  height: 4px;
  background: #ff4433;
  box-shadow: 0 0 5px #ff4433;
}

.crt-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1px solid #ff4433;
  opacity: 0.4;
  z-index: 5;
}
.crt-corner-tl {
  top: 4px;
  left: 4px;
  border-right: none;
  border-bottom: none;
}
.crt-corner-tr {
  top: 4px;
  right: 4px;
  border-left: none;
  border-bottom: none;
}
.crt-corner-bl {
  bottom: 4px;
  left: 4px;
  border-right: none;
  border-top: none;
}
.crt-corner-br {
  bottom: 4px;
  right: 4px;
  border-left: none;
  border-top: none;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  box-shadow: 0 0 30px 5px rgba(255, 68, 51, 0.1) inset;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  animation: crtGlow 0.5s ease var(--ui-reveal-delay) forwards;
}

@keyframes crtGlow {
  to {
    opacity: 1;
  }
}

/* ============================================
   MAC — MISC HARDWARE PARTS
   ============================================ */
.logo {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  position: absolute;
  left: 22px;
  bottom: 22px;
  padding-left: 3.5px;
}

img.logoimg {
  width: 6.9em;
  display: block;
  z-index: 9999;
  position: relative;
}

.opening {
  display: block;
  width: 155px;
  height: 15px;
  position: absolute;
  bottom: 55px;
  right: 21px;
  border-radius: 4px;
  z-index: 2;
}

.opening::before {
  content: "-";
  display: block;
  position: absolute;
  background: linear-gradient(180deg, #87867830 0%, #bbb99547 35%);
  width: 20.63em;
  left: -9em;
  right: 10em;
  cursor: default;
  z-index: -1;
  top: -1.7px;
  user-select: none;
  color: transparent;
}

.opening-inner {
  display: none;
  width: 126px;
  height: 11px;
  background-color: #181914;
  border-radius: 2px;
  margin: auto;
  position: absolute;
  left: 0;
  right: 0;
  top: 2.49px;
  z-index: 9;
}

.foot {
  display: block;
  width: 100%;
  height: 85px;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;
  border-radius: 7px;
  background-image: linear-gradient(#b3ad96, #b9b59d);
  box-shadow:
    14px 0 3px -7px #c4c0aa inset,
    -14px 0 3px -7px #c5c3ab inset,
    0 32px 3px -7px #b9b59d inset,
    0 -6px 3px -4px #a6a288 inset;
}

.inset {
  display: inline;
  width: 16px;
  height: 16px;
  background-color: #bbb69e;
  position: absolute;
  bottom: 20px;
  left: 35px;
  border-radius: 2px;
  box-shadow:
    0 0 2px #c1bba1 inset,
    0 0 2px 1px #b4ae94;
}

.cable-container {
  display: block;
  width: 60px;
  height: 30px;
  background-color: #bbb69e;
  position: absolute;
  right: 30px;
  bottom: 12px;
  border-radius: 3px;
  box-shadow:
    0 2px 1px -1px #c8c3a8 inset,
    4px 0 1px -1px #b2ac92 inset,
    -5px 0 2px -2px #a09b82 inset,
    0 -4px 2px -3px #a5a08a inset;
}

.cable-hole {
  display: block;
  width: 18px;
  height: 20px;
  background-color: #848580;
  position: absolute;
  top: 5px;
  right: 7px;
  border-radius: 3px;
  box-shadow:
    0 -4px 0.5px -0.5px rgba(25, 25, 25, 0.2) inset,
    -2px 0 0.5px -0.5px rgba(25, 25, 25, 0.2) inset,
    2px 0 0.5px -0.5px rgba(25, 25, 25, 0.2) inset;
  background-image:
    linear-gradient(#848580 20%, transparent 20% 80%, #848580 80%),
    linear-gradient(90deg, transparent 30%, #181914 30% 70%, transparent 70%);
}

/* ============================================
   STICKER — SHADER CANVAS (ripple + holo)
   ============================================ */
.sticker-shader-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  mix-blend-mode: screen;
  border-radius: inherit;
}

/* ============================================
   STICKER — PEEL-OFF MECHANICS
   ============================================ */
.sticker-container {
  position: relative;
}

.sticker-container * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.sticker-main {
  clip-path: polygon(
    var(--sticker-start) var(--sticker-start),
    var(--sticker-end) var(--sticker-start),
    var(--sticker-end) var(--sticker-end),
    var(--sticker-start) var(--sticker-end)
  );
  transition: clip-path var(--sticker-peel-hover-easing);
  filter: url(#dropShadow);
}

.sticker-lighting {
  filter: url(#pointLight);
}

.sticker-container:hover .sticker-main {
  clip-path: polygon(
    var(--sticker-start) var(--sticker-peelback-hover),
    var(--sticker-end) var(--sticker-peelback-hover),
    var(--sticker-end) var(--sticker-end),
    var(--sticker-start) var(--sticker-end)
  );
  transition: clip-path var(--sticker-peel-hover-easing);
}

.sticker-container:active .sticker-main {
  clip-path: polygon(
    var(--sticker-start) var(--sticker-peelback-active),
    var(--sticker-end) var(--sticker-peelback-active),
    var(--sticker-end) var(--sticker-end),
    var(--sticker-start) var(--sticker-end)
  );
  transition: clip-path var(--sticker-peel-easing);
}

.sticker-image {
  transform: rotate(var(--sticker-rotate));
  filter: url(#outerStroke);
}

.flap {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: calc(-100% - var(--sticker-p) - var(--sticker-p));
  clip-path: polygon(
    var(--sticker-start) var(--sticker-start),
    var(--sticker-end) var(--sticker-start),
    var(--sticker-end) var(--sticker-start),
    var(--sticker-start) var(--sticker-start)
  );
  transform: scaleY(-1);
  transition: all var(--sticker-peel-hover-easing);
}

.sticker-container:hover .flap {
  clip-path: polygon(
    var(--sticker-start) var(--sticker-start),
    var(--sticker-end) var(--sticker-start),
    var(--sticker-end) var(--sticker-peelback-hover),
    var(--sticker-start) var(--sticker-peelback-hover)
  );
  top: calc(-100% + 2 * var(--sticker-peelback-hover) - 1px);
  transition: all var(--sticker-peel-hover-easing);
}

.sticker-container:active .flap {
  clip-path: polygon(
    var(--sticker-start) var(--sticker-start),
    var(--sticker-end) var(--sticker-start),
    var(--sticker-end) var(--sticker-peelback-active),
    var(--sticker-start) var(--sticker-peelback-active)
  );
  top: calc(-100% + 2 * var(--sticker-peelback-active) - 1px);
  transition: all var(--sticker-peel-easing);
}

.flap-lighting {
  filter: url(#pointLightFlipped);
}

.flap-image,
.shadow-image {
  transform: rotate(var(--sticker-rotate));
  filter: url(#expandAndFill);
}

.shadow {
  position: absolute;
  top: 1rem;
  left: 0.5rem;
  width: 100%;
  height: 100%;
  filter: brightness(0) blur(8px);
  opacity: 0.4;
}

.sticker-container:hover .sticker-main,
.sticker-container:hover .flap {
  will-change: clip-path, transform;
}

/* ============================================
   STICKER — DRAGGABLE
   ============================================ */
.draggable {
  position: absolute;
  cursor: grab;
  z-index: 10;
}

.draggable:active {
  cursor: grabbing;
}

/* Sticker image sizes */
.sticker-image,
.shadow-image,
.flap-image {
  width: 100px;
}

/* Sticker 2: wide Popsicle artwork */
.sticker-container-2 .sticker-image,
.sticker-container-2 .shadow-image,
.sticker-container-2 .flap-image {
  width: 330px;
}

/* The supplied non-popsicle artwork uses wide banner proportions. */
.sticker-1-pos .sticker-image,
.sticker-1-pos .shadow-image,
.sticker-1-pos .flap-image,
.sticker-container-3 .sticker-image,
.sticker-container-3 .shadow-image,
.sticker-container-3 .flap-image {
  width: 240px;
}

/* Leave room for the edge of the wide artwork while its peel effect is active. */
.sticker-1-pos,
.sticker-3-pos {
  --sticker-p: 28px;
}

/* ============================================
   STICKER POSITIONS ON MAC
   ============================================ */
.sticker-1-pos {
  right: 190px;
  bottom: 150px;
  --sticker-rotate: -2deg;
}

.sticker-2-pos {
  top: 18px;
  left: 16px;
  width: 360px;
  height: 200px;
  --sticker-rotate: -8deg;
}

.sticker-3-pos {
  top: 140px;
  left: 24px;
  --sticker-rotate: 2deg;
}

/* Extra stickers form a playful cluster along the monitor's right edge. */
.sticker-4-pos,
.sticker-5-pos,
.sticker-6-pos {
  --sticker-p: 18px;
}

.sticker-4-pos .sticker-image,
.sticker-4-pos .shadow-image,
.sticker-4-pos .flap-image {
  width: 78px;
}

.sticker-5-pos .sticker-image,
.sticker-5-pos .shadow-image,
.sticker-5-pos .flap-image {
  width: 92px;
}

.sticker-6-pos .sticker-image,
.sticker-6-pos .shadow-image,
.sticker-6-pos .flap-image {
  width: 70px;
}

.sticker-4-pos {
  top: calc(50% - 120px);
  right: 48px;
  --sticker-rotate: 9deg;
}

.sticker-5-pos {
  top: calc(50% - 35px);
  right: 112px;
  --sticker-rotate: -12deg;
}

.sticker-6-pos {
  top: calc(50% + 50px);
  right: 46px;
  --sticker-rotate: 7deg;
}

@keyframes ambientPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

#screenContent {
  --prompt-selection-bg: #fbbc05;
  --chat-selection-bg: #4285f4;
  --preview-bg: rgb(255, 67, 67);
  --preview-fg: rgba(255, 255, 255, 0.6);
  --preview-tab-border: rgba(255, 255, 255, 0.2);
}

/* ============================================
   MAC SCREEN — CONTAINED EDITOR EXPERIENCE
   ============================================ */
#screenContent {
  contain: layout paint;
  isolation: isolate;
  transform: translateZ(0);
}

/* The saved editor markup remains available in the document, while the source
   file is rendered once inside a self-contained viewport below. */
#screenContent > :not(.mac-intro):not(.embedded-editor-shell) {
  display: none !important;
}

.embedded-editor-shell {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #ff4343;
}

#embedded-editor {
  --editor-scale: 1;
  position: absolute;
  top: 0;
  left: 0;
  width: 1600px;
  height: 100%;
  border: 0;
  display: block;
  background: #ff4343;
  transform: scale(var(--editor-scale));
  transform-origin: top left;
}

.mac-intro {
  position: absolute;
  inset: 0;
  z-index: 12;
  overflow: hidden;
  background: #090304;
  color: #ffc1e4;
  font-family: "Courier New", Courier, monospace;
  transition: opacity 280ms ease, visibility 280ms step-end;
}

.mac-intro.is-dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mac-intro .static-overlay {
  z-index: 0;
  border-radius: 0;
  animation: none !important;
}

.mac-intro-copy {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: clamp(8px, 0.9vw, 13px);
  letter-spacing: 0.14em;
  text-shadow: 0 0 8px rgba(255, 110, 199, 0.65);
  pointer-events: none;
}

.mac-intro-copy span:last-child {
  color: rgba(255, 193, 228, 0.66);
  font-size: 0.78em;
}

.desktop-action-buttons {
  position: absolute;
  right: 28px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
}

.open-editor-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px 10px 15px;
  /* border: 1px solid #4d94f2; */
  border-radius: 5px;
  background: linear-gradient(180deg, #4a8fff 0%, #1175e8 100%);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(238, 251, 255, 0.18),
    inset 0 -2px 0 rgba(5, 72, 135, 0.46),
    0 4px 0 #075eaa,
    0 7px 13px rgba(0, 0, 0, 0.5);
  font: 700 clamp(9px, 0.85vw, 13px) / 1 var(--font-sans, sans-serif);
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.about-popsicle-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border: 0;
  border-radius: 5px;
  background: linear-gradient(180deg, #ffffff 0%, #e9e9e9 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(107, 107, 107, 0.36),
    0 4px 0 #a7a7a7,
    0 7px 13px rgba(0, 0, 0, 0.5);
  color: #161616;
  font: 700 clamp(9px, 0.85vw, 13px) / 1 var(--font-sans, sans-serif);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.about-popsicle-btn:hover {
  filter: brightness(1.04);
}

.about-popsicle-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.about-popsicle-btn:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 3px rgba(107, 107, 107, 0.25),
    0 1px 0 #a7a7a7,
    0 3px 7px rgba(0, 0, 0, 0.5);
}

.open-editor-btn:hover {
  filter: brightness(1.05);
}

.open-editor-btn:focus-visible {
  outline: 2px solid #9ee8ff;
  outline-offset: 3px;
}

.open-editor-btn:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 3px rgba(5, 72, 135, 0.42),
    0 1px 0 #075eaa,
    0 3px 7px rgba(0, 0, 0, 0.5);
}

.open-editor-btn i {
  font-size: 0.95em;
  color: inherit;
}

.open-editor-btn .open-editor-brand-icon {
  font-size: 1.05em;
}

/* ============================================
   ABOUT POPSICLE — DESKTOP DIALOG
   ============================================ */
.about-popsicle-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms step-end;
}

.about-popsicle-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 180ms ease;
}

.about-popsicle-window {
  width: min(560px, 100%);
  max-height: calc(100dvh - 64px);
  overflow: auto;
  border: 1px solid #282828;
  border-radius: 10px;
  background: #151515;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  color: #fff5de;
  font-family: "Courier New", Courier, monospace;
  transform: translateY(12px) scale(0.98);
  transition: transform 180ms ease;
}

.about-popsicle-modal.is-open .about-popsicle-window {
  transform: translateY(0) scale(1);
}

.about-popsicle-titlebar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-bottom: 1px solid #282828;
  background: #151515;
  color: #f4f4f4;
  font-size: 12px;
  font-weight: 700;
  position: relative;
}

.about-popsicle-controls {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.about-popsicle-close {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.34);
  border-radius: 50%;
}

.about-popsicle-close {
  position: relative;
  padding: 0;
  background: #ff5f57;
  cursor: pointer;
}

.about-popsicle-close::before,
.about-popsicle-close::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 2px;
  width: 6px;
  height: 1px;
  background: #7f1d18;
  opacity: 0;
  transition: opacity 120ms ease;
}

.about-popsicle-close::before { transform: rotate(45deg); }
.about-popsicle-close::after { transform: rotate(-45deg); }

.about-popsicle-close:hover::before,
.about-popsicle-close:hover::after,
.about-popsicle-close:focus-visible::before,
.about-popsicle-close:focus-visible::after {
  opacity: 1;
}

.about-popsicle-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.about-popsicle-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 25px 34px 28px;
  text-align: center;
}

.about-popsicle-ascii {
  margin: 0;
  color: #ffc456;
  font: 700 12px / 1.1 "Courier New", Courier, monospace;
  white-space: pre;
}

.about-popsicle-logo {
  width: min(100%, 310px);
  height: auto;
  filter: drop-shadow(5px 7px 0 rgba(0, 0, 0, 0.3));
}

.about-popsicle-copy {
  max-width: 42ch;
  color: #fff5de;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.about-popsicle-open-editor {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border-radius: 5px;
  background: linear-gradient(180deg, #4a8fff 0%, #1175e8 100%);
  box-shadow: inset 0 1px 0 rgba(238, 251, 255, 0.18), inset 0 -2px 0 rgba(5, 72, 135, 0.46), 0 4px 0 #075eaa;
  color: #ffffff;
  font: 700 13px / 1 var(--font-sans, sans-serif);
  text-decoration: none;
}

.about-popsicle-open-editor:hover { filter: brightness(1.08); }

.about-popsicle-credit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d6d6d6;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.about-popsicle-credit:hover,
.about-popsicle-credit:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================
   MOBILE — STATIC POPSICLE INTRODUCTION
   ============================================ */
.mobile-popsicle {
  display: none;
}

@media (max-width: 767px) {
  html,
  body {
    min-height: 100%;
    overflow: auto;
  }

  body {
    background: #ff4343;
  }

  /* Keep the desktop experience completely out of the mobile composition. */
  #main-stage {
    display: none;
  }

  #mac-background-shader {
    display: none;
  }

  .mobile-popsicle {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    padding: 32px 24px 40px;
    overflow: hidden;
    background:
      radial-gradient(circle at 90% 8%, rgba(255, 255, 255, 0.18), transparent 32%),
      #ff4343;
    color: #1d1732;
    font-family: "Courier New", Courier, monospace;
  }

  .mobile-popsicle::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 12px;
    background: linear-gradient(90deg, #304884 0 50%, #f8c24f 50% 100%);
  }

  .mobile-popsicle-logo {
    width: min(100%, 330px);
    height: auto;
    filter: drop-shadow(5px 7px 0 rgba(29, 23, 50, 0.18));
  }

  .mobile-popsicle-copy {
    max-width: 35ch;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
  }

  .mobile-popsicle-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #211c34;
    border-radius: 2px;
    background: rgba(29, 23, 50, 0.82);
    box-shadow: 3px 3px 0 rgba(29, 23, 50, 0.24);
    color: #fff5de;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .mobile-popsicle-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin-top: auto;
  }

  .mobile-popsicle-credit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #1d1732;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
  }

  .mobile-popsicle-credit:hover,
  .mobile-popsicle-credit:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .mobile-sticker-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding-top: 2px;
  }

  .mobile-sticker {
    display: block;
    flex: 0 0 auto;
    filter: drop-shadow(4px 6px 0 rgba(29, 23, 50, 0.2));
  }

  .mobile-sticker-2 {
    width: min(100%, 300px);
    transform: rotate(-8deg);
  }

  .mobile-sticker-3 {
    width: min(100%, 300px);
    transform: rotate(7deg);
  }
}
