/* Outfit Font - Self-Hosted */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* New Soft-Premium Light Theme Variables */
  --bg-color: #fafaf9; /* Warm Bone White */
  --text-color: #2d3748; /* Indigo Slate */
  --text-muted: #4a5568; /* Darker Slate for contrast */
  
  /* Soft Indigo-Purple Gradient Accent */
  --accent-color: #4f46e5; /* Darker Indigo for visibility */
  --accent-gradient: linear-gradient(135deg, #4f46e5, #9333ea);
  --accent-glow: rgba(79, 70, 229, 0.2);
  
  /* Refined Glassmorphism (Softer/Premium) */
  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.8);
  --nav-bg: rgba(250, 250, 249, 0.8);

  --shadow-sm: 0 4px 6px -1px rgba(99, 102, 241, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(99, 102, 241, 0.08);
  --shadow-hover: 0 25px 35px -5px rgba(99, 102, 241, 0.15);
  
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark {
  /* Dark Theme Variables */
  --bg-color: #0d1117;
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Vibrant Purple-Cyan Gradient Accent */
  --accent-color: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #60a5fa, #c084fc);
  --accent-glow: rgba(192, 132, 252, 0.35);
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(30, 41, 59, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --nav-bg: rgba(13, 17, 23, 0.85);

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 20px 25px -5px var(--accent-glow), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floatAvatar {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}



@keyframes meshRotate {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(10vw, 10vh) rotate(180deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

@keyframes meshRotateAlt {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-10vw, 5vh) rotate(-180deg); }
  100% { transform: translate(0, 0) rotate(-360deg); }
}

@keyframes glintShimmer {
  0% { transform: translateX(-150%) skewX(-25deg); }
  100% { transform: translateX(150%) skewX(-25deg); }
}



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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: var(--transition-smooth);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Premium Grain Texture Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

body.dark::before {
  opacity: 0.05;
}

/* Reveal transition classes */
.reveal-on-scroll {
  opacity: 0 !important;
  transform: translateY(30px) !important;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) !important;
  will-change: opacity, transform;
}

.reveal-on-scroll.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-gradient);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Background mesh blobs */
.mesh-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 65vw;
  height: 65vw;
  border-radius: 50%;
  opacity: 0.25; /* Slightly higher base opacity since radial-gradient fades out */
  transition: var(--transition-smooth);
  will-change: transform;
}
.blob-1 {
  top: -10%;
  left: -10%;
  background: radial-gradient(circle closest-side, #fbbf24 0%, transparent 100%);
  animation: meshRotate 25s infinite linear;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  background: radial-gradient(circle closest-side, #6366f1 0%, transparent 100%);
  animation: meshRotateAlt 30s infinite linear;
}

.blob-3 {
  top: 40%;
  right: 15%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle closest-side, #d8b4fe 0%, transparent 100%);
  animation: meshRotate 35s infinite linear reverse;
}

body.dark .blob-2 { background: radial-gradient(circle closest-side, #60a5fa 0%, transparent 100%); }
body.dark .blob-1 { background: radial-gradient(circle closest-side, #8b5cf6 0%, transparent 100%); }
body.dark .blob { opacity: 0.2; }

/* Main Container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Navigation / Lang Switch */
.lang-switch {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-color);
  padding: 12px 30px;
  text-align: right;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  transition: var(--transition-smooth);
}

.lang-switch span {
  font-weight: 500;
  margin-right: 10px;
  color: var(--text-muted);
}

.lang-switch a {
  text-decoration: none;
  margin: 0 10px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}

.lang-switch a:hover {
  color: var(--accent-color);
}

.lang-switch a[style*="text-decoration: underline"] {
  color: var(--text-color);
  text-decoration: none !important;
  position: relative;
}

.lang-switch a[style*="text-decoration: underline"]::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

/* Theme Toggle Button */
.toggle-theme {
  cursor: pointer;
  padding: 8px 18px;
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  margin-left: 20px;
  background: var(--glass-bg);
  color: var(--text-color);
  font-size: 0.9em;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition-smooth);
}

.toggle-theme:hover {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* Sidebar Ads */




/* Main Content Area */
.main-content {
  padding: 100px 20px 40px 20px;
  animation: fadeInUp 0.8s ease-out;
}

header {
  margin-bottom: 50px;
  text-align: center;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}

.header-avatar img, .profile-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid transparent;
  background: linear-gradient(var(--bg-color), var(--bg-color)) padding-box,
              var(--accent-gradient) border-box;
  box-shadow: 0 10px 25px var(--accent-glow);
  animation: floatAvatar 6s infinite ease-in-out;
  transition: var(--transition-smooth);
}

.header-avatar img:hover, .profile-avatar img:hover {
  transform: scale(1.1) rotate(5deg);
}

h1 {
  font-size: 3em;
  font-weight: 700;
  background: var(--accent-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1.2;
}

h2 {
  font-size: 1.8em;
  font-weight: 600;
  color: var(--text-color);
  margin-top: 50px;
  margin-bottom: 25px;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 40px;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.3s;
}

h2:hover::after {
  width: 100%;
}

section {
  background: var(--glass-bg);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
  border-top: 1px solid rgba(255, 255, 255, 0.4); /* Edge highlight */
}

body.dark section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Profile Info */
.about-section {
  margin-bottom: 30px;
}

.profile-info {
  display: flex;
  align-items: flex-start;
  gap: 30px;
}

.profile-text p {
  margin-bottom: 15px;
  font-size: 1.05em;
  color: var(--text-muted);
}
.profile-text strong {
  color: var(--text-color);
  font-weight: 600;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--glass-bg);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
  overflow: hidden; /* Prevent glint overflow */
}

.project-card::after, .service-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.2) 40%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.2) 60%,
    transparent 70%
  );
  transform: translateX(-150%) skewX(-25deg);
  transition: none;
  pointer-events: none;
  z-index: 5;
  opacity: 0.4; /* Soften the glint */
}

