/* ==========================================================================
   ندا | پورتفولیو طراح گرافیک
   Liquid-Glass / Neon-Violet Luxury Design System
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
  scroll-behavior: smooth;
  /* Keep scrollbar always on the right */
  direction: rtl !important;
}
/* Make sure the content still works correctly with both directions */
body {
  direction: inherit;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
ul { list-style: none; }

/* ---------- 2. Design Tokens ---------- */
:root {
  /* Backgrounds */
  --void: #0a0509;
  --void-2: #150810;
  --abyss: #200b18;

  /* Glass */
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-glass-strong: rgba(255, 255, 255, 0.26);

  /* Brand — saturated, vivid, "talking" purple */
  --royal: #7a0f45;
  --violet: #b81f66;
  --neon-violet: #d52678;
  --neon-magenta: #ff6ec4;
  --neon-blue: #ca3a86; /* replace blue with a pink-hued brand tone */

  /* Text */
  --pearl: #fff1f7;
  --mist: #d9a3bf;
  --mist-dim: #8f6273;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, var(--neon-blue), var(--neon-violet) 45%, var(--neon-magenta));
  --gradient-text: linear-gradient(90deg, #ffb8dd, #ff6ec4);

  /* Glow shadows */
  --glow-sm: 0 0 22px rgba(213, 38, 120, 0.32);
  --glow-md: 0 10px 44px rgba(122, 15, 69, 0.4), 0 0 60px rgba(213, 38, 120, 0.18);
  --glow-lg: 0 24px 90px rgba(122, 15, 69, 0.5), 0 0 130px rgba(255, 110, 196, 0.2);

  /* Type */
  --font-fa: 'Vazirmatn', Tahoma, sans-serif;
  --font-latin: 'Manrope', sans-serif;

  /* Radii */
  --radius-sm: 16px;
  --radius-md: 26px;
  --radius-lg: 34px;
  --radius-full: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 3. Base ---------- */
body {
  font-family: var(--font-fa);
  background: var(--void);
  color: var(--pearl);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

[dir="ltr"], .latin { font-family: var(--font-latin); }

::selection { background: var(--neon-violet); color: #fff; }

:focus-visible {
  outline: 2px solid var(--neon-violet);
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--neon-violet), var(--neon-magenta));
  border-radius: 10px;
}
html { scrollbar-color: var(--neon-violet) var(--void); scrollbar-width: thin; }

.skip-link {
  position: absolute;
  top: -100px;
  right: 16px;
  background: var(--pearl);
  color: var(--void);
  padding: 12px 22px;
  border-radius: 12px;
  z-index: 2000;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.3s var(--ease-out);
}
.skip-link:focus { top: 16px; }

/* Fix header to stay in the same position for both languages */
.site-header,
.header-inner {
  direction: rtl !important;
}

/* Group right header actions */
.header-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language selector - liquid glass style */
.lang-select { position: relative; }

.lang-select-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border-glass);
  color: var(--pearl);
  cursor: pointer;
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.lang-select-btn:hover,
.lang-select-btn[aria-expanded="true"] {
  border-color: var(--border-glass-strong);
  box-shadow: var(--glow-sm);
}

.lang-select-icon {
  color: var(--neon-violet);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-out);
}

.lang-select-btn[aria-expanded="true"] .lang-select-icon {
  transform: rotate(180deg);
}

.lang-select-current {
  min-width: 16px;
  text-align: center;
}

/* Positioned via JS (fixed, synced to the button's rect) so it can float over
   the header without being clipped by the header's own overflow:hidden, and
   without ever expanding the header's height. */
.lang-dropdown.glass-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 84px;
  padding: 6px;
  margin: 0;
  list-style: none;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.94);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0.25s;
  z-index: 200;
}

.lang-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.lang-dropdown li {
  padding: 9px 0;
  border-radius: 11px;
  font-family: var(--font-latin);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--mist);
  cursor: pointer;
  text-align: center;
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out);
}

