/* ==================== RESET ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Urbanist', sans-serif;
}

:root {
  /* Task 12: Color Contrast Compliance (Requirements 12.1, 12.2, 12.3, 12.4) */
  /* Light mode colors meet WCAG 2.1 Level AA standards:
     - Normal text (--text-primary #111 on --bg-primary #f7f7f7): 15:1 ratio ✓
     - Normal text (--text-secondary #444 on --bg-primary #f7f7f7): 9:1 ratio ✓
     - Large text (--text-tertiary #555 on --bg-primary #f7f7f7): 7.5:1 ratio ✓
     - Interactive elements (#e60000 on #fff): 5.5:1 ratio ✓
     - Focus indicators (#e60000 outline): 3:1+ ratio on all backgrounds ✓
  */
  --bg-primary: #f7f7f7;
  --bg-secondary: #fff;
  --bg-tertiary: #f8f8f8;
  --text-primary: #111;
  --text-secondary: #444;
  --text-tertiary: #555;
  --text-muted: #666;
  --text-light: #888;
  --border-color: #ccc;
  --border-light: #eee;
  --border-lighter: #f0f0f0;
  --shadow-sm: rgba(0, 0, 0, 0.04);
  --shadow-md: rgba(0, 0, 0, 0.05);
  --shadow-lg: rgba(0, 0, 0, 0.08);
  --shadow-xl: rgba(0, 0, 0, 0.1);
  --card-bg: #fff;
  --input-bg: #fff;
  --hero-gradient-start: #ffffff;
  --hero-gradient-mid: #f8f8f8;
  --hero-gradient-end: #f2f2f2;
}

body.dark-mode {
  /* Dark mode colors meet WCAG 2.1 Level AA standards:
     - Normal text (--text-primary #f0f0f0 on --bg-primary #1a1a1a): 13:1 ratio ✓
     - Normal text (--text-secondary #d0d0d0 on --bg-primary #1a1a1a): 10:1 ratio ✓
     - Large text (--text-tertiary #b0b0b0 on --bg-primary #1a1a1a): 7.5:1 ratio ✓
     - Interactive elements (#e60000 on #242424): 6.8:1 ratio ✓
     - Focus indicators (#e60000 outline): 3:1+ ratio on all backgrounds ✓
  */
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --bg-tertiary: #2a2a2a;
  --text-primary: #f0f0f0;
  --text-secondary: #d0d0d0;
  --text-tertiary: #b0b0b0;
  --text-muted: #999;
  --text-light: #888;
  --border-color: #444;
  --border-light: #333;
  --border-lighter: #2a2a2a;
  --shadow-sm: rgba(0, 0, 0, 0.3);
  --shadow-md: rgba(0, 0, 0, 0.4);
  --shadow-lg: rgba(0, 0, 0, 0.5);
  --shadow-xl: rgba(0, 0, 0, 0.6);
  --card-bg: #242424;
  --input-bg: #2a2a2a;
  --hero-gradient-start: #1a1a1a;
  --hero-gradient-mid: #202020;
  --hero-gradient-end: #242424;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  /* Theme transition: all color properties transition smoothly over 300ms (Requirement 2.5) */
  transition: background-color 300ms ease, color 300ms ease;
  overflow-x: hidden;
}

/* ==================== SKIP LINK ==================== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #e60000;
  color: #fff;
  padding: 12px 24px;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 8px 0;
  transition: top 300ms ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Main content focus - remove outline when focused programmatically */
#main-content:focus {
  outline: none;
}

/* ==================== GLOBAL FOCUS STYLES (Task 4.1) ==================== */
/* Global focus indicator for keyboard navigation (Requirements 3.3, 4.1, 4.2, 4.3, 4.4) */
*:focus {
  outline: 2px solid #e60000;
  outline-offset: 2px;
}

/* Remove outline for mouse users only - show only for keyboard navigation */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure focus-visible works for keyboard users */
*:focus-visible {
  outline: 2px solid #e60000;
  outline-offset: 2px;
}

