@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800;900&display=swap');

/* ==========================================================================
   Wiby Agency - Premium Design System & Typography
   Coolors Palette: #011826 - #083540 - #0e5259 - #1c8c81 - #0d0d0d
   ========================================================================== */

@font-face {
  font-family: 'IRANSans';
  src: url('/assets/fonts/IRANSans.woff2') format('woff2'),
       url('/assets/fonts/IRANSans.woff') format('woff'),
       url('/assets/fonts/IRANSans.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IRANSans';
  src: url('/assets/fonts/IRANSansBold.woff2') format('woff2'),
       url('/assets/fonts/IRANSansBold.woff') format('woff'),
       url('/assets/fonts/IRANSansBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand Color Palette */
  --bg-primary: #011826;
  --bg-secondary: #083540;
  --bg-glass: rgba(8, 53, 64, 0.65);
  --border-teal: #0e5259;
  --accent-teal: #1c8c81;
  --accent-glow: rgba(28, 140, 129, 0.45);
  --black-deep: #0d0d0d;
  
  /* Text & Neutrals */
  --text-light: #ffffff;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;
  
  /* Layout & Transitions */
  --font-en: 'Outfit', 'Inter', sans-serif;
  --font-fa: 'IRANSans', sans-serif;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-light);
}

body {
  font-family: var(--font-en);
  line-height: 1.6;
  overflow-x: hidden;
  background: radial-gradient(circle at 15% 15%, #083540 0%, #011826 60%, #0d0d0d 100%);
  min-height: 100vh;
  position: relative;
}

/* RTL Override for Persian - Enforce IRANSans on 100% of DOM elements */
html[dir="rtl"],
html[dir="rtl"] *,
html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea,
html[dir="rtl"] a,
html[dir="rtl"] span,
html[dir="rtl"] div,
html[dir="rtl"] label,
html[dir="rtl"] li,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] p {
  font-family: 'IRANSans', sans-serif !important;
}

html[dir="rtl"], html[dir="rtl"] * {
  letter-spacing: normal !important;
}

/* Persian/Arabic text also renders in IRANSans when it appears inside an LTR
   page — e.g. the "فارسی" and "العربية" entries in the language selector on
   /en/, /de/, /es/ and /fr/, which would otherwise fall back to Outfit. */
[lang="fa"],
[lang="fa"] *,
[lang="ar"],
[lang="ar"] * {
  font-family: 'IRANSans', sans-serif !important;
  letter-spacing: normal !important;
}

html[dir="rtl"] .sheet-link span:last-child {
  display: inline-block;
  transform: scaleX(-1);
}

html[dir="rtl"] body {
  text-align: right;
}

html[dir="rtl"] .nav-links {
  direction: rtl;
  gap: 1.25rem;
  flex-wrap: nowrap !important;
}
html[dir="rtl"] .nav-link {
  font-size: 0.93rem;
  white-space: nowrap !important;
}

html[dir="rtl"] .calc-options {
  direction: rtl;
}

/* ==========================================================================
   Background Ambient Lighting & Glassmorphism
   ========================================================================== */
.ambient-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(28, 140, 129, 0.18) 0%, rgba(1, 24, 38, 0) 70%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
}
.glow-1 { top: -10%; left: -10%; }
.glow-2 { bottom: 10%; right: -10%; background: radial-gradient(circle, rgba(14, 82, 89, 0.25) 0%, rgba(1, 24, 38, 0) 70%); }

.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(28, 140, 129, 0.2);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-teal);
  box-shadow: 0 15px 35px rgba(1, 24, 38, 0.8), 0 0 25px var(--accent-glow);
}