.lang-dropdown li:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--pearl);
}

.lang-dropdown li[aria-selected="true"] {
  background: linear-gradient(135deg, var(--neon-violet), var(--neon-magenta));
  color: #fff;
  box-shadow: var(--glow-sm);
}

/* Fix button icons for LTR */
[dir="ltr"] .btn-icon,
[dir="ltr"] .bio-link svg {
  transform: scaleX(-1);
}

[dir="ltr"] .btn:hover .btn-icon {
  transform: scaleX(-1) translateX(5px);
}

[dir="ltr"] .bio-link:hover svg {
  transform: scaleX(-1) translateX(6px);
}


/* Anchor offset so the fixed glass header never overlaps section tops */
section[id] { scroll-margin-top: 110px; }

/* ---------- 4. Ambient Background ---------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, var(--void-2), var(--void) 60%);
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  will-change: transform;
  animation: auroraFloat 24s ease-in-out infinite;
}
.aurora--one {
  width: 640px; height: 640px;
  background: radial-gradient(circle, var(--neon-violet), transparent 70%);
  top: -12%; right: -8%;
}
.aurora--two {
  width: 560px; height: 560px;
  background: radial-gradient(circle, var(--neon-magenta), transparent 70%);
  bottom: -10%; left: -12%;
  animation-delay: -8s;
}
.aurora--three {
  width: 460px; height: 460px;
  background: radial-gradient(circle, var(--neon-blue), transparent 70%);
  top: 42%; left: 38%;
  animation-delay: -16s;
  opacity: 0.35;
}
@keyframes auroraFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-50px, 40px) scale(1.1); }
  66% { transform: translate(40px, -30px) scale(0.92); }
}

.noise-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%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");
}

/* ---------- 5. Glass Panel Utility (signature element) ---------- */
.glass-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    inset 0 -12px 24px -12px rgba(122, 15, 69, 0.25),
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(122, 15, 69, 0.1);
  overflow: hidden;
  isolation: isolate;
}
/* Specular sheen sweep — the "liquid glass" light-pass signature */
.glass-panel::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -70%;
  width: 55%;
  height: 220%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: rotate(15deg);
  transition: right 1.3s var(--ease-out);
  pointer-events: none;
  z-index: 2;
}
.glass-panel:hover::before { right: 150%; }
/* Bright top edge — glossy rim highlight */
.glass-panel::after {
  content: '';
  position: absolute;
  top: 0; right: 8%; left: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  z-index: 2;
}

