/* ==========================================================================
   1. VARIABLES & CONFIGURATION
   ========================================================================== */
@font-face {
  font-family: "Ray";
  src: url("../fonts/Ray-VF.woff2") format("woff2");
  font-weight: 300 950;
  font-style: normal;
  font-display: swap;
}
:root {
  /* Color Palette & Font */
  --accent: #f7d248;
  --light: #f0f0f0;
  --dark: #0f0f0f;
  --dark-hover: #3b3b3b;
  --white: #ffffff;
  --gray-muted: #b8b8b8;
  --transparent: transparent;
  --font-primary: "Ray", sans-serif;

  /* Aliases */
  --bg-main: var(--white);
  --text-light: var(--light);
  --text-dark: var(--dark);
  --text-muted: rgba(15, 15, 15, 0.25);
  --accent-yellow: var(--accent);
  --color-white: var(--white);

  /* Editor & Canvas Tokens */
  --bg-color: var(--light);
  --path-fill: #d8d8d880;
  --path-stroke: #a8a8a87e;
  --connector-stroke: #00000044;
  --guideline-stroke: #1d1d1dbd;
  --anchor-smooth-fill: #3aaa4a;
  --anchor-square-fill: #e24444;
  --anchor-tangent-fill: #06b6d4;
  --handle-fill: #2b695a;
  --handle-stroke: #00000014;
  --selection-stroke: #4b7bffee;
  --label-fill: #1f2328;
}

/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

* {
  font-family: var(--font-primary);
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--white);
  color: var(--dark);
}



.navbar-floating,
.navbar-floating *,
.menu-dropdown-contact,
.menu-dropdown-contact * {
  box-sizing: border-box !important;
  margin: 0;
}

/* ==========================================================================
   3. FLOATING LOGO
   ========================================================================== */
.navbar-floating {
  position: relative;
  z-index: 1000;
}