/* ==========================================================================
   Typography & Utility Classes
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-teal) 50%, #48e5d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(28, 140, 129, 0.15);
  border: 1px solid var(--accent-teal);
  color: #48e5d4;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 15px rgba(28, 140, 129, 0.2);
}

html[dir="rtl"] .section-badge {
  letter-spacing: 0;
}

.section {
  padding: 7rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem auto;
}

.section-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1.7;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-teal) 0%, #156d64 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(28, 140, 129, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(28, 140, 129, 0.7);
  background: linear-gradient(135deg, #23ab9d 0%, var(--accent-teal) 100%);
}

.btn-secondary {
  background: rgba(14, 82, 89, 0.3);
  color: var(--text-light);
  border: 1px solid var(--border-teal);
}

.btn-secondary:hover {
  background: rgba(28, 140, 129, 0.25);
  border-color: var(--accent-teal);
  transform: translateY(-2px);
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(1, 24, 38, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(14, 82, 89, 0.4);
  transition: var(--transition);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 85px;
  width: 98%;
  max-width: 1750px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--text-light);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  margin-right: 3rem;
  flex-shrink: 0;
}

html[dir="rtl"] .nav-brand {
  margin-right: 0;
  margin-left: 3rem;
}

.nav-logo-img {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex !important;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
}

.nav-link {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.96rem;
  transition: var(--transition);
  opacity: 0.88;
  padding: 0.4rem 0.5rem;
  white-space: nowrap !important;
}

.nav-link:hover, .nav-link.active {
  color: #48e5d4;
  opacity: 1;
  text-shadow: 0 0 10px rgba(72, 229, 212, 0.5);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-toggle {
  background: rgba(14, 82, 89, 0.4);
  border: 1px solid var(--border-teal);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
}

.lang-toggle:hover {
  background: var(--accent-teal);
  border-color: #48e5d4;
  box-shadow: 0 0 15px var(--accent-glow);
}

.mobile-toggle {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-light);
}

/* ==========================================================================
   Hero Section & 3D Canvas
   ========================================================================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  position: relative;
}

#three-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  /* Dim the 3D layer slightly so bright shards never fight the copy for attention */
  opacity: 0.68;
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 2;
  padding: 3rem 0;
}

.hero-title {
  font-size: 4.2rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

html[dir="rtl"] .hero-title {
  font-size: 3.5rem;
  line-height: 1.3;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 700px;
  line-height: 1.8;
}

.hero-cta-group {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(14, 82, 89, 0.5);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: #48e5d4;
  line-height: 1.1;
  margin-bottom: 0.3rem;
  text-shadow: 0 0 20px rgba(28, 140, 129, 0.5);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Grids & Card Components
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(28, 140, 129, 0.2) 0%, rgba(8, 53, 64, 0.4) 100%);
  border: 1px solid var(--accent-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px rgba(28, 140, 129, 0.2);
}

.glass-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.glass-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.98rem;
  line-height: 1.7;
}

.card-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border-top: 1px solid rgba(14, 82, 89, 0.4);
  padding-top: 1.2rem;
}

.card-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #d1d5db;
  font-size: 0.9rem;
}

.card-features li::before {
  content: "✓";
  color: #48e5d4;
  font-weight: 800;
}

/* ==========================================================================
   Interactive Cost Estimator Component
   ========================================================================== */
.calculator-box {
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-teal);
  border-radius: var(--radius-lg);
  padding: 3.5rem;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 3.5rem;
  box-shadow: 0 25px 50px rgba(1, 24, 38, 0.8);
}

.calc-group {
  margin-bottom: 2.5rem;
}

