/* Design tokens from Figma */
:root {
  --primary: #1b1918;
  --border: #e4e4e4;
  --bg: #f5f5f5;
  --tertiary: #8f8f8f;
  --page-bg: #fefefe;
  --card-bg: #f3e7d3;
  --radius-pill: 32px;
  --radius-slot: 16px;
  --font: 'Space Grotesk', system-ui, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--primary);
  min-height: 100vh;
}

/* Landing — centered input */
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Ambient grid background — canvas, sits behind fan/grid/input */
.bg-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.layout-toggle {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  z-index: 3;
}

.layout-toggle-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  width: 0;
  height: calc(100% - 8px);
  background: white;
  border-radius: 16px;
  z-index: 0;
  pointer-events: none;
  transform-origin: left center;
}

.layout-opt {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1px;
  text-transform: uppercase;
  color: var(--tertiary);
  cursor: pointer;
  transition: color 160ms ease;
}

.layout-opt img { display: block; }

.layout-opt.is-active {
  color: var(--primary);
}

/* Fan cards — ferris wheel orbit */
.fan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.fan-orbit {
  --radius: max(1600px, 110vh);
  position: absolute;
  width: calc(var(--radius) * 2);
  height: calc(var(--radius) * 2);
  left: 0;
  top: 50%;
  margin-left: calc(var(--radius) * -1);
  margin-top: calc(var(--radius) * -1);
  border-radius: 50%;
  animation: orbit-spin 150s linear infinite;
}

.fan.paused .fan-orbit {
  animation-play-state: paused;
}

.fan-card {
  --card-h: min(924px, 66vh);
  --card-w: calc(var(--card-h) * 9 / 16);
  position: absolute;
  height: var(--card-h);
  width: var(--card-w);
  left: calc(50% - var(--card-w) / 2);
  top: calc(0px - var(--card-h) / 2);
  transform-origin: calc(var(--card-w) / 2) calc(var(--radius) + var(--card-h) / 2);
  pointer-events: auto;
  cursor: pointer;
}

/* The visible card shell lives on the inner wrapper so we can scale it
   from a center origin (fan mode's `.fan-card` origin is at orbit center,
   which would make a scale read as a radial slide). */
.fan-card-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 32px;
  overflow: hidden;
}

.fan-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-h);
  transform-origin: top left;
  transform: translateY(var(--card-h)) rotate(-90deg);
}

.fan-card:nth-child(1)  { transform: rotate(0deg); }
.fan-card:nth-child(2)  { transform: rotate(36deg); }
.fan-card:nth-child(3)  { transform: rotate(72deg); }
.fan-card:nth-child(4)  { transform: rotate(108deg); }
.fan-card:nth-child(5)  { transform: rotate(144deg); }
.fan-card:nth-child(6)  { transform: rotate(180deg); }
.fan-card:nth-child(7)  { transform: rotate(216deg); }
.fan-card:nth-child(8)  { transform: rotate(252deg); }
.fan-card:nth-child(9)  { transform: rotate(288deg); }
.fan-card:nth-child(10) { transform: rotate(324deg); }
/* Clones 11-20 exist only to fill the grid layout. In fan mode they'd sit
   on top of the originals at the same 10 angles — harmless when everything
   is static but visibly duplicated when each card has its own spring delay.
   Hide them in fan, show them in grid. */
.fan:not(.is-grid) .fan-card:nth-child(n+11) {
  visibility: hidden;
}

/* Fan card hover — Generate button */
.fan-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: none;
  border-radius: 48px;
  color: white;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  transform: rotate(-90deg);
}

.fan-card:hover .fan-generate {
  opacity: 1;
  pointer-events: auto;
}

@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Fan-as-grid layout (style mode, G-key toggle) */
.fan.is-grid {
  overflow: hidden;
}

.fan.is-grid .fan-orbit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  margin: 0;
  border-radius: 0;
  display: grid;
  grid-template-columns: repeat(4, 640px);
  grid-auto-rows: 360px;
  gap: 40px;
  padding: 40px;
  justify-content: center;
  align-content: center;
  animation: none;
  transform: none;
  rotate: none;
  scale: none;
  translate: none;
}

