/* ============================================
   ISSAM WEB STUDIO — Portfolio Stylesheet
   ============================================ */

:root {
  --gold: #c9a227;
  --gold-light: #e3c968;
  --ink: #0b0b0c;
  --ink-800: #141416;
  --ink-700: #1c1c1f;
  --cream: #f8f4ec;
}

* {
  scroll-behavior: smooth;
}

html {
  scroll-padding-top: 96px;
}

body {
  background-color: var(--ink);
  overflow-x: hidden;
}

::selection {
  background: var(--gold);
  color: #0b0b0c;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--ink);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-radius: 10px;
}

/* ============ Preloader ============ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-mark {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  letter-spacing: 0.35em;
  color: var(--gold-light);
  animation: preloaderPulse 1.4s ease-in-out infinite;
}
.preloader-ring {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 2px solid rgba(201, 162, 39, 0.25);
  border-top-color: var(--gold-light);
  animation: spin 1s linear infinite;
}
@keyframes preloaderPulse {
  0%, 100% { opacity: 0.55; letter-spacing: 0.35em; }
  50% { opacity: 1; letter-spacing: 0.45em; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ Glassmorphism ============ */
.glass {
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.glass-light {
  background: rgba(248, 244, 236, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#navbar {
  transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
}
#navbar.scrolled {
  box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(201, 162, 39, 0.15);
}

/* ============ Gold text / gradient ============ */
.text-gradient-gold {
  background: linear-gradient(90deg, #f5e9c2, #c9a227 45%, #e3c968);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gold-underline {
  position: relative;
  display: inline-block;
}
.gold-underline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35em;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}

/* ============ Buttons ============ */
.btn-gold {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #e3c968, #c9a227 55%, #a9821e);
  color: #0b0b0c;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  box-shadow: 0 8px 30px -10px rgba(201, 162, 39, 0.55);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -10px rgba(201, 162, 39, 0.75);
}
.btn-gold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.55) 50%, transparent 100%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}
.btn-gold:hover::before {
  transform: translateX(120%);
}

.btn-outline-gold {
  border: 1px solid rgba(201, 162, 39, 0.55);
  color: var(--gold-light);
  transition: all 0.35s ease;
}
.btn-outline-gold:hover {
  background: rgba(201, 162, 39, 0.1);
  border-color: var(--gold-light);
  transform: translateY(-2px);
}

/* ============ Scroll reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.in-view {
  opacity: 1;
  transform: scale(1);
}
.reveal-right {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
[dir="rtl"] .reveal-right { transform: translateX(32px); }
[dir="ltr"] .reveal-right { transform: translateX(-32px); }
.reveal-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* stagger helper */
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.4s; }
.reveal-delay-6 { transition-delay: 0.48s; }

/* ============ Portfolio cards ============ */
.portfolio-card {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--ink-800);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s ease, box-shadow 0.5s ease;
}
.portfolio-card:hover {
  transform: translateY(-8px);
  border-color: rgba(201, 162, 39, 0.4);
  box-shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.7);
}
.portfolio-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #1c1c1f, #0b0b0c 60%, #2a2210);
}
.portfolio-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
}
.portfolio-card:hover .portfolio-img-wrap img {
  transform: scale(1.1);
  filter: brightness(0.55);
}
.portfolio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: linear-gradient(180deg, rgba(11,11,12,0.2), rgba(11,11,12,0.85));
}
.portfolio-card:hover .portfolio-overlay {
  opacity: 1;
}
.portfolio-overlay > * {
  transform: translateY(14px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.portfolio-card:hover .portfolio-overlay > * {
  transform: translateY(0);
}

/* ============ Counters / Why choose us ============ */
.feature-icon {
  transition: transform 0.4s ease, background-color 0.4s ease;
}
.feature-card:hover .feature-icon {
  transform: rotate(-8deg) scale(1.08);
  background-color: rgba(201, 162, 39, 0.16);
}

/* ============ Testimonials ============ */
.testimonial-track {
  display: flex;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.testimonial-slide {
  flex: 0 0 100%;
}
.t-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.35s ease;
  cursor: pointer;
}
.t-dot.active {
  width: 26px;
  background: var(--gold-light);
}

/* ============ FAQ ============ */
.faq-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.4s ease, background-color 0.4s ease;
}
.faq-item.open,
.faq-item:hover {
  border-color: rgba(201, 162, 39, 0.35);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), padding 0.5s ease;
}
.faq-item.open .faq-answer {
  padding-bottom: 1.25rem;
}
.faq-icon {
  transition: transform 0.4s ease;
}
.faq-item.open .faq-icon {
  transform: rotate(135deg);
}

/* ============ Floating WhatsApp ============ */
#whatsapp-float {
  position: fixed;
  bottom: 24px;
  z-index: 50;
  box-shadow: 0 10px 30px -8px rgba(37, 211, 102, 0.6);
  animation: floatPulse 2.6s ease-in-out infinite;
}
html[dir="rtl"] #whatsapp-float { left: 20px; }
html[dir="ltr"] #whatsapp-float { right: 20px; }
@keyframes floatPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ============ Back to top ============ */
#back-to-top {
  position: fixed;
  bottom: 24px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.4s ease;
}
html[dir="rtl"] #back-to-top { right: 20px; }
html[dir="ltr"] #back-to-top { left: 20px; }
#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ============ Lightbox ============ */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 6, 7, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: 1.5rem;
}
#lightbox.open {
  opacity: 1;
  visibility: visible;
}
#lightbox img {
  max-width: 90vw;
  max-height: 82vh;
  border-radius: 1rem;
  transform: scale(0.92);
  transition: transform 0.4s ease;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8);
}
#lightbox.open img {
  transform: scale(1);
}

/* ============ Toast ============ */
#form-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) translateX(-50%);
}
#form-toast {
  transform: translateX(-50%) translateY(1rem);
}

/* ============ Mobile menu ============ */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobile-menu.open {
  max-height: 640px;
}

/* ============ Language toggle ============ */
.lang-btn {
  transition: background-color 0.3s ease, color 0.3s ease;
}
.lang-btn.active {
  background: var(--gold-light);
  color: #0b0b0c;
}

/* ============ Misc ============ */
.section-eyebrow {
  letter-spacing: 0.35em;
}
[dir="rtl"] .section-eyebrow { letter-spacing: 0.1em; }

.noise-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
}

/* Hide scrollbar on filter row but keep scrollable */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Focus visibility for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
  border-radius: 4px;
}

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