/* ---------- 6. Typography & Section Scaffolding ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border-glass);
  font-size: 14px;
  font-weight: 500;
  color: var(--mist);
}
.eyebrow--center { display: flex; width: fit-content; margin-inline: auto; }
.eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gradient-brand);
  box-shadow: 0 0 10px var(--neon-violet);
  flex-shrink: 0;
}

.section-head { text-align: center; max-width: 720px; margin: 0 auto 64px; }
.section-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  margin-top: 18px;
  letter-spacing: -0.01em;
}
.section-desc { color: var(--mist); margin-top: 14px; font-size: 17px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 34px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-out), background 0.4s;
  white-space: nowrap;
}
.btn--primary { background: var(--gradient-brand); color: #fff; box-shadow: var(--glow-md); }
.btn--primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--glow-lg); }
.btn--glass {
  background: var(--surface);
  border: 1px solid var(--border-glass);
  color: var(--pearl);
  backdrop-filter: blur(14px);
}
.btn--glass:hover {
  background: var(--surface-strong);
  box-shadow: var(--glow-sm);
  transform: translateY(-3px);
  border-color: var(--border-glass-strong);
}
.btn--ghost {
  padding: 11px 24px;
  background: var(--surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--pearl);
  transition: all 0.3s var(--ease-out);
}
.btn--ghost:hover { background: var(--gradient-brand); border-color: transparent; box-shadow: var(--glow-sm); }
.btn-icon { transition: transform 0.3s var(--ease-out); }
.btn:hover .btn-icon { transform: translateX(-5px); }

/* ---------- 7. Scroll Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; inset-inline: 0;
  z-index: 100;
  padding: 20px clamp(16px, 4vw, 48px);
  transition: padding 0.4s var(--ease-out);
}
.header-inner.glass-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 12px 10px 24px;
  border-radius: var(--radius-full);
}
.site-header.is-scrolled { padding-top: 12px; }
.site-header.is-scrolled .header-inner.glass-panel { box-shadow: var(--glow-md); }

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark img {
  width: 100%; height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.3; }
.logo-text { font-weight: 700; font-size: 16px; }
.logo-text em {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  color: var(--mist);
}

.main-nav ul { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative;
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  color: var(--mist);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.3s, background 0.3s;
}
.nav-link:hover { color: var(--pearl); background: rgba(255, 255, 255, 0.06); }
.nav-link.is-active { color: var(--pearl); background: rgba(213, 38, 120, 0.16); }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  flex-shrink: 0;
}
.menu-toggle span { width: 22px; height: 2px; background: var(--pearl); border-radius: 2px; transition: all 0.3s var(--ease-out); }
.menu-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 160px 24px 100px;
  text-align: center;
  overflow: hidden;
}
.hero-lines-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 0%, black 52%, transparent 86%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 52%, transparent 86%);
}
.hero-inner {
  position: relative;
  z-index: 2;
}
.floating-lines-container {
  width: 100%;
  height: 100%;
  /* Only the glowing lines should show — screen blend drops the canvas's
     black background out so the aurora backdrop reads through underneath. */
  mix-blend-mode: screen;
}
.floating-lines-container canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}
.hero-lines-fallback {
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 20% 20%, rgba(213, 38, 120, 0.18), transparent 15%),
    radial-gradient(circle at 80% 25%, rgba(213, 38, 120, 0.16), transparent 15%),
    radial-gradient(circle at 50% 75%, rgba(255, 110, 196, 0.12), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 20%),
    linear-gradient(120deg, rgba(213, 38, 120, 0.08), transparent 18%),
    linear-gradient(240deg, rgba(213, 38, 120, 0.06), transparent 22%);
  background-size: cover;
  animation: hero-lines-fallback-glow 8s ease-in-out infinite alternate;
}
@keyframes hero-lines-fallback-glow {
  from { filter: brightness(1); }
  to { filter: brightness(1.14); }
}

.hero-inner { position: relative; z-index: 2; max-width: min(900px, calc(100vw - 40px)); width: 100%; display: flex; flex-direction: column; align-items: center; }
.hero-inner > * + * { margin-top: 26px; }

.hero-title {
  display: flex; flex-direction: column; gap: 6px;
  max-width: 100%;
}
.hero-title-small { font-size: clamp(20px, 3vw, 28px); font-weight: 500; color: var(--mist); }
.hero-title-big {
  white-space: nowrap;
  font-size: clamp(44px, 9vw, 90px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: #fff;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
  filter: drop-shadow(0 0 30px rgba(213, 38, 120, 0.35));
  animation: none;
}

[dir="rtl"] .hero-title-big {
  font-weight: 900;
}
@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 45px rgba(213, 38, 120, 0.45)); }
  50% { filter: drop-shadow(0 0 75px rgba(255, 110, 196, 0.55)); }
}

.hero-subtitle { max-width: min(620px, 100%); color: white; font-size: 18px; line-height: 2; }

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