.fan.is-grid .fan-card {
  position: relative;
  left: auto;
  top: auto;
  width: 640px;
  height: 360px;
  transform: none;
  transform-origin: center center;
  align-self: start;
  justify-self: start;
}

/* Grid order: warm samples toward centre, cool/dark toward corners.
   Duplicates of the same sample kept ≥2 cells apart (no diagonal adjacency).
   DOM positions 1-10 are originals, 11-20 are clones. */
.fan.is-grid .fan-card:nth-child(1)  { order: 1;  } /* sample 5   → NW corner */
.fan.is-grid .fan-card:nth-child(2)  { order: 3;  } /* sample 14  → row 1 centre */
.fan.is-grid .fan-card:nth-child(3)  { order: 2;  } /* sample 11  → row 1 */
.fan.is-grid .fan-card:nth-child(4)  { order: 6;  } /* sample 9   → centre */
.fan.is-grid .fan-card:nth-child(5)  { order: 10; } /* sample 8   → centre */
.fan.is-grid .fan-card:nth-child(6)  { order: 7;  } /* sample 10  → centre */
.fan.is-grid .fan-card:nth-child(7)  { order: 5;  } /* sample 6   → row 2 edge */
.fan.is-grid .fan-card:nth-child(8)  { order: 11; } /* sample 13  → centre */
.fan.is-grid .fan-card:nth-child(9)  { order: 8;  } /* sample 12  → row 2 edge */
.fan.is-grid .fan-card:nth-child(10) { order: 4;  } /* sample 7   → NE corner */
.fan.is-grid .fan-card:nth-child(11) { order: 20; } /* sample 5c  → SE corner */
.fan.is-grid .fan-card:nth-child(12) { order: 15; } /* sample 14c → row 4 centre */
.fan.is-grid .fan-card:nth-child(13) { order: 14; } /* sample 11c → row 4 */
.fan.is-grid .fan-card:nth-child(14) { order: 12; } /* sample 9c  → row 3 edge */
.fan.is-grid .fan-card:nth-child(15) { order: 18; } /* sample 8c  → row 5 */
.fan.is-grid .fan-card:nth-child(16) { order: 9;  } /* sample 10c → row 3 edge */
.fan.is-grid .fan-card:nth-child(17) { order: 16; } /* sample 6c  → row 4 edge */
.fan.is-grid .fan-card:nth-child(18) { order: 19; } /* sample 13c → row 5 */
.fan.is-grid .fan-card:nth-child(19) { order: 13; } /* sample 12c → row 4 edge */
.fan.is-grid .fan-card:nth-child(20) { order: 17; } /* sample 7c  → SW corner */

.fan.is-grid .fan-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform: none;
  transform-origin: center center;
}

.fan.is-grid .fan-generate {
  transform: none;
}


/* Grid background — interaction mode */
.grid-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 120px;
  width: calc(100% + 600px);
  flex-shrink: 0;
  pointer-events: none;
}

.grid-card {
  aspect-ratio: 3 / 2;
  background: var(--card-bg);
  border-radius: 24px;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Hide center 2 cards of middle row to clear space for input */
.grid-card:nth-child(6),
.grid-card:nth-child(7) {
  visibility: hidden;
}

.grid-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: none;
  border-radius: 48px;
  color: white;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.grid-card:hover .grid-generate {
  opacity: 1;
  pointer-events: auto;
}

.input-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  position: relative;
  z-index: 1;
}

/* Mode selector */
.mode-selector {
  position: relative;
  align-self: flex-start;
}

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 64px;
  padding: 8px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-slot);
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24px;
  text-transform: uppercase;
  color: var(--primary);
}

.mode-icon {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.15s;
}

.mode-selector.open .chevron {
  transform: rotate(180deg);
}