.calc-label {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.calc-btn {
  background: rgba(1, 24, 38, 0.6);
  border: 1px solid var(--border-teal);
  color: var(--text-muted);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.calc-btn:hover, .calc-btn.active {
  background: rgba(28, 140, 129, 0.25);
  border-color: var(--accent-teal);
  color: #ffffff;
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}

input[type="range"] {
  width: 100%;
  height: 8px;
  background: rgba(14, 82, 89, 0.6);
  border-radius: 5px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #48e5d4;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(28, 140, 129, 0.8);
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.calc-summary {
  background: rgba(1, 24, 38, 0.9);
  border: 1px solid var(--accent-teal);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 0 30px rgba(28, 140, 129, 0.15);
}

.estimated-price {
  /* Persian prices ("۴۰۹٬۵۰۰٬۰۰۰ ریال") are far longer than "$4,095" and a
     digit group offers no break opportunity, so a fixed 3.5rem overflowed the
     card and gave the whole page a horizontal scrollbar on phones. */
  font-size: clamp(1.75rem, 8vw, 3.5rem);
  font-weight: 900;
  color: #48e5d4;
  margin: 1rem 0 0.5rem 0;
  text-shadow: 0 0 25px rgba(28, 140, 129, 0.6);
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

/* ==========================================================================
   Contact Form Section
   ========================================================================== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
  justify-content: space-between;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
  width: 100%;
}

html[dir="rtl"] .form-group {
  text-align: right;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
}

.form-input, .form-textarea, .form-select {
  background: rgba(1, 24, 38, 0.7);
  border: 1px solid var(--border-teal);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  color: var(--text-light);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.form-input, .form-select {
  height: 58px;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 15px var(--accent-glow);
  background: rgba(8, 53, 64, 0.8);
}

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

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: #000b12;
  border-top: 1px solid var(--border-teal);
  padding: 4rem 0 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-bottom {
  border-top: 1px solid rgba(14, 82, 89, 0.3);
  padding-top: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Responsive Breakpoints & Modern Mobile Floating Dock
   ========================================================================== */
@media (max-width: 1250px) {
  .nav-links {
    gap: 0.8rem !important;
  }
  .nav-link {
    font-size: 0.88rem !important;
    padding: 0.3rem 0.3rem !important;
  }
  .nav-brand {
    margin-right: 1rem !important;
  }
  html[dir="rtl"] .nav-brand {
    margin-left: 1rem !important;
  }
}

@media (max-width: 1024px) {
  .calculator-box {
    grid-template-columns: 1fr;
    padding: 2rem;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .nav-links, .mobile-toggle, .lang-toggle, .flag-btn, .nav-actions {
    display: none !important;
  }
  .mobile-dock {
    display: flex !important;
  }
  .navbar {
    height: 75px;
    /* nav-links and nav-actions are hidden below 992px, so space-between would
       pin the logo to the left and leave the whole right half empty */
    justify-content: center;
  }
  .nav-brand {
    margin-right: 0 !important;
  }
  html[dir="rtl"] .nav-brand {
    margin-left: 0 !important;
  }
  .hero-title {
    font-size: 2.8rem;
  }
  html[dir="rtl"] .hero-title {
    font-size: 2.5rem !important;
    line-height: 1.35 !important;
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .calc-options {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Modern Bottom Floating Action Dock & Slide-Up Sheet (Mobile / Tablet)
   ========================================================================== */
.mobile-dock {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 480px;
  background: rgba(8, 53, 64, 0.92);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(72, 229, 212, 0.4);
  border-radius: 50px;
  padding: 0.6rem 1.2rem;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(72, 229, 212, 0.2);
  justify-content: space-around;
  align-items: center;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 0.25s ease;
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
}

.dock-item span.dock-icon {
  font-size: 1.3rem;
}

.dock-item:hover, .dock-item.active {
  color: #48e5d4;
  transform: translateY(-3px);
}

/* Slide-up Glassmorphic Modal Sheet */
.mobile-sheet-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(1, 24, 38, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-sheet-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-sheet-modal {
  position: absolute;
  bottom: -100%;
  left: 0;
  width: 100%;
  background: radial-gradient(circle at 50% 0%, #0e5259 0%, #011826 80%);
  border-top: 1px solid #48e5d4;
  border-radius: 30px 30px 0 0;
  padding: 2.5rem 2rem 5rem 2rem;
  transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.9);
  max-height: 85vh;
  /* A slide-up sheet scrolls vertically only — never sideways */
  overflow-x: hidden;
  overflow-y: auto;
}

.mobile-sheet-overlay.active .mobile-sheet-modal {
  bottom: 0;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(72, 229, 212, 0.2);
}

/* Title must be able to shrink/wrap, otherwise a long localized heading pushes
   the header wider than the sheet */
.sheet-header > :first-child {
  min-width: 0;
  overflow-wrap: break-word;
}

.sheet-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.sheet-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sheet-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sheet-link:hover {
  background: rgba(72, 229, 212, 0.15);
  border-color: #48e5d4;
  color: #48e5d4;
  transform: translateX(6px);
}

/* Individual service pages — the mobile equivalent of the desktop mega menu,
   which is hidden below 992px and would otherwise leave them unreachable */
.sheet-sublist {
  margin-top: -0.5rem;
}

.sheet-sublist ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 1.1rem;
  border-left: 1px solid rgba(72, 229, 212, 0.25);
}

html[dir="rtl"] .sheet-sublist ul {
  padding-left: 0;
  padding-right: 1.1rem;
  border-left: none;
  border-right: 1px solid rgba(72, 229, 212, 0.25);
}

.sheet-sublink {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.sheet-sublink:hover,
.sheet-sublink:focus-visible {
  background: rgba(72, 229, 212, 0.12);
  color: #48e5d4;
}

.sheet-subicon {
  flex-shrink: 0;
  font-size: 1.1rem;
}

html[dir="rtl"] .sheet-link:hover {
  transform: translateX(-6px);
}

/* ==========================================================================
   Super Deluxe Trending Micro-interactions & Movie-Like Section Animations
   ========================================================================== */
.reveal-item {
  opacity: 0;
  transform: translateY(26px) scale(0.98);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-item.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Accessibility + no-surprises fallback: show content instantly when the user
   prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Lift headings off the animated 3D backdrop for readability.
   IMPORTANT: gradient text (background-clip: text) has a transparent fill, so an
   inherited text-shadow bleeds THROUGH the glyphs and makes them look foggy.
   Shadow the solid text only; gradient spans get a drop-shadow filter instead,
   which follows the rendered pixels and keeps the gradient crisp. */
.hero-title,
.section-title {
  text-shadow: 0 2px 24px rgba(1, 18, 29, 0.9), 0 1px 4px rgba(1, 18, 29, 0.7);
}

.text-gradient {
  text-shadow: none;
  filter: drop-shadow(0 2px 10px rgba(1, 18, 29, 0.8));
}

/* Language Selector Dropdown */
.lang-selector-dropdown {
  position: relative;
  display: inline-block;
  z-index: 100;
}

.lang-selector-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: rgba(28, 140, 129, 0.15);
  border: 1px solid rgba(72, 229, 212, 0.4);
  border-radius: 50px;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lang-selector-btn:hover, .lang-selector-dropdown.open .lang-selector-btn {
  background: rgba(28, 140, 129, 0.35);
  border-color: #48e5d4;
  box-shadow: 0 0 20px rgba(72, 229, 212, 0.4);
}

.lang-flag-img {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  display: block;
}

.lang-code-text {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.8rem;
  font-weight: 700;
}

.lang-dropdown-chevron {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  opacity: 0.8;
}

.lang-selector-dropdown.open .lang-dropdown-chevron {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  max-height: 360px;
  overflow-y: auto;
  background: rgba(1, 18, 29, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(72, 229, 212, 0.3);
  border-radius: 14px;
  padding: 0.5rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(72, 229, 212, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

[dir="rtl"] .lang-dropdown-menu {
  right: auto;
  left: 0;
}

.lang-selector-dropdown.open .lang-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.lang-dropdown-menu::-webkit-scrollbar {
  width: 5px;
}
.lang-dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(72, 229, 212, 0.3);
  border-radius: 10px;
}
.lang-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(72, 229, 212, 0.6);
}

.lang-option-btn {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

[dir="rtl"] .lang-option-btn {
  text-align: right;
}

.lang-option-btn:hover {
  background: rgba(72, 229, 212, 0.15);
  color: #fff;
  transform: translateX(3px);
}

[dir="rtl"] .lang-option-btn:hover {
  transform: translateX(-3px);
}

.lang-option-btn.active {
  background: rgba(28, 140, 129, 0.35);
  border: 1px solid rgba(72, 229, 212, 0.5);
  color: #48e5d4;
  font-weight: 700;
}

.lang-option-native {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  overflow-wrap: break-word;
}

/* Flag never shrinks or stretches, so a slow/blocked flagcdn.com response
   cannot reflow the row */
.lang-flag-img {
  flex-shrink: 0;
}

.lang-option-code {
  font-size: 0.75rem;
  opacity: 0.6;
  text-transform: uppercase;
  font-weight: 600;
}

/* Mobile Language Grid Modal */
.lang-sheet-modal {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.mobile-lang-grid {
  display: grid;
  /* min(130px, 100%) keeps the track from ever exceeding the container on very
     narrow screens; without it a track wider than the grid forces a horizontal
     scrollbar, because overflow-y:auto makes overflow-x compute to auto too */
  grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr));
  gap: 0.6rem;
  padding: 1rem 0;
  max-height: 65vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.flag-btn {
  font-size: 1.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  background: rgba(28, 140, 129, 0.2);
  border: 1px solid var(--accent-teal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 15px rgba(72, 229, 212, 0.2);
}

.flag-btn:hover {
  transform: scale(1.1) rotate(5deg);
  background: rgba(28, 140, 129, 0.4);
  box-shadow: 0 0 25px rgba(72, 229, 212, 0.5);
  border-color: #48e5d4;
}

/* ==========================================================================
   Cinematic 3D Particle Intro & Warp Drive
   ========================================================================== */
#cinematic-intro {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #011d2e 0%, #010e17 100%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#intro-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

#intro-content-box {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}

#intro-logo-img {
  height: 90px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 30px rgba(72, 229, 212, 0.8));
  animation: introLogoFloat 4s infinite ease-in-out;
}

#intro-status {
  color: #48e5d4;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 2rem;
  text-shadow: 0 0 10px rgba(72, 229, 212, 0.5);
}

.intro-progress-container {
  width: 300px;
  max-width: 80vw;
  height: 6px;
  background: rgba(14, 82, 89, 0.3);
  border: 1px solid rgba(72, 229, 212, 0.4);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 8px rgba(0, 0, 0, 0.5);
}

.intro-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #1c8c81 0%, #48e5d4 50%, #ffd700 100%);
  border-radius: 10px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 15px #48e5d4;
}

@keyframes introLogoFloat {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 25px rgba(72, 229, 212, 0.6)); }
  50% { transform: translateY(-10px) scale(1.03); filter: drop-shadow(0 0 40px rgba(72, 229, 212, 0.9)); }
}

/* ==========================================================================
   Staggered Cascading Entrance Animations (Triggered on body.intro-completed)
   ========================================================================== */
body:not(.intro-completed) .header {
  opacity: 0;
  transform: translateY(-60px);
}

body:not(.intro-completed) .hero-content {
  opacity: 0;
  transform: translateY(40px) scale(0.95);
}

body:not(.intro-completed) .hero-visual {
  opacity: 0;
  transform: scale(0.8);
}

body.intro-completed .header {
  animation: headerCascadeDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.intro-completed .nav-brand {
  opacity: 0;
  animation: slideInLeft 0.8s 0.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.intro-completed .nav-links li {
  opacity: 0;
  animation: navLinkCascade 0.6s calc(0.2s + var(--idx, 1) * 0.08s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.intro-completed .nav-actions {
  opacity: 0;
  animation: slideInRight 0.8s 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.intro-completed .hero-content {
  opacity: 0;
  animation: heroContentReveal 1s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.intro-completed .hero-visual {
  opacity: 0;
  animation: heroVisualReveal 1.2s 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes headerCascadeDown {
  from { opacity: 0; transform: translateY(-60px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes navLinkCascade {
  from { opacity: 0; transform: translateY(-25px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroContentReveal {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes heroVisualReveal {
  from { opacity: 0; transform: scale(0.8) rotateZ(-5deg); }
  to { opacity: 1; transform: scale(1) rotateZ(0); }
}

/* Portfolio Interactive Carousel Slider */
#projects .container {
  max-width: 1440px !important;
}

.portfolio-carousel-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 1.5rem 0;
}

.portfolio-carousel {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.portfolio-slide {
  flex: 0 0 calc((100% - 3rem) / 3);
  max-width: calc((100% - 3rem) / 3);
  display: flex;
  flex-direction: column;
}

/* Enlarge client favicon icons inside featured carousel */
.portfolio-slide .client-icon {
  width: 64px !important;
  height: 64px !important;
  border-radius: 16px !important;
  padding: 8px !important;
  background: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 0 20px rgba(72, 229, 212, 0.4) !important;
}

@media (max-width: 1024px) {
  .portfolio-slide {
    flex: 0 0 calc((100% - 1.5rem) / 2);
    max-width: calc((100% - 1.5rem) / 2);
  }
}

@media (max-width: 768px) {
  .portfolio-slide {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .container {
    padding: 0 1.25rem !important;
  }
  .section {
    padding: 4.5rem 0 !important;
  }
  .hero-section {
    padding-top: 6.5rem !important;
    padding-bottom: 3.5rem !important;
  }
  .hero-title {
    font-size: 2.2rem !important;
    line-height: 1.25 !important;
  }
  html[dir="rtl"] .hero-title {
    font-size: 2rem !important;
    line-height: 1.35 !important;
  }
  .section-title {
    font-size: 1.85rem !important;
  }
  html[dir="rtl"] .section-title {
    font-size: 1.75rem !important;
  }
  .hero-description, .section-subtitle {
    font-size: 1rem !important;
    line-height: 1.7 !important;
  }
  .hero-cta-group {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.85rem !important;
    margin-bottom: 2.5rem !important;
  }
  .hero-cta-group .btn, .section .btn, .glass-card .btn {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.85rem 1.2rem !important;
    font-size: 0.95rem !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.4 !important;
    justify-content: center !important;
  }
  .stat-number {
    font-size: 2rem !important;
  }
  .glass-card {
    padding: 1.5rem !important;
  }
  .form-group {
    width: 100% !important;
  }
}

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(14, 82, 89, 0.8);
  border: 1px solid #48e5d4;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.carousel-nav-btn:hover {
  background: #48e5d4;
  color: #011826;
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

/* Interactive Social SVG Vector Icons */
.social-icons-grid {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  margin-top: 1.5rem;
}

.social-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(72, 229, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #48e5d4;
  transition: all 0.3s ease;
}

.social-icon-btn:hover {
  background: #48e5d4;
  color: #011826;
  transform: translateY(-4px) rotate(8deg);
  box-shadow: 0 0 20px rgba(72, 229, 212, 0.6);
}


/* ==========================================================================
   Blog Index — Post Cards
   ========================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin: 3rem 0 5rem;
}

.blog-card {
  padding: 0;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55), 0 0 25px rgba(72, 229, 212, 0.15);
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.blog-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.06);
}

.blog-card-category {
  position: absolute;
  top: 1rem;
  inset-inline-start: 1rem;
  padding: 0.35rem 0.9rem;
  background: rgba(1, 24, 38, 0.85);
  border: 1px solid rgba(72, 229, 212, 0.5);
  color: #48e5d4;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 30px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.6rem 1.6rem 1.8rem;
  gap: 0.7rem;
}

.blog-card-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.blog-card-title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.4;
  margin: 0;
}

.blog-card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-more {
  margin-top: auto;
  padding-top: 0.6rem;
  color: #48e5d4;
  font-weight: 700;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Service card action links (homepage + services index) */
.card-link {
  display: inline-block;
  margin-top: 1.2rem;
  color: #48e5d4;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition);
}

.card-link:hover {
  transform: translateX(4px);
  text-shadow: 0 0 12px rgba(72, 229, 212, 0.6);
}

/* ==========================================================================
   Services Mega Menu (desktop nav)
   ========================================================================== */
.nav-item-mega {
  position: relative;
}

.nav-item-mega > .nav-link::after {
  content: "▾";
  font-size: 0.7em;
  margin-inline-start: 0.35rem;
  opacity: 0.7;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item-mega:hover > .nav-link::after,
.nav-item-mega:focus-within > .nav-link::after {
  transform: rotate(180deg);
}

.mega-menu {
  position: absolute;
  /* 30px clears the vertically-centered link so the panel drops exactly from
     the 85px header's bottom edge */
  top: calc(100% + 30px);
  left: 50%;
  transform: translate(-50%, 12px);
  /* Grows with the content so longer translations (es/de/fr) still fit inside
     the panel, but never wider than the viewport */
  width: max-content;
  min-width: 560px;
  max-width: min(760px, calc(100vw - 40px));
  background: rgba(1, 24, 38, 0.97);
  border: 1px solid rgba(72, 229, 212, 0.25);
  border-radius: 16px;
  padding: 1.1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(28, 140, 129, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 200;
}

/* Invisible bridge so the pointer can travel from the link to the panel */
.mega-menu::before {
  content: "";
  position: absolute;
  top: -32px;
  left: 0;
  right: 0;
  height: 32px;
}

.nav-item-mega:hover .mega-menu,
.nav-item-mega:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.mega-item {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  /* Grid/flex children default to min-width:auto and refuse to shrink; without
     this, long labels overflow the panel instead of wrapping */
  min-width: 0;
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-light);
  transition: background 0.2s ease, transform 0.2s ease;
}

.mega-item:hover {
  background: rgba(28, 140, 129, 0.18);
  transform: translateY(-2px);
}

.mega-icon {
  font-size: 1.5rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.mega-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  overflow-wrap: break-word;
}

.mega-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.mega-text small {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.mega-all {
  display: block;
  text-align: center;
  margin-top: 0.8rem;
  padding: 0.7rem 0 0.2rem;
  border-top: 1px solid rgba(72, 229, 212, 0.15);
  color: #48e5d4;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.mega-all:hover {
  text-shadow: 0 0 12px rgba(72, 229, 212, 0.6);
}

html[dir="rtl"] .mega-item,
html[dir="rtl"] .mega-text {
  text-align: right;
}

/* Mega menu is desktop-only; mobile uses the dock + sheet */
@media (max-width: 992px) {
  .mega-menu {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mega-menu,
  .mega-item,
  .nav-item-mega > .nav-link::after {
    transition: none;
  }
}

/* Honeypot field — invisible to humans, tempting to bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
