/* ============================================================
   CSS DOS COMPONENTES REACT BITS
   Copiado dos componentes originais (RotatingText, LineSidebar,
   GradientWaves, SpecularButton, SpotlightCard, HoloCard, FoldText).
   Os ajustes de identidade visual ficam em style.css, carregado depois.
   ============================================================ */

/* ---------- RotatingText ---------- */
.text-rotate {
  display: flex;
  flex-wrap: wrap;
  white-space: pre-wrap;
  position: relative;
}

.text-rotate-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-rotate-word {
  display: inline-flex;
}

.text-rotate-lines {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.text-rotate-element {
  display: inline-block;
}

.text-rotate-space {
  white-space: pre;
}

.text-rotate-highlight {
  box-sizing: content-box;
  flex-wrap: nowrap;
  justify-content: center;
  overflow: hidden;
  padding: 0.1em 0.28em;
  border-radius: 0.16em;
}

.text-rotate-highlight-content {
  display: flex;
  flex-shrink: 0;
  white-space: pre;
}

/* ---------- LineSidebar ---------- */
.line-sidebar {
  --accent-color: #a855f7;
  --text-color: #c4c4c4;
  --marker-color: #6c6c6c;
  --marker-length: 60px;
  --marker-gap: 0px;
  --tick-scale: 0.5;
  --max-shift: 30px;
  --item-gap: 20px;
  --font-size: 1.1rem;
  --smoothing: 100ms;

  position: relative;
  display: flex;
  justify-content: flex-start;
}

.line-sidebar--markers {
  padding-left: calc(var(--marker-length) + var(--marker-gap));
}

.line-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: var(--item-gap);
}

/* --effect (0..1) é guiado por item num lerp rAF em JS, então toda
   propriedade derivada abaixo lê o mesmo valor animado e anda junto,
   sem transições CSS para escalonar. */
.line-sidebar__item {
  position: relative;
  cursor: pointer;
}

/* Alarga a área do ponteiro para o item reagir um pouco antes */
.line-sidebar__item::before {
  content: '';
  position: absolute;
  inset: -6px -48px;
}

.line-sidebar__label {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  font-size: var(--font-size);
  line-height: 1.2;
  color: color-mix(in srgb, var(--accent-color) calc(var(--effect, 0) * 100%), var(--text-color));
  transform: translateX(calc(var(--effect, 0) * var(--max-shift)));
}

.line-sidebar__index {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-right: 0.6rem;
  font-size: 0.85em;
  opacity: calc(0.55 + var(--effect, 0) * 0.45);
}

.line-sidebar__marker {
  position: absolute;
  top: 50%;
  left: calc(-1 * var(--marker-length) - var(--marker-gap));
  height: 1px;
  width: var(--marker-length);
  background-color: color-mix(in srgb, var(--accent-color) calc(var(--effect, 0) * 100%), var(--marker-color));
  transform-origin: left center;
  transform: translateY(-50%) scaleX(calc(0.7 + var(--effect, 0) * 0.5));
}

/* Traço curto fixo, centralizado no espaço entre dois itens */
.line-sidebar--markers .line-sidebar__item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: calc(100% + var(--item-gap) / 2);
  left: calc(-1 * var(--marker-length) - var(--marker-gap));
  height: 1px;
  width: calc(var(--marker-length) * var(--tick-scale));
  background-color: var(--marker-color);
  opacity: 0.5;
  transform: translateY(-50%);
}

/* Quando ligado, os traços intermediários também crescem com a proximidade */
.line-sidebar--scale-tick .line-sidebar__item:not(:last-child)::after {
  transform-origin: left center;
  transform: translateY(-50%) scaleX(calc(0.7 + var(--effect, 0) * 0.6));
}

/* ---------- GradientWaves ---------- */
.gradient-waves-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gradient-waves-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- SpecularButton ---------- */
.specular-button {
  --sb-radius: 18px;
  --sb-tint: #ffffff;
  --sb-tint-opacity: 0.04;
  --sb-blur: 0px;
  --sb-text-color: #f5f5f5;

  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin: 0;
  border: 0;
  border-radius: var(--sb-radius);
  font: inherit;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--sb-text-color);
  background: color-mix(in srgb, var(--sb-tint) calc(var(--sb-tint-opacity) * 100%), transparent);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(var(--sb-blur));
  backdrop-filter: blur(var(--sb-blur));
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.specular-button:active {
  transform: scale(0.97);
}

.specular-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sb-text-color) 55%, transparent);
  outline-offset: 3px;
}

.specular-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.specular-button:disabled:active {
  transform: none;
}

.specular-button--sm {
  padding: 10px 20px;
  font-size: 0.875rem;
}

.specular-button--md {
  padding: 14px 28px;
  font-size: 1rem;
}

