/* ==========================================================================
   Carmín · Estudio digital — efectos: preloader, cursor y bordes iridiscentes
   ========================================================================== */

/* ---------- Cursor ---------- */
.cursor { display: none; }
.has-cursor,
.has-cursor a,
.has-cursor button,
.has-cursor label,
.has-cursor summary { cursor: none; }
.has-cursor input,
.has-cursor textarea { cursor: text; }
.has-cursor .cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 130;
  display: block;
  pointer-events: none;
  mix-blend-mode: difference;
}
.cursor__dot,
.cursor__ring {
  position: fixed;
  left: 0;
  top: 0;
  border-radius: 50%;
  will-change: transform;
}
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #FFFFFF; }
.cursor__ring {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .85);
  transition: width .45s var(--ease), height .45s var(--ease), margin .45s var(--ease), background-color .45s;
}
.cursor__label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #000000;
  opacity: 0;
  transition: opacity .3s;
}
.cursor.is-link .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
.cursor.is-label .cursor__ring { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: #FFFFFF; }
.cursor.is-label .cursor__label { opacity: 1; }
.cursor.is-hidden { opacity: 0; }

/* ---------- Borde iridiscente animado ---------- */
@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.irid-border { position: relative; isolation: isolate; }
.irid-border::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), var(--line-2), var(--c1), var(--accent), var(--c3), var(--c4), var(--line-2) 70%, var(--line-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: border-turn 6s linear infinite;
  pointer-events: none;
}
@keyframes border-turn { to { --angle: 360deg; } }

/* ---------- Texto que se decodifica ---------- */
.scramble-char { color: var(--accent-text); }

@media (prefers-reduced-motion: reduce) {
  .has-cursor, .has-cursor a, .has-cursor button, .has-cursor label, .has-cursor summary { cursor: auto; }
  .has-cursor .cursor { display: none; }
}

/* ---------- Paleta en vivo (dentro del menú) ---------- */
.dock {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 12px;
  border-radius: 999px;
  background: rgba(243, 242, 239, .05);
  box-shadow: inset 0 0 0 1px var(--line);
}
.dock__label {
  margin-right: 4px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--silver-2);
}
.dock__sw {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform .5s var(--ease);
}
.dock__sw i {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--sw1), var(--sw2), var(--sw3), var(--sw4), var(--sw1));
}
.dock__sw::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--pearl);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .4s, transform .5s var(--ease);
}
.dock__sw[aria-pressed="true"]::after { opacity: 1; transform: none; }
@media (hover: hover) { .dock__sw:hover { transform: scale(1.12); } }
.dock__sw[data-palette="aurora"] { --sw1: #8BF3FF; --sw2: #7B6BFF; --sw3: #F08CFF; --sw4: #6FA8FF; }
.dock__sw[data-palette="carmin"] { --sw1: #F4B6A0; --sw2: #E0234E; --sw3: #B9A6FF; --sw4: #8FB4FF; }
.dock__sw[data-palette="oro"] { --sw1: #FFE6B3; --sw2: #D9A441; --sw3: #F6D58E; --sw4: #B5865A; }
.dock__sw[data-palette="esmeralda"] { --sw1: #B4F5DC; --sw2: #10B981; --sw3: #5EEAD4; --sw4: #7DB8FF; }
@media (max-width: 1440px) { .dock__label { display: none; } .dock { padding-left: 4px; } }
@media (max-width: 480px) { .dock { gap: 0; padding: 2px; } .dock__sw { width: 25px; height: 25px; } }

/* ---------- Títulos letra por letra ---------- */
.split > span { perspective: 700px; }
.split .sw { display: inline-block; white-space: nowrap; }
.split .sc,
.split .su {
  display: inline-block;
  transform: translateY(.55em) rotateX(-75deg);
  transform-origin: 50% 100%;
  opacity: 0;
  filter: blur(8px);
  transition:
    transform 1s var(--ease) calc(var(--i) * 22ms),
    opacity 1s var(--ease) calc(var(--i) * 22ms),
    filter 1s var(--ease) calc(var(--i) * 22ms);
}
.split.is-in .sc,
.split.is-in .su { transform: none; opacity: 1; filter: none; }

/* ---------- Letras del titular que responden al cursor ---------- */
.hero__title .hl {
  display: inline-block;
  white-space: pre;
  transition: font-variation-settings .45s var(--ease);
}

/* ---------- Cinta guiada por el scroll ---------- */
.ticker.is-driven .ticker__track { animation: none; will-change: transform; }

/* ---------- Ventana que se abre ---------- */
[data-expand] { will-change: clip-path; }

/* ---------- Reflector en tarjetas ---------- */
[data-spot] { position: relative; }
[data-spot]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--sx, 50%) var(--sy, 0%), rgba(var(--accent-rgb), .16), transparent 62%);
  opacity: 0;
  transition: opacity .5s var(--ease);
}
@media (hover: hover) { [data-spot]:hover::after { opacity: 1; } }
[data-spot] > * { position: relative; z-index: 1; }
