/* ============================================================
   Qubi — Custom Styles (style.css)
   Stack: Tailwind CSS + Custom CSS + GSAP + Lenis
   ============================================================ */

/* === ROOT & TOKENS === */
:root {
  --accent: #00EE99;
  --accent-dark: #00CC80;
  --black: #000000;
  --surface: #111111;
  --surface-light: #1a1a1a;
  --font-main: 'Outfit', 'Inter', sans-serif;
}

/* === BASE === */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: #000;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* === LENIS SMOOTH SCROLL === */
html.lenis {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#site-header {
  background: transparent;
}

#site-header.scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-link:hover::after {
  width: 100%;
}

/* Mobile menu open state */
#mobile-menu-btn.is-open .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#mobile-menu-btn.is-open .hamburger-line:nth-child(2) {
  opacity: 0;
}
#mobile-menu-btn.is-open .hamburger-line:nth-child(3) {
  width: 24px;
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  background: #050a0d;
}

.hero-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.35) 0%,
    rgba(0,5,15,0.5) 50%,
    rgba(0,0,0,0.85) 100%
  );
}

/* Title sizing */
.hero-title {
  font-size: clamp(3rem, 9vw, 8.5rem);
  letter-spacing: -0.03em;
  line-height: 0.92;
}

/* Floating orbs */
.floating-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  animation: float 8s ease-in-out infinite;
}
.floating-orb-1 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  top: 25%;
  left: -80px;
  animation-duration: 10s;
  animation-delay: 0s;
  filter: blur(2px);
}
.floating-orb-2 {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  top: 30%;
  right: -60px;
  animation-duration: 12s;
  animation-delay: -3s;
  filter: blur(2px);
}
.floating-orb-3 {
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(0,238,153,0.08) 0%, transparent 70%);
  bottom: 25%;
  left: 60%;
  animation-duration: 9s;
  animation-delay: -6s;
  filter: blur(1px);
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-30px) rotate(3deg); }
  66%       { transform: translateY(-15px) rotate(-2deg); }
}

/* Scroll Indicator */
.scroll-indicator-arrow {
  animation: bounce-down 2s ease-in-out infinite;
}
@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

/* Hero video performance hardware-acceleration layer fixes */
.hero-video-container {
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.hero-video-container video {
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.3s ease;
  cursor: pointer;
  border: none;
  outline: none;
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 238, 153, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.25);
  text-decoration: none;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 13px 32px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.btn-outline:hover {
  background: var(--accent);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 238, 153, 0.25);
}

/* ============================================================
   MARQUEE / LOGO SCROLL
   ============================================================ */