.mode-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  list-style: none;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px;
  z-index: 10;
  min-width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: scale(0.96) translateY(-3px);
  transform-origin: top left;
  pointer-events: none;
  transition:
    opacity 180ms ease-out,
    transform 200ms ease-out;
}

.mode-menu.is-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  transition:
    opacity 200ms ease-out,
    transform 320ms cubic-bezier(0.25, 1.5, 0.5, 1);
}

@media (prefers-reduced-motion: reduce) {
  .mode-menu,
  .mode-menu.is-open {
    transition: opacity 120ms linear;
    transform: none;
  }
}

.mode-menu li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 12px;
  white-space: nowrap;
}

.mode-menu li.active {
  color: var(--tertiary);
}

.mode-menu li[data-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.mode-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--secondary);
}

.hidden {
  display: none !important;
}

/* Input bar */
.input-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px;
  background: var(--bg);
  border-radius: var(--radius-pill);
}

.upload-slots {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.upload-slot {
  width: 96px;
  height: 64px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-slot);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Upload-slot icon hover animations.
   Draw: stroke-dashoffset 300→0 on stroked paths.
   Transform animations live on <g> wrappers, not <path>, for cross-browser
   reliability (transforms on individual <path>s are flaky in some browsers). */

@keyframes slot-icon-draw {
  0%   { stroke-dashoffset: 300; }
  100% { stroke-dashoffset: 0; }
}

@keyframes slot-plus-spin {
  0%   { transform: rotate(0deg); }
  70%  { transform: rotate(105deg); }
  100% { transform: rotate(90deg); }
}

@keyframes slot-dot-pop {
  0%   { transform: scale(0.3); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.slot-icon .slot-peak,
.slot-icon .slot-plus-group path {
  stroke-dasharray: 300;
  stroke-dashoffset: 0;
}

.slot-icon .slot-plus-group,
.slot-icon .slot-dot-wrap {
  transform-box: fill-box;
  transform-origin: center;
}

#slot-screenshot:not(.has-file):hover .slot-peak-big {
  animation: slot-icon-draw 0.6s cubic-bezier(0.65, 0, 0.35, 1) backwards;
}
#slot-screenshot:not(.has-file):hover .slot-peak-small {
  animation: slot-icon-draw 0.5s cubic-bezier(0.65, 0, 0.35, 1) 0.35s backwards;
}
#slot-screenshot:not(.has-file):hover .slot-dot-wrap {
  animation: slot-dot-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.75s backwards;
}

#slot-video:not(.has-file):hover .slot-plus-h {
  animation: slot-icon-draw 1.4s cubic-bezier(0.65, 0, 0.35, 1) backwards;
}
#slot-video:not(.has-file):hover .slot-plus-v {
  animation: slot-icon-draw 1.4s cubic-bezier(0.65, 0, 0.35, 1) 0.35s backwards;
}
#slot-video:not(.has-file):hover .slot-plus-group {
  animation: slot-plus-spin 0.9s cubic-bezier(0.34, 1.2, 0.64, 1) 1.5s both;
}

.upload-slot-wrap {
  position: relative;
  display: flex;
}

.upload-slot-wrap[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #fff;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  width: max-content;
  max-width: 220px;
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.upload-slot-wrap[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.upload-slot.dragover {
  border-color: var(--primary);
  border-style: solid;
  background: var(--bg);
}

.upload-slot.has-file {
  border-style: solid;
  border-color: var(--border);
}

.slot-content {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  position: relative;
  z-index: 1;
}

.upload-slot.has-file .slot-content {
  display: none;
}

.slot-icon {
  width: 24px;
  height: 24px;
}

.slot-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 14px;
  position: relative;
  z-index: 1;
}

.slot-filename {
  font-size: 10px;
  color: var(--primary);
  text-align: center;
  padding: 4px;
  word-break: break-all;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.slot-remove {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
  padding: 0;
  pointer-events: none;
}

.upload-slot.has-file .slot-remove {
  display: flex;
}

.upload-slot.has-file:hover .slot-remove {
  opacity: 1;
  pointer-events: auto;
}

.slot-remove img {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .slot-icon *,
  .slot-icon {
    animation: none !important;
  }
}

/* Context text input */
.context-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.context-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  max-height: 96px;
  overflow-y: auto;
  padding: 12px 4px;
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.5;
  color: var(--primary);
  outline: none;
  word-break: break-word;
}

.context-input.is-empty::before {
  content: attr(data-placeholder);
  color: var(--tertiary);
  pointer-events: none;
}

.context-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--tertiary);
  flex-shrink: 0;
  padding: 0;
}