.logo-floating {
  position: fixed;
  top: 25px;
  inset-inline-start: 25px;
  z-index: 999999 !important;
  width: 28px;
  height: 50px;
  display: flex;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-floating img {
  position: relative;
  z-index: 999999 !important;
  width: 28px;
  height: 50px;
  object-fit: contain;
  transition: filter 0.3s ease;
}

/* ==========================================================================
   4. MAIN MENU & HAMBURGER
   ========================================================================== */
.menu-dropdown-wrapper {
  position: fixed;
  top: 30px;
  inset-inline-end: 50px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
}

.hamburger-floating {
  position: relative;
  z-index: 2000;
  display: inline-flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: auto;
  height: 45px;
  padding-block: 0;
  padding-inline: 16px;
  border-radius: 22.5px;
  background: var(--light);
  cursor: pointer;
  user-select: none;
}

.hamburger-floating:hover {
  background: var(--dark-hover);
}

.menu-text {
  font-size: 16px;
  font-weight: 525;
  color: var(--dark);
  line-height: 1;
}

.hamburger-floating:hover .menu-text {
  color: var(--light);
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  width: 12px;
  height: 10px;
}

.hamburger-icon span {
  width: 12px;
  height: 2px;
  background: var(--dark);
}

.hamburger-floating:hover .hamburger-icon span {
  background: var(--light);
}

/* Menu Checked / Active State */
.menu-toggle:checked + .hamburger-floating {
  z-index: 999999 !important;
  min-width: auto;
  width: 45px;
  padding: 0;
  gap: 0;
  background: var(--transparent);
  border-color: var(--transparent);
  box-shadow: none;
}

.menu-toggle:checked + .hamburger-floating .menu-text {
  display: none;
}

.menu-toggle:checked + .hamburger-floating .hamburger-icon span {
  background: var(--light);
}

.menu-toggle:checked + .hamburger-floating .hamburger-icon span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.menu-toggle:checked + .hamburger-floating .hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.menu-toggle:checked + .hamburger-floating .hamburger-icon span:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* Nav Menu Dropdown List */
.nav-menu-dropdown {
  position: fixed;
  top: 30px;
  inset-inline-end: 50px;
  z-index: 2500 !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  padding-block: 90px 45px;
  padding-inline: 20px;
  margin: 0;
  list-style: none;
  background: var(--dark);
  border-radius: 22.5px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-toggle:checked ~ .nav-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu-dropdown li a {
  display: block;
  min-width: auto;
  color: var(--light);
  text-decoration: none;
  font-size: 16px;
  font-family: var(--font-primary);
  font-weight: 625;
}

[dir="ltr"] .nav-menu-dropdown li a {
  text-align: left;
}

[dir="rtl"] .nav-menu-dropdown li a {
  text-align: right;
}

.nav-menu-dropdown li a:hover {
  font-weight: 750;
  background: var(--transparent);
  color: var(--accent);
  transform: translateX(-4px);
}

[dir="ltr"] .nav-menu-dropdown li a:hover {
  transform: translateX(4px);
}

/* ==========================================================================
   5. CONTACT DROPDOWN
   ========================================================================== */
.menu-dropdown-contact {
  position: fixed;
  inset-inline-start: 50px;
  bottom: 50px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-toggle {
  display: none;
}

.contact-floating {
  position: relative;
  z-index: 2000;
  display: inline-flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: auto;
  height: 45px;
  padding-inline: 16px;
  border-radius: 22.5px;
  background: var(--dark);
  cursor: pointer;
  user-select: none;
}

.contact-floating:hover {
  background: var(--dark-hover);
}

.contact-text {
  font-size: 16px;
  font-weight: 525;
  color: var(--light);
  line-height: 1;
}

.contact-floating:hover .contact-text {
  color: var(--light);
}

.contact-icon {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 3px;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.contact-icon span {
  width: 2px;
  height: 2px;
  background: var(--light);
}

.contact-floating:hover .contact-icon span {
  background: var(--light);
}


.contact-toggle:checked + .contact-floating {
  z-index: 3000 !important; 
  min-width: auto;
  width: 45px;
  height: 45px;
  padding: 0;
  gap: 0;
  background: var(--transparent);
  border-color: var(--transparent);
  box-shadow: none;
  position: fixed;
  inset-inline-start: 310px;
  bottom: 278px;
}

.contact-toggle:checked + .contact-floating .contact-text {
  display: none;
}

.contact-toggle:checked + .contact-floating .contact-icon span {
  width: 12px;
  height: 2px;
  background: var(--light);
  position: absolute;
}

.contact-toggle:checked + .contact-floating .contact-icon span:nth-child(1) {
  transform: rotate(45deg);
}

.contact-toggle:checked + .contact-floating .contact-icon span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.contact-toggle:checked + .contact-floating .contact-icon span:nth-child(3) {
  transform: rotate(-45deg);
}


.nav-menu-contact {
  position: fixed;
  inset-inline-start:  50px;
  bottom: 50px;
  z-index: 2500 !important; 
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 305px;
  padding: 80px 0 20px 0;
  margin: 0;
  list-style: none;
  background: var(--dark);
  border-radius: 22.5px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-toggle:checked ~ .nav-menu-contact {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}



.nav-menu-contact li p.contact-desc {
  padding: 0 20px;
  margin-bottom: 12px;
  color: var(--light);
  font-size: 14px;
  font-weight: 425;
  font-family: var(--font-primary);
  text-align: right;
  direction: rtl;
}

/* بالابردن اولویت با اضافه کردن کلاس والد */
[dir="ltr"] .nav-menu-contact li p.contact-desc {
  text-align: left;
  direction: ltr;
}
.nav-menu-contact li a {
  display: block;
  padding: 0 20px;
  min-width: auto;
  border: none;
  border-radius: 0;
  color: var(--gray-muted);
  text-decoration: none;
  font-size: 14px;
  font-family: var(--font-primary);
  font-weight: 425;
  text-align: left;
  line-height: 1.2;
}

.nav-menu-contact li a:hover {
    font-weight: 525;
  background: var(--transparent);
  color: var(--accent);
  transform: translateX(4px);
}

/* ==========================================================================
   6. LANGUAGE SWITCHER
   ========================================================================== */
.lang-switch {
  position: relative;
  z-index: 2001;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 45px;
  padding: 2px;
  background: var(--light);
  border-radius: 22.5px;
  isolation: isolate;
}

[dir="rtl"] .lang-switch {
  flex-direction: row-reverse;
}

.lang-link {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 41px;
  border-radius: 22.5px;
  font-size: 13px;
  font-weight: 525;
  color: var(--dark-hover);
  text-decoration: none;
  /* اضافه کردن ترنزیشن برای نرم شدن انیمیشن هاور */
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ۱. هاور برای زبان‌های قابل انتخاب (غیرفعال) */
.lang-link:not(.active):hover {
  background: var(--accent); /* یا هر رنگ پس‌زمینه دلخواه برای هاور */
  color: var( --dark-hover);
}

/* ۲. استایل زبان فعال */
.lang-link.active {
  background: var(--dark-hover);
  color: var(--light) !important;
  font-weight: 625;
}

.menu-toggle:checked ~ .lang-switch {
  background: var(--dark);
}




/* ==========================================================================
   7. SPLASH SCREEN
   ========================================================================== */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  height: 100%;

  background-color: var(--white);

  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transition: opacity 0.6s ease;

  will-change: opacity;
}

#splash-logo,
#splash-screen img {
  width: 150px;
  max-width: 60%;

  opacity: 0;
  transform: scale(0.94);

  animation: splashReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;

  will-change: opacity, transform;
}

.fade-out {
  opacity: 0;
  pointer-events: none;

  visibility: hidden;

  transition:
    opacity 0.6s ease,
    visibility 0s linear 0.6s;
}


/* Logo entrance */
@keyframes splashReveal {
  0% {
    opacity: 0;
    transform: scale(0.94);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}


/* Mobile */
@media (max-width: 768px) {
  #splash-screen {
    transition: opacity 0.45s ease;
  }

  .fade-out {
    transition:
      opacity 0.45s ease,
      visibility 0s linear 0.45s;
  }

  #splash-logo,
  #splash-screen img {
    width: 130px;
    animation-duration: 1s;
  }
}


/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  #splash-screen {
    transition: none;
  }

  #splash-logo,
  #splash-screen img {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .fade-out {
    transition: none;
  }
}
/* ==========================================================================
   8. MEDIA QUERIES (FULLSCREEN MENUS)
   ========================================================================== */

