:root {
  --primary-color: #3fa49b;
  --primary-dark: #0d4c44;
  --primary-light: #17836e;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #334155;
  --text-light: #ffffff;
  --shadow: 0 7px 20px -1px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.3, 0.8, 0.25, 1);
  --radius: 14px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --primary-color: #17836e;
  --primary-dark: #0d4c44;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-color: #e2e8f0;
  --text-light: #f1f5f9;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  outline: none;
}
/* ----------  فونت‌ها  ---------- */
@font-face {
    font-family: 'BNazanin';
    src: url('www.cmobl.ir/font/BNazanin.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'TitrDF';
    src: url('www.cmobl.ir/font/TitrDF.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Parastoo';
    src: url('www.cmobl.ir/font/Parastoo.woff2') format('woff2'),
         url('www.cmobl.ir/font/Parastoo-Bold.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Pixelboy-BNazanin';
    src: url('www.cmobl.ir/font/pixelboy-BNazanin.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Vazir';
    src: url('www.cmobl.ir/font/Vazir-Bold.woff2') format('woff2'),
         url('www.cmobl.ir/font/Vazir-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Yekan';
    src: url('www.cmobl.ir/font/Yekan.woff') format('woff'),
         url('www.cmobl.ir/font/yekan-regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

body {
  font-family: 'BNazanin, 'Yekan', 'Vazir','TitrDF','Parastoo';
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  transition: background-color 0.5s ease, color 0.5s ease;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Banner --- */

.main-banner {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.main-banner img {
  width: 100%;
  display: block;
}

/* --- Hero Section --- */

.hero-section {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeIn 0.8s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.profile-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 20px;
}

.profile-img {
  width: 90%;
  height:90%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card-bg);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.mrcode-rotate:hover .profile-img {
  transform: rotate(10deg) scale(1.05);
  border-color: var(--primary-color);
}

.quote-box {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 20px 0;
  border-right: 4px solid var(--accent-color);
  font-style: italic;
}

/* --- Social Bar --- */

.social-bar {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  background: var(--card-bg);
  padding: 15px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  position: relative;
  z-index: 50;
}

.social-item {
  width:80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.social-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transition: var(--transition);
}

.social-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.social-item:hover img {
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--primary-color);
}

/* --- Gallery Grid --- */

.gallery-section {
  width: 100%;
  margin-bottom: 50px;
}

.section-header {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--primary-dark);
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
  padding-bottom: 5px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
  transition: var(--transition);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  z-index: 2;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* --- Text Content --- */

.content-text {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 40px;
  text-align: justify;
  width: 100%;
}

.content-text h3 {
  color: var(--primary-color);
  text-align: center;
  margin-top: 0;
}
.content-text h1 {
  color: var(--primary-color);
  text-align: center;
  margin-top: 0;
}

/* --- Footer & CTA --- */

.footer-info {
  text-align: center;
  margin: 20px 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.cta-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  width: 100%;
  margin-bottom: 30px;
}

.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: var(--card-bg);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-color);
  font-weight: bold;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 2px solid transparent;
}

.cta-btn:hover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
}

.cta-btn img {
  width: 40px;
  height: 40px;
  margin-left: 10px;
  border-radius: 8px;
}

/* --- Settings Menu --- */

.settings-btn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  z-index: 1000;
  transition: var(--transition);
  border: none;
}

.settings-btn:hover {
  transform: rotate(90deg) scale(1.1);
  background: var(--primary-dark);
}

.settings-panel {
  position: fixed;
  bottom: 100px;
  left: 30px;
  width: 300px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  z-index: 999;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.5);
}

[data-theme="dark"] .settings-panel {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255,255,255,0.1);
}

.settings-panel.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding-bottom: 10px;
}

.setting-item {
  margin-bottom: 15px;
}

.setting-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.settings-title {
  font-weight: bold;
  font-size: 1.1rem;
}

/* Toggle Switch */

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Range Slider */

input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  background: transparent;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  margin-top: -6px;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: #ddd;
  border-radius: 2px;
}

/* Animations */

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

.reduce-motion * {
  animation: none !important;
  transition: none !important;
}

/* Responsive */

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.8rem;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .settings-btn {
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
  }
  .settings-panel {
    bottom: 80px;
    left: 20px;
    width: calc(100% - 40px);
  }
}

.card-overlay {
  position: absolute;
  top: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  width: 260px;
  background: rgba(13, 76, 68, 0.95);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  padding: 15px;
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  z-index: 100;
  line-height: 1.8;
  pointer-events: none;
}

.card-overlay::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: transparent transparent rgba(13, 76, 68, 0.95) transparent;
}

/* --- Projects Grid --- */

.section-title {
  font-size: 1.8rem;
  margin-bottom: 25px;
  position: relative;
  display: inline-block;
  color: var(--primary-dark);
}

.section-title::after {
  content: '';
  display: block;
  width: 50%;
  height: 4px;
  background: var(--primary-color);
  margin: 5px auto 0;
  border-radius: 2px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  margin-bottom: 40px;
}

.project-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid transparent;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.project-link {
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-name {
  font-size: 1.7rem;
  font-weight: bold;
  margin-bottom: 15px;
  flex-grow: 1;
}

.project-count {
  background: var(--primary-color);
  color: white;
  padding: 15px;
  border-radius: 20px;
  text-align: center;
  font-weight: bold;
  font-size: 1.5rem;
  transition: var(--transition);
}

.project-card:hover .project-count {
  background: var(--primary-dark);
}

/* --- Quote Section --- */

.quote-section {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: 40px;
  width: 100%;
  border-right: 5px solid var(--primary-color);
}

.quote-text {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text-color);
}

/* --- Video & Banner --- */

.media-container {
  width: 100%;
  margin-bottom: 30px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.media-container img {
  width: 100%;
  display: block;
  transition: var(--transition);
}

.media-container:hover img {
  transform: scale(1.04);
}

/* --- Footer --- */

footer {
  text-align: center;
  margin-top: auto;
  padding: 20px;
  color: var(--text-color);
  font-size: 0.9rem;
  opacity: 0.8;
}

.card-overlay {
  width: 260px;
  font-size: 14px;
  top: 130%;
}
.card-body{
    padding:1rem;
    flex-grow:1;
    display:flex;
    flex-direction:column;
}
.card-body h2{
    font-family:'BTitrBold',sans-serif;
    font-size:1.7rem;
    margin:0 0 .5rem;
    color:var(--primary-dark);
}
.card-body .meta{
    font-size:1rem;
    line-height:1.4;
    margin-bottom:.6rem;
}
.card-body .meta span{
    display:block;
}

/* دکمه‌ها */
.actions{
    margin-top:auto;
    display:flex;
    flex-wrap:wrap;
    gap:.7rem;
}
.actions a{
    flex:1;
    text-align:center;
    padding:.4rem;
    border:2px solid var(--primary);
    border-radius:var(--radius);
    font-weight:600;
    transition:var(--transition);
    font-size:1.2rem;
}
.actions a:hover{
    background:var(--primary);
    color:#fff;
}

/* ریسپانسیو */
@media(max-width:600px){
    .gallery-header h1{font-size:1.8rem;}
}