.context-clear:hover {
  color: var(--primary);
}

/* Generate button */
.generate-btn {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 96px;
  padding: 0 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 24px;
  outline: 3px solid var(--border);
  outline-offset: 0;
  cursor: pointer;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.generate-btn > * {
  position: relative;
  z-index: 1;
}

@property --gen-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes gen-border-spin {
  to { --gen-angle: 360deg; }
}

@keyframes gen-glow-pulse {
  0%, 100% { filter: blur(22px) saturate(1.25) brightness(0.92); }
  50%      { filter: blur(28px) saturate(1.5)  brightness(1.12); }
}

.generate-btn::before,
.generate-btn::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

/* Inner glow — blurred conic that bleeds inward from the gradient ring.
   Pseudo extends 30px beyond the button so the blur kernel has source
   pixels at the edge (no edge dimming), then clip-path crops it back
   to the button shape. Radial mask keeps the glow strongest near the
   edge and fades to nothing at the centre. */
.generate-btn::before {
  inset: -30px;
  background: conic-gradient(
    from var(--gen-angle),
    #5BD7E0,
    #5C8FE0,
    #9B6FD9,
    #E862C4,
    #FF9555,
    #F5E6D3,
    #7FE0B5,
    #5BD7E0
  );
  filter: blur(22px) saturate(1.3);
  clip-path: inset(30px round 24px);
  -webkit-mask: radial-gradient(
    ellipse farthest-corner at center,
    transparent 0%,
    transparent 25%,
    rgba(0, 0, 0, 0.6) 60%,
    black 90%
  );
          mask: radial-gradient(
    ellipse farthest-corner at center,
    transparent 0%,
    transparent 25%,
    rgba(0, 0, 0, 0.6) 60%,
    black 90%
  );
  opacity: 0;
  transition: opacity 520ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.generate-btn:hover::before {
  opacity: 0.75;
  animation:
    gen-border-spin 7s linear infinite,
    gen-glow-pulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Outer rotating gradient ring */
.generate-btn::after {
  inset: -3px;
  border-radius: 27px;
  padding: 3px;
  background: conic-gradient(
    from var(--gen-angle),
    #5BD7E0,
    #5C8FE0,
    #9B6FD9,
    #E862C4,
    #FF9555,
    #F5E6D3,
    #7FE0B5,
    #5BD7E0
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  filter: saturate(0.4) brightness(0.95);
  transition:
    opacity 480ms cubic-bezier(0.4, 0, 0.2, 1),
    filter  480ms cubic-bezier(0.4, 0, 0.2, 1);
}

.generate-btn:hover::after {
  opacity: 1;
  filter: saturate(1) brightness(1);
  animation: gen-border-spin 7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .generate-btn:hover::before,
  .generate-btn:hover::after { animation: none; }
}

.gen-star {
  transform-box: fill-box;
  transform-origin: center;
}

/* power1.inOut (GSAP) ≈ easeInOutQuad */
@keyframes gen-star-a {
  0%   { opacity: 0; transform: rotate(0deg);   animation-timing-function: cubic-bezier(0.455, 0.03, 0.515, 0.955); }
  33%  { opacity: 1; transform: rotate(-45deg); animation-timing-function: cubic-bezier(0.455, 0.03, 0.515, 0.955); }
  66%  {             transform: rotate(30deg);  animation-timing-function: cubic-bezier(0.455, 0.03, 0.515, 0.955); }
  100% { opacity: 1; transform: rotate(0deg); }
}
@keyframes gen-star-b {
  0%   { opacity: 0; transform: rotate(0deg);   animation-timing-function: cubic-bezier(0.455, 0.03, 0.515, 0.955); }
  33%  { opacity: 1; transform: rotate(45deg);  animation-timing-function: cubic-bezier(0.455, 0.03, 0.515, 0.955); }
  66%  {             transform: rotate(-20deg); animation-timing-function: cubic-bezier(0.455, 0.03, 0.515, 0.955); }
  100% { opacity: 1; transform: rotate(0deg); }
}

.generate-btn:hover .gen-star-big {
  animation: gen-star-a 0.9s linear 0.3s both;
}
.generate-btn:hover .gen-star-small {
  animation: gen-star-b 0.9s linear 0.45s both;
}

@media (prefers-reduced-motion: reduce) {
  .generate-btn:hover .gen-star-big,
  .generate-btn:hover .gen-star-small { animation: none; }
}

/* Inline hint */
.input-hint {
  font-size: 12px;
  color: #cc0000;
  padding: 0 16px;
  opacity: 0;
  transition: opacity 0.3s;
}

.input-hint.visible {
  opacity: 1;
}

/* Progress bar */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-pill);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

.progress-count {
  color: var(--tertiary);
}

/* ── Results loading (inside right panel) ──── */
.results-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--secondary);
}

.loading-progress {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.loading-bar {
  width: 420px;
  height: 32px;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  outline: 4px solid var(--bg);
  outline-offset: 0;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    #5BD7E0,
    #5C8FE0,
    #9B6FD9,
    #E862C4,
    #FF9555,
    #F5E6D3,
    #7FE0B5,
    #5BD7E0
  );
  background-size: 420px 100%;
  background-repeat: no-repeat;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {
  .loading-bar-fill { transition: width 0.3s linear; }
}

.loading-pct {
  display: inline-block;
  transform-origin: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--tertiary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.loading-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 420px;
  max-width: 640px;
}

.loading-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.5;
}

.title-word {
  display: inline-block;
  transform-origin: center;
  will-change: transform, opacity;
}

.loading-desc {
  position: relative;
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary, #7f7f7f);
  line-height: 1.5;
  white-space: nowrap;
}

.desc-word {
  display: inline-block;
  will-change: transform, opacity, filter;
}

.desc-ghost {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  pointer-events: none;
}

/* ── Session history strip ──────────────────── */
.history-strip {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  gap: 8px;
}

.history-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.history-thumb:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.history-thumb .history-mode {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--primary);
  color: white;
  padding: 2px 6px;
  border-radius: 6px;
}