/* Mobile Portrait Devices (<= 768px) - Fullscreen View */
@media (max-width: 768px) {
  /* اینورت شدن لوگو فقط زمانی که منوی تمام‌صفحه باز می‌شود */
  body:has(.menu-toggle:checked) .logo-floating img,
  body:has(.contact-toggle:checked) .logo-floating img {
    filter: brightness(0) invert(1) !important;
  }

  body:has(.menu-toggle:checked) .menu-dropdown-contact {
    z-index: 1000 !important;
  }

  body:has(.contact-toggle:checked) .menu-dropdown-wrapper {
    z-index: 1000 !important;
  }

  .menu-dropdown-wrapper {
    top: 30px;
    inset-inline-end: 20px;
    gap: 10px;
  }

  .hamburger-icon span {
    width: 10px;
    height: 1px;
    background: var(--dark);
  }

  .hamburger-floating {
    height: 30px;
    padding: 12px;
    border-radius: 16px;
  }

  .menu-toggle:checked + .hamburger-floating {
    width: 38px;
    height: 38px;
  }

  .menu-toggle:checked + .hamburger-floating .hamburger-icon span:nth-child(1) {
    transform: translateY(3px) rotate(45deg);
  }

  .menu-toggle:checked + .hamburger-floating .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
  }

  .menu-toggle:checked + .hamburger-floating .hamburger-icon span:nth-child(3) {
    transform: translateY(-3px) rotate(-45deg);
  }

  .menu-text {
    font-size: 12px;
  }

  /* Fullscreen Menu Dropdown */
  .nav-menu-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding-block: 30px 100px;
    padding-inline: 50px;
    justify-content: center;
    gap: 16px;
    border-radius: 0;
    z-index: 99990 !important;
  }

  .nav-menu-dropdown li a {
    font-size: 25px;
  }

  .nav-menu-dropdown li a:hover {
    transform: translateY(-2px);
  }

  .menu-dropdown-contact {
    inset-inline-start: 20px;
    bottom: 25px;
  }



  .contact-floating {
    height: 30px;
    padding: 12px;
    gap: 16px;
    border-radius: 19px;
  }

  /* Fullscreen Contact Menu for Landscape */
  .nav-menu-contact {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 30px 25px 30px 25px;
    justify-content: center;
    gap: 6px;
    z-index: 99990 !important;
    overflow-y: auto;
  }

  .contact-toggle:checked + .contact-floating {
    position: fixed;
    top: 20px;
    bottom: auto;
    inset-inline-start: auto;
    inset-inline-end: 20px;
    z-index: 999999 !important;
    width: 38px;
    height: 38px;
    padding: 0;
    background: var(--transparent);
    border-color: var(--transparent);
    box-shadow: none;
  }

  .contact-toggle:checked + .contact-floating .contact-icon span {
    position: absolute;
    width: 10px;
    height: 1px;
    background: var(--light);
  }

  .contact-toggle:checked + .contact-floating .contact-icon span:nth-child(1) {
    transform: rotate(45deg);
  }

  .contact-toggle:checked + .contact-floating .contact-icon span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
  }

  .contact-toggle:checked + .contact-floating .contact-icon span:nth-child(3) {
    transform: rotate(-45deg);
  }

  .contact-text {
    font-size: 12px;
  }

  .logo-floating {
    top: 20px;
    inset-inline-start: 20px;
  }

  .logo-floating img {
    width: 28px;
    height: 50px;
    object-fit: contain;
  }

  .lang-switch {
    height: 30px;
    padding: 1px;
    border-radius: 16px;
  }

  .lang-link {
    width: 28px;
    height: 26px;
    border-radius: 15px;
    font-size: 11px;
  }
}

