:root {
  --bg: #0b1020;
  --bg-soft: #11182d;
  --card: rgba(17, 24, 45, 0.72);
  --card-backdrop: rgba(17, 24, 45, 0.52);
  --border: rgba(255, 255, 255, 0.1);
  --text: #e9ecf5;
  --muted: #a8b0c7;

  --accent: #7c5cff;
  --accent-2: #34d399;
  --accent-3: #00c2ff;
  --gradient: linear-gradient(90deg, #7c5cff 0%, #00c2ff 50%, #34d399 100%);

  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;

  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}

body.light {
  --bg: #f5f7fb;
  --bg-soft: #ffffff;
  --card: rgba(255, 255, 255, 0.78);
  --card-backdrop: rgba(255, 255, 255, 0.6);
  --border: rgba(15, 23, 42, 0.15);
  --text: #111827;
  --muted: #5b6475;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@font-face {
  font-family: "byekan";
  src: url('./font/Yekan.ttf');
}

body {
  margin: 0;
  font-family: iranyekan, sans-serif, "byekan";
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(0, 194, 255, 0.12), transparent 22%),
    radial-gradient(circle at bottom, rgba(52, 211, 153, 0.08), transparent 20%),
    var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.75), transparent 90%);
}

.topbar {
  display: flex;
  justify-content: flex-end;
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(0,0,0,0.22), transparent);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-btn,
.lang-btn,
.modal-close {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover,
.lang-btn:hover,
.modal-close:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 92, 255, 0.5);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 18px;
}

.lang-btn {
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  font-weight: 700;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto 48px;
  display: grid;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 24px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 28px;
}

.avatar {
  width: 110px;
  height: 110px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.profile-text h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 44px);
}

.role {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--accent-2);
  font-weight: 700;
}

.muted,
.section-text {
  color: var(--muted);
  line-height: 1.9;
  margin: 0;
}

.section-title {
  margin: 0 0 16px;
  font-size: 1.35rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- تنظیمات گالری --- */
.docs-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto; /* فعال کردن اسکرول افقی */
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch; /* برای اسکرول بهتر در iOS */
}

.docs-scroll::-webkit-scrollbar {
  height: 8px;
}

.docs-scroll::-webkit-scrollbar-thumb {
  background: rgba(124, 92, 255, 0.45);
  border-radius: 999px;
}

.docs-item {
  flex: 0 0 auto; /* مهم: از فشرده شدن عکس‌ها جلوگیری می‌کنه */
  width: 240px; /* عرض هر آیتم گالری */
  height: 160px; /* ارتفاع هر آیتم گالری */
  object-fit: cover;
  border-radius: 18px;
  cursor: zoom-in;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.docs-item:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}
/* --- پایان تنظیمات گالری --- */

.logos {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.logo-item {
  width: 130px;
  height: 86px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  padding: 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  overflow: visible; /* برای نمایش متن بیرون کارت */

  cursor: help;

  transform: translateY(0) scale(1);
  transition: transform 840ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 800ms ease,
              box-shadow 840ms ease;
  will-change: transform;
}

.logo-item img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: saturate(1.05);
  opacity: 0.95;
}

/* Tooltip بالای کارت - تنظیمات چند خطی */
.logo-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px); /* بالای کارت + فاصله */
  transform: translate(-50%, 8px);

  width: 240px; /* عرض ثابت برای چند خطی */
  max-width: 240px; /* حداکثر عرض */

  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.14);

  color: #fff;
  font-size: 12px;
  line-height: 1.3; /* فاصله بین خطوط */

  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 200ms ease;

  white-space: normal; /* اجازه به چند خطی شدن */
  text-align: center; /* متن وسط‌چین */

  transition: opacity 160ms ease, transform 200ms ease;
}

.logo-item:hover{
  transform: translateY(-4px) scale(1.1);
  background: rgba(255,255,255,0.05);
  transition:
    transform 380ms ease,
    border-color 380ms ease,
    box-shadow 380ms ease,
    background 380ms ease;
}

/* .logo-item.is-open {
  transform: translateY(-8px) scale(1.05);
  z-index: 10;
  box-shadow: 0 14px 30px rgba(0,0,0,0.18);
} */
/* نمایش در hover و فوکوس (کیبورد) */
.logo-item:hover .logo-tooltip {
  /* on click not tooltip hover!!  */
/* .logo-item:focus .logo-tooltip { */ 
  opacity: 1;
  transform: translate(-50%, 0);
}

/* اشاره‌گر کوچک (اختیاری) */
.logo-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%; /* اشاره‌گر به سمت پایین */
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(0,0,0,0.6); /* رنگ مثلث */
}

/* اگر از قابلیت کلیک استفاده می‌کنید: */
/* .logo-item.is-open .logo-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
} */



.skills-timeline {
  display: grid;
  gap: 18px;
}

.skill-row {
  display: grid;
  grid-template-columns: 120px 1fr 70px;
  gap: 14px;
  align-items: center;
}

.skill-name,
.skill-level {
  font-weight: 700;
}

.skill-name {
  text-align: end;
  color: var(--accent-color-num);
}

.skill-level {
  text-align: start;
  /* color: var(--accent-3); */
  color: var(--accent-color-num);
}

.skill-line {
  position: relative;
  height: 2px;
  /* background: linear-gradient(90deg, transparent, var(--accent), transparent); */
  background: linear-gradient(90deg, transparent, var(--accent-color-num), transparent);
}

/* .skill-dot {
  position: absolute;
  top: 50%;
  inset-inline-start: 10%;
  inset-inline-start: var(--percent-num);
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  background: var(--accent-color-num);
  box-shadow: 0 0 0 6px rgba(124, 92, 255, 0.15);
  box-shadow: 0 0 0 6px var(--skill-dot-shadow);
} */