.history-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: white;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.history-thumb-remove img {
  width: 12px;
  height: 12px;
  object-fit: contain;
}

.history-thumb:hover .history-thumb-remove {
  opacity: 1;
  transform: scale(1);
}

.history-thumb-remove:hover {
  background: var(--bg);
}

/* ── Results overlay ────────────────────────── */
.results-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease-out;
}
.results-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.results-overlay .results-card {
  transform: scale(0.94);
  /* Back-out curve — slight overshoot past 1.0 before settling gives a
     subtle spring feel without needing a JS animation library. */
  transition: transform 440ms cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}
.results-overlay.is-open .results-card {
  transform: scale(1);
}
@keyframes r-card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.results-overlay.is-open .results-right > .r-card,
.results-overlay.is-open .results-left > * {
  animation: r-card-in 420ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 180ms;
}
.results-overlay.is-open .results-right > .r-card:nth-child(2) { animation-delay: 240ms; }
.results-overlay.is-open .results-right > .r-card:nth-child(3) { animation-delay: 300ms; }
.results-overlay.is-open .results-right > .r-card:nth-child(4) { animation-delay: 360ms; }
.results-overlay.is-open .results-right > .r-card:nth-child(5) { animation-delay: 420ms; }

.results-wrap {
  position: relative;
  flex: 1;
}

.results-card {
  background: white;
  border-radius: 24px;
  width: 100%;
  height: 100%;
  display: flex;
  overflow: hidden;
}

