/* ==========================================================================
   MAISON MIRSAM — Saudi Luxury Delicatessen Brand Identity CSS
   AZRI Creative Studio Design System
   ========================================================================== */

:root {
  --color-burgundy: #412D2F;
  --color-rosewood: #9B615D;
  --color-rosewood-light: #B87B77;
  --color-linen: #FAF5EB;
  --color-sand: #ECE0C6;
  --color-obsidian: #0A0A0A;
  --color-dark-surface: #141011;
  --color-glass-card: rgba(20, 16, 17, 0.75);
  --color-border-muted: rgba(155, 97, 93, 0.25);
  --color-text-dim: #C5B8B7;

  --font-heading: "Syne", "Inter", -apple-system, sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;

  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --deck-transition-speed: 0.65s;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--color-obsidian);
  color: #ffffff;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body.is-loading {
  overflow: hidden !important;
}

/* Background Canvas */
#starscape {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

/* Top Progress Bar (Solid Rosewood) */
#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background-color: var(--color-rosewood);
  z-index: 9999;
  transition: width 0.15s ease-out;
}

/* ==========================================================================
   PRELOADER SCREEN (MAISON MIRSAM LOGO SQUARE SVG)
   ========================================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background-color: var(--color-burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 280px;
}

.preloader-logo {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(155, 97, 93, 0.4));
  animation: preloaderPulse 2s ease-in-out infinite alternate;
}

@keyframes preloaderPulse {
  0% { transform: scale(0.96); opacity: 0.85; }
  100% { transform: scale(1.04); opacity: 1; }
}

.preloader-counter {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-rosewood);
  letter-spacing: -0.02em;
}

.preloader-progress-wrap {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.preloader-progress-bar {
  width: 0%;
  height: 100%;
  background-color: var(--color-rosewood);
  transition: width 0.2s ease-out;
}

/* ==========================================================================
   FLOATING NAVBAR
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 24px 40px;
  z-index: 1000;
  pointer-events: none;
}

.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  pointer-events: auto;
}

.studio-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.studio-mark__azri {
  color: var(--color-rosewood);
}

.studio-mark__divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.25);
}

.header-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  transition: var(--transition-smooth);
}

.header-back:hover {
  color: #ffffff;
  transform: translateX(-3px);
}

/* ==========================================================================
   RIGHT SIDEBAR NAV (DESKTOP) / BOTTOM PILL BAR (MOBILE)
   ========================================================================== */
.services-nav-sidebar {
  position: fixed;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}

.services-nav-sidebar::-webkit-scrollbar {
  width: 3px;
}
.services-nav-sidebar::-webkit-scrollbar-thumb {
  background: var(--color-rosewood);
  border-radius: 3px;
}

.sidebar-item-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  opacity: 0.4;
  transition: var(--transition-smooth);
}

.sidebar-item-btn:hover,
.sidebar-item-btn.active {
  opacity: 1;
}

.sidebar-item-num {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-rosewood);
  min-width: 20px;
}

.sidebar-item-line {
  width: 16px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  transition: var(--transition-smooth);
}

.sidebar-item-btn.active .sidebar-item-line {
  width: 32px;
  background-color: var(--color-rosewood);
}

.sidebar-item-label {
  font-size: 0.75rem;
  color: #ffffff;
  letter-spacing: 0.05em;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: var(--transition-smooth);
  pointer-events: none;
}

.sidebar-item-btn:hover .sidebar-item-label,
.sidebar-item-btn.active .sidebar-item-label {
  opacity: 1;
  transform: translateX(0);
}

/* ==========================================================================
   DECK WRAPPER & SLIDES
   ========================================================================== */
.deck-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

.deck-slide {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(60px) scale(0.97);
  transition: opacity var(--deck-transition-speed) cubic-bezier(0.16, 1, 0.3, 1),
              transform var(--deck-transition-speed) cubic-bezier(0.16, 1, 0.3, 1),
              visibility var(--deck-transition-speed);
}

