/* Quirks: chrome control-room cursor, magnetic buttons, holographic sticker sheet.
   Everything here is progressive enhancement switched on by classes that quirks.js adds. */

/* ---------- 1. Chrome control-room cursor ---------- */

.quirk-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483000;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  contain: layout style;
}

.quirk-cursor > * {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
}

html.quirk-cursor-on .quirk-cursor {
  opacity: 1;
}

/* Hide the system cursor only while the custom one is live. Inputs keep their caret. */
html.quirk-cursor-on,
html.quirk-cursor-on *:not(input):not(textarea):not(select) {
  cursor: none !important;
}

.quirk-cursor__ghost {
  width: 14px;
  height: 2px;
  margin: -1px 0 0 -7px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(202, 255, 61, 0.9) 35%, rgba(121, 168, 255, 0.9) 65%, transparent);
  box-shadow: 0 0 6px rgba(121, 168, 255, 0.55);
}

.quirk-cursor__head {
  width: 0;
  height: 0;
}

.quirk-cursor__head > * {
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 160ms ease;
}

/* Crosshair: two chrome hairlines with a gap and a lime pip in the centre. */
.quirk-cursor__x {
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  background: radial-gradient(circle, #caff3d 0 1.6px, transparent 2.2px);
  filter: drop-shadow(0 0 1px rgba(3, 3, 3, 0.95)) drop-shadow(0 0 5px rgba(121, 168, 255, 0.45));
}

.quirk-cursor__x::before,
.quirk-cursor__x::after {
  position: absolute;
  content: "";
}

.quirk-cursor__x::before {
  top: 12.25px;
  left: 0;
  width: 26px;
  height: 1.5px;
  background: linear-gradient(90deg, #f8fbff 0, #79808a 22%, #f8fbff 36%, transparent 36% 64%, #f8fbff 64%, #79808a 78%, #f8fbff 100%);
}

.quirk-cursor__x::after {
  top: 0;
  left: 12.25px;
  width: 1.5px;
  height: 26px;
  background: linear-gradient(180deg, #f8fbff 0, #79808a 22%, #f8fbff 36%, transparent 36% 64%, #f8fbff 64%, #79808a 78%, #f8fbff 100%);
}

.quirk-cursor__ring {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border: 1.5px solid rgba(248, 251, 255, 0.9);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(3, 3, 3, 0.55),
    inset 0 0 0 1px rgba(3, 3, 3, 0.35),
    0 0 16px rgba(121, 168, 255, 0.5),
    inset 0 0 10px rgba(202, 255, 61, 0.25);
  opacity: 0;
  transform: scale(0.35);
}

.quirk-cursor__bar {
  width: 20px;
  height: 3px;
  margin: 9px 0 0 -10px;
  border-radius: 2px;
  background: linear-gradient(90deg, #f8fbff, #caff3d 50%, #79a8ff);
  box-shadow: 0 0 0 1px rgba(3, 3, 3, 0.6), 0 0 8px rgba(202, 255, 61, 0.55);
  opacity: 0;
  transform: scaleX(0);
}

.quirk-cursor__rec {
  margin: 12px 0 0 13px;
  padding: 2px 5px 2px 4px;
  border: 1px solid rgba(248, 251, 255, 0.55);
  border-radius: 3px;
  color: #f8fbff;
  background: rgba(3, 3, 3, 0.78);
  font: 700 9px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.12em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(3px);
}

.quirk-cursor__rec::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 4px 1px 0;
  content: "";
  border-radius: 50%;
  background: #ff1648;
  box-shadow: 0 0 5px #ff1648;
  vertical-align: middle;
  animation: quirk-rec-blink 1.1s steps(2, jump-none) infinite;
}

@keyframes quirk-rec-blink {
  50% { opacity: 0.2; }
}

.quirk-cursor.is-ring .quirk-cursor__x { transform: scale(0.45); }
.quirk-cursor.is-ring .quirk-cursor__ring { opacity: 1; transform: scale(1); }
.quirk-cursor.is-bar .quirk-cursor__x { transform: scale(0.6); }
.quirk-cursor.is-bar .quirk-cursor__bar { opacity: 1; transform: scaleX(1); }
.quirk-cursor.is-rec .quirk-cursor__rec { opacity: 1; transform: none; }
.quirk-cursor.is-grab .quirk-cursor__ring { opacity: 0.8; transform: scale(0.62); }
.quirk-cursor.is-grab .quirk-cursor__x { transform: scale(0.5) rotate(45deg); }
.quirk-cursor.is-down .quirk-cursor__head > :not(.quirk-cursor__rec) { transform: scale(0.8); }
.quirk-cursor.is-ring.is-down .quirk-cursor__ring { transform: scale(0.82); }

/* Never on touch, coarse pointers, or reduced motion (quirks.js also refuses to start). */
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .quirk-cursor {
    display: none !important;
  }

  html.quirk-cursor-on,
  html.quirk-cursor-on * {
    cursor: auto !important;
  }
}

/* ---------- 2. Holographic sticker sheet (About hero) ---------- */

@property --quirk-drift {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

.about-value-cloud.is-sticker-sheet {
  z-index: 3;
  pointer-events: none;
  animation: quirk-holo-drift 14s ease-in-out infinite alternate;
}

@keyframes quirk-holo-drift {
  from { --quirk-drift: -12%; }
  to { --quirk-drift: 12%; }
}

.is-sticker-sheet .about-value {
  --dx: 0px;
  --dy: 0px;
  --rot: 0deg;
  --lift: 1;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: 1;
  padding: 0.62em 0.95em 0.6em 0.8em;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 7px;
  color: #0a0f24;
  font-size: clamp(0.72rem, 0.85vw, 0.92rem);
  letter-spacing: 0.05em;
  line-height: 1;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, 0.5) 100%),
    linear-gradient(var(--holo-angle, 120deg), #c8f7ff 0%, #f2c4ff 16%, #e7ff9e 32%, #9fc0ff 48%, #ffd3ea 64%, #b8fff0 80%, #e3e7f2 100%);
  background-size: 100% 100%, 320% 320%;
  background-position:
    0 0,
    calc(var(--hx, 50%) + var(--quirk-drift, 0%)) calc(var(--hy, 50%) - var(--quirk-drift, 0%));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 -1px 0 rgba(10, 15, 36, 0.18) inset,
    0 6px 14px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(3, 3, 3, 0.35);
  transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rot)) scale(var(--lift));
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 180ms ease;
  will-change: transform;
}

