:root {
  --bg-light: #f2f2f7;
  --text-light: #1c1c1e;
  --glass-bg-light: rgba(255, 255, 255, 0.65);
  --glass-border-light: rgba(255, 255, 255, 0.4);
  --accent-light: #007aff;
  --card-shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

  --bg-dark: #000000;
  --text-dark: #f5f5f7;
  --glass-bg-dark: rgba(28, 28, 30, 0.65);
  --glass-border-dark: rgba(255, 255, 255, 0.1);
  --accent-dark: #0a84ff;
  --card-shadow-dark: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

  --ease-ios: cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="light"] {
  --bg-color: var(--bg-light);
  --text-color: var(--text-light);
  --glass-bg: var(--glass-bg-light);
  --glass-border: var(--glass-border-light);
  --accent: var(--accent-light);
  --card-shadow: var(--card-shadow-light);
  --mesh-1: #ff9a9e;
  --mesh-2: #fad0c4;
  --mesh-3: #a18cd1;
}

[data-theme="dark"] {
  --bg-color: var(--bg-dark);
  --text-color: var(--text-dark);
  --glass-bg: var(--glass-bg-dark);
  --glass-border: var(--glass-border-dark);
  --accent: var(--accent-dark);
  --card-shadow: var(--card-shadow-dark);
  --mesh-1: #1a3c5e;
  --mesh-2: #005f6b;
  --mesh-3: #165e34;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.5s var(--ease-ios), color 0.5s var(--ease-ios);
  overflow-x: hidden;
  min-height: 100vh;
  direction: rtl;
  text-align: right;
}

.container,
.container {
  direction: rtl;
}

html {
  scroll-behavior: smooth;
}

.light-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -2;
  opacity: 0.5;
  top: 50%;
  left: 50%;
  transform-origin: center center;
}

.orb-1 {
  width: 60vw;
  height: 60vw;
  background: var(--mesh-1);
  margin-left: -30vw;
  margin-top: -30vw;
  animation: rotateOrb1 20s linear infinite;
}

.orb-2 {
  width: 50vw;
  height: 50vw;
  background: var(--mesh-2);
  margin-left: -25vw;
  margin-top: -25vw;
  animation: rotateOrb2 25s linear infinite reverse;
}

.orb-3 {
  width: 40vw;
  height: 40vw;
  background: var(--mesh-3);
  margin-left: -20vw;
  margin-top: -20vw;
  animation: rotateOrb3 30s linear infinite;
}

@keyframes rotateOrb1 {
  from {
    transform: rotate(0deg) translate(20vw) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translate(20vw) rotate(-360deg);
  }
}

@keyframes rotateOrb2 {
  from {
    transform: rotate(0deg) translate(25vw) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translate(25vw) rotate(-360deg);
  }
}

@keyframes rotateOrb3 {
  from {
    transform: rotate(0deg) translate(15vw) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translate(15vw) rotate(-360deg);
  }
}

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

.background-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%, var(--mesh-1), transparent 70%),
    radial-gradient(circle at 80% 20%, var(--mesh-2), transparent 50%),
    radial-gradient(circle at 20% 80%, var(--mesh-3), transparent 50%);
  filter: blur(80px);
  opacity: 0.4;
  animation: meshMove 20s infinite alternate;
}

@keyframes meshMove {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.2);
  }
}

.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
}

.navbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1400px;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  transition: all 0.3s var(--ease-ios);
  direction: ltr;
  text-align: left;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo img {
  height: 40px;
  border-radius: 10px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-icon {
  color: var(--text-color);
  font-size: 1.2rem;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.nav-icon:hover {
  background: rgba(128, 128, 128, 0.1);
  transform: translateY(-2px);
}

.theme-toggle {
  cursor: pointer;
  font-size: 1.2rem;
  padding: 10px;
  border-radius: 50%;
  transition: background 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(128, 128, 128, 0.1);
  transform: rotate(15deg);
}

.container {
  width: 90%;
  max-width: 1400px;
  margin: 120px auto 0px;
}

.hero {
  text-align: center;
  margin-bottom: 60px;
  opacity: 0;
  animation: fadeUp 1s var(--ease-ios) 0.5s forwards;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--text-color) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.7;
  max-width: 900px;
  margin: 0 auto;
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-color);
  border: 1px solid var(--glass-border);
  transition: transform 0.3s var(--ease-ios), background 0.3s var(--ease-ios);
}