.project-card:hover::after, .service-card:hover::after {
  animation: glintShimmer 1.5s ease-in-out forwards;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 20px;
  padding: 2px;
  background: var(--accent-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 10;
  pointer-events: none;
}


.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.project-card:hover::before {
  opacity: 1;
}

.card-image-container {
  height: 180px;
  overflow: hidden;
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .card-image {
  transform: scale(1.08);
}

.card-content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  margin: 0 0 10px 0;
  font-size: 1.4em;
  font-weight: 600;
  color: var(--text-color);
  transition: color 0.3s;
}

.project-card:hover .card-content h3 {
  color: var(--accent-color);
}

.card-content p {
  margin: 0 0 20px 0;
  color: var(--text-muted);
  font-size: 0.95em;
  flex: 1;
}

.card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 500;
  border: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
}

.project-card:hover .tag {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
}

/* Freelance & Services Section */
.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.service-card {
  background: var(--glass-bg);
  padding: 30px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  text-align: center;
  transition: var(--transition-smooth);
  overflow: hidden; /* Prevent glint overflow */
  position: relative;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.service-icon {
  font-size: 2.5em;
  margin-bottom: 15px;
}

.service-card h3 {
  font-size: 1.3em;
  margin-bottom: 15px;
  color: var(--text-color);
}

.service-card p {
  font-size: 0.95em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.cta-button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent-gradient);
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9em;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.cta-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px var(--accent-glow);
}

/* Contact Section */
.contact-section {
  background: rgba(100, 116, 139, 0.05);
  padding: 30px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  text-align: center;
}

.contact-section p {
  margin: 10px 0;
  font-size: 1.1em;
  color: var(--text-muted);
}

.contact-section a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  position: relative;
}

.contact-section a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width 0.3s;
}

.contact-section a:hover::after {
  width: 100%;
}

/* Responsive */

@media (max-width: 968px) {
  h1 { font-size: 2.5em; }
}

@media (max-width: 768px) {
  .lang-switch {
    padding: 10px 15px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }
  .toggle-theme { margin-left: auto; }
  .main-content { padding-top: 100px; }
  section { padding: 25px; }
  .header-content { flex-direction: column; text-align: center; gap: 15px; }
  .profile-info { flex-direction: column; align-items: center; text-align: center; }
  h1 { font-size: 2.2em; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.8em; }
  .header-avatar img, .profile-avatar img { width: 60px; height: 60px; }
  .lang-switch span { display: none; }
  section { padding: 20px; }
}

/* --- Phase 6: Final Cinematic Polish --- */

/* Page Transitions */
body {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

body.page-loaded {
  opacity: 1;
}

body.page-unloading {
  opacity: 0 !important;
}

/* Typing Subtitle */
.typing-subtitle {
  font-size: 1.1em;
  color: var(--text-muted);
  min-height: 1.5em;
  margin-top: 5px;
}


/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: 20px;
  margin-top: 30px;
}

.bento-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  justify-content: center;
  will-change: transform;
}

.bento-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.bento-large {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-tall {
  grid-row: span 2;
}

@media (max-width: 900px) {
  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  .bento-large, .bento-tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}