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

:root {
  /* Color Palette */
  --gold: #C9A84C;
  --gold-light: #e8c96a;
  --gold-dark: #a8782a;
  --gold-rgb: 201, 168, 76;
  
  --dark: #0a0a0a;
  --dark2: #111;
  --dark3: #181818;
  --dark-rgb: 10, 10, 10;
  
  --text: #d8d8d8;
  --text-dim: #888;
  --text-rgb: 216, 216, 216;
  
  /* Design Tokens */
  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  
  /* Transitions */
  --transition: 0.3s ease;
  --transition-fast: 0.15s ease;
  --transition-slow: 0.5s ease;
  
  /* Spacing System */
  --space-xxs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-xxl: 4rem;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3);
  
  /* Z-index Layers */
  --z-below: -1;
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal: 400;
  --z-popover: 500;
  --z-tooltip: 600;
  
  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container-xxl: 1400px;
}

/* Typography */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--dark);
  color: var(--text);
  direction: rtl;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  right: 0;
  background: var(--gold);
  color: var(--dark);
  padding: var(--space-sm);
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--dark2);
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: var(--z-fixed);
  background: rgba(var(--dark-rgb), 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.12);
  transition: background var(--transition), transform var(--transition);
  transform: translateY(0);
}

.navbar.hidden {
  transform: translateY(-100%);
}

.navbar.scrolled {
  background: rgba(10, 10, 10, 0.95);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo img {
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.3));
}

.nav-menu {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--dark);
  padding: var(--space-xs) var(--space-md);
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.nav-cta:hover::before {
  left: 100%;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 70px;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('24.webp') center/cover no-repeat;
  filter: brightness(0.25) saturate(1.2);
  transform: scale(1.05);
  transition: transform 8s ease;
  will-change: transform;
}

.hero:hover .hero-bg {
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg {
    transition: none;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--dark) 0%,
    transparent 40%,
    transparent 70%,
    var(--dark) 100%
  );
}

.hero-content {
  position: relative;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.hero-badge {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
  border: 1px solid rgba(201, 168, 76, 0.3);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  background: rgba(201, 168, 76, 0.06);
}

.hero-title {
  font-size: clamp(3.5rem, 12vw, 8rem);
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  letter-spacing: -0.02em;
  filter: drop-shadow(0 0 60px rgba(var(--gold-rgb), 0.25));
  animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  0% {
    filter: drop-shadow(0 0 40px rgba(var(--gold-rgb), 0.2));
  }
  100% {
    filter: drop-shadow(0 0 80px rgba(var(--gold-rgb), 0.3));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title {
    animation: none;
  }
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--text-dim);
  font-weight: 300;
  max-width: 480px;
  line-height: 1.8;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--dark);
  padding: var(--space-sm) var(--space-xl);
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--font-size-base);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition);
  position: relative;
  overflow: hidden;
  animation: ctaPulse 2s ease-in-out infinite;
}

.hero-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.hero-cta:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-xl);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.hero-cta:hover::before {
  left: 100%;
}

@keyframes ctaPulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(var(--gold-rgb), 0.35);
  }
  50% {
    box-shadow: 0 8px 40px rgba(var(--gold-rgb), 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-cta {
    animation: none;
  }
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.scroll-indicator {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollPulse 2s infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Common Section Styles */
.section {
  padding: var(--space-xl) 5%;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: linear-gradient(to left, var(--gold), transparent);
  margin: var(--space-sm) auto 0;
}

/* Specs Section */
.specs {
  background: var(--dark2);
  position: relative;
  overflow: hidden;
}

.specs::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(var(--gold-rgb), 0.05), transparent 70%);
  filter: blur(40px);
  z-index: var(--z-below);
}

.specs-container {
  max-width: 720px;
  margin: 0 auto;
}

.specs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.4rem;
}

.specs-row {
  transition: transform var(--transition-fast), background-color var(--transition);
}

.specs-row:hover {
  transform: translateX(-4px);
  background-color: rgba(var(--gold-rgb), 0.05);
}

.specs-cell {
  padding: 1rem 1.5rem;
  background: var(--dark3);
  font-size: 0.92rem;
}

.specs-cell:first-child {
  color: var(--gold);
  font-weight: 600;
  border-radius: 0 var(--radius) var(--radius) 0;
  border-right: 2px solid var(--gold);
  width: 42%;
}

.specs-cell:last-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

/* Features Section */
.features {
  background: var(--dark);
  position: relative;
}

.features::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(var(--gold-rgb), 0.03), transparent 70%);
  filter: blur(60px);
  z-index: var(--z-below);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
  max-width: 1100px;
  margin: 0 auto;
}

