/* ─── Design Tokens ─────────────────────────────────────── */
:root,
[data-theme="dark"] {
  /* Colors */
  --color-bg-primary: #0a0a0a;
  --color-bg-secondary: #0d0d0d;
  --color-bg-card: #111111;
  --color-bg-footer: #050505;
  --color-bg-marquee: #1a1a1a;
  --color-bg-muted: #1a1a1a;
  --color-text-primary: #ffffff;
  --color-text-inverse: #0a0a0a;
  --color-text-muted: rgba(255, 255, 255, 0.6);
  --color-text-subtle: rgba(255, 255, 255, 0.4);
  --color-text-faint: rgba(255, 255, 255, 0.3);
  --color-text-nav: rgba(255, 255, 255, 0.7);
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-strong: rgba(255, 255, 255, 0.2);
  --color-logo-bg: #ffffff;
  --color-hero-number: rgba(255, 255, 255, 0.03);
  --color-gradient-end: transparent;
  --color-noise-opacity: 0.03;
  --color-nav-scrolled: rgba(10, 10, 10, 0.9);
  --color-client-track: rgba(255, 255, 255, 0.05);
  --color-gold: #F5C518;
  --color-gold-muted: rgba(245, 197, 24, 0.7);

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 5rem;
  --space-section: 3.5rem;
  --space-section-lg: 5rem;

  /* Type scale */
  --type-xs: 0.65rem;
  --type-sm: 0.875rem;
  --type-base: 1rem;
  --type-lg: 1.125rem;
  --type-xl: 1.25rem;
  --type-2xl: 1.5rem;
  --type-3xl: 1.875rem;
  --type-4xl: 2.25rem;
  --type-5xl: 3rem;
  --type-6xl: 3.75rem;
  --type-7xl: 4.5rem;
  --type-8xl: 6rem;
  --type-9xl: 8rem;

  /* Tracking */
  --tracking-tight: -0.02em;
  --tracking-wide: 0.1em;
  --tracking-wider: 0.2em;
  --tracking-widest: 0.3em;
}

[data-theme="light"] {
  --color-bg-primary: #f8f8f6;
  --color-bg-secondary: #f0f0ec;
  --color-bg-card: #ffffff;
  --color-bg-footer: #ebebe7;
  --color-bg-marquee: #ecece8;
  --color-bg-muted: #e8e8e4;
  --color-text-primary: #0a0a0a;
  --color-text-inverse: #ffffff;
  --color-text-muted: rgba(10, 10, 10, 0.65);
  --color-text-subtle: rgba(10, 10, 10, 0.50);
  --color-text-faint: rgba(10, 10, 10, 0.40);
  --color-text-nav: rgba(10, 10, 10, 0.75);
  --color-border: rgba(10, 10, 10, 0.1);
  --color-border-strong: rgba(10, 10, 10, 0.2);
  --color-logo-bg: #0a0a0a;
  --color-hero-number: rgba(10, 10, 10, 0.04);
  --color-gradient-end: rgba(248, 248, 246, 0);
  --color-noise-opacity: 0.015;
  --color-nav-scrolled: rgba(248, 248, 246, 0.92);
  --color-client-track: rgba(10, 10, 10, 0.06);
  --color-gold: #C8A000;
  --color-gold-muted: rgba(200, 160, 0, 0.7);
}

/* ─── Surface overrides (no !important) ────────────────── */
[data-theme="light"] body,
[data-theme="light"] .bg-dark {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
}

