/* ================================================================
   Noktacode — Custom Styles
   Organized: Variables → Base → Components → Animations → Responsive
   ================================================================ */

/* --------------------------------
   CSS Custom Properties
   -------------------------------- */
:root {
  /* Backgrounds */
  --bg-primary: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-input: rgba(255, 255, 255, 0.03);
  --bg-input-focus: rgba(255, 255, 255, 0.05);
  --bg-overlay: rgba(10, 10, 10, 0.85);

  /* Borders */
  --border-card: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-input: rgba(255, 255, 255, 0.08);

  /* Accent (same both themes) */
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-secondary: #8b5cf6;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-nav: #cbd5e1;
  --text-nav-hover: #ffffff;

  /* Misc */
  --dot-color: rgba(255, 255, 255, 0.03);
  --hamburger-color: #ffffff;
  --social-bg: rgba(255, 255, 255, 0.05);
  --social-border: rgba(255, 255, 255, 0.1);
  --footer-border: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --bg-input: rgba(0, 0, 0, 0.02);
  --bg-input-focus: #ffffff;
  --bg-overlay: rgba(248, 250, 252, 0.9);

  --border-card: rgba(0, 0, 0, 0.06);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-input: rgba(0, 0, 0, 0.12);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-nav: #334155;
  --text-nav-hover: #0f172a;

  --dot-color: rgba(0, 0, 0, 0.04);
  --hamburger-color: #1e293b;
  --social-bg: rgba(0, 0, 0, 0.03);
  --social-border: rgba(0, 0, 0, 0.08);
  --footer-border: rgba(0, 0, 0, 0.06);
}

/* --------------------------------
   Base & Reset
   -------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-light); }

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  z-index: 9999;
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* --------------------------------
   Typography
   -------------------------------- */
.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --------------------------------
   Navbar
   -------------------------------- */
.navbar {
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background-color: var(--bg-overlay) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border-subtle);
}

.nav-link {
  position: relative;
  color: var(--text-nav);
  transition: color 0.2s ease;
}

.nav-link:hover { color: var(--text-nav-hover); }

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  border-radius: 1px;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger Button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.hamburger-btn:hover { border-color: var(--accent); }

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--hamburger-color);
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger-btn.open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-btn.open .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
  background: var(--bg-overlay);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border-subtle);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open { transform: translateX(0); }

.mobile-link {
  color: var(--text-nav);
  transition: color 0.2s ease;
}

.mobile-link:hover { color: var(--text-nav-hover); }

/* --------------------------------
   Theme Toggle
   -------------------------------- */
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(0); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0); }

/* Language Toggle */
.lang-toggle {
  border: 1px solid var(--border-card);
  color: var(--text-nav);
  transition: all 0.3s ease;
}

.lang-toggle:hover {
  color: var(--text-nav-hover);
  border-color: var(--accent);
}

/* --------------------------------
   Cards
   -------------------------------- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.08), 0 0 60px rgba(139, 92, 246, 0.04);
  transform: translateY(-4px);
}

.project-card { position: relative; overflow: hidden; }

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.04));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.project-card:hover::before { opacity: 1; }
.project-card .project-content { position: relative; z-index: 1; }

/* Service Icon */
.service-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
  transition: all 0.3s ease;
}

.glass-card:hover .service-icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.16));
  border-color: rgba(99, 102, 241, 0.4);
  transform: scale(1.05);
}

/* Tech Tags */
.tech-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tech-tag:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
}

/* Stats */
.stat-number { font-variant-numeric: tabular-nums; }

/* Tech Cards */
.tech-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.tech-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.tech-logo {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-card:hover .tech-logo {
  transform: scale(1.1) rotate(5deg);
}

/* Process Steps */
.process-step {
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-number {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2.5rem;
  font-weight: 800;
  opacity: 0.08;
  color: var(--accent);
  line-height: 1;
}

.step-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
}

.process-step:hover { transform: translateY(-4px); }
.process-step:hover .step-icon { transform: scale(1.1); }

/* Testimonials */
.testimonial-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.12);
}

/* --------------------------------
   Buttons
   -------------------------------- */
.btn-glow {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-glow::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary), var(--accent));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  filter: blur(10px);
}

.btn-glow:hover::before { opacity: 0.6; }

.btn-outline {
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* --------------------------------
   Form
   -------------------------------- */
.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background: var(--bg-input-focus);
}

/* --------------------------------
   Social Icons
   -------------------------------- */
.social-icon {
  background: var(--social-bg);
  border: 1px solid var(--social-border);
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.social-icon:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* --------------------------------
   Hero Content
   -------------------------------- */
.hero-title {
  font-size: clamp(1.75rem, 5vw, 4.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tech-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  display: none;
}

@media (min-width: 640px) {
  .tech-dot { display: block; }
  .tech-stack { gap: 8px 24px; }
}

/* --------------------------------
   Layout Utilities
   -------------------------------- */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(99, 102, 241, 0.2) 50%, transparent 100%);
}

.hero-badge {
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.site-footer {
  border-top: 1px solid var(--footer-border);
}

/* --------------------------------
   Hero Background & Particles
   -------------------------------- */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.hero-bg::before {
  content: "";
  position: absolute;
  width: 150%;
  height: 150%;
  top: -25%;
  left: -25%;
  background:
    radial-gradient(circle at 30% 40%, rgba(99, 102, 241, 0.15), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(139, 92, 246, 0.12), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.05), transparent 70%);
  animation: heroGradient 15s ease-in-out infinite alternate;
}

[data-theme="light"] .hero-bg::before {
  background:
    radial-gradient(circle at 30% 40%, rgba(99, 102, 241, 0.08), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(139, 92, 246, 0.06), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.03), transparent 70%);
}

.grid-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: floatParticle linear infinite;
}

[data-theme="light"] .particle { opacity: 0 !important; }

/* --------------------------------
   Animations
   -------------------------------- */
@keyframes heroGradient {
  0%   { transform: translate(0, 0) rotate(0deg); }
  33%  { transform: translate(2%, -2%) rotate(1deg); }
  66%  { transform: translate(-1%, 1%) rotate(-0.5deg); }
  100% { transform: translate(1%, -1%) rotate(0.5deg); }
}

@keyframes floatParticle {
  0%   { opacity: 0; transform: translateY(100vh) scale(0); }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70%  { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.pulse-ring { animation: pulseRing 2s ease-out infinite; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active { opacity: 1; transform: translateX(0); }

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.active > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.active > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.active > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.active > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.active > *:nth-child(6) { transition-delay: 0.3s; }

.stagger-children.active > * {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------
   Responsive
   -------------------------------- */
@media (max-width: 768px) {
  .hero-bg::before {
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
  }

  /* Sections: tighter padding on mobile */
  section { padding-top: 4rem; padding-bottom: 4rem; }
  .section-divider { margin-bottom: 3rem; }

  /* Cards: slightly less padding */
  .glass-card { padding: 1.25rem; }

  /* About stats: smaller text */
  .stat-number { font-size: 1.75rem; }

  /* Footer */
  .site-footer { padding-top: 3rem; padding-bottom: 3rem; }
}

@media (max-width: 480px) {
  /* Extra small: even tighter */
  .hero-title { font-size: 1.6rem; }
  .hero-subtitle { font-size: 0.9rem; }
  .tech-stack { font-size: 0.75rem; gap: 8px 12px; }
}