.btn:hover {
  transform: translateY(-2px);
  background: rgba(128, 128, 128, 0.08);
}

.btn-primary {
  background: rgba(10, 132, 255, 0.18);
  border-color: rgba(10, 132, 255, 0.25);
}

.music-section {
  margin-bottom: 60px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-inline-start: 16px;
  border-inline-start: 4px solid var(--accent);
  opacity: 0.9;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.track-card {
  padding: 16px;
  transition: transform 0.4s var(--ease-ios), box-shadow 0.4s var(--ease-ios);
  opacity: 0;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.project-actions {
  margin-top: auto;
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.project-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-title i {
  color: var(--accent);
  font-size: 1.2rem;
}

.project-title h3 {
  font-size: 1.1rem;
  font-weight: 800;
  direction: ltr;
  unicode-bidi: plaintext;
}

.project-desc {
  opacity: 0.8;
  line-height: 1.6;
  font-size: 0.98rem;
  margin-top: 6px;
}

.project-actions {
  padding-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(128, 128, 128, 0.08);
  opacity: 0.9;
}

.link-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
}

.link-card p {
  opacity: 0.75;
  line-height: 1.6;
}

.link-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-title i {
  color: var(--accent);
}

.link-title h3 {
  font-size: 1.05rem;
  font-weight: 800;
  direction: ltr;
  unicode-bidi: plaintext;
}

.about-card {
  padding: 22px;
}

.about-card p {
  opacity: 0.85;
  line-height: 1.8;
}

.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-color);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: opacity 0.8s var(--ease-ios);
}

.intro-logo {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

.intro-logo img {
  width: 100%;
  height: 100%;
  border-radius: 20px;
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--text-color);
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

footer {
  text-align: center;
  padding: 0px 40px 40px 40px;
  opacity: 0.6;
  font-size: 0.9rem;
  direction: ltr;
}

footer a {
  color: var(--text-color);
  text-decoration: none;
  margin: 0 10px;
  font-weight: 600;
}

.socials {
  margin-top: 10px;
}

.full-width {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .navbar {
    width: 95%;
    padding: 0 16px;
  }
}

@media (max-width: 540px) {
  .container {
    width: 92%;
    margin-top: 110px;
  }
  .navbar {
    height: 64px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .track-grid {
    grid-template-columns: 1fr;
  }
  .project-card {
    min-height: unset;
  }
}

@media (min-width: 1800px) {
  .navbar {
    max-width: 1600px;
  }
  .container {
    max-width: 1600px;
  }
  .hero h1 {
    font-size: 3.5rem;
  }
}

.sites-grid .link-card {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.sites-grid .link-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(
      800px circle at var(--mx, 50%) var(--my, 30%),
      rgba(10, 132, 255, 0.22),
      transparent 45%
    ),
    radial-gradient(
      700px circle at 30% 70%,
      rgba(255, 154, 158, 0.18),
      transparent 40%
    ),
    radial-gradient(
      700px circle at 80% 20%,
      rgba(22, 94, 52, 0.18),
      transparent 45%
    );
  opacity: 0;
  transition: opacity 0.35s var(--ease-ios);
  pointer-events: none;
}

.sites-grid .link-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 35%,
    transparent 60%
  );
  transform: translateX(60%);
  opacity: 0;
  pointer-events: none;
}

.sites-grid .link-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
}

.sites-grid .link-card:hover::before {
  opacity: 1;
}

.sites-grid .link-card:hover::after {
  opacity: 1;
  animation: shineMove 1.35s var(--ease-ios) forwards;
}

.sites-grid .link-title i {
  filter: drop-shadow(0 10px 18px rgba(10, 132, 255, 0.35));
}

@keyframes shineMove {
  0% {
    transform: translateX(60%);
  }
  100% {
    transform: translateX(-120%);
  }
}