[data-theme="light"] .bg-\[\#0d0d0d\],
[data-theme="light"] .bg-\[\#0a0a0a\] {
  background-color: var(--color-bg-secondary);
}

[data-theme="light"] .bg-card {
  background-color: var(--color-bg-card);
}

[data-theme="light"] .bg-\[\#050505\] {
  background-color: var(--color-bg-footer);
}

[data-theme="light"] .bg-\[\#1a1a1a\] {
  background-color: var(--color-bg-marquee);
}

/* Text overrides */
[data-theme="light"] .text-white {
  color: var(--color-text-primary);
}

[data-theme="light"] .text-white\/70 {
  color: var(--color-text-nav);
}

[data-theme="light"] .text-white\/60 {
  color: var(--color-text-muted);
}

[data-theme="light"] .text-white\/50 {
  color: rgba(10, 10, 10, 0.5);
}

[data-theme="light"] .text-white\/40 {
  color: var(--color-text-subtle);
}

[data-theme="light"] .text-white\/30 {
  color: var(--color-text-faint);
}

[data-theme="light"] .text-white\/20 {
  color: rgba(10, 10, 10, 0.2);
}

[data-theme="light"] .text-white\/5 {
  color: rgba(10, 10, 10, 0.05);
}

[data-theme="light"] .text-white\/10 {
  color: rgba(10, 10, 10, 0.1);
}

[data-theme="light"] .text-white\/80 {
  color: rgba(10, 10, 10, 0.85);
}

[data-theme="light"] .text-white\/90 {
  color: rgba(10, 10, 10, 0.92);
}

/* Placeholder text fix — invisible white placeholder on light bg */
[data-theme="light"] .placeholder-white\/30::placeholder {
  color: rgba(10, 10, 10, 0.4);
}

[data-theme="light"] .placeholder-white\/40::placeholder {
  color: rgba(10, 10, 10, 0.5);
}

[data-theme="light"] .placeholder-white\/50::placeholder {
  color: rgba(10, 10, 10, 0.6);
}

/* Gold background and its alpha variants */
[data-theme="light"] .bg-gold {
  background-color: var(--color-gold);
}

[data-theme="light"] .bg-gold\/5 {
  background-color: rgba(200, 160, 0, 0.05);
}

[data-theme="light"] .bg-gold\/10 {
  background-color: rgba(200, 160, 0, 0.1);
}

[data-theme="light"] .bg-gold\/20 {
  background-color: rgba(200, 160, 0, 0.2);
}

[data-theme="light"] .bg-gold\/30 {
  background-color: rgba(200, 160, 0, 0.3);
}

[data-theme="light"] .text-dark {
  color: var(--color-text-primary);
}

/* Button hover — bg-gold → white on hover */
[data-theme="light"] .hover\:bg-white:hover {
  background-color: var(--color-text-primary);
  color: var(--color-text-inverse);
}

/* Toast notifications — better contrast in light mode */
[data-theme="light"] .text-gold\/70 {
  color: rgba(200, 160, 0, 0.7);
}

[data-theme="light"] .text-green-400 {
  color: #16a34a;
}

[data-theme="light"] .text-red-400 {
  color: #dc2626;
}

/* Gold color light mode override */
[data-theme="light"] .text-gold {
  color: var(--color-gold);
}

/* Borders */
[data-theme="light"] .border-white\/10 {
  border-color: var(--color-border);
}

[data-theme="light"] .border-white\/20 {
  border-color: var(--color-border-strong);
}

/* Restore golden top accent line on cards */
[data-theme="light"] .border-t-gold {
  border-top-color: var(--color-gold);
}

/* Navbar scrolled state */
[data-theme="light"] #navbar.bg-dark\/90 {
  background-color: var(--color-nav-scrolled);
}

/* Text turns gold on hover */
[data-theme="light"] .hover\:text-gold:hover,
[data-theme="light"] .group:hover .group-hover\:text-gold,
[data-theme="light"] .group:focus-within .group-focus-within\:text-gold {
  color: var(--color-gold);
}

/* Gold-on-gold hover variants */
[data-theme="light"] .group:hover .group-hover\:text-gold\/50 {
  color: rgba(200, 160, 0, 0.5);
}
[data-theme="light"] .group:hover .group-hover\:text-gold\/20 {
  color: rgba(200, 160, 0, 0.2);
}

/* Borders turn gold on hover */
[data-theme="light"] .hover\:border-gold:hover,
[data-theme="light"] .group:hover .group-hover\:border-gold {
  border-color: var(--color-gold);
}

/* Golden side glow on hover */
[data-theme="light"] #services .tilt-card:hover {
  box-shadow: 0 0 60px rgba(200, 160, 0, 0.35), 0 0 25px rgba(200, 160, 0, 0.25);
}