.skill-dot {
  position: absolute;
  top: 50%;
  inset-inline-start: var(--percent-num);
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-color-num);
  box-shadow: 0 0 0 6px var(--skill-dot-shadow);

  z-index: 2; /* برای اینکه روی خط/پس‌زمینه بایستد */
}

/* حلقه پالس */
.skill-dot::before {
  content: "";
  position: absolute;
  inset: -8px;           /* اندازه موج (بزرگ‌تر/کوچکترش کن) */
  border-radius: 50%;
  background: var(--accent-color-num);

  opacity: 0.35;
  transform: scale(0.7);
  animation: skillDotPulse 1.8s ease-out infinite;

  /* برای اینکه شکل موج تمیزتر دیده بشه */
  filter: blur(0.2px);
  z-index: -1;
}

@keyframes skillDotPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.40;
  }
  60% {
    transform: scale(1.35);
    opacity: 0.12;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}


.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal.open {
  display: flex;
}

.modal img {
  max-width: min(92vw, 1100px);
  max-height: 86vh;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-close {
  position: absolute;
  top: 22px;
  inset-inline-end: 22px;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-size: 28px;
  line-height: 1;
}

.linering {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2rem;
}

/* card image article book */
.article-docs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

/* hidden */
.extra-card {
  display: none;
}

/* show */
.article-docs.show-all .extra-card {
  display: block;
}

/* CARD */
.book-card {
  position: relative;
  width: 100px;
  height: 140px;
  border-radius: 12px;
  transition: 0.35s ease;
  cursor: help;
}

.book-card:hover {
  transform: translateY(-5px) scale(1.04);
}

/* ELECTRIC BORDER */
.electric-border {
    position: absolute;
    inset: -3px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-color-one), var(--accent-color-two), var(--accent-color-three), var(--accent-color-four));
    background-size: 300% 300%;
    animation:
        electricMove 5s linear infinite,
        electricPulse 1s ease infinite;
    filter: url(#electric-filter) blur(0.5px);
    z-index: 0;
}

/* glow */
.electric-border::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  background: inherit;
  filter: blur(14px);
  opacity: 0.9;
  z-index: -1;
}

/* image */
.book-cover {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,.08);
  z-index: 1;
  margin: -1px;
  overflow: hidden; /* مهم */
}

.ribbon-under-construction {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 15px;
  left: -35px;
  width: 120px;
  padding: 1px 0;
  text-align: center;
  font-weight: bold;
  font-size: 0.9rem; 
  color: #fefcff;
  background: #900000;
  transform: rotate(-45deg);
  z-index: 10;
}

.ribbon-publishing {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 15px;
  left: -35px;
  width: 120px;
  padding: 1px 0;
  text-align: center;
  font-weight: bold;
  font-size: 0.9rem;
  color: #fefcff;
  background: #119300;
  transform: rotate(-45deg);
  z-index: 10;
}

.ribbon-define {
  display: flex;
  position: absolute;
  bottom: 0;
  left: -15px;
  width: 130px;
  height: 1.5rem;
  justify-content: center;
  align-items: center;
  padding: 1px 0;
  text-align: center;
  font-weight: bold;
  font-size: 0.65rem;
  color: #f4ebdb;
  background: #83838398;
  /* transform: rotate(-45deg); */
  z-index: 10;
}



/* ANIMATION */
@keyframes electricMove {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 300% 50%;
  }
}

@keyframes electricPulse {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

/* GLASS BUTTON */
.expand-btn {
  margin: 30px auto 0;
  /* width: 52px;
  height: 32px; */
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.35s ease;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
  color: #00ff9d;
  font-size: 15px;
}

.expand-btn:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 0 25px rgba(0, 255, 242, 0.55);
}

/* rotate arrow */
.expand-btn.active span {
  transform: rotate(180deg);
}

.expand-btn span {
  transition: 0.35s;
}

/* MOBILE */
@media (max-width: 480px) {
  .article-docs {
    grid-template-columns: repeat(2, 90px);
  }
}

/* TABLET */
@media (min-width: 481px) and (max-width: 768px) {
  .article-docs {
    grid-template-columns: repeat(3, 90px);
  }
}

/* DESKTOP */
@media (min-width: 769px) {
  .article-docs {
    grid-template-columns: repeat(4, 90px);
  }
}
@media (max-width: 768px) {
  .profile-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .skill-row {
    grid-template-columns: 1fr;
  }

  .skill-name,
  .skill-level {
    text-align: start;
  }

  .skill-line {
    height: 12px;
    border-radius: 999px;
    /* background: linear-gradient(90deg, rgba(124, 92, 255, 0.2), rgba(124, 92, 255, 0.8)); */
    background: linear-gradient(90deg, var(--skill-dot-shadow), var(--accent-color-num);
  }

  .skill-dot {
    left: 18px;
    transform: translateY(-50%);
  }

  .docs-item {
    width: 200px;
    height: 140px;
  }

  /* --- تغییرات گلس مورفیسم برای موبایل --- */
  .card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .modal img {
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
  }
  /* ------------- */

  /* --- تنظیمات گالری برای موبایل --- */
  .docs-scroll {
    /* اطمینان از اینکه عرض کلی بیشتر از عرض صفحه نشه */
    padding-inline: 16px; /* اضافه کردن کمی padding در طرفین */
    margin-inline: -16px; /* برای اینکه padding اصلی صفحه رو بگیره */
  }
  .docs-item {
     width: 80%; /* عکس‌ها 80% عرض صفحه رو بگیرن */
     max-width: 260px; /* حداکثر عرض رو هم مشخص می‌کنیم */
     height: 180px;
  }
  /* --- پایان تنظیمات گالری برای موبایل --- */
}