.deck-slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  z-index: 2;
}

.deck-slide.prev {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-60px) scale(0.97);
  z-index: 1;
}

.fullscreen-slide-img {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  cursor: zoom-in;
}

.slide-corner-badge {
  position: absolute;
  bottom: 32px;
  left: 40px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-rosewood);
  letter-spacing: 0.1em;
  pointer-events: none;
  z-index: 10;
  background: var(--color-glass-card);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--color-border-muted);
}

.slide-corner-badge span {
  color: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   HERO CANVAS & 3D TEXT OVERLAYS
   ========================================================================== */
.hero-stage-slide {
  background-color: var(--color-obsidian);
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-3d-text-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 0 40px;
}

.hero-main-title-box {
  text-align: center;
  max-width: 900px;
  transition: var(--transition-smooth);
}

.hero-title-main {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.hero-title-arabic {
  font-family: "Bedayah", serif;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--color-rosewood);
  margin-bottom: 24px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: var(--color-text-dim);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}

.hero-pillar-overlay {
  position: absolute;
  max-width: 600px;
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition-smooth);
  pointer-events: auto;
}

.hero-pillar-overlay.active {
  opacity: 1;
  transform: translateY(0);
}

.pillar-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-rosewood);
  margin-bottom: 12px;
}

.pillar-heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 16px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}

.pillar-heading span {
  color: var(--color-rosewood);
}

.pillar-desc {
  font-size: 1.05rem;
  color: var(--color-text-dim);
  line-height: 1.6;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}

.btn-enter-deck {
  margin-top: 24px;
  padding: 14px 28px;
  background-color: var(--color-rosewood);
  color: #ffffff;
  border: none;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-enter-deck:hover {
  background-color: var(--color-rosewood-light);
  transform: translateY(-2px);
}

/* ==========================================================================
   CLOSING AZRI STUDIO CTA SLIDE
   ========================================================================== */
.cta-container {
  text-align: center;
  max-width: 720px;
  padding: 40px;
  background: var(--color-dark-surface);
  border: 1px solid var(--color-border-muted);
  border-radius: 24px;
}

.cta-tag {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-rosewood);
  margin-bottom: 16px;
}

.cta-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
  margin-bottom: 20px;
}

.cta-title span {
  color: var(--color-rosewood);
}

.cta-description {
  font-size: 1.05rem;
  color: var(--color-text-dim);
  line-height: 1.6;
  margin-bottom: 32px;
}

.cta-buttons-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}

.btn-primary-cta {
  padding: 14px 32px;
  background-color: var(--color-rosewood);
  color: #ffffff;
  text-decoration: none;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  transition: var(--transition-smooth);
}

.btn-primary-cta:hover {
  background-color: var(--color-rosewood-light);
  transform: translateY(-2px);
}

.btn-secondary-cta {
  padding: 14px 32px;
  background: transparent;
  color: var(--color-text-dim);
  text-decoration: none;
  border: 1px solid var(--color-border-muted);
  border-radius: 30px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.btn-secondary-cta:hover {
  color: #ffffff;
  border-color: var(--color-rosewood);
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
}

/* Lightbox Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 2.5rem;
  color: #ffffff;
  cursor: pointer;
}

.modal-img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE BOTTOM BAR)
   ========================================================================== */
@media (max-width: 768px) {
  .header {
    padding: 16px 20px;
  }

  .slide-corner-badge {
    left: 20px;
    bottom: 80px;
  }

  .cta-container {
    padding: 24px;
    margin: 20px;
  }

  .cta-buttons-row {
    flex-direction: column;
  }

  /* Horizontal Bottom Pill Navigation Bar on Mobile */
  .services-nav-sidebar {
    right: 50%;
    top: auto;
    bottom: 20px;
    transform: translateX(50%);
    flex-direction: row;
    max-height: none;
    width: 90vw;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(20, 16, 17, 0.9);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--color-border-muted);
  }

  .sidebar-item-label {
    display: none;
  }
}