/* Gold border opacity variants for light mode */
[data-theme="light"] .border-gold\/10 {
  border-color: rgba(200, 160, 0, 0.1);
}

[data-theme="light"] .border-gold\/20 {
  border-color: rgba(200, 160, 0, 0.2);
}

[data-theme="light"] .border-gold\/30 {
  border-color: rgba(200, 160, 0, 0.3);
}

[data-theme="light"] .border-gold\/40 {
  border-color: rgba(200, 160, 0, 0.4);
}

/* Logo circle */
[data-theme="light"] .theme-logo-bg {
  background-color: var(--color-logo-bg);
}
[data-theme="light"] .theme-logo-text {
  color: var(--color-text-inverse);
}

/* Hero decorative elements */
[data-theme="light"] .hero-number {
  color: var(--color-hero-number);
}

[data-theme="light"] .noise-overlay {
  opacity: var(--color-noise-opacity);
}

[data-theme="light"] .from-dark {
  --tw-gradient-from: var(--color-bg-primary) var(--tw-gradient-from-position);
}

/* Mobile menu */
[data-theme="light"] #mobile-menu {
  background-color: var(--color-bg-primary);
}

/* Filter button active */
.filter-btn.active {
  background-color: var(--color-gold);
  color: #0a0a0a;
  border-color: var(--color-gold);
}

/* Light mode filter btn */
[data-theme="light"] .filter-btn.active {
  background-color: var(--color-gold);
  color: #0a0a0a;
  border-color: var(--color-gold);
}

/* ─── Theme toggle ──────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}
.theme-toggle:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 1.125rem;
  height: 1.125rem;
}
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ─── Focus indicators ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ─── Custom Cursor ──────────────────────────────────── */
.cursor-dot {
  width: 8px;
  height: 8px;
  background: #F5C518;
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s ease;
}
.cursor-ring {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(245, 197, 24, 0.5);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  transition: all 0.15s ease-out;
}
.cursor-ring.hover {
  transform: scale(1.5);
  border-color: #F5C518;
  background: rgba(245, 197, 24, 0.1);
}
@media (hover: none) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ─── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .clients-marquee-track {
    animation: none !important;
  }

  .animate-marquee {
    animation: none !important;
  }

  .float,
  .pulse-glow,
  .glow-line,
  .text-gradient,
  .scroll-line,
  .glitch-text:hover {
    animation: none !important;
  }

  .cursor-dot,
  .cursor-ring,
  .magnetic-btn,
  .tilt-card,
  .parallax-layer {
    transition: none !important;
    transform: none !important;
  }

  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ─── Shared animations (extracted from inline <style>) ── */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.animate-marquee {
  animation: marquee 20s linear infinite;
}

@keyframes textShine {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}
.text-gradient {
  background: linear-gradient(135deg, var(--color-gold) 0%, #fff 50%, var(--color-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: textShine 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}
.float {
  animation: float 6s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(245, 197, 24, 0.3); }
  50% { box-shadow: 0 0 40px rgba(245, 197, 24, 0.6); }
}
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 20px rgba(245, 197, 24, 0); }
  50% { text-shadow: 0 0 40px rgba(245, 197, 24, 0.5), 0 0 80px rgba(245, 197, 24, 0.3); }
}

@keyframes scrollLine {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.5); opacity: 0.5; }
}

@keyframes clients-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Clients marquee */
.clients-marquee-viewport {
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.clients-marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: clients-marquee 40s linear infinite;
}
.client-logo-slot {
  flex: 0 0 auto;
  width: clamp(9rem, calc(100vw / 5 - 1rem), 15rem);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 1024px) {
  .client-logo-slot {
    width: clamp(8rem, calc(100vw / 4 - 1rem), 12rem);
    padding: 0 1.25rem;
  }
}
@media (max-width: 640px) {
  .client-logo-slot {
    width: clamp(7rem, calc(100vw / 3 - 0.75rem), 10rem);
    padding: 0 1rem;
  }
}
.client-logo-slot img {
  height: 4.5rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* ─── Work grid (bento) ───────────────────────────────── */
picture { display: contents; }
.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 280px;
  grid-auto-flow: dense;
  gap: 1.25rem;
}
.work-card {
  position: relative;
  overflow: hidden;
  display: block;
  border-radius: 0.5rem;
}
.work-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.work-card:hover img {
  transform: scale(1.08);
}
.work-card-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: 1.5rem;
  transition: background 0.4s ease;
}
.work-card:hover .work-card-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
}
.work-card.hidden-filter {
  display: none;
}

