/* ============================================
   Abhinandan K Kumar - Portfolio Styles
   Animated UI | SEO Optimized | Responsive
   ============================================ */

/* --- CSS Variables / Theme --- */
:root {
  --primary: #0a192f;
  --primary-light: #112240;
  --secondary: #64ffda;
  --accent: #ccd6f6;
  --text-primary: #ccd6f6;
  --text-secondary: #8892b0;
  --text-dark: #333;
  --text-light: #fff;
  --bg-dark: #0a192f;
  --bg-light: #f8f9fa;
  --bg-card: #112240;
  --border-color: #1e3a5f;
  --shadow: 0 10px 30px -15px rgba(2,12,27,0.7);
  --shadow-light: 0 5px 20px rgba(0,0,0,0.1);
  --radius: 8px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-light);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul { list-style: none; }

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

.section-padding {
  padding: 100px 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.divider {
  width: 80px;
  height: 4px;
  background: var(--secondary);
  margin: 0 auto 20px;
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.highlight {
  color: #0a192f;
  position: relative;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.1);
  transition: var(--transition);
  z-index: -1;
}

.btn:hover::before {
  left: 0;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-light);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: transparent;
  color: var(--primary);
}

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

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

.btn-small {
  padding: 8px 20px;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* ============================================
   PRELOADER
   ============================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader {
  text-align: center;
}

.loader-ring {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-size: 1.3rem;
  color: var(--secondary);
  font-family: 'Courier New', monospace;
  font-weight: 700;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--text-light);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  transform: translateX(120%);
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.removing {
  transform: translateX(120%);
  opacity: 0;
}

.toast-success {
  border-left: 4px solid #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: #10b981; }
.toast-error .toast-icon { color: #ef4444; }

.toast-message {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0 0 0 8px;
  line-height: 1;
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--primary);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
  box-shadow: 0 5px 20px rgba(100,255,218,0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(100,255,218,0.5);
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
  padding: 15px 0;
}

.header.scrolled {
  background: rgba(10, 25, 47, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 10px 0;
}

.header.header-hidden {
  transform: translateY(-100%);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  font-family: 'Courier New', monospace;
}

.nav-menu {
  display: flex;
  gap: 30px;
}

.nav-link {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 5px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: var(--transition);
}

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

.nav-link:hover,
.nav-link.active-link {
  color: var(--secondary);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
}

.hamburger .bar {
  width: 25px;
  height: 3px;
  background: var(--secondary);
  margin: 3px 0;
  transition: var(--transition);
  border-radius: 2px;
}

.hamburger.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--bg-dark);
  overflow: hidden;
}

.particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(100,255,218,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(100,255,218,0.03) 0%, transparent 50%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--secondary);
  margin-bottom: 10px;
  letter-spacing: 2px;
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.hero-name {
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  line-height: 1.1;
  animation: fadeInUp 0.6s ease 0.2s forwards;
  opacity: 0;
}

.hero-title {
  font-size: 2rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease 0.4s forwards;
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

#typing-text {
  color: var(--secondary);
}

.typing-cursor {
  color: var(--secondary);
  animation: blink 0.7s step-end infinite;
  font-weight: 100;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 40px;
  line-height: 1.8;
  animation: fadeInUp 0.6s ease 0.6s forwards;
  opacity: 0;
}

.hero-cta {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.8s forwards;
  opacity: 0;
}

.hero-cta .btn-primary {
  background: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
}

.hero-cta .btn-primary:hover {
  background: transparent;
  color: var(--secondary);
}

.hero-cta .btn-secondary {
  color: var(--secondary);
  border-color: var(--secondary);
}

.hero-cta .btn-secondary:hover {
  background: var(--secondary);
  color: var(--primary);
}

.hero-social {
  display: flex;
  gap: 20px;
  animation: fadeInUp 0.6s ease 1s forwards;
  opacity: 0;
}

.hero-social a {
  color: var(--text-secondary);
  font-size: 1.3rem;
  transition: var(--transition);
}

.hero-social a:hover {
  color: var(--secondary);
  transform: translateY(-3px);
}

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

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.stagger-children > .reveal {
  transition-delay: calc(var(--i, 0) * 0.1s);
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
  background: var(--bg-light);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 60px;
  align-items: center;
}

.about-image-wrapper {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  border: 3px solid var(--primary);
}

.about-image-wrapper img {
  width: 100%;
  height: auto;
  transition: transform 0.5s ease;
}

.about-image-wrapper:hover img {
  transform: scale(1.05);
}

.about-content h3 {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.about-content p {
  color: var(--text-dark);
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.8;
}

/* Skills Bars */
.skills-section {
  margin: 30px 0;
}

.skills-section h3 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: var(--primary);
}

.skill-item {
  margin-bottom: 18px;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
}

.skill-bar {
  height: 10px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 10px;
  width: 0;
  transition: width 1.2s ease;
  position: relative;
}

.skill-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 30px 0;
}

.stat-item {
  text-align: center;
  padding: 20px;
  background: var(--primary);
  border-radius: var(--radius);
  color: var(--text-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  margin-top: 5px;
  color: var(--accent);
}

/* ============================================
   SERVICES SECTION
   ============================================ */
.services {
  background: var(--primary);
}

.services .section-header h2 {
  color: var(--text-light);
}

.services .section-subtitle {
  color: var(--text-secondary);
}

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

.service-card {
  background: var(--bg-card);
  padding: 40px 30px;
  border-radius: var(--radius);
  text-align: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--secondary), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow);
  border-color: var(--secondary);
}