.specular-button--lg {
  padding: 18px 38px;
  font-size: 1.125rem;
}

.specular-button__light {
  position: absolute;
  inset: -24px;
  z-index: 1;
  display: block;
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  pointer-events: none;
}

.specular-button__label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: inherit;
}

/* ---------- SpotlightCard ---------- */
.spotlight-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 2rem;
  border-radius: 1.5rem;
  background-color: var(--spotlight-card-surface);
  box-shadow: var(--spotlight-card-shadow);
}

.spotlight-card__light,
.spotlight-card__grain,
.spotlight-card__border,
.spotlight-card__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.spotlight-card__light,
.spotlight-card__grain {
  z-index: -1;
  opacity: 0;
}

.spotlight-card__grain {
  background-size: 160px 160px;
  mix-blend-mode: overlay;
}

.spotlight-card__border,
.spotlight-card__edge {
  z-index: 1;
  padding: 1px;
  -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);
}

.spotlight-card__border {
  background: var(--spotlight-card-border);
}

.spotlight-card__edge {
  opacity: 0;
}

/* ---------- HoloCard ---------- */
.holo-card {
  --hc-w: 320px;
  --hc-ratio: 0.716;
  --hc-radius: 14px;

  position: relative;
  display: inline-block;
  width: var(--hc-w);
  max-width: 100%;
  aspect-ratio: var(--hc-ratio);
  border-radius: var(--hc-radius);
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

.holo-card[data-flippable] {
  cursor: pointer;
}

.holo-card[data-flippable]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
}

.holo-card__shadow {
  position: absolute;
  inset: 10% 7% -4%;
  border-radius: var(--hc-radius);
  background: rgba(0, 0, 0, 0.42);
  filter: blur(26px);
  pointer-events: none;
  will-change: transform;
}

.holo-card__rotor {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.holo-card__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--hc-radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.holo-card__face--back {
  transform: rotateY(180deg);
}

.holo-card__face img,
.holo-card__face canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.holo-card__face img {
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.holo-card__face canvas {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.holo-card[data-ready] .holo-card__face canvas {
  opacity: 1;
}

/* ---------- FoldText ---------- */
.fold-text {
  display: inline-block;
  color: var(--fold-text-color, currentColor);
  font-size: var(--fold-text-font-size, inherit);
  font-weight: var(--fold-text-font-weight, inherit);
  line-height: 0.95;
  letter-spacing: -0.04em;
  white-space: pre-wrap;
  user-select: text;
}

.fold-text-sr-only {
  position: absolute;
  user-select: none;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fold-text-visual {
  display: inline;
}

.fold-text-word {
  display: inline-block;
  white-space: nowrap;
}

.fold-text-segment {
  display: inline-block;
  perspective: var(--fold-perspective, 700px);
  vertical-align: baseline;
}

.fold-text-segment[data-fold-split='line'] {
  display: block;
}

.fold-text-piece {
  --fold-shade: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.58) 0%,
    rgba(0, 0, 0, 0.22) 42%,
    rgba(255, 255, 255, 0.26) 100%
  );
  position: relative;
  display: inline-block;
  backface-visibility: hidden;
  transform-origin: 50% 0%;
}

.fold-text-piece[data-fold-hinge='bottom'] {
  --fold-shade: linear-gradient(0deg, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.22) 42%, rgba(255, 255, 255, 0.26) 100%);
  transform-origin: 50% 100%;
}

.fold-text-piece[data-fold-hinge='left'] {
  --fold-shade: linear-gradient(90deg, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.22) 42%, rgba(255, 255, 255, 0.26) 100%);
  transform-origin: 0% 50%;
}

.fold-text-piece[data-fold-hinge='right'] {
  --fold-shade: linear-gradient(
    270deg,
    rgba(0, 0, 0, 0.58) 0%,
    rgba(0, 0, 0, 0.22) 42%,
    rgba(255, 255, 255, 0.26) 100%
  );
  transform-origin: 100% 50%;
}

.fold-text-piece[data-fold-style='blinds'] {
  perspective: var(--fold-perspective, 700px);
}

.fold-text-slat {
  position: relative;
  display: inline-block;
  backface-visibility: hidden;
}

.fold-text-slat[data-fold-slat='b'] {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.fold-text-piece::after,
.fold-text-slat::after {
  content: attr(data-fold-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-image: var(--fold-shade);
  -webkit-background-clip: text;
  background-clip: text;
  opacity: var(--fold-crease, 0);
}

@media (prefers-reduced-motion: reduce) {
  .fold-text-piece,
  .fold-text-slat {
    transform: none !important;
  }

  .fold-text-piece::after,
  .fold-text-slat::after {
    opacity: 0 !important;
  }
}