.marquee-wrapper {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 45s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-set {
  display: flex;
  align-items: center;
  gap: 52px;
  padding: 0 26px;
}
.marquee-logo {
  height: auto;
  max-height: 62px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  opacity: 0.55;
  transition: opacity 0.3s ease, filter 0.3s ease;
  filter: grayscale(100%) brightness(1.8);
  flex-shrink: 0;
}
.marquee-logo:hover { opacity: 1; filter: grayscale(0%) brightness(1); }
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* Services heading scroll reveal */
.services-heading-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.services-heading-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   STACKED SERVICE CARDS
   ============================================================ */
.service-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.svc-card {
  position: relative;
  overflow: hidden;
  border-radius: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  min-height: auto;
  display: flex;
  flex-direction: column;
  margin-bottom: 2.5rem;
}
.svc-card:last-child {
  margin-bottom: 0;
}

/* Explicit z-indexing to guarantee correct stacking overlap order */
.svc-card:nth-child(1) { z-index: 1; }
.svc-card:nth-child(2) { z-index: 2; }
.svc-card:nth-child(3) { z-index: 3; }
.svc-card:nth-child(4) { z-index: 4; }
.svc-card:nth-child(5) { z-index: 5; }
.svc-card:nth-child(6) { z-index: 6; }

/* Alternate card color themes */
.svc-card--white { background: #e3e3e8; }
.svc-card--black {
  background: #1e1e20;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Card inner layout */
.svc-card__content {
  flex: 1;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.svc-card__media {
  flex: 1;
  min-height: 280px;
  overflow: hidden;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 768px) {
  .svc-card {
    position: sticky;
    top: var(--card-top, 10vh);
    flex-direction: row;
    min-height: 70vh;
    margin-bottom: 16vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
  .svc-card__content {
    flex: 1;
    padding: 4rem 2rem 4rem 10.5rem; /* Shifts the text block right, closer to the video */
  }
  .svc-card__media {
    flex: 1.5; /* Makes video area wider */
    min-height: auto;
    padding: 1.5rem 3.5rem 1.5rem 0.5rem; /* Less left padding, more right padding to shift video slightly left */
    align-items: center;
    justify-content: center;
  }
  /* Constrain the video wrapper from overflowing the 70vh card height */
  .svc-card__media > div {
    max-height: calc(70vh - 3rem);
    max-width: 100%;
    width: 100%;
    height: auto;
  }
}

/* Sub-label */
.svc-sub {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 1rem;
}
.svc-sub--dark { color: rgba(255, 255, 255, 0.35); }

/* Title */
.svc-title {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 800;
  color: #000;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}
.svc-title--dark { color: #fff; }

/* Body text */
.svc-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 2rem;
  max-width: 44ch;
}
.svc-text--dark { color: rgba(255, 255, 255, 0.45); }

/* Buttons */
.svc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  transition: all 0.25s ease;
  width: fit-content;
}
.svc-btn--accent {
  background: var(--accent);
  color: #000;
}
.svc-btn--accent:hover {
  background: #00cc80;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 238, 153, 0.3);
}
.svc-btn--dark {
  background: #000;
  color: #fff;
}
.svc-btn--dark:hover {
  background: #222;
  transform: translateY(-1px);
}
.svc-btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(0, 238, 153, 0.4);
  padding: 0.65rem 1.4rem;
}
.svc-btn--ghost:hover {
  background: rgba(0, 238, 153, 0.1);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Placeholder panels */
.svc-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.svc-placeholder--light { background: #f0f0f0; }
.svc-placeholder--dark  { background: #1a1a1a; }

/* ============================================================
   SERVICE CARDS (legacy — keep for any remaining references)
   ============================================================ */


/* ============================================================
   SERVICE CARDS
   ============================================================ */
.service-card {
  transition: transform 0.4s ease;
}
.service-card:hover {
  transform: translateY(-2px);
}

/* ============================================================
   PORTFOLIO
   ============================================================ */
#portfolio {
  position: relative;
  z-index: 10;
}

/* ============================================================
   PORTFOLIO — CATEGORY NAV
   ============================================================ */
.portfolio-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.pf-nav-btn {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.35);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pf-nav-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.pf-nav-btn--active {
  color: #000;
  background: #fff;
  border-color: #fff;
}

/* ============================================================
   PORTFOLIO — TILES
   ============================================================ */
.pf-tile {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  cursor: pointer;
}

.pf-tile__thumb {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  aspect-ratio: 4 / 3;
  background: #111;
}

.pf-tile__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pf-tile:hover .pf-tile__thumb img {
  transform: scale(1.06);
}

/* Play icon overlay on hover */
.pf-tile__thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 1.25rem;
  z-index: 1;
}
.pf-tile:hover .pf-tile__thumb::after {
  opacity: 1;
}

/* Centered semi-transparent play button icon */
.pf-tile__thumb::before {
  content: '▶';
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.45);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px; /* Optically centers the play triangle icon */
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.pf-tile:hover .pf-tile__thumb::before {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(0, 238, 153, 0.25); /* Soft Qubi green backdrop on hover */
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 238, 153, 0.4);
}

/* Hardware accelerate backdrop filter to prevent Chrome compositor delay */
#service-modal-backdrop {
  will-change: opacity, backdrop-filter;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.pf-tile__label {
  padding: 0 0.25rem;
}

/* Category label: only shown in featured view (when .show-tags is present on parent) */
.pf-tile__cat {
  display: none;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.3rem;
}
.show-tags .pf-tile__cat {
  display: block;
}

.pf-tile__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
}

/* Hidden tiles (filtered out) */
.pf-tile.is-hidden {
  display: none;
}



@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}

.portfolio-item {
  border-radius: 16px;
  overflow: hidden;
}

.portfolio-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 4 / 3;
  background: var(--surface);
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block;
}
.portfolio-thumb:hover .portfolio-img {
  transform: scale(1.08);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.portfolio-thumb:hover .portfolio-overlay {
  opacity: 1;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.stat-card:hover {
  border-color: rgba(0,238,153,0.2);
  transform: translateY(-4px);
}
.stat-card:hover::before {
  opacity: 1;
}

/* Large variant — used when only 2 cards are shown */
.stat-card--large {
  padding: 44px 32px;
}
.stat-card--large .stat-number {
  font-size: 4.5rem;
}
.stat-card--large .stat-suffix {
  font-size: 2.5rem;
  margin-top: 10px;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.stat-suffix {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  display: inline-block;
  margin-left: 2px;
  vertical-align: top;
  margin-top: 8px;
}
.stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  margin-top: 8px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ============================================================
   ABOUT IMAGE GRID
   ============================================================ */
.about-image-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr;
  gap: 12px;
  height: 480px;
  border-radius: 24px;
  overflow: hidden;
}

.about-img-main {
  grid-row: 1;
  grid-column: 1;
  overflow: hidden;
  border-radius: 16px;
}
.about-img-secondary {
  grid-row: 1;
  grid-column: 2;
  overflow: hidden;
  border-radius: 16px;
}

.about-img-main img,
.about-img-secondary img {
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.about-image-grid:hover .about-img-main img,
.about-image-grid:hover .about-img-secondary img {
  transform: scale(1.04);
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact-form {
  text-align: left;
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.9rem;
  padding: 14px 18px;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  -webkit-appearance: none;
}
.form-input::placeholder {
  color: rgba(255,255,255,0.3);
}
.form-input:focus {
  border-color: var(--accent);
  background: rgba(0,238,153,0.04);
  box-shadow: 0 0 0 4px rgba(0,238,153,0.08);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 5l3 3 3-3' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.form-select option {
  background: #111;
  color: #fff;
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
}

/* Contact submit button loading state */
#contact-submit.loading {
  opacity: 0.7;
  cursor: wait;
}
#contact-submit .btn-arrow {
  transition: transform 0.3s ease;
}
#contact-submit:hover .btn-arrow {
  transform: translateX(4px);
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
.section-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.section-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero reveal (immediately on page load) */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  animation: reveal-up-anim 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes reveal-up-anim {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   UTILITIES
   ============================================================ */

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

/* Smooth image load */
img {
  display: block;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(2.5rem, 13vw, 4rem);
  }

  .about-image-grid {
    height: 320px;
  }

  .stat-card {
    padding: 24px 18px;
  }
  .stat-number {
    font-size: 2.8rem;
  }
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,238,153,0.3);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,238,153,0.6);
}

/* ============================================================
   SELECTION COLOR
   ============================================================ */
::selection {
  background: rgba(0,238,153,0.25);
  color: #fff;
}