.service-icon {
  width: 70px;
  height: 70px;
  line-height: 70px;
  border-radius: 50%;
  background: rgba(100,255,218,0.1);
  margin: 0 auto 25px;
  font-size: 1.8rem;
  color: var(--secondary);
  transition: transform 0.4s ease, background 0.4s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.15) rotateY(360deg);
  background: rgba(100,255,218,0.2);
}

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

.service-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */
.portfolio {
  background: var(--bg-light);
}

.portfolio-filter {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 28px;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(100,255,218,0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.filter-btn:active::before {
  width: 200px;
  height: 200px;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: var(--text-light);
}

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

.portfolio-item {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.portfolio-image {
  position: relative;
  overflow: hidden;
}

.portfolio-image img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.portfolio-item:hover .portfolio-image img {
  transform: scale(1.12);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 47, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-info {
  text-align: center;
  color: var(--text-light);
  padding: 20px;
  transform: translateY(20px);
  transition: transform 0.4s ease;
}

.portfolio-item:hover .portfolio-info {
  transform: translateY(0);
}

.portfolio-info h4 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--secondary);
}

.portfolio-info p {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 15px;
}

.portfolio-info .btn {
  background: var(--secondary);
  color: var(--primary);
  border-color: var(--secondary);
}

.portfolio-info .btn:hover {
  background: transparent;
  color: var(--secondary);
}

/* ============================================
   PORTFOLIO MODAL
   ============================================ */
.modal {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: var(--text-light);
  border-radius: var(--radius);
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.8) translateY(20px);
  transition: transform 0.4s ease;
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  color: var(--text-dark);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--primary);
  transform: rotate(90deg);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius) 0 0 var(--radius);
}

.modal-text {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-text h3 {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 15px;
}

.modal-text p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 25px;
}

/* ============================================
   TESTIMONIALS SECTION
   ============================================ */
.testimonials {
  background: var(--primary);
}

.testimonials .section-header h2 {
  color: var(--text-light);
}

.testimonials .section-subtitle {
  color: var(--text-secondary);
}

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