/* Global theme transition for all elements using CSS custom properties */
*,
*::before,
*::after {
  /* Ensure smooth theme transitions for color-related properties */
  transition-property: background-color, color, border-color, box-shadow, fill, stroke, background, border;
  transition-duration: 300ms;
  transition-timing-function: ease;
}

/* Elements with specific animation transitions will override the above */

/* Page Load Animation */
body.loading {
  overflow: hidden;
}

/* Page transition fade-in effect (Task 11.1 - Requirement 8.1) */
body:not(.loading) {
  animation: pageFadeIn 500ms ease-out;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: #e60000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ==================== COMMON ==================== */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text-primary);
}

.btn {
  display: inline-block;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 300ms ease;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}

.btn:focus,
.btn:focus-visible {
  outline: 2px solid #e60000;
  outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
  outline: none;
}

.primary {
  background: #e60000;
  color: #fff;
}

.primary:hover {
  background: #c40000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 0, 0, 0.3);
}

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

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

.small {
  padding: 10px 18px;
  font-size: 0.9rem;
}

/* ==================== NAVBAR ==================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 80px;
  background: var(--bg-secondary);
  box-shadow: 0 4px 20px var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background 0.3s ease;
}

.logo img {
  height: 32px;
  object-fit: contain;
  transition: filter 0.3s ease;
}

body.dark-mode .logo img {
  filter: brightness(0) invert(1);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger:focus,
.hamburger:focus-visible {
  outline: 2px solid #e60000;
  outline-offset: 2px;
}

.hamburger:focus:not(:focus-visible) {
  outline: none;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 3px;
  transition: all 0.3s ease;
}

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

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

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

.nav-menu ul {
  display: flex;
  align-items: center;
  gap: 25px;
  list-style: none;
}

.nav-menu ul li a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  transition: background 300ms ease, color 300ms ease, box-shadow 300ms ease;
}

.nav-menu ul li a:hover,
.nav-menu ul li a:focus {
  background: var(--bg-tertiary);
}

.nav-menu ul li a:focus,
.nav-menu ul li a:focus-visible {
  outline: 2px solid #e60000;
  outline-offset: 2px;
  transition: outline 300ms ease, outline-offset 300ms ease, background 300ms ease;
}

.nav-menu ul li a:focus:not(:focus-visible) {
  outline: none;
}

/* ACTIVE LINK STYLE */
.nav-menu ul li a.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: inset 0 2px 4px var(--shadow-xl);
}

/* DROPDOWN */
.dropdown {
  position: relative;
}

.dropdown > a::after {
  content: " ▾";
  font-size: 0.75rem;
  margin-left: 1px;
}

.dropdown-menu {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--bg-secondary);
  border-radius: 14px;
  box-shadow: 0 10px 40px var(--shadow-lg);
  list-style: none;
  min-width: 190px;
  padding: 10px 0;
  z-index: 999;
  transition: opacity 300ms ease, visibility 300ms ease, transform 300ms ease, background 300ms ease;
  transition-delay: 0s;
  display: flex;
  flex-direction: column;
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: var(--bg-secondary);
  border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: -2px -2px 5px var(--shadow-md);
}

.dropdown-menu li {
  position: relative;
  z-index: 1;
}

.dropdown-menu li a {
  display: block;
  padding: 10px 24px;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 300ms ease, color 300ms ease, padding-left 300ms ease;
  position: relative;
}

.dropdown-menu li a:focus,
.dropdown-menu li a:focus-visible {
  outline: 2px solid #e60000;
  outline-offset: -2px;
  background: var(--bg-tertiary);
}

.dropdown-menu li a:focus:not(:focus-visible) {
  outline: none;
}

.dropdown-menu li a::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: #e60000;
  border-radius: 2px;
  transition: height 300ms ease;
}

.dropdown-menu li a:hover {
  background: var(--bg-tertiary);
  color: #e60000;
  padding-left: 28px;
}