/* Mobile Landscape Mode (<= 650px height) - Fullscreen View */
@media (max-height: 650px) and (orientation: landscape) {
  body:has(.menu-toggle:checked) .logo-floating img,
  body:has(.contact-toggle:checked) .logo-floating img {
    filter: brightness(0) invert(1) !important;
  }

  body:has(.menu-toggle:checked) .menu-dropdown-contact {
    z-index: 1000 !important;
  }

  body:has(.contact-toggle:checked) .menu-dropdown-wrapper {
    z-index: 1000 !important;
  }

  .menu-dropdown-wrapper {
    top: 30px;
    inset-inline-end: 20px;
    gap: 10px;
  }

  .hamburger-icon span {
    width: 10px;
    height: 1px;
    background: var(--dark);
  }

  .hamburger-floating {
    height: 30px;
    padding: 12px;
    border-radius: 16px;
  }

  .menu-toggle:checked + .hamburger-floating {
    width: 38px;
    height: 38px;
  }

  .menu-toggle:checked + .hamburger-floating .hamburger-icon span:nth-child(1) {
    transform: translateY(3px) rotate(45deg);
  }

  .menu-toggle:checked + .hamburger-floating .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
  }

  .menu-toggle:checked + .hamburger-floating .hamburger-icon span:nth-child(3) {
    transform: translateY(-3px) rotate(-45deg);
  }

  .menu-text {
    font-size: 12px;
  }

  /* Fullscreen Menu Dropdown */
  .nav-menu-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding-block: 70px 100px;
    padding-inline: 50px;
    justify-content: center;
    gap: 16px;
    border-radius: 0;
    z-index: 99990 !important;
  }

  .nav-menu-dropdown li a {
    font-size: 25px;
  }

  .nav-menu-dropdown li a:hover {
    transform: translateY(-2px);
  }

  .menu-dropdown-contact {
    inset-inline-start: 20px;
    bottom: 20px;
  }

  .contact-floating {
    height: 30px;
    padding: 12px;
    gap: 16px;
    border-radius: 19px;
  }

  /* Fullscreen Contact Menu for Landscape */
  .nav-menu-contact {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 60px 25px 30px 25px;
    justify-content: center;
    gap: 6px;
    z-index: 99990 !important;
    overflow-y: auto;
  }

  .contact-toggle:checked + .contact-floating {
    position: fixed;
    top: 20px;
    bottom: auto;
    inset-inline-start: auto;
    inset-inline-end: 20px;
    z-index: 999999 !important;
    width: 38px;
    height: 38px;
    padding: 0;
    background: var(--transparent);
    border-color: var(--transparent);
    box-shadow: none;
  }

  .contact-toggle:checked + .contact-floating .contact-icon span {
    position: absolute;
    width: 10px;
    height: 1px;
    background: var(--light);
  }

  .contact-toggle:checked + .contact-floating .contact-icon span:nth-child(1) {
    transform: rotate(45deg);
  }

  .contact-toggle:checked + .contact-floating .contact-icon span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
  }

  .contact-toggle:checked + .contact-floating .contact-icon span:nth-child(3) {
    transform: rotate(-45deg);
  }

  .contact-text {
    font-size: 12px;
  }

  .logo-floating {
    top: 20px;
    inset-inline-start: 20px;
  }

  .logo-floating img {
    width: 28px;
    height: 50px;
    object-fit: contain;
  }

  .lang-switch {
    height: 30px;
    padding: 2px;
    border-radius: 16px;
  }

  .lang-link {
    width: 29px;
    height: 27px;
    border-radius: 15px;
    font-size: 11px;
  }
}