.hero-stats { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; width: min(100%, 860px); }
.stat-card.glass-panel {
  display: flex; flex-direction: column; align-items: center;
  padding: 26px 30px;
  border-radius: var(--radius-md);
  min-width: 148px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), box-shadow 0.4s;
}
.hero-stats.is-visible .stat-card { opacity: 1; transform: translateY(0); }
.hero-stats.is-visible .stat-card:nth-child(1) { transition-delay: .05s; }
.hero-stats.is-visible .stat-card:nth-child(2) { transition-delay: .13s; }
.hero-stats.is-visible .stat-card:nth-child(3) { transition-delay: .21s; }
.hero-stats.is-visible .stat-card:nth-child(4) { transition-delay: .29s; }
.stat-card:hover { box-shadow: var(--glow-md); }
.stat-number {
  font-size: 38px; font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline;
}
.stat-suffix { font-size: 22px; font-weight: 700; color: var(--neon-violet); margin-inline-start: 2px; }
.stat-label { display: block; font-size: 13px; color: var(--mist); margin-top: 8px; }

.scroll-cue {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid var(--border-glass-strong);
  border-radius: var(--radius-full);
  display: flex; justify-content: center; padding-top: 8px;
}
.scroll-cue span {
  width: 4px; height: 8px;
  border-radius: 2px;
  background: var(--neon-violet);
  box-shadow: 0 0 8px var(--neon-violet);
  animation: cueMove 1.8s ease-in-out infinite;
}
@keyframes cueMove {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about { padding: 80px 24px 130px; max-width: 1280px; margin: 0 auto; position: relative; }

.about-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 64px; align-items: start; }

.about-bio { position: relative; padding: 12px 20px; }
.quote-mark {
  position: absolute;
  top: -38px; right: -6px;
  font-size: 130px;
  font-family: Georgia, serif;
  color: rgba(213, 38, 120, 0.18);
  line-height: 1;
  z-index: -1;
}
.about-bio p { color: var(--mist); font-size: 16.5px; line-height: 2; margin-bottom: 20px; }
.about-bio p:first-of-type { color: var(--pearl); font-size: 19px; font-weight: 500; }
.bio-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--neon-violet); font-weight: 700;
  text-decoration: none; margin-top: 8px;
}
.bio-link svg { transition: transform 0.3s var(--ease-out); }
.bio-link:hover svg { transform: translateX(-6px); }

.about-skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skill-card.glass-panel {
  padding: 30px 26px;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-out), background 0.5s;
  opacity: 0; transform: translateY(20px);
}
.about-skills.is-visible .skill-card { opacity: 1; transform: translateY(0); }
.about-skills.is-visible .skill-card:nth-child(1) { transition-delay: .05s; }
.about-skills.is-visible .skill-card:nth-child(2) { transition-delay: .11s; }
.about-skills.is-visible .skill-card:nth-child(3) { transition-delay: .17s; }
.about-skills.is-visible .skill-card:nth-child(4) { transition-delay: .23s; }
.about-skills.is-visible .skill-card:nth-child(5) { transition-delay: .29s; }
.about-skills.is-visible .skill-card:nth-child(6) { transition-delay: .35s; }
.skill-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--glow-md);
  background: linear-gradient(160deg, rgba(213, 38, 120, 0.22), rgba(255, 110, 196, 0.06));
}
.skill-icon {
  display: flex; width: 54px; height: 54px;
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(213, 38, 120, 0.28), rgba(255, 110, 196, 0.14));
  align-items: center; justify-content: center;
  color: var(--neon-violet);
  margin-bottom: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.skill-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.skill-card p { font-size: 14px; color: var(--mist); line-height: 1.75; }

/* ==========================================================================
   GALLERY
   ========================================================================== */
.gallery { padding: 130px 24px 150px; max-width: 1400px; margin: 0 auto; }

.gallery-filters { display: flex; gap: 12px; justify-content: center; margin-bottom: 52px; flex-wrap: wrap; }
.filter-btn {
  padding: 11px 26px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
  color: var(--mist);
  font-family: inherit; font-weight: 600; font-size: 14.5px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}
.filter-btn:hover { color: var(--pearl); border-color: var(--border-glass-strong); }
.filter-btn.is-active { background: var(--gradient-brand); color: #fff; border-color: transparent; box-shadow: var(--glow-sm); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  align-items: start; /* مهم: نذار آیتم‌ها کش بیان و ارتفاعشون به هم بخوره */
}

