@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@600;700;800&display=swap');

:root {
  /* Core Colors - Refined Emerald Theme with Depth */
  --bg-body: #E2E8E4;
  --bg-card: #FFFFFF;
  --text-primary: #1F2D2B;
  --text-secondary: #4A5D5A;
  --accent: #10B981;
  --accent-glow: rgba(16, 185, 129, 0.3);

  /* Borders & Glass */
  --border-light: rgba(31, 45, 43, 0.1);
  --glass-border: rgba(31, 45, 43, 0.08);

  /* Spacing */
  --section-padding: 120px 0;
  /* Increased from 100px for better breathing room */
  --container-width: 1200px;

  /* Transitions */
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-secondary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}


/* Corner Glows for "Life to Edges" */
body::before,
body::after {
  content: "";
  position: fixed;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -2;
  opacity: 0.25;
  pointer-events: none;
}

body::before {
  top: -20vw;
  right: -20vw;
  background: radial-gradient(circle, #FB7185, transparent 75%);
}

body::after {
  bottom: -20vw;
  left: -20vw;
  background: radial-gradient(circle, #818CF8, transparent 75%);
}

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

h1,
h2,
h3 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography Helpers */
.accent-text {
  color: var(--accent);
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 50px;
  text-align: center;
  color: var(--text-primary);
}

/* Navigation */
nav {
  height: 80px;
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(226, 232, 228, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-light);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  transition: var(--transition-smooth);
}

.nav-links a.active {
  color: var(--accent);
}

@media (hover: hover) {
  .nav-links a:hover {
    color: var(--accent);
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--text-primary);
  color: var(--text-primary);
}

.btn-telegram:hover {
  background-color: #0891B2 !important;
  border-color: #0891B2 !important;
  color: white !important;
  box-shadow: 0 10px 20px rgba(8, 145, 178, 0.2);
}

.btn-secondary:hover {
  background-color: var(--text-primary);
  color: white;
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Work Cards */
.work-card {
  background: var(--bg-card);
  padding: 35px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(31, 45, 43, 0.03);
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.work-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(31, 45, 43, 0.07);
  border-color: var(--accent) !important;
  background: #FFFFFF;
}

.logo-container {
  width: 60px;
  height: 60px;
  margin-bottom: 25px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: transform 0.4s ease, border-color 0.4s ease;
  padding: 10px;
}

.work-card:hover .logo-container {
  border-color: var(--accent);
  transform: rotate(-5deg) scale(1.1);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.experience-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 20px;
  cursor: default;
}

/* Updated Click Hint as Button */
.click-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 15px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.click-hint:hover {
  background: var(--accent);
  color: white;
}


@media (max-width: 768px) {

  /* Mobile Nav Fix - Header Row + Links Row */
  nav {
    height: auto;
    padding: 10px 0;
    /* Compact padding */
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-light);
  }

  nav .container {
    flex-wrap: wrap;
    /* Allow wrapping */
    justify-content: space-between;
    /* Logo Left, Button Right */
    align-items: center;
    gap: 10px;
  }

  .logo {
    font-size: 1rem;
    /* Reduced size */
    width: auto;
    text-align: left;
    margin: 0;
    order: 1;
  }

  /* Show Contact Button on Mobile */
  .nav-cta {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.8rem !important;
    order: 2;
  }

  /* Links on second row */
  .nav-links {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    padding: 5px 0 0 0;
    justify-content: center;
    /* Center the links */
    width: 100%;
    order: 3;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    /* Subtle separator */
    margin-top: 5px;
  }

  .nav-links a {
    font-weight: 500;
  }

  .hero-content h1 {
    font-size: 2.5rem !important;
    /* Slightly smaller to prevent overflow */
  }
}

/* About Section Styles */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 60px;
  align-items: start;
}

.about-image {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(31, 45, 43, 0.05);
  max-width: 280px;
  /* Reduced from default */
  margin: 0 auto;
}


.about-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.about-text .section-title {
  text-align: left;
  margin-bottom: 30px;
}

.about-text p {
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .about-image {
    margin: 0 auto;
    width: 80%;
    /* Smaller image on mobile */
    max-width: 300px;
  }

  .about-text .section-title {
    text-align: center;
  }

  .about-text p {
    font-size: 1rem;
    line-height: 1.6;
  }
}

/* Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  overflow: hidden;
  /* Overlay does not scroll */
  z-index: 2500;
}