.is-sticker-sheet .about-value::before {
  width: 6px;
  height: 6px;
  margin-right: 7px;
  background: radial-gradient(circle at 35% 35%, #ffffff, #79808a 70%);
  box-shadow: 0 0 0 1px rgba(10, 15, 36, 0.35);
}

/* Peeled corner: a folded flap of foil backing at the bottom right. */
.is-sticker-sheet .about-value::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 14px;
  height: 14px;
  content: "";
  border-radius: 0 0 7px 0;
  background: linear-gradient(135deg, transparent 50%, #f8fbff 50%, #b9c0cc 78%, #79808a 100%);
  box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: scale(0.2);
  transform-origin: 100% 100%;
  transition: transform 180ms ease, opacity 180ms ease;
}

.is-sticker-sheet .about-value:hover,
.is-sticker-sheet .about-value.is-dragging {
  --lift: 1.06;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 -1px 0 rgba(10, 15, 36, 0.18) inset,
    0 16px 26px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(3, 3, 3, 0.35);
}

.is-sticker-sheet .about-value:hover::after,
.is-sticker-sheet .about-value.is-dragging::after {
  opacity: 1;
  transform: scale(1);
}

.is-sticker-sheet .about-value.is-dragging {
  --lift: 1.09;
  cursor: grabbing;
  transition: box-shadow 180ms ease;
}

.is-sticker-sheet.is-resetting .about-value {
  transition: transform 520ms cubic-bezier(0.34, 1.4, 0.5, 1), box-shadow 180ms ease;
}

.is-sticker-sheet .about-value:nth-child(3n + 1) { --holo-angle: 100deg; }
.is-sticker-sheet .about-value:nth-child(3n + 2) { --holo-angle: 145deg; }
.is-sticker-sheet .about-value:nth-child(3n) { --holo-angle: 205deg; }

/* Start positions: a scattered sheet that keeps clear of the headline. */
.is-sticker-sheet .about-value-culture { top: 4%; left: 3%; --rot: -6deg; }
.is-sticker-sheet .about-value-technology { top: 5.5%; left: 21%; --rot: 4deg; }
.is-sticker-sheet .about-value-taste { top: 21%; left: 36%; --rot: -9deg; }
.is-sticker-sheet .about-value-content { top: 5%; left: 46%; --rot: 5deg; }
.is-sticker-sheet .about-value-strategy { top: 40%; left: 35.6%; --rot: 7deg; }
.is-sticker-sheet .about-value-communities { top: 3%; left: 74%; --rot: -4deg; }
.is-sticker-sheet .about-value-momentum { top: 63%; left: 36%; --rot: -5deg; }
.is-sticker-sheet .about-value-native { top: 88%; left: 55%; --rot: 6deg; }
.is-sticker-sheet .about-value-curiosity { top: 47%; left: 86%; --rot: -8deg; }

/* Stacked layout: two stickers in the top band, the rest scattered over the collage. */
@media (max-width: 1120px) {
  .is-sticker-sheet .about-value-culture { top: 2%; left: 3%; }
  .is-sticker-sheet .about-value-technology { top: 2.6%; left: 38%; }
  .is-sticker-sheet .about-value-communities { top: 2%; left: 68%; }
  .is-sticker-sheet .about-value-taste { top: 55%; left: 72%; }
  .is-sticker-sheet .about-value-content { top: 58%; left: 4%; }
  .is-sticker-sheet .about-value-strategy { top: 66%; left: 58%; }
  .is-sticker-sheet .about-value-momentum { top: 75%; left: 8%; }
  .is-sticker-sheet .about-value-native { top: 85%; left: 62%; }
  .is-sticker-sheet .about-value-curiosity { top: 93%; left: 22%; }
}

@media (max-width: 720px) {
  .is-sticker-sheet .about-value { font-size: 0.68rem; }
  .is-sticker-sheet .about-value-culture { top: 1.2%; left: 4%; }
  .is-sticker-sheet .about-value-technology { top: 1.4%; left: 44%; }
  .is-sticker-sheet .about-value-taste { top: 62.5%; left: 64%; }
  .is-sticker-sheet .about-value-content { top: 62%; left: 4%; }
  .is-sticker-sheet .about-value-strategy { top: 70%; left: 56%; }
  .is-sticker-sheet .about-value-communities { top: 78%; left: 6%; }
  .is-sticker-sheet .about-value-momentum { top: 86%; left: 52%; }
  .is-sticker-sheet .about-value-native { top: 93%; left: 8%; }
  .is-sticker-sheet .about-value-curiosity { top: 96%; left: 60%; }
}

.sticker-reset {
  position: absolute;
  z-index: 4;
  right: var(--pad, 24px);
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px 0 10px;
  border: 1px solid rgba(248, 251, 255, 0.7);
  border-radius: 999px;
  color: #030303;
  font: 800 0.66rem/1 "Inter Tight", system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(180deg, #f8fbff 0%, #c9ced8 45%, #79808a 52%, #e7ebf2 100%);
  box-shadow: 0 0 0 1px rgba(3, 3, 3, 0.6), 0 6px 16px rgba(0, 0, 0, 0.45);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.sticker-reset[hidden] {
  display: none;
}

.sticker-reset::before {
  content: "\21BA";
  font-size: 0.95rem;
  letter-spacing: 0;
}

.sticker-reset:hover {
  box-shadow: 0 0 0 1px rgba(3, 3, 3, 0.6), 0 0 0 3px rgba(202, 255, 61, 0.45), 0 6px 16px rgba(0, 0, 0, 0.45);
}

.sticker-reset:focus-visible {
  outline: 2px solid #caff3d;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .about-value-cloud.is-sticker-sheet {
    animation: none;
  }

  .is-sticker-sheet .about-value,
  .is-sticker-sheet .about-value::after,
  .is-sticker-sheet.is-resetting .about-value,
  .sticker-reset {
    transition: none;
  }
}