.results-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.results-close:hover {
  background: var(--border);
}

/* Left panel */
.results-left {
  flex: 0 0 50%;
  padding: 32px 68px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-height: 0;
  overflow: hidden;
}

.results-preview:not(.scrollable) {
  margin-top: auto;
  margin-bottom: auto;
}

.results-picker {
  display: flex;
  width: 343px;
  height: 32px;
  padding: 2px;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 8px;
  flex-shrink: 0;
}

.picker-opt {
  flex: 1;
  border: none;
  border-radius: 7px;
  background: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: black;
  letter-spacing: -0.08px;
  line-height: 20px;
}

.picker-opt.active {
  background: white;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 3px 1px rgba(0,0,0,0.04);
  border: 0.5px solid rgba(0,0,0,0.04);
}

.results-preview {
  width: 800px;
  max-height: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg);
  position: relative;
  flex-shrink: 0;
}

.results-preview.scrollable {
  flex: 1;
  border-radius: 24px 24px 0 0;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: none;
}

.results-preview.scrollable::-webkit-scrollbar {
  display: none;
}

.results-preview.scrollable::after {
  content: '';
  position: sticky;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 80px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

.results-preview img,
.results-preview video {
  width: 100%;
  display: block;
}

/* Divider */
.results-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  flex-shrink: 0;
}

/* Right panel */
.results-right {
  flex: 1;
  padding: 128px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  overflow-y: auto;
  min-width: 0;
}

.results-right::-webkit-scrollbar {
  width: 4px;
}

.results-right::-webkit-scrollbar-track {
  background: transparent;
}

.results-right::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Cards base */
.r-card {
  border: 1px solid var(--border);
  border-radius: 32px;
  width: 100%;
}

/* Color swatches */
.r-color {
  height: 120px;
  padding: 24px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
}

.color-pill {
  flex: 1 0 0;
  border-radius: 16px;
  background: var(--bg);
  position: relative;
  cursor: pointer;
  transition: flex 0.35s ease;
  overflow: hidden;
}

.color-pill.sibling {
  flex: 0 0 32px;
}

.color-hex {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0.24px;
  line-height: 1.5;
  color: white;
  text-transform: lowercase;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.color-pill:hover .color-hex {
  opacity: 1;
}

.color-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0.24px;
  line-height: 1.5;
  color: white;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.color-pill:hover .color-copy {
  opacity: 1;
  pointer-events: auto;
}

.color-copy:hover {
  background: rgba(0, 0, 0, 0.75);
}

.color-copy img {
  width: 16px;
  height: 16px;
}

/* Typography */
.r-type {
  display: flex;
  padding: 32px;
  flex-shrink: 0;
}

.type-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
}

.type-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.5;
}

.type-label {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.96px;
  line-height: 1.1;
}

.type-font-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.type-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.32px;
}

.type-verified {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  line-height: 0;
}

.type-verified-icon {
  flex-shrink: 0;
}