/* ─── Orientation spans ──────────────────────────────── */
.work-card[data-orientation="landscape"] {
  grid-column: span 2;
  grid-row: span 1;
}
.work-card[data-orientation="portrait"] {
  grid-column: span 1;
  grid-row: span 2;
}
.work-card[data-orientation="square"] {
  grid-column: span 1;
  grid-row: span 1;
}

/* ── Tablet ────────────────────────────────── */
@media (max-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 240px;
  }
  .work-card[data-orientation="portrait"] {
    grid-row: span 2;
  }
}

/* ── Mobile ────────────────────────────────── */
@media (max-width: 640px) {
  .work-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .work-card {
    aspect-ratio: 16 / 9;
  }
  .work-card[data-orientation="landscape"],
  .work-card[data-orientation="portrait"],
  .work-card[data-orientation="square"] {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* ─── Featured grid (index page) ──────────────────────────── */
.featured-grid {
  grid-auto-flow: dense;
}
.featured-grid > a[data-orientation="landscape"] {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}
.featured-grid > a[data-orientation="portrait"] {
  aspect-ratio: 3 / 4;
}
.featured-grid > a[data-orientation="square"] {
  aspect-ratio: 1 / 1;
}
@media (max-width: 768px) {
  .featured-grid > a {
    aspect-ratio: 16 / 9 !important;
  }
  .featured-grid > a[data-orientation="landscape"],
  .featured-grid > a[data-orientation="portrait"],
  .featured-grid > a[data-orientation="square"] {
    grid-column: span 1;
  }
}

/* ─── Team section ───────────────────────────────────── */
.team-portrait {
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease;
}
.team-card:hover .team-portrait {
  border-color: rgba(245, 197, 24, 0.35);
}
.team-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.team-card:hover .team-portrait img {
  transform: scale(1.03);
}
.team-portrait-placeholder {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
  text-align: center;
  padding: 1rem;
}
[data-theme="light"] .team-portrait {
  border-color: rgba(10, 10, 10, 0.12);
  background: rgba(10, 10, 10, 0.02);
}
[data-theme="light"] .team-portrait-placeholder {
  color: rgba(10, 10, 10, 0.2);
}

.team-card-label {
  margin-top: 1rem;
  text-align: center;
}
.team-card-label .role-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.125rem;
  letter-spacing: 0.12em;
  color: var(--color-gold);
  line-height: 1.2;
}
.team-card-label .role-sub {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold-muted);
  margin-top: 0.35rem;
}

/* ─── Section spacing ────────────────────────────────── */
.section-tight {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}
@media (min-width: 768px) {
  .section-tight {
    padding-top: var(--space-section-lg);
    padding-bottom: var(--space-section-lg);
  }
}

/* ─── Footer ─────────────────────────────────────────── */
footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold) 30%, var(--color-gold) 70%, transparent);
}
footer {
  position: relative;
}
.footer-social-icon {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.footer-social-icon:hover {
  border-color: var(--color-gold);
  background: rgba(245, 197, 24, 0.1);
}
[data-theme="light"] footer {
  background-color: var(--color-bg-footer);
}
[data-theme="light"] .footer-social-icon {
  border-color: rgba(10, 10, 10, 0.15);
}
[data-theme="light"] .footer-social-icon:hover {
  border-color: var(--color-gold);
  background: rgba(245, 197, 24, 0.1);
}

/* ─── Form validation ────────────────────────────────── */
.form-input.error {
  border-color: #dc2626;
}
.form-input.error:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
}
.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
}
.error-message.visible {
  display: block;
}

/* ─── Mobile menu focus trap (inert handling) ────────── */
#mobile-menu[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}
#mobile-menu[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}
