/* Make hero texts unselectable */
.hero__title, .hero__subtitle {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
/* ============================================
   UNIVOS SITE — Main Stylesheet
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #420f1c;
  --color-surface: #111111;
  --color-surface-2: #1a1a1a;
  --color-border: #222222;
  --color-text: #f0f0f0;
  --color-text-muted: #f0f0f0;
  --color-accent: #e61d43;
  --color-accent-dim: #e61d43;
  --color-white: #ffffff;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);

  --container-max: 1320px;
  --gap: 24px;
  --radius: 12px;
  --radius-sm: 8px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Interactive squares canvas background --- */
#squaresBgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

#rockGameCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-tag {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-white);
}

.section-title em {
  font-style: normal;
  color: var(--color-accent);
}

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 50px;
  border: 2px solid var(--color-accent);
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.btn:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  transform: translateY(-2px);
}

.btn--hero {
  font-size: 1rem;
  padding: 16px 40px;
  background: var(--color-accent);
  color: var(--color-bg);
}

.btn--hero:hover {
  background: var(--color-accent-dim);
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(230, 29, 67, 0.3);
}

.btn--nav {
  padding: 10px 24px;
  font-size: 0.85rem;
}

.btn--submit {
  width: 100%;
  justify-content: center;
  padding: 16px;
  font-size: 1rem;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: background var(--transition-medium), padding var(--transition-medium), backdrop-filter var(--transition-medium);
}

.navbar.scrolled {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.navbar__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.logo-text {
  color: var(--color-white);
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.navbar__links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.navbar__links a:hover {
  color: var(--color-white);
}

.navbar__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.navbar__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.navbar__mobile {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px;
  list-style: none;
}

.navbar__mobile.open {
  display: flex;
}

.navbar__mobile a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  z-index: 1;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, rgba(230, 29, 67, 0.15) 0%, transparent 70%);
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: 0 var(--gap);
}

.hero__tag {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--color-accent);
  margin-bottom: 24px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-white);
  margin-bottom: 24px;
}

.hero__title em {
  font-style: normal;
  color: var(--color-accent);
}

.hero__title .score-label {
  color: var(--color-white);
}

.hero__title .score-value {
  color: #ffd700;
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 40px;
  letter-spacing: 1px;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.hero__scroll span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-text-muted);
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: var(--color-text-muted);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-accent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { top: -100%; }
  50% { top: 100%; }
  100% { top: 100%; }
}

/* ============================================
   WORK — Unified team selector + projects grid
   ============================================ */
.work {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

/* --- Loading --- */
.projects__loading {
  text-align: center;
  color: var(--color-text-muted);
  grid-column: 1 / -1;
  padding: 60px 0;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.project-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.project-card.hidden {
  opacity: 0;
  transform: scale(0.95);
}

.project-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

/* --- Image cycling: stack all images, only .active is visible --- */
.project-card__media img,
.project-card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow), filter var(--transition-medium), opacity 0.4s ease;
}

.project-card__media img.cyclable {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.project-card__media img.cyclable.active {
  opacity: 1;
  position: relative;
}

/* Image counter badge */
.project-card__counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--color-white);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  z-index: 3;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}

.project-card:hover .project-card__media img,
.project-card:hover .project-card__media video {
  transform: scale(1.08);
  filter: brightness(0.35);
}

/* Info overlay — hidden by default, appears on hover */
.project-card__info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition-medium), transform var(--transition-medium);
  z-index: 2;
  pointer-events: none;
}

.project-card:hover .project-card__info {
  opacity: 1;
  transform: translateY(0);
}

.project-card__category {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent);
}

.project-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 6px 0 4px;
  color: var(--color-white);
}

.project-card__desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

/* ============================================
   ABOUT
   ============================================ */
.about {
  position: relative;
  z-index: 1;
  padding: 120px 0;
  background: var(--color-surface);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about__text .section-header {
  text-align: left;
  margin-bottom: 0;
}

.about__text .section-tag {
  margin-bottom: 12px;
}

.about__text .section-title {
  margin-bottom: 32px;
}

.about__body {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.8;
}

.about__stats {
  display: flex;
  gap: 48px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.stat__number {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-accent);
}

.stat__label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.about__image {
  border-radius: var(--radius);
  overflow: hidden;
}

.about__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ============================================
   CONTACT
   ============================================ */
.contact {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 80px;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group input,
.form-group textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 14px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(200, 255, 0, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #555;
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-top: 16px;
}

.contact__block h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.contact__block a,
.contact__block p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  line-height: 1.8;
}

.contact__block a:hover {
  color: var(--color-white);
}

.contact__socials {
  display: flex;
  gap: 20px;
}

.contact__socials a {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.contact__socials a:hover {
  color: var(--color-accent);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  position: relative;
  z-index: 1;
  padding: 40px 0;
  border-top: 1px solid var(--color-border);
}

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

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 2px;
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Camera shake on click — per-element, distance-based intensity --- */
@keyframes cameraShake {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(calc(-4px * var(--shake-i, 1)), calc(3px * var(--shake-i, 1))); }
  20%  { transform: translate(calc(5px * var(--shake-i, 1)), calc(-3px * var(--shake-i, 1))); }
  30%  { transform: translate(calc(-3px * var(--shake-i, 1)), calc(4px * var(--shake-i, 1))); }
  40%  { transform: translate(calc(4px * var(--shake-i, 1)), calc(-2px * var(--shake-i, 1))); }
  50%  { transform: translate(calc(-2px * var(--shake-i, 1)), calc(3px * var(--shake-i, 1))); }
  60%  { transform: translate(calc(3px * var(--shake-i, 1)), calc(-2px * var(--shake-i, 1))); }
  70%  { transform: translate(calc(-2px * var(--shake-i, 1)), calc(1px * var(--shake-i, 1))); }
  80%  { transform: translate(calc(1px * var(--shake-i, 1)), calc(-1px * var(--shake-i, 1))); }
  90%  { transform: translate(calc(-1px * var(--shake-i, 1)), calc(1px * var(--shake-i, 1))); }
  100% { transform: translate(0, 0); }
}

.shaking {
  animation: cameraShake 0.35s ease-out;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .projects__grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .about__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .contact__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .navbar__links {
    display: none;
  }
  .navbar__burger {
    display: flex;
  }

  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card__title {
    font-size: 0.95rem;
  }

  .project-card--half {
    grid-column: span 1;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .about__stats {
    gap: 32px;
    flex-wrap: wrap;
  }

  .footer__inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