.testimonial-card {
  background: var(--bg-card);
  padding: 35px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.testimonial-card:hover {
  transform: translateY(-8px);
  border-color: var(--secondary);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.testimonial-stars {
  color: #ffd700;
  font-size: 1.3rem;
  margin-bottom: 20px;
  animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.testimonial-card p {
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 25px;
  font-style: italic;
}

.testimonial-card footer cite {
  font-style: normal;
}

.testimonial-card footer strong {
  display: block;
  color: var(--secondary);
  font-size: 1.05rem;
  margin-bottom: 5px;
}

.testimonial-card footer span {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact {
  background: var(--bg-light);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 50px;
}

.contact-info {
  display: grid;
  gap: 25px;
}

.contact-item {
  background: var(--primary);
  padding: 25px;
  border-radius: var(--radius);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(10,25,47,0.2);
}

.contact-item i {
  font-size: 1.8rem;
  color: var(--secondary);
  margin-bottom: 15px;
  transition: transform 0.3s ease;
}

.contact-item:hover i {
  transform: scale(1.2);
}

.contact-item h3 {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.contact-item p,
.contact-item a {
  color: var(--accent);
  font-size: 0.95rem;
}

.contact-item a:hover {
  color: var(--secondary);
}

.contact-form {
  background: var(--text-light);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: var(--bg-light);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,25,47,0.1);
}

.form-group input.error,
.form-group textarea.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.error-text {
  display: none;
  color: #ef4444;
  font-size: 0.8rem;
  margin-top: 5px;
}

.form-group input.error + .error-text,
.form-group textarea.error + .error-text {
  display: block;
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

.contact-form .btn {
  background: var(--primary);
  color: var(--text-light);
  border-color: var(--primary);
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.contact-form .btn:hover {
  background: transparent;
  color: var(--primary);
}

.btn-loader {
  display: none;
}

.btn:disabled .btn-text {
  display: none;
}

.btn:disabled .btn-loader {
  display: inline-block;
}

/* ============================================
   FAQ SECTION
   ============================================ */
.faq {
  background: var(--primary);
}

.faq .section-header h2 {
  color: var(--text-light);
}

.faq .section-subtitle {
  color: var(--text-secondary);
}

.faq-grid {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover {
  border-color: var(--secondary);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  cursor: pointer;
  user-select: none;
}

.faq-question h3 {
  font-size: 1.1rem;
  color: var(--text-light);
  font-weight: 500;
  margin: 0;
}

.faq-toggle {
  color: var(--secondary);
  font-size: 1rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
}

.faq-item.active .faq-toggle {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 25px;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 25px 20px;
}

.faq-answer p {
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1.8;
}

.faq-answer a {
  color: var(--secondary);
}

.faq-answer a:hover {
  text-decoration: underline;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--primary);
  padding: 60px 0 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand h3 {
  font-size: 1.4rem;
  color: var(--text-light);
  margin-bottom: 15px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 300px;
}

.footer h4 {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}

.footer h4::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--secondary);
}

.footer ul li {
  margin-bottom: 10px;
}

.footer ul li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: padding-left 0.3s ease, color 0.3s ease;
}

.footer ul li a:hover {
  color: var(--secondary);
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  width: 45px;
  height: 45px;
  line-height: 45px;
  text-align: center;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
  display: inline-block;
}

.social-links a:hover {
  background: var(--secondary);
  color: var(--primary);
  transform: translateY(-5px) scale(1.1);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 25px 0;
  text-align: center;
}

.footer-bottom p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(100,255,218,0.3); }
  50% { box-shadow: 0 0 20px rgba(100,255,218,0.6); }
}

/* Animate elements with float class */
.float-anim {
  animation: float 3s ease-in-out infinite;
}

.glow-anim {
  animation: glow 2s ease-in-out infinite;
}

/* Service icon float on hover */
.service-card:hover .service-icon i {
  animation: float 1.5s ease-in-out infinite;
}

/* ============================================
   RESPONSIVE DESIGN — FULLY MOBILE FRIENDLY
   ============================================ */

/* Tablet Landscape */
@media (max-width: 1024px) {
  html { font-size: 15px; }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .testimonial-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-image img {
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 250px;
  }

  .hero-name { font-size: 3.2rem; }
  .hero-title { font-size: 1.6rem; }
  .about-grid { gap: 40px; }
}

/* Tablet Portrait & Large Phones */
@media (max-width: 768px) {
  html { font-size: 14px; }

  .container {
    padding: 0 16px;
  }

  /* --- Navigation --- */
  .hamburger {
    display: flex;
    z-index: 1001;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    background: var(--primary);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.35s ease;
    gap: 30px;
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0,0,0,0.3);
  }

  .nav-menu.active {
    right: 0;
  }

  /* Nav overlay when open */
  body.nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }

  .nav-link {
    font-size: 1.15rem;
    padding: 8px 0;
  }

  /* --- Hero --- */
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 80px 0 60px;
  }

  .hero-content {
    text-align: center;
  }

  .hero-name {
    font-size: 2.5rem;
  }

  .hero-title {
    font-size: 1.25rem;
    justify-content: center;
  }

  .hero-tagline {
    font-size: 1rem;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }

  .hero-social {
    justify-content: center;
  }

  .hero-social a {
    font-size: 1.2rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- About --- */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .about-content h3 {
    font-size: 1.5rem;
  }

  .about-content p {
    text-align: left;
  }

  .about-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-item {
    padding: 15px 10px;
  }

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

  /* Skills */
  .skills-section h3 {
    text-align: left;
  }

  .skill-info {
    font-size: 0.85rem;
  }

  /* --- Services --- */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .service-card h3 {
    font-size: 1.15rem;
  }

  /* --- Portfolio --- */
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .portfolio-image img {
    height: 200px;
  }

  .portfolio-filter {
    gap: 10px;
  }

  .filter-btn {
    padding: 10px 20px;
    font-size: 0.85rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* --- Testimonials --- */
  .testimonial-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .testimonial-card {
    padding: 25px 20px;
  }

  /* --- FAQ --- */
  .faq-question {
    padding: 16px 18px;
  }

  .faq-question h3 {
    font-size: 1rem;
    line-height: 1.4;
  }

  .faq-answer {
    padding: 0 18px;
  }

  .faq-item.active .faq-answer {
    padding: 0 18px 16px;
  }

  .faq-answer p {
    font-size: 0.9rem;
  }

  /* --- Contact --- */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .contact-form {
    padding: 25px 20px;
  }

  .form-group input,
  .form-group textarea {
    padding: 12px 14px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  .contact-info {
    gap: 15px;
  }

  .contact-item {
    padding: 20px 15px;
  }

  .contact-item i {
    font-size: 1.5rem;
  }

  /* --- Modal --- */
  .modal-content {
    width: 92%;
    max-height: 85vh;
  }

  .modal-text {
    padding: 20px;
  }

  .modal-text h3 {
    font-size: 1.3rem;
  }

  .modal-close {
    top: 10px;
    right: 15px;
    font-size: 1.8rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- Footer --- */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .footer-brand p {
    margin: 0 auto;
    max-width: 100%;
  }

  .footer h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .social-links {
    justify-content: center;
  }

  .footer-links ul,
  .footer-services ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
  }

  .footer-links ul li,
  .footer-services ul li {
    margin-bottom: 0;
  }

  /* --- General --- */
  .section-padding {
    padding: 50px 0;
  }

  .section-header {
    margin-bottom: 35px;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    min-height: 44px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    max-width: none;
    top: 16px;
  }

  .toast {
    padding: 14px 16px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
  }
}

/* Small Phones */
@media (max-width: 480px) {
  html { font-size: 13px; }

  .container {
    padding: 0 14px;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 1.1rem;
  }

  .hero-tagline {
    font-size: 0.95rem;
  }

  .hero-greeting {
    font-size: 0.95rem;
  }

  .about-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-item {
    padding: 12px 8px;
  }

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

  .stat-label {
    font-size: 0.75rem;
  }

  .portfolio-image img {
    height: 180px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  .section-padding {
    padding: 40px 0;
  }

  .section-header {
    margin-bottom: 28px;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .back-to-top {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
    bottom: 16px;
    right: 16px;
  }

  .toast-container {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .toast {
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  .service-card {
    padding: 24px 16px;
  }

  .service-icon {
    width: 55px;
    height: 55px;
    line-height: 55px;
    font-size: 1.4rem;
    margin-bottom: 18px;
  }

  .contact-form {
    padding: 20px 16px;
  }

  .nav-menu {
    width: 85%;
    gap: 25px;
  }
}

/* Very Small Phones */
@media (max-width: 360px) {
  html { font-size: 12px; }

  .hero-name {
    font-size: 1.7rem;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

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

  .portfolio-image img {
    height: 160px;
  }
}

/* Landscape Mode on Phones */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 120vh;
    min-height: 120dvh;
    padding: 80px 0 40px;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }

  .hero-tagline {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .hero-cta {
    margin-bottom: 20px;
  }

  .hero-cta .btn {
    padding: 8px 20px;
    font-size: 0.85rem;
    min-height: 36px;
  }

  .hero-social {
    gap: 12px;
  }

  .hero-social a {
    font-size: 1rem;
    min-width: 36px;
    min-height: 36px;
  }

  .nav-menu {
    gap: 20px;
  }

  .nav-link {
    font-size: 1rem;
  }

  .section-padding {
    padding: 30px 0;
  }
}

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .skill-progress {
    width: 0 !important;
    transition: none !important;
  }

  .skill-progress.revealed,
  .skill-item .skill-progress {
    width: var(--data-width, 0%) !important;
  }
}