/* دیگه لازم نیست — این دو کلاس رو از CSS حذف کن: */
/* .gallery-item.item--wide { grid-column: span 2; } */
/* .gallery-item.item--tall { grid-row: span 2; } */

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-glass);
  isolation: isolate;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.5s var(--ease-spring), box-shadow 0.4s;
}
.gallery-grid.is-visible .gallery-item { opacity: 1; transform: translateY(0); }
.gallery-grid.is-visible .gallery-item:nth-child(1) { transition-delay: .04s; }
.gallery-grid.is-visible .gallery-item:nth-child(2) { transition-delay: .09s; }
.gallery-grid.is-visible .gallery-item:nth-child(3) { transition-delay: .14s; }
.gallery-grid.is-visible .gallery-item:nth-child(4) { transition-delay: .19s; }
.gallery-grid.is-visible .gallery-item:nth-child(5) { transition-delay: .24s; }
.gallery-grid.is-visible .gallery-item:nth-child(6) { transition-delay: .29s; }
.gallery-grid.is-visible .gallery-item:nth-child(7) { transition-delay: .34s; }
.gallery-grid.is-visible .gallery-item:nth-child(8) { transition-delay: .39s; }
.gallery-item.item--wide { grid-column: span 2; }
.gallery-item.item--tall { grid-row: span 2; }
.gallery-item:hover { transform: translateY(-6px) scale(1.015); box-shadow: var(--glow-md); z-index: 2; }
.gallery-item.is-filtered-out {
  opacity: 0 !important;
  transform: scale(0.85) !important;
  pointer-events: none;
  position: absolute;
  width: 0; height: 0;
  overflow: hidden;
}

.gallery-item::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.22) 45%, transparent 60%);
  transform: translateX(-130%);
  transition: transform 0.9s var(--ease-out);
  z-index: 3;
  pointer-events: none;
}
.gallery-item:hover::before { transform: translateX(130%); }

.gallery-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px; /* فقط یه fallback برای وقتی عکس واقعی هنوز لود نشده/شکسته‌ست */
  background-size: cover;
  background-position: center;
}
.gallery-media img,
.gallery-media video {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto; /* این خط کلیدیه: ارتفاع کارت از ratio خود عکس/ویدیو میاد، نه یک سایز ثابت */
}
.media-glyph { position: absolute; inset: 0; z-index: 0; display: flex; justify-content: center; color: rgba(255, 255, 255, 0.5); filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.25)); }