.modal-inner {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 50px 20px;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-card);
  width: 90%;
  max-width: 700px;
  padding: 50px;
  border-radius: 30px;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  box-shadow: 0 40px 100px rgba(31, 45, 43, 0.1);
  border: 1px solid var(--border-light);
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

@media (max-width: 768px) {
  .modal-content {
    padding: 30px 20px;
    border-radius: 20px;
    width: 95%;
  }

  .modal-header h3 {
    font-size: 1.4rem !important;
  }

  .modal-description {
    font-size: 0.95rem;
    line-height: 1.6;
  }
}

.modal-content.rotate-out-next {
  animation: rotateOutNext 0.4s forwards;
}

.modal-content.rotate-in-next {
  animation: rotateInNext 0.4s forwards;
}

.modal-content.rotate-out-prev {
  animation: rotateOutPrev 0.4s forwards;
}

.modal-content.rotate-in-prev {
  animation: rotateInPrev 0.4s forwards;
}

@keyframes rotateOutNext {
  0% {
    transform: scale(1) rotateY(0);
    opacity: 1;
  }

  100% {
    transform: scale(0.8) rotateY(-90deg);
    opacity: 0;
  }
}

@keyframes rotateInNext {
  0% {
    transform: scale(0.8) rotateY(90deg);
    opacity: 0;
  }

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

@keyframes rotateOutPrev {
  0% {
    transform: scale(1) rotateY(0);
    opacity: 1;
  }

  100% {
    transform: scale(0.8) rotateY(90deg);
    opacity: 0;
  }
}

@keyframes rotateInPrev {
  0% {
    transform: scale(0.8) rotateY(-90deg);
    opacity: 0;
  }

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

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 25px;
  right: 25px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--accent);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.modal-logo {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--border-light);
  padding: 10px;
  object-fit: contain;
}

#modal-body h3 {
  font-size: 1.8rem;
  margin-bottom: 5px;
  color: var(--text-primary);
}

#modal-body .modal-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
  cursor: default;
}

.modal-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.modal-samples-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-samples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.sample-placeholder {
  aspect-ratio: 16/9;
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.sample-placeholder:hover {
  background: #e2e8f0;
  border-color: var(--accent);
  color: var(--accent);
}

.modal-sample-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  transition: transform 0.3s ease;
  border: 1px solid var(--border-light);
}

.modal-sample-img:hover {
  border-color: var(--accent);
}

.sample-image-container {
  overflow: hidden;
  border-radius: 12px;
}

.service-card ul {
  list-style-position: outside;
}

/* Modal Navigation Buttons */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 1px solid var(--border-light);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2001;
  transition: var(--transition-smooth);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
  backdrop-filter: blur(5px);
}

.nav-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}

.prev-btn {
  left: 40px;
}

.next-btn {
  right: 40px;
}

@media (max-width: 900px) {
  .nav-btn {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
  }

  .prev-btn {
    left: 15px;
  }

  .next-btn {
    right: 15px;
  }
}

/* Skills Section */
#skills {
  background: rgba(241, 247, 244, 0.4) !important;
  backdrop-filter: blur(5px);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

@media (max-width: 900px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}


/* Skills Section Hover Effects */
.skill-icon-container {
  width: 50px;
  height: 50px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: var(--transition-smooth);
}

.skill-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
  transition: var(--transition-smooth);
}

.service-card:hover .skill-icon-container {
  background: var(--accent);
  transform: scale(1.1) rotate(5deg);
}

.service-card:hover .skill-icon {
  color: white;
}

.service-card {
  background: #FFFFFF !important;
  border: 1px solid var(--border-light) !important;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(31, 45, 43, 0.07);
  border-color: var(--accent) !important;
  background: #FFFFFF !important;
}

/* Stats Section Styles */
.stats-section {
  background: #0F172A;
  /* Dark navy background like the image */
  padding: 50px 0;
  /* Reduced from 80 */
  margin: 30px 0;
  /* Reduced from 40 */
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}


.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.stat-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 25px 20px;
  /* Reduced from 40x30 */
  border-radius: 20px;
  text-align: center;
  transition: var(--transition-smooth);
}


.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  background: rgba(30, 41, 59, 0.8);
}

.stat-icon {
  width: 60px;
  height: 60px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--accent);
}

.stat-icon i {
  width: 24px;
  height: 24px;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: white;
  display: inline-block;
}

.stat-card h3 {
  color: white;
  font-size: 2.8rem;
  margin-bottom: 10px;
}

.stat-card p {
  color: #94A3B8;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .stat-card {
    padding: 30px 20px;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .stat-card h3 {
    font-size: 2.3rem;
  }
}