.dropdown-menu li a:hover::before {
  height: 16px;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover,
.dropdown-menu.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}

/* THEME TOGGLE */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 300ms ease;
  position: relative;
  overflow: hidden;
  margin-left: 10px;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--shadow-md);
}

.theme-toggle:focus,
.theme-toggle:focus-visible {
  outline: 2px solid #e60000;
  outline-offset: 2px;
  transition: outline 300ms ease, outline-offset 300ms ease;
}

.theme-toggle:focus:not(:focus-visible) {
  outline: none;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  font-size: 20px;
  position: absolute;
  transition: transform 300ms ease, opacity 300ms ease;
}

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

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

body.dark-mode .theme-toggle .sun-icon {
  transform: rotate(-180deg) scale(0);
  opacity: 0;
}

body.dark-mode .theme-toggle .moon-icon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

/* ==================== HERO ==================== */
.hero {
  min-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 80px 20px;
  background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-mid) 50%, var(--hero-gradient-end) 100%);
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

.hero::before {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 350px;
  height: 350px;
  background: url('../img/star2.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  animation: starFadeInRotate 1.5s ease forwards, rotateLoop 30s linear 1.5s infinite;
  z-index: 10;
}

.hero::after {
  content: "";
  position: absolute;
  top: 50px;
  right: 50px;
  width: 180px;
  height: 180px;
  background: url('../img/star2.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  animation: starFadeInRotate 1.5s ease forwards, rotateLoop 30s linear 1.5s infinite;
  z-index: 0;
}

@keyframes starFadeInRotate {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  100% {
    opacity: 0.5;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes rotateLoop {
  from {
    transform: scale(1) rotate(0deg);
  }
  to {
    transform: scale(1) rotate(360deg);
  }
}

.hero-content {
  max-width: 850px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  animation: fadeInBlurScale 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.hero h1 span {
  color: #e60000;
  display: inline-block;
  animation: fadeInBlurScale 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards, pulse 2s ease-in-out 1.5s infinite;
  animation-delay: 0.4s;
  opacity: 0;
  position: relative;
}

.hero h1 span::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #e60000, transparent);
  animation: shimmer 3s ease-in-out infinite;
}

.hero p {
  margin-top: 18px;
  font-size: 1.1rem;
  color: var(--text-muted);
  animation: fadeInBlurUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.8s;
  opacity: 0;
  letter-spacing: 0.5px;
}

.buttons {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.buttons .btn {
  position: relative;
  overflow: hidden;
}

.buttons .btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.buttons .btn:hover::before {
  width: 300px;
  height: 300px;
}

.buttons .btn:nth-child(1) {
  animation: fadeInBlurUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 1.2s;
  opacity: 0;
}

.buttons .btn:nth-child(2) {
  animation: fadeInBlurUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 1.4s;
  opacity: 0;
}

@keyframes fadeInBlurScale {
  0% {
    opacity: 0;
    filter: blur(15px);
    transform: translateY(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInBlurUp {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}
  
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
  }
}

/* ==================== ABOUT ==================== */
.about {
  padding: 100px 80px;
  background: var(--bg-secondary);
  position: relative;
  transition: background 0.3s ease;
}

.about-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  margin-top: 50px;
}

.about-text {
  flex: 1;
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-text.animate {
  opacity: 1;
  transform: translateX(0);
}

.about-text h3 {
  font-size: 1.8rem;
  color: #e60000;
  margin-bottom: 15px;
}

.about-text p {
  color: var(--text-secondary);
  max-width: 650px;
}

.skills-tools {
  display: flex;
  gap: 25px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.info-box {
  background: var(--bg-tertiary);
  padding: 20px;
  border-radius: 14px;
  min-width: 220px;
  box-shadow: 0 4px 20px var(--shadow-sm);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease, background 0.3s ease;
}

.info-box.animate {
  opacity: 1;
  transform: translateY(0);
}

.info-box:nth-child(2) {
  transition-delay: 0.2s;
}

.info-box h4 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.info-box ul {
  padding-left: 18px;
  color: var(--text-secondary);
}

.tools {
  display: grid;
  grid-template-columns: repeat(2, 50px);
  gap: 12px;
  justify-content: center;
}

.tools img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: white;
  padding: 10px;
  border-radius: 10px;
  transition: transform 300ms ease, box-shadow 300ms ease;
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

body.dark-mode .tools img {
  background: #fff;
}

.tools img:nth-child(1) {
  animation-delay: 0.1s;
}

.tools img:nth-child(2) {
  animation-delay: 0.2s;
}

.tools img:nth-child(3) {
  animation-delay: 0.3s;
}

.tools img:nth-child(4) {
  animation-delay: 0.4s;
}

.tools img:hover {
  transform: translateY(-8px) scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

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

.about-img {
  flex: 1;
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-img.animate {
  opacity: 1;
  transform: translateX(0);
}

.about-img img {
  width: 100%;
  max-width: 500px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* ==================== PROJECTS ==================== */
.projects {
  padding: 100px 80px;
  background: var(--bg-primary);
  transition: background 0.3s ease;
}

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

.card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 6px 24px var(--shadow-md);
  transition: all 300ms ease;
  opacity: 0;
}

.card.animate {
  opacity: 1;
  transform: translateY(0);
}

.card:nth-child(2) {
  transition-delay: 0.15s;
}

.card:nth-child(3) {
  transition-delay: 0.3s;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px var(--shadow-lg);
}

.card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 14px;
  aspect-ratio: 400 / 220;
}

.card h3 {
  margin-top: 18px;
  font-size: 1.3rem;
}

.card p {
  margin: 12px 0 18px;
  color: var(--text-tertiary);
}

/* ==================== CONTACT ==================== */
.contact {
  padding: 100px 80px;
  background: var(--bg-secondary);
  text-align: center;
  transition: background 0.3s ease;
}

.contact-text {
  color: var(--text-tertiary);
  margin-bottom: 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.contact-text.animate {
  opacity: 1;
  transform: translateY(0);
}

.contact-box {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-tertiary);
  padding: 35px;
  border-radius: 18px;
  box-shadow: 0 8px 30px var(--shadow-sm);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease, background 0.3s ease;
  transition-delay: 0.2s;
}

.contact-box.animate {
  opacity: 1;
  transform: translateY(0);
}

.row {
  display: flex;
  gap: 20px;
}

.form-group {
  flex: 1;
  text-align: left;
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color 300ms ease;
}

.required-indicator {
  color: #e60000;
  font-weight: 700;
  margin-left: 4px;
}

.error-message {
  display: block;
  color: #e60000;
  font-size: 0.85rem;
  margin-top: 6px;
  min-height: 20px;
  font-weight: 500;
}

.error-message:empty {
  display: none;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  margin: 0;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  outline: none;
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--text-primary);
  transition: border-color 300ms ease, box-shadow 300ms ease, transform 300ms ease, background 300ms ease, color 300ms ease;
}

input.error,
textarea.error {
  border-color: #e60000;
  background: rgba(230, 0, 0, 0.05);
}

input:focus,
textarea:focus,
input:focus-visible,
textarea:focus-visible {
  border-color: #e60000;
  box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.08);
  transform: translateY(-2px);
  outline: 2px solid #e60000;
  outline-offset: 2px;
}

input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

/* ==================== FOOTER ==================== */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #e60000;
  color: #fff;
  padding: 22px 80px;
  flex-wrap: wrap;
  transition: background 0.3s ease;
}

body.dark-mode .footer {
  background: #1a1a1a;
  border-top: 1px solid #333;
}

.footer-left,
.footer-right,
.copyright {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo {
  height: 28px;
  width: auto;
}

.footer-logo-sm {
  height: 38px;
  width: auto;
}

.copyright p {
  font-size: 0.95rem;
  text-align: center;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
  .navbar,
  .about,
  .projects,
  .contact,
  .footer {
    padding-left: 60px;
    padding-right: 60px;
  }
}

@media (max-width: 992px) {
  .navbar,
  .about,
  .projects,
  .contact,
  .footer {
    padding-left: 40px;
    padding-right: 40px;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .about-container {
    flex-direction: column;
    text-align: center;
  }

  .about-text {
    text-align: center;
    order: 2;
  }

  .about-img {
    order: 1;
  }

  .about-text p {
    max-width: 100%;
  }

  .skills-tools {
    justify-content: center;
  }

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

  .row {
    flex-direction: column;
    gap: 0;
  }
  
  .form-group {
    margin-bottom: 10px;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
    margin-left: 0;
  }

  .theme-toggle .sun-icon,
  .theme-toggle .moon-icon {
    font-size: 18px;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    box-shadow: -5px 0 15px var(--shadow-xl);
    transition: right 0.3s ease, background 0.3s ease;
    padding-top: 80px;
    z-index: 999;
  }

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

  .nav-menu ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 20px;
  }

  .nav-menu ul li {
    width: 100%;
    border-bottom: 1px solid var(--border-lighter);
  }

  .nav-menu ul li a {
    display: block;
    width: 100%;
    padding: 15px 10px;
    border-radius: 0;
  }

  .dropdown-menu {
    position: static;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: none;
    box-shadow: none;
    background: var(--bg-tertiary);
    margin-top: 10px;
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, background 0.3s ease;
  }

  .dropdown-menu.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    display: flex;
    max-height: 500px;
  }

  .dropdown-menu::before {
    display: none;
  }

  .dropdown > a::after {
    float: right;
  }

  .hero::before {
    width: 200px;
    height: 200px;
    bottom: -60px;
    left: -60px;
  }

  .hero::after {
    width: 120px;
    height: 120px;
    top: 30px;
    right: 20px;
    opacity: 0.4;
  }

  .navbar {
    padding: 15px 20px;
  }

  .nav-menu ul {
    gap: 12px;
  }

  .nav-menu ul li a {
    padding: 6px 12px;
    font-size: 0.9rem;
  }

  .title {
    font-size: 28px;
  }

  .bottom {
    flex-direction: column;
    gap: 20px;
  }

  .footer {
    padding: 20px;
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .hero::before {
    width: 150px;
    height: 150px;
    bottom: -50px;
    left: -50px;
  }

  .hero::after {
    width: 80px;
    height: 80px;
    top: 20px;
    right: 15px;
    opacity: 0.3;
  }

  .navbar {
    padding: 12px 15px;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
    margin-left: 0;
  }

  .theme-toggle .sun-icon,
  .theme-toggle .moon-icon {
    font-size: 16px;
  }

  .logo img {
    height: 28px;
  }

  .nav-menu ul {
    gap: 8px;
  }

  .nav-menu ul li a {
    padding: 5px 10px;
    font-size: 0.85rem;
  }

  .hero {
    padding: 50px 15px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .buttons {
    flex-direction: column;
    gap: 10px;
  }

  .btn {
    width: 100%;
    max-width: 250px;
  }

  .about,
  .projects,
  .contact {
    padding: 50px 15px;
  }

  .section-title {
    font-size: 1.5rem;
  }

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

  .info-box {
    min-width: 100%;
  }

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

  input,
  textarea {
    font-size: 0.9rem;
  }
}

/* ==================== SCROLL OFFSET ==================== */
section {
  scroll-margin-top: 100px;
}

/* LIGHTBOX */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
}

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

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-img,
.lightbox-video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  transition: color 300ms ease;
  font-weight: 300;
  line-height: 1;
  background: none;
  border: none;
  padding: 8px;
}

.lightbox-close:hover {
  color: #e60000;
}

.lightbox-close:focus,
.lightbox-close:focus-visible {
  outline: 2px solid #e60000;
  outline-offset: 2px;
  color: #e60000;
}

.lightbox-close:focus:not(:focus-visible) {
  outline: none;
}

@media (max-width: 768px) {
  .lightbox-close {
    top: -40px;
    font-size: 35px;
  }
}

/* WORKING PROCESS */
.process {
  padding: 80px 80px;
  background: var(--bg-secondary);
  transition: background 0.3s ease;
}

.process-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin-top: 50px;
  position: relative;
}

.process-step {
  text-align: center;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.process-step:nth-child(1) { animation-delay: 0.1s; }
.process-step:nth-child(2) { animation-delay: 0.2s; }
.process-step:nth-child(3) { animation-delay: 0.3s; }
.process-step:nth-child(4) { animation-delay: 0.4s; }
.process-step:nth-child(5) { animation-delay: 0.5s; }
.process-step:nth-child(6) { animation-delay: 0.6s; }

.process-step::after {
  content: "";
  position: absolute;
  top: 30px;
  left: calc(50% + 40px);
  width: 0;
  height: 2px;
  background: #e60000;
  z-index: -1;
  animation: drawLineStep 0.6s ease-out forwards;
}

.process-step:nth-child(1)::after { animation-delay: 0.7s; }
.process-step:nth-child(2)::after { animation-delay: 0.9s; }
.process-step:nth-child(3)::after { animation-delay: 1.1s; }
.process-step:nth-child(4)::after { animation-delay: 1.3s; }
.process-step:nth-child(5)::after { animation-delay: 1.5s; }

.process-step:last-child::after {
  display: none;
}

@keyframes drawLineStep {
  0% {
    width: 0;
  }
  100% {
    width: calc(100% - 80px);
  }
}

.step-number {
  width: 60px;
  height: 60px;
  background: #e60000;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 20px;
  box-shadow: 0 3px 10px rgba(230, 0, 0, 0.3);
  transition: all 300ms ease;
  position: relative;
  z-index: 2;
}

.step-number::before {
  content: "✓";
  font-size: 28px;
  font-weight: 700;
}

.process-step:hover .step-number {
  transform: scale(1.1);
  box-shadow: 0 5px 20px rgba(230, 0, 0, 0.4);
}

.process-step h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.process-step p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-tertiary);
}

@media (max-width: 1200px) {
  .process-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }

  .process-step::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .process {
    padding: 60px 40px;
  }

  .process-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 0;
  }

  .process-container::before {
    display: none;
  }

  .process-step::before {
    content: "";
    position: absolute;
    left: 25px;
    top: 60px;
    width: 2px;
    height: calc(100% - 60px + 20px);
    background: #e60000;
    z-index: 0;
    transform: scaleY(0);
    transform-origin: top;
    animation: drawSegment 0.4s ease-out forwards;
  }

  .process-step:nth-child(1)::before { animation-delay: 0.7s; }
  .process-step:nth-child(2)::before { animation-delay: 0.9s; }
  .process-step:nth-child(3)::before { animation-delay: 1.1s; }
  .process-step:nth-child(4)::before { animation-delay: 1.3s; }
  .process-step:nth-child(5)::before { animation-delay: 1.5s; }

  .process-step:last-child::before {
    display: none;
  }

  @keyframes drawSegment {
    0% {
      transform: scaleY(0);
    }
    100% {
      transform: scaleY(1);
    }
  }

  .process-step {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 80px;
    text-align: left;
    position: relative;
  }

  .process-step:last-child {
    margin-bottom: 0;
  }

  .process-step::after {
    display: none;
  }

  .step-number {
    width: 50px;
    height: 50px;
    font-size: 20px;
    margin: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
  }

  .step-number::before {
    font-size: 24px;
  }

  .process-step-content {
    flex: 1;
    padding-top: 10px;
  }

  .process-step h3 {
    font-size: 18px;
    text-align: left;
    margin-bottom: 8px;
  }

  .process-step p {
    font-size: 14px;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .process {
    padding: 50px 20px;
  }

  .process-container::before {
    left: 22px;
  }

  .step-number {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  .step-number::before {
    font-size: 22px;
  }

  .process-step {
    gap: 25px;
  }

  .process-step h3 {
    font-size: 16px;
  }

  .process-step p {
    font-size: 13px;
  }
}

/* TESTIMONIALS */
.testimonials {
  padding: 80px 80px;
  background: var(--bg-primary);
  overflow: hidden;
  transition: background 0.3s ease;
}

.testimonials-container {
  display: flex;
  gap: 30px;
  animation: slideTestimonials 20s linear infinite;
  width: max-content;
}

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

.testimonials-container:hover {
  animation-play-state: paused;
}

.testimonial-card {
  background: var(--card-bg);
  padding: 20px 25px;
  border-radius: 12px;
  box-shadow: 0 5px 20px var(--shadow-lg);
  transition: all 300ms ease;
  position: relative;
  min-width: 350px;
  max-width: 350px;
  flex-shrink: 0;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--shadow-xl);
}

.quote-icon {
  font-size: 32px;
  color: #e60000;
  line-height: 1;
  margin-bottom: 12px;
  font-family: Georgia, serif;
}

.testimonial-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-tertiary);
  margin-bottom: 15px;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.client-info {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 15px;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}

.client-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}

