:root {
  --font-body: "Rubik", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-title: "Bricolage Grotesque", "Rubik", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Sometype Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
}

.font-mono {
  font-family: var(--font-mono);
}

.reveal-up {
  animation: reveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(1.5rem);
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.card-zoom {
  transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

#top {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
}

.nav-focus-ring:focus-visible {
  outline: 2px solid #292044;
  outline-offset: 4px;
  border-radius: 999px;
}

.section-card {
  box-shadow: 0 -25px 50px -12px rgba(0, 0, 0, 0.15);
}

.carousel-viewport {
  overflow-x: clip;
}

.hero-pattern {
  --reveal-x: 50%;
  --reveal-y: 50%;
  --reveal-size: 0px;
  background-image: url("../assets/rkbz-background-bray-claro.png");
  background-repeat: repeat;
  background-position: center;
  background-size: 1280px auto;
  -webkit-mask-image: radial-gradient(
    circle var(--reveal-size) at var(--reveal-x) var(--reveal-y),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 55%,
    rgba(0, 0, 0, 0) 70%
  );
  mask-image: radial-gradient(
    circle var(--reveal-size) at var(--reveal-x) var(--reveal-y),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 55%,
    rgba(0, 0, 0, 0) 70%
  );
}

@media (hover: none), (pointer: coarse) {
  .hero-pattern {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Squads section pattern reveal */
.squads-pattern {
  --reveal-x: 50%;
  --reveal-y: 50%;
  --reveal-size: 0px;
  background-image: url("../assets/rkbz-background-bray-claro.png");
  background-repeat: repeat;
  background-position: center;
  background-size: 1280px auto;
  filter: invert(1) brightness(0.4);
  -webkit-mask-image: radial-gradient(
    circle var(--reveal-size) at var(--reveal-x) var(--reveal-y),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 30%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: radial-gradient(
    circle var(--reveal-size) at var(--reveal-x) var(--reveal-y),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 30%,
    rgba(0, 0, 0, 0) 100%
  );
}

@media (hover: none), (pointer: coarse) {
  .squads-pattern {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Text Rotator */
.text-rotator {
  display: inline-block;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.text-rotator-fade-out {
  opacity: 0;
  transform: translateY(0.25em);
}

/* ===== Hub Orbital Timeline (Desktop) ===== */
.hub-orbital {
  position: relative;
  perspective: 1000px;
}

/* Orbit ring */
.hub-orbit-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

/* Centro pulsante */
.hub-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-center-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #f40059;
  animation: hub-pulse 2s ease-in-out infinite;
}

/* Ping - círculo expandindo e sumindo */
.hub-center-ping {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(244, 0, 89, 0.5);
  animation: hub-ping 2s ease-out infinite;
}

.hub-center-ping--delayed {
  inset: -4px;
  animation-delay: 1s;
  border-color: rgba(244, 0, 89, 0.3);
}

.hub-center-core {
  position: relative;
  z-index: 2;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fcfbf9;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes hub-pulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes hub-ping {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* Nodes container */
.hub-nodes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Individual node */
.hub-node {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  z-index: 20;
}

.hub-node.is-active {
  z-index: 100;
}

.hub-node-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #292044;
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.hub-node-dot::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hub-node:hover .hub-node-dot,
.hub-node.is-active .hub-node-dot {
  background: #fcfbf9;
  border-color: #fcfbf9;
  transform: scale(1.2);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.hub-node:hover .hub-node-dot::before,
.hub-node.is-active .hub-node-dot::before {
  opacity: 1;
}

.hub-node.is-related .hub-node-dot {
  border-color: rgba(255, 255, 255, 0.8);
  animation: hub-related-pulse 1s ease-in-out infinite;
}

@keyframes hub-related-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

.hub-node-label {
  margin-top: 12px;
  text-align: center;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.hub-node-name {
  font-family: var(--font-title);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
}

.hub-node:hover .hub-node-name,
.hub-node.is-active .hub-node-name {
  color: #fcfbf9;
  transform: scale(1.1);
}

.hub-node-tagline {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: lowercase;
  margin-top: 2px;
  display: block;
}

/* Card expandido - centralizado na órbita */
.hub-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 280px;
  background: #131124;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  pointer-events: none;
}

.hub-card.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.hub-card-connector {
  display: none;
}

.hub-card-header {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hub-card-name {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 500;
  color: #fcfbf9;
  text-transform: lowercase;
  display: block;
}

.hub-card-tagline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
  display: block;
}

.hub-card-description {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 16px;
}

.hub-card-button {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: #fcfbf9;
  text-transform: lowercase;
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.hub-card-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ===== Hub Mobile ===== */
.hub-mobile-item {
  position: relative;
  padding: 16px 0;
  cursor: pointer;
}

.hub-mobile-item.is-expanded {
  padding-bottom: 8px;
}

.hub-mobile-dot {
  position: absolute;
  left: -32px;
  top: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.hub-mobile-item.is-expanded .hub-mobile-dot,
.hub-mobile-item:hover .hub-mobile-dot {
  background-color: #f40059;
  border-color: #f40059;
  transform: scale(1.2);
}

.hub-mobile-name {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 500;
  color: #fcfbf9;
  text-transform: lowercase;
  display: block;
}

.hub-mobile-tagline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
  display: block;
}

.hub-mobile-card {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  margin-top: 0;
  background: #131124;
  border-radius: 8px;
  padding: 0 12px;
}

.hub-mobile-item.is-expanded .hub-mobile-card {
  max-height: 200px;
  opacity: 1;
  margin-top: 12px;
  padding: 12px;
}

.hub-mobile-card p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 12px;
}

.hub-mobile-button {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #f40059;
  text-decoration: none;
  padding: 8px 0;
  transition: opacity 0.2s ease;
}

.hub-mobile-button:hover {
  opacity: 0.8;
}

/* ===== Card Stack (Mobile Squads) ===== */
.card-stack {
  position: relative;
  width: 100%;
  height: 380px;
  perspective: 1000px;
  overflow: visible;
  touch-action: pan-y pinch-zoom;
}

.card-stack-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}

.card-stack-item {
  position: absolute;
  width: 280px;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  background: #131124;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  cursor: grab;
  user-select: none;
  will-change: transform, opacity;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease,
              box-shadow 0.4s ease;
  transform-style: preserve-3d;
}

.card-stack-item:active {
  cursor: grabbing;
}

.card-stack-item.is-active {
  z-index: 100;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(244, 0, 89, 0.1);
}

.card-stack-item.is-dragging {
  transition: none;
}

/* Card content */
.card-stack-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
}

.card-stack-header {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-stack-name {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 500;
  color: #fcfbf9;
  text-transform: lowercase;
  display: block;
}

.card-stack-tagline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
  display: block;
}

.card-stack-description {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  flex: 1;
}

.card-stack-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: #fcfbf9;
  text-transform: lowercase;
  text-decoration: none;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
  margin-top: 16px;
  width: fit-content;
}

.card-stack-link:hover,
.card-stack-link:active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Dots indicator */
.card-stack-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.card-stack-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.card-stack-dot.is-active {
  background: #f40059;
  transform: scale(1.2);
}

/* Swipe hint animation */
.card-stack-hint {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: lowercase;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: card-stack-hint-fade 3s ease-in-out infinite;
}

.card-stack-hint svg {
  animation: card-stack-hint-swipe 1.5s ease-in-out infinite;
}

@keyframes card-stack-hint-fade {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes card-stack-hint-swipe {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

/* ===== Accessibility: Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .hub-center-pulse,
  .hub-center-ping,
  .hub-node,
  .hub-node-dot,
  .hub-card,
  .hub-mobile-item,
  .hub-mobile-dot,
  .hub-mobile-card,
  .card-stack-item,
  .card-stack-dot,
  .card-stack-hint,
  .card-stack-hint svg {
    animation: none !important;
    transition: none !important;
  }
}