.gm--1 { background: linear-gradient(135deg, #6b0f3e, #d52678 55%, #2c0616); }
.gm--2 { background: linear-gradient(140deg, #ca3a86, #ff2f93 55%, #34104f); }
.gm--3 { background: linear-gradient(160deg, #a3125f, #2b0a1c); }
.gm--4 { background: linear-gradient(140deg, #ff2f93, #7a1150); }
.gm--5 { background: linear-gradient(125deg, #c2185b, #ff6ec4); }
.gm--6 { background: linear-gradient(150deg, #4a1263, #ff2f93); }
.gm--7 { background: linear-gradient(140deg, #8a0f4c, #ffa8d6); }
.gm--8 { background: linear-gradient(135deg, #29061c, #d52678); }
.gm--9 { background: linear-gradient(145deg, #ff6ec4, #8a0f4c 60%, #24040f); }
.gm--10 { background: linear-gradient(155deg, #d52678, #4a1263); }

.gallery-caption {
  position: absolute; inset-inline: 0; bottom: 0;
  padding: 22px;
  background: linear-gradient(0deg, rgba(7, 2, 6, 0.85), transparent);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 4;
  transform: translateY(65%);
  opacity: 0;
  transition: all 0.4s var(--ease-out);
}
.gallery-item:hover .gallery-caption,
.gallery-item:focus-visible .gallery-caption { transform: translateY(0); opacity: 1; }
.gallery-tag {
  align-self: flex-start;
  font-size: 11px; font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  color: #fff;
}
.gallery-caption h3 { font-size: 15px; font-weight: 700; color: #fff; }

/* ==========================================================================
   COLLAB / FORM
   ========================================================================== */
.collab { padding: 130px 24px 150px; position: relative; }
.collab-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }

.collab-desc { color: var(--mist); line-height: 1.95; margin: 20px 0 30px; font-size: 16.5px; max-width: 480px; }
.collab-points { display: flex; flex-direction: column; gap: 16px; }
.collab-points li { display: flex; align-items: center; gap: 12px; color: var(--pearl); font-weight: 500; font-size: 15.5px; }
.point-icon { color: var(--neon-magenta); font-size: 15px; text-shadow: 0 0 10px var(--neon-magenta); }

.collab-form.glass-panel { padding: 42px; display: flex; flex-direction: column; gap: 22px; border-radius: var(--radius-lg); }
.form-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); left: -9999px; }
.form-row { display: flex; flex-direction: column; gap: 9px; }
.form-row label { font-size: 14px; font-weight: 600; color: var(--mist); }
.form-row input, .form-row select, .form-row textarea {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border-glass);
  border-radius: 15px;
  padding: 14px 18px;
  color: var(--pearl);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.3s var(--ease-out);
  resize: vertical;
}
#contactInfo {
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  -webkit-appearance: none;
  appearance: none;
}
#content-wrapper[dir="ltr"] #contactInfo {
  direction: ltr;
  text-align: left;
}
#contactInfo::-webkit-outer-spin-button,
#contactInfo::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--mist-dim); }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--neon-violet);
  box-shadow: 0 0 0 4px rgba(213, 38, 120, 0.16), 0 0 26px rgba(213, 38, 120, 0.28);
  background: rgba(255, 255, 255, 0.065);
}
.form-row select option { background: #150c24; color: var(--pearl); }
.form-submit { justify-content: center; margin-top: 6px; }
.form-status { text-align: center; font-size: 14px; min-height: 20px; color: var(--neon-violet); font-weight: 600; }
.form-status.is-error { color: #ff6b6b; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact { padding: 40px 24px 150px; max-width: 1160px; margin: 0 auto; }
.contact-panel.glass-panel {
  padding: clamp(34px, 5vw, 64px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 48px;
  align-items: center;
  border-radius: var(--radius-lg);
}
.contact-brand { text-align: center; }
.logo-mark--lg { width: 108px; height: 108px; margin: 0 auto 16px; }
.contact-brand h2 { font-size: 27px; font-weight: 800; }
.contact-brand p { color: var(--mist); font-size: 14px; margin-top: 6px; }

.contact-details { display: flex; flex-direction: column; gap: 20px; }
.detail-item { display: flex; align-items: center; gap: 15px; text-decoration: none; color: inherit; }
.detail-icon {
  width: 46px; height: 46px;
  border-radius: 15px;
  background: rgba(213, 38, 120, 0.14);
  display: flex; align-items: center; justify-content: center;
  color: var(--neon-violet);
  flex-shrink: 0;
  transition: all 0.35s var(--ease-out);
}
.detail-text { display: flex; flex-direction: column; gap: 3px; }
.detail-text strong { font-size: 12.5px; color: var(--mist); font-weight: 600; }
.detail-text span:last-child { font-size: 15px; font-weight: 600; color: var(--pearl); }
a.detail-item:hover .detail-icon { background: var(--gradient-brand); color: #fff; box-shadow: var(--glow-sm); transform: scale(1.06); }

.contact-socials { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.socials-label { font-size: 13px; color: var(--mist); font-weight: 600; }
.social-list { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.social-btn {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--pearl);
  transition: all 0.35s var(--ease-out);
}
.social-btn:hover { background: var(--gradient-brand); color: #fff; transform: translateY(-4px); box-shadow: var(--glow-md); border-color: transparent; }

/* Raster icons (Bale, Rubika) recolored via mask so they behave exactly
   like the inline SVG icons — same currentColor + hover transition. */
.social-icon-mask {
  display: inline-block;
  width: 19px; height: 19px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.35s var(--ease-out);
}
.social-icon-mask--bale { -webkit-mask-image: url('assets/icons/bale.png'); mask-image: url('assets/icons/bale.png'); }
.social-icon-mask--rubika { -webkit-mask-image: url('assets/icons/rubika.png'); mask-image: url('assets/icons/rubika.png'); }
.social-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 124%; left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #26101c;
  color: var(--pearl);
  padding: 6px 13px;
  border-radius: 9px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s var(--ease-out);
  border: 1px solid var(--border-glass);
}
.social-btn:hover[data-tooltip]::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  text-align: center;
  padding: 34px 24px;
  color: var(--mist-dim);
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 1;
}
.site-footer .signature { margin-top: 6px; font-family: var(--font-latin); font-size: 12px; letter-spacing: 0.03em; }
.site-footer .signature span:last-child { color: var(--neon-violet); font-weight: 700; }

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease-out);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(8, 3, 7, 0.85); backdrop-filter: blur(10px); }
.lightbox-content.glass-panel {
  position: relative;
  max-width: 620px; width: 100%;
  padding: 26px;
  border-radius: var(--radius-lg);
  transform: scale(0.9);
  transition: transform 0.4s var(--ease-spring);
}
.lightbox.is-open .lightbox-content { transform: scale(1); }
.lightbox-media {
  border-radius: 20px;
  overflow: hidden;
  /* Allow the lightbox to size based on the image/video rather than forcing a 4:3 crop */
  aspect-ratio: auto;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.lightbox-close {
  position: absolute; top: -14px; left: -14px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff; border: none; font-size: 20px;
  cursor: pointer;
  box-shadow: var(--glow-sm);
  z-index: 5;
}
.lightbox-caption { text-align: center; color: var(--pearl); font-weight: 600; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-skills { grid-template-columns: repeat(2, 1fr); }
  .collab-inner { grid-template-columns: 1fr; }
  .collab-desc { max-width: none; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-panel.glass-panel { grid-template-columns: 1fr; text-align: center; }
  .contact-details { align-items: center; }
  .detail-item { flex-direction: column; text-align: center; }
}

@media (max-width: 768px) {
  .main-nav, .header-cta { display: none; }
  .menu-toggle { display: flex; }
  .main-nav {
    position: fixed; inset: 0;
    background: rgba(10, 5, 9, 0.97);
    backdrop-filter: blur(30px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s var(--ease-out);
    z-index: 99;
  }
  .main-nav.is-open { opacity: 1; visibility: visible; display: flex; }
  .main-nav ul { flex-direction: column; gap: 28px; text-align: center; }
  .main-nav a { font-size: 22px; }

  .hero { padding: 120px 20px 72px; }
  .hero-inner { padding: 0 10px; }
  .hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 14px; }
  .stat-card.glass-panel { min-width: 0; }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 190px; }
  .about-skills { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item.item--wide, .gallery-item.item--tall { grid-column: span 1; grid-row: span 1; }
  .hero { padding:110px 16px 60px; }
  .hero-inner { padding: 0 8px; }
  .hero-title { max-width: 100%; }
  .hero-title-small { font-size: clamp(18px, 4vw, 24px); }
  .hero-title-big { font-size: clamp(28px, 12vw, 52px); line-height: 1.05; }
  .hero-subtitle { font-size: 15px; line-height: 1.75; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { grid-template-columns: 1fr; gap: 12px; }
  .stat-card.glass-panel { padding: 18px 18px; }
  .stat-number { font-size: 30px; }
  .stat-suffix { font-size: 16px; }
  .stat-label { font-size: 12px; }
}