.client-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.client-info p {
  font-size: 12px;
  color: var(--text-light);
}

@media (max-width: 992px) {
  .testimonials {
    padding: 60px 40px;
  }

  .testimonial-card {
    min-width: 350px;
    max-width: 350px;
    padding: 20px 25px;
  }

  .quote-icon {
    font-size: 35px;
  }

  .testimonial-text {
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .testimonials {
    padding: 50px 20px;
  }

  .testimonial-card {
    min-width: 300px;
    max-width: 300px;
    padding: 20px;
  }

  .quote-icon {
    font-size: 30px;
  }

  .testimonial-text {
    font-size: 12px;
  }

  .client-info h4 {
    font-size: 14px;
  }

  .client-info p {
    font-size: 12px;
  }
}


/* ==================== MOTION PREFERENCES (Task 13) ==================== */
/* Reduce/disable non-essential animations for users who prefer reduced motion (Requirement 14.1, 14.2, 14.3) */
@media (prefers-reduced-motion: reduce) {
  /* Reduce page transition duration to 100ms (Requirement 14.3) */
  body:not(.loading) {
    animation-duration: 100ms;
  }
  
  /* Disable non-essential animations (Requirement 14.1) */
  .hero h1,
  .hero h1 span,
  .hero p,
  .buttons .btn,
  .about-text,
  .about-img,
  .info-box,
  .tools img,
  .card,
  .contact-text,
  .contact-box,
  .process-step,
  .testimonials-container,
  @keyframes fadeInBlurScale,
  @keyframes fadeInBlurUp,
  @keyframes pulse,
  @keyframes shimmer,
  @keyframes float,
  @keyframes fadeInUp,
  @keyframes starFadeInRotate,
  @keyframes rotateLoop,
  @keyframes slideTestimonials,
  @keyframes drawLineStep,
  @keyframes drawSegment {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  /* Disable star decorations rotation */
  .hero::before,
  .hero::after {
    animation: none !important;
    opacity: 0.5 !important;
  }
  
  /* Disable testimonials auto-scroll */
  .testimonials-container {
    animation: none !important;
  }
  
  /* Maintain essential animations for user feedback (Requirement 14.2) */
  /* Keep hover, focus, and loading animations with reduced duration */
  .btn:hover,
  .primary:hover,
  .secondary:hover,
  .card:hover,
  .tools img:hover,
  .testimonial-card:hover,
  *:focus,
  *:focus-visible {
    transition-duration: 100ms;
  }
  
  /* Keep loading spinner */
  .loader-spinner {
    animation: spin 1s linear infinite;
  }
}