.type-verified[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #fff;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  width: max-content;
  max-width: 220px;
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.type-verified[data-tooltip]:hover::after,
.type-verified[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.type-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.type-info {
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  letter-spacing: 0.32px;
  min-width: 0;
  flex: 1;
}

.type-match {
  font-size: 16px;
  font-weight: 700;
}

.type-desc {
  font-size: 16px;
  font-weight: 500;
  color: #7f7f7f;
}

.type-link-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  margin-left: 12px;
}

.type-link-btn:hover {
  background: var(--border);
}

.type-div {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0 40px;
  flex-shrink: 0;
}

/* Summary section */
.r-summary {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Expandable cards */
.r-expand {
  padding: 32px;
  overflow: hidden;
}

.r-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.r-row-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.r-label {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.r-toggle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.r-toggle img {
  transition: transform 0.2s;
}

.r-toggle:hover {
  background: var(--border);
}

.r-expand.open .r-toggle img {
  transform: rotate(45deg);
  transition: transform 0.2s;
}

/* Expanded content */
.r-body {
  padding-top: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--tertiary);
}

.r-body p {
  margin-bottom: 12px;
}

.r-body strong {
  color: var(--primary);
  font-weight: 600;
}

.r-body h4 {
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 8px;
}

/* Personality keywords */
.r-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.r-keyword {
  padding: 8px 14px;
  border-radius: 60px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 400;
  color: var(--primary);
  line-height: 1.5;
  letter-spacing: 0.32px;
}

/* Personality dimensions */
.r-dimensions {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 24px;
}

.r-dimension-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.r-dimension-header span {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.r-dimension-body {
  font-size: 14px;
  line-height: 1.5;
  color: #474747;
  letter-spacing: 0.02em;
}

.r-dimension-body p {
  margin-bottom: 4px;
}

.r-dimension-body p:last-child {
  margin-bottom: 0;
}

.r-highlight {
  background: #F6C779;
  padding: 0 2px;
  border-radius: 2px;
}

/* Design levers — subsections with highlights */
.r-lever-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.r-lever-choice {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0;
}

.r-lever-trait {
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #474747;
  margin: 0;
}

.r-lever-body {
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #474747;
  margin: 0;
}

.r-lever-section p {
  margin: 0;
}

.r-lever-divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* Design levers — old fallback */
.r-lever {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.r-lever:last-child {
  border-bottom: none;
}

.r-lever .r-lever-trait {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 4px;
}

.r-lever p {
  margin: 0;
}

/* Shift recipes — redesigned */
.r-recipe + .r-recipe {
  margin-top: 32px;
}

.r-recipe-target {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.28px;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 8px;
}

.r-recipe-changes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 16px;
}

.r-recipe-changes p {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.28px;
  color: #474747;
  margin: 0;
}

.r-recipe-screenshots {
  display: flex;
  gap: 24px;
}

.r-screenshot-card {
  width: 240px;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.r-screenshot-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #ececee;
  position: relative;
  overflow: hidden;
}

.r-screenshot-img > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 2;
}

/* Shimmer loading state */
.r-screenshot-img.shimmer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ececee 25%, #e0e0e3 50%, #ececee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  z-index: 1;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Failure fallback */
.r-screenshot-fail {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  color: var(--primary);
  text-align: center;
  padding: 16px;
}

.r-screenshot-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.r-screenshot-card:hover .r-screenshot-overlay {
  opacity: 1;
}

.r-screenshot-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

p.r-screenshot-label {
  padding: 8px 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.5;
  color: var(--secondary);
  margin: 0;
  white-space: nowrap;
}

.r-screenshot-label strong {
  color: var(--primary);
  font-weight: 600;
}

/* Similar feel links */
.r-similar-screenshots {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.r-similar-screenshots .r-screenshot-card {
  width: 240px;
  flex-shrink: 0;
}

.r-similar-screenshots .r-screenshot-label {
  color: var(--primary);
  font-weight: 600;
}


.r-similar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.r-similar-link {
  padding: 6px 14px;
  border-radius: 32px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: background 0.15s;
}

.r-similar-link:hover {
  background: var(--border);
}

.r-similar-reason {
  font-size: 13px;
  color: var(--tertiary);
  line-height: 1.6;
}

/* Shift + Similar pair */
.r-pair {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.r-half {
  flex: 1;
  min-width: 0;
  transition: flex 0.25s ease;
}

/* Pair open card takes all space */
.r-half.open {
  flex: 1 1 0%;
}

/* Shrunk pair card — icon only */
.r-half.shrunk {
  flex: 0 0 72px;
  padding: 24px;
  cursor: pointer;
  overflow: hidden;
}

.r-half.shrunk .r-label,
.r-half.shrunk .r-toggle {
  display: none;
}

.r-half.shrunk .r-row {
  justify-content: center;
}

/* --- Interaction results --- */

/* HTML Demo card */
.r-demo {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.r-demo-title {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--primary);
  padding: 16px 16px 0;
}

.r-demo-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 2027 / 1123;
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg);
}

.r-demo-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
  scrollbar-width: none;
}

.r-demo-preview iframe::-webkit-scrollbar {
  display: none;
}

.r-demo-open {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.r-demo-open:hover {
  background: var(--border);
}

/* Interaction preview — video */
#interaction-results-overlay .results-left {
  justify-content: center;
}

#interaction-results-overlay .results-preview::after {
  display: none;
}