.feature-card {
  background: var(--dark3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: var(--space-lg) var(--space-md);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  will-change: transform;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(var(--gold-rgb), 0.08), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: linear-gradient(to bottom, var(--gold), var(--gold-light));
  transition: height var(--transition);
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--gold-rgb), 0.35);
  box-shadow: var(--shadow-xl);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card:hover::after {
  height: 100%;
}

.feature-number {
  font-size: 3rem;
  font-weight: 900;
  color: rgba(201, 168, 76, 0.08);
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  line-height: 1;
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  display: block;
}

.feature-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.feature-description {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.8;
}

/* Gallery Section */
.gallery {
  background: var(--dark2);
  position: relative;
}

.gallery::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(var(--gold-rgb), 0.04), transparent 70%);
  filter: blur(50px);
  z-index: var(--z-below);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto auto;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.gallery-item:first-child {
  grid-column: 1 / 3;
}

.gallery-item:nth-child(2),
.gallery-item:nth-child(3) {
  grid-column: span 1;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  background: #0d0d0d;
  transition: transform var(--transition), border-color var(--transition);
}

.gallery-item:hover {
  border-color: rgba(var(--gold-rgb), 0.3);
  transform: scale(1.02);
}

.gallery-item:first-child {
  aspect-ratio: 21 / 8;
}

.gallery-item:nth-child(2),
.gallery-item:nth-child(3) {
  aspect-ratio: 4 / 3;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: var(--space-md);
  transition: transform var(--transition-slow), filter var(--transition);
  filter: brightness(0.95);
  will-change: transform;
}

.gallery-item:hover .gallery-image {
  transform: scale(1.03);
  filter: brightness(1.08);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 1.25rem 1.5rem;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-caption {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 8px;
  object-fit: contain;
  background: #0f0f0f;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(201, 168, 76, 0.3);
}

/* Contact Section */
.contact {
  background: var(--dark);
  background-image: radial-gradient(
    ellipse 60% 40% at 50% 100%,
    rgba(var(--gold-rgb), 0.06),
    transparent
  );
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(var(--gold-rgb), 0.08), transparent 70%);
  filter: blur(80px);
  z-index: var(--z-below);
}

.contact-container {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.contact-description {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.9;
  margin-bottom: 2rem;
}

.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  color: #fff;
  padding: var(--space-md) var(--space-xl);
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--font-size-base);
  box-shadow: 0 8px 32px rgba(253, 29, 29, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition);
  position: relative;
  overflow: hidden;
}

.instagram-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.instagram-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(253, 29, 29, 0.4);
  filter: brightness(1.1);
}

.instagram-link:hover::before {
  left: 100%;
}

.instagram-icon {
  width: 22px;
  height: 22px;
  fill: #fff;
  flex-shrink: 0;
}

/* Footer */
.footer {
  background: #060606;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.78rem;
  color: #444;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity var(--transition-slow) ease, transform var(--transition-slow) ease;
  will-change: opacity, transform;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* Staggered animations for children */
.features-grid .fade-in:nth-child(1) { transition-delay: 0.1s; }
.features-grid .fade-in:nth-child(2) { transition-delay: 0.2s; }
.features-grid .fade-in:nth-child(3) { transition-delay: 0.3s; }
.features-grid .fade-in:nth-child(4) { transition-delay: 0.4s; }

.gallery-grid .fade-in:nth-child(1) { transition-delay: 0.1s; }
.gallery-grid .fade-in:nth-child(2) { transition-delay: 0.2s; }
.gallery-grid .fade-in:nth-child(3) { transition-delay: 0.3s; }

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Print Styles */
@media print {
  .navbar,
  .hero-scroll,
  .lightbox,
  .contact {
    display: none !important;
  }
  
  body {
    background: #fff !important;
    color: #000 !important;
  }
  
  .hero-bg {
    filter: brightness(0.5);
  }
  
  .hero-title {
    -webkit-text-fill-color: #8a6a1e;
    color: #8a6a1e;
  }
  
  .section {
    padding: 2.5rem 5% !important;
    background: #fff !important;
  }
  
  .specs-cell {
    background: #f5f5f5 !important;
  }
  
  .specs-cell:first-child {
    color: #8a6a1e;
    border-right-color: #8a6a1e;
  }
  
  .feature-card {
    background: #f9f9f9 !important;
    border-color: #ddd !important;
  }
  
  .gallery-image {
    padding: 0 !important;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .gallery-item:first-child {
    aspect-ratio: 16 / 7;
  }
  
  .gallery-item:nth-child(2),
  .gallery-item:nth-child(3) {
    aspect-ratio: 1 / 1;
  }
  
  .section {
    padding: 4.5rem 5%;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-item:first-child,
  .gallery-item:nth-child(2),
  .gallery-item:nth-child(3) {
    grid-column: auto;
    aspect-ratio: 4 / 3;
  }
  
  .hero-title {
    font-size: 3.5rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --gold: #ffd700;
    --text: #fff;
    --text-dim: #ccc;
  }
}

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