#interaction-results-overlay .results-preview {
  flex: none;
  overflow: hidden;
  background: none;
}

#interaction-results-overlay .results-preview video,
#interaction-results-overlay .results-preview img {
  width: 100%;
  display: block;
}

/* Frames panel */
.frames-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 68px;
  width: 100%;
}

.frames-toolbar {
  display: flex;
  align-items: center;
  padding: 0 0 16px;
  flex-shrink: 0;
}

.frames-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
}

.frames-filter input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.frames-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: min-content;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 32px;
  flex: 1 1 0;
  min-height: 0;
}

.frames-grid::-webkit-scrollbar {
  display: none;
}

.frame-thumb {
  position: relative;
  cursor: pointer;
  min-height: 0;
}

.frame-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.frame-thumb:hover img {
  border-color: var(--primary);
}

.frame-thumb.keyframe img {
  border-color: var(--border);
}

.frame-thumb .frame-label {
  display: none;
}

.frame-thumb.keyframe .frame-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 0;
  font-family: var(--font);
  font-size: 11px;
  color: var(--tertiary);
  letter-spacing: 0.2px;
}

.frame-thumb.keyframe {
  border-color: var(--border);
}

.frame-thumb.keyframe .frame-badge {
  padding: 1px 6px;
  background: var(--bg);
  color: var(--tertiary);
  font-family: var(--font);
  font-size: 9px;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* ── Easter-egg milestone modal ────────────────────────── */
.easter-egg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease-out;
}
.easter-egg-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.easter-egg-card {
  position: relative;
  background: #ffffff;
  border-radius: 32px;
  padding: 32px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: scale(0.94);
  transition: transform 440ms cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}
.easter-egg-overlay.is-open .easter-egg-card {
  transform: scale(1);
}
.easter-egg-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 160ms ease-out;
}
.easter-egg-close:hover {
  background: var(--border);
}
.easter-egg-close img {
  width: 24px;
  height: 24px;
  display: block;
}
.easter-egg-badge {
  width: 160px;
  height: 160px;
  object-fit: contain;
  display: block;
  transform: scale(0.6);
  opacity: 0;
  transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 120ms,
              opacity 280ms ease-out 120ms;
}
.easter-egg-overlay.is-open .easter-egg-badge {
  transform: scale(1);
  opacity: 1;
}
.easter-egg-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 420px;
  text-align: center;
}
.easter-egg-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  line-height: normal;
  color: var(--primary);
  white-space: nowrap;
  margin: 0;
}
.easter-egg-body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 12px;
  line-height: normal;
  color: var(--secondary, #7f7f7f);
  margin: 0;
}
@media (prefers-reduced-motion: reduce) {
  .easter-egg-overlay,
  .easter-egg-card,
  .easter-egg-badge {
    transition: opacity 120ms linear;
  }
  .easter-egg-card,
  .easter-egg-badge {
    transform: none;
  }
}

/* Small-screen gate: block UI under 1200px wide */
.small-screen-block {
  display: none;
}

@media (max-width: 1199px) {
  .small-screen-block {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 32px;
  }

  .small-screen-block-inner {
    max-width: 420px;
    text-align: center;
  }

  .small-screen-block-eyebrow {
    font-family: var(--font);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--tertiary);
    margin-bottom: 16px;
  }

  .small-screen-block-title {
    font-family: var(--font);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.4px;
    color: var(--primary);
    margin: 0 0 12px 0;
  }

  .small-screen-block-body {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--secondary);
    margin: 0;
  }

  body > :not(.small-screen-block) {
    display: none !important;
  }
}
