/* ========================================
   COSMIC BRUTALISM - Portfolio Styles
   ======================================== */

:root {
  /* Color Palette - Cosmic Noir */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(15, 15, 25, 0.9);
  --accent-cyan: #00ffff;
  --accent-magenta: #ff00ff;
  --accent-purple: #7c3aed;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --glow-cyan: rgba(0, 255, 255, 0.4);
  --glow-magenta: rgba(255, 0, 255, 0.3);
  
  /* Typography */
  --font-mono: 'Space Mono', 'Courier New', monospace;
  
  /* Spacing */
  --section-gap: clamp(60px, 10vw, 120px);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-y: auto;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body::-webkit-scrollbar {
  display: none;
}

.container {
  position: relative;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--section-gap);
}

.back-vid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  mix-blend-mode: overlay;
}

header {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  background-color: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0 30px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
  z-index: 9999;
  max-width: 100%;
}

.left {
  display: flex;
  align-items: center;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}

.left h1 {
  white-space: nowrap;
  font-size: 22px;
}

.left img {
  width: 50px;
  margin: 0 15px;
  border-radius: 50%;
}

header ul {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px 25px;
  border-radius: 50px;
  background-color: rgba(0, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 255, 255, 0.15);
}

header ul li {
  list-style: none;
}

header ul a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 25px;
  transition: all 0.3s ease;
}

header ul a:hover {
  background-color: rgba(0, 255, 255, 0.1);
  color: var(--accent-cyan);
}

.box-icons {
  display: flex;
  gap: 20px;
}

.box-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  width: 40px;
  height: 40px;
  background: transparent;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
}

.box-icons a::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.box-icons a:hover {
  color: var(--accent-cyan);
  transform: translateY(-3px);
}

.box-icons a:hover::before {
  opacity: 1;
}

/* Name highlight in header */
.name-highlight {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.8;
}

.blackhole-box {
  position: absolute;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  mix-blend-mode: lighten;
  pointer-events: none;
}

.blackhole-box video {
  width: 100%;
  max-width: 1400px;
  margin-top: -20%;
}

.hero {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  justify-content: space-between;
  padding-top: 100px;
}

.hero-info {
  position: relative;
  left: 5%;
  z-index: 10;
}

.hero-info .hero-info-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-cyan);
  padding: 12px 20px;
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 50px;
  font-size: 14px;
  letter-spacing: 1px;
}

.hero-info .hero-info-title i {
  font-size: 18px;
}

.hero-info h2 {
  font-size: clamp(28px, 4vw, 42px);
  max-width: 650px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 30px;
  margin-bottom: 25px;
}

.hero-info p {
  max-width: 550px;
  line-height: 1.7;
  margin-bottom: 35px;
  font-size: clamp(16px, 2vw, 18px);
  color: var(--text-secondary);
}

.hero-info button {
  color: var(--text-primary);
  padding: 16px 32px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.15), rgba(255, 0, 255, 0.15));
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.hero-info button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.hero-info button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px var(--glow-cyan);
}

.hero-info button i {
  margin-right: 8px;
}

.gradient {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta), var(--accent-cyan));
  background-size: 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: animate-gradient 3s linear infinite;
}

@keyframes animate-gradient {
  to {
    background-position: 200%;
  }
}

.hero-vid-box {
  position: absolute;
  right: 3%;
  z-index: 5;
  width: 40%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-vid-box.visible {
  opacity: 1;
}

model-viewer {
  height: 400px;
  width: 100%;
  --poster-color: transparent;
}

.scroll-down {
  height: 50px;
  width: 30px;
  border: 2px solid rgba(0, 255, 255, 0.5);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12%;
  border-radius: 50px;
  cursor: pointer;
  overflow: hidden;
}

.scroll-down::before,
.scroll-down::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  height: 8px;
  width: 8px;
  border: 2px solid var(--accent-cyan);
  transform: translate(-50%, 0) rotate(45deg);
  border-top: transparent;
  border-left: transparent;
  animation: scroll-down 1.5s ease-in-out infinite;
}

.scroll-down::after {
  top: 35%;
  animation-delay: 0.3s;
  opacity: 0.6;
}

@keyframes scroll-down {
  0% {
    opacity: 0;
  }

  30%,
  60% {
    opacity: 1;
  }

  100% {
    top: 90%;
    opacity: 0;
  }
}

.info-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(90%, 1200px);
  margin-top: 50px;
  padding: 0 20px;
}

.section-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  margin-bottom: 50px;
  text-align: center;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  width: 100%;
  margin-top: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding: 30px 25px;
  min-height: 320px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid rgba(0, 255, 255, 0.1);
  border-radius: 16px;
  transition: all 0.4s ease;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 255, 255, 0.3);
}

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

.card img {
  width: 100%;
  max-width: 200px;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  margin-bottom: 20px;
  border-radius: 12px;
}

.card h3 {
  position: relative;
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  width: 100%;
}

.card p {
  position: relative;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.card video {
  width: 80%;
  max-width: 180px;
  height: auto;
  object-fit: cover;
  mix-blend-mode: lighten;
  border-radius: 50%;
  margin-bottom: 20px;
}

.card button {
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  background: rgba(0, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: auto;
  font-family: inherit;
  font-size: 13px;
}

.card button:hover {
  background: rgba(0, 255, 255, 0.15);
  border-color: var(--accent-cyan);
}

/* Remove complex nth-child positioning */
.card:nth-child(3) {
  grid-row: auto;
}

.card:nth-child(4) {
  grid-column: auto;
}

/* My project */
.my-projects {
  display: flex;
  flex-direction: column;
  gap: 80px;
  align-items: center;
  position: relative;
  width: min(90%, 1200px);
  margin-top: 100px;
  padding: 0 20px;
}

.project-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 60px;
  justify-content: center;
}

.project-card:nth-child(even) {
  flex-direction: row-reverse;
}

.project-vidbox {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 500px;
  position: relative;
  cursor: pointer;
  transition: transform 0.4s ease;
}

.project-vidbox::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.project-vidbox:hover::before {
  opacity: 0.5;
}

.project-vidbox:hover {
  transform: scale(1.02);
}

.project-vidbox img,
.project-img {
  object-fit: cover;
  width: 100%;
  border-radius: 16px;
  transition: all 0.4s ease;
  max-height: 280px;
}

.project-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
  max-width: 450px;
}

.project-info h3 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  margin: 0 0 20px 0;
}

.project-info p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 25px 0;
  font-size: 15px;
}

.project-info a {
  text-decoration: none;
}

.project-info button {
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  background: rgba(0, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-info button:hover {
  background: rgba(0, 255, 255, 0.15);
  border-color: var(--accent-cyan);
  transform: translateX(5px);
}

/* ========================================
   SKILLS SECTION - Neural Constellation
   ======================================== */
.skills-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: min(90%, 1200px);
  padding: 100px 20px;
}

.skills-t {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  margin-bottom: 60px;
  text-align: center;
}

/* ---- Main Grid ---- */
.skills-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 25px;
  width: 100%;
  position: relative;
}

.skills-grid::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 350px; height: 350px;
  background: url('digital brain.webp') center/contain no-repeat;
  opacity: 0.04;
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: lighten;
}

.skills-stack {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* ---- Skill Card ---- */
.skill-card {
  position: relative;
  padding: 30px 28px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s ease;
  z-index: 1;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 255, 255, 0.2);
}

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

/* Card Content */
.skill-card__title {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  margin: 0 0 15px 0;
  color: var(--text-primary);
}

.skill-card__desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 25px 0;
}

/* Tech Badges */
.skill-card__techs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0, 255, 255, 0.03);
  border: 1px solid rgba(0, 255, 255, 0.1);
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: default;
}

.tech-badge:hover {
  border-color: rgba(0, 255, 255, 0.35);
  background: rgba(0, 255, 255, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 255, 255, 0.08);
}

.tech-badge span {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Primary Card */
.skill-card--primary { border-color: rgba(0, 255, 255, 0.12); }
.skill-card--primary .skill-card__title { font-size: clamp(24px, 3.5vw, 32px); }
.skill-card--primary .skill-card__desc { font-size: 15px; max-width: 480px; }

.skill-card__decoration {
  position: absolute;
  bottom: 0; right: 0;
  width: 120px; height: 120px;
  overflow: hidden;
  pointer-events: none;
}

.skill-card__decoration::before {
  content: '';
  position: absolute;
  bottom: -60px; right: -60px;
  width: 120px; height: 120px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  opacity: 0.06;
  border-radius: 50%;
  transition: opacity 0.4s ease;
}

.skill-card--primary:hover .skill-card__decoration::before { opacity: 0.12; }

/* Designer Accent (cyan) */
.skill-card--designer { border-color: rgba(0, 255, 255, 0.12); }
.skill-card--designer::before { background: linear-gradient(90deg, var(--accent-cyan), transparent); }

/* Developer Accent (magenta) */
.skill-card--developer { border-color: rgba(255, 0, 255, 0.12); }
.skill-card--developer::before { background: linear-gradient(90deg, var(--accent-magenta), transparent); }
.skill-card--developer .tech-badge:hover {
  border-color: rgba(255, 0, 255, 0.35);
  background: rgba(255, 0, 255, 0.06);
  box-shadow: 0 4px 15px rgba(255, 0, 255, 0.08);
}

/* ========================================
   CONTACT SECTION
   ======================================== */
.contact-section {
  width: min(90%, 800px);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin: 0 auto;
  padding: 100px 20px;
}

.contact-section h2.section-title {
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 50px;
  text-align: center;
}

.social-box {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 50px;
}

.social-box a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 25px;
  font-size: 15px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid rgba(0, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.social-box a:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px var(--glow-cyan);
}

.social-box i {
  font-size: 20px;
  color: var(--accent-cyan);
}

.contact-box {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-box label {
  display: block;
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: -10px;
}

.contact-box input,
.contact-box textarea {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 10px;
  background-color: var(--bg-card);
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.contact-box input::placeholder,
.contact-box textarea::placeholder {
  color: var(--text-secondary);
}

.contact-box textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-box input:focus,
.contact-box textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px var(--glow-cyan);
}

.contact-box button {
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.15), rgba(255, 0, 255, 0.15));
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  align-self: flex-start;
  position: relative;
}

.contact-box button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.contact-box button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px var(--glow-cyan);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  width: 100%;
  padding: 30px;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(0, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 50px;
}

footer p {
  font-size: 14px;
  font-weight: 400;
  margin: 0;
  text-align: center;
  color: var(--text-secondary);
}
/* ========================================
   ANIMATIONS - With JS Fallback
   ======================================== */

/* These classes will be toggled by Intersection Observer in JS */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Legacy scroll animations - only for supported browsers */
@supports (animation-timeline: view()) {
  .autoBlur {
    animation: autoBlurAnimation linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }

  .autoDisplay {
    animation: autoDisplayAnimation linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }

  .fadeInRight {
    animation: fadeInRightAnimation linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

@keyframes autoBlurAnimation {
  from {
    filter: blur(20px);
    opacity: 0;
  }
  to {
    filter: blur(0);
    opacity: 1;
  }
}

@keyframes autoDisplayAnimation {
  from {
    filter: blur(5px);
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRightAnimation {
  from {
    filter: blur(10px);
    transform: translateX(-80px);
    opacity: 0;
  }
  to {
    filter: blur(0);
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   SIDEBAR (Mobile Menu)
   ======================================== */
.menu-icon {
  font-size: 28px;
  cursor: pointer;
  display: none;
  z-index: 1000;
  color: var(--text-primary);
  padding: 8px;
  transition: color 0.3s ease;
}

.menu-icon:hover {
  color: var(--accent-cyan);
}

.sidebar {
  position: fixed;
  right: -100%;
  top: 0;
  width: 80%;
  max-width: 350px;
  height: 100vh;
  background: var(--bg-primary);
  backdrop-filter: blur(20px);
  z-index: 1001;
  border-left: 1px solid rgba(0, 255, 255, 0.1);
  transition: right 0.4s ease;
  padding: 80px 30px 30px;
}

.sidebar.open-sidebar {
  right: 0;
  animation: none;
}

.close-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 35px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}

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

.sidebar ul {
  padding: 0;
  margin: 0;
}

.sidebar ul li {
  list-style: none;
  margin-bottom: 25px;
}

.sidebar ul li a {
  text-decoration: none;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  transition: color 0.3s ease;
}

.sidebar ul li a:hover {
  color: var(--accent-cyan);
}

.sidebar .social-icons {
  display: flex;
  gap: 20px;
  margin-top: 50px;
}

.sidebar .social-icons a {
  font-size: 24px;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.sidebar .social-icons a:hover {
  color: var(--accent-cyan);
}

/* ========================================
   LOADING OVERLAY
   ======================================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.loading-overlay.hidden {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Spinning ring */
.loader-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 255, 0.1);
  position: relative;
  animation: loader-ring-rotate 1.8s linear infinite;
}

.loader-ring::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent-cyan);
  filter: drop-shadow(0 0 6px var(--accent-cyan));
}

.loader-ring__inner {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-bottom-color: var(--accent-magenta);
  filter: drop-shadow(0 0 4px var(--accent-magenta));
  animation: loader-ring-rotate 1.2s linear infinite reverse;
}

/* Name text */
.loader-name {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--text-primary);
  opacity: 0;
  animation: loader-name-in 0.6s ease-out 0.2s forwards;
}

/* Progress bar */
.loader-bar {
  width: 120px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  border-radius: 2px;
  transform-origin: left;
  animation: loader-bar-fill 1.6s ease-in-out infinite;
}

@keyframes loader-ring-rotate {
  to { transform: rotate(360deg); }
}

@keyframes loader-name-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes loader-bar-fill {
  0%   { transform: scaleX(0); transform-origin: left; }
  50%  { transform: scaleX(1); transform-origin: left; }
  51%  { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */


/* Tablet & Small Desktop */
@media screen and (max-width: 1024px) {
  .hero-vid-box {
    width: 35%;
    right: 2%;
  }

  .box-icons {
    display: none;
  }

  header ul {
    padding: 10px 15px;
  }

  header ul a {
    font-size: 12px;
    padding: 6px 10px;
  }

  .lang-switcher {
    display: none;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile */
@media screen and (max-width: 768px) {
  :root {
    --section-gap: 60px;
  }

  .autoBlur,
  .autoDisplay,
  .fadeInRight {
    animation: none;
  }

  header {
    padding: 0 20px;
    height: 60px;
  }

  header ul {
    display: none;
  }

  .menu-icon {
    display: flex;
  }

  .left h1 {
    font-size: 18px;
  }

  .left img {
    width: 40px;
    margin: 0 10px;
  }

  .hero {
    padding-top: 100px;
    min-height: auto;
    padding-bottom: 40px;
    flex-direction: column;
  }

  .hero-info {
    left: 0;
    padding: 0 20px;
    width: 100%;
  }

  .hero-info .hero-info-title {
    font-size: 12px;
    padding: 8px 15px;
  }

  .hero-vid-box {
    display: none;
  }

  .blackhole-box video {
    margin-top: -10%;
  }

  .scroll-down {
    position: relative;
    bottom: auto;
    margin: 15px auto 0;
    left: 0;
    transform: none;
  }

  .project-card {
    flex-direction: column !important;
    gap: 30px;
  }

  .project-vidbox {
    max-width: 100%;
    width: 100%;
  }

  .project-info {
    max-width: 100%;
    padding: 0 10px;
  }

  .project-info h3 {
    font-size: 24px;
  }

  .skills-section {
    padding: 60px 20px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .skill-card--primary .skill-card__desc {
    max-width: 100%;
  }

  .contact-section {
    padding: 60px 20px;
  }

  .social-box {
    flex-direction: column;
  }

  .social-box a {
    width: 100%;
    justify-content: center;
  }

  [dir="rtl"] .hero-info {
    right: 0;
  }

  [dir="rtl"] .project-card {
    flex-direction: column !important;
  }

  .lang-switcher {
    display: none;
  }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
  header {
    padding: 0 12px;
    height: 50px;
  }

  .left h1 {
    font-size: 15px;
  }

  .left img {
    width: 32px;
    margin: 0 6px;
  }

  .scroll-down {
    height: 40px;
    width: 24px;
    margin-top: 20px;
  }

  .hero-info h2 {
    font-size: 24px;
  }

  .hero-info p {
    font-size: 14px;
  }

  .section-title,
  .skills-t {
    font-size: 28px;
  }

  .card {
    padding: 20px 15px;
    min-height: 280px;
  }

  .skill-card {
    padding: 22px 18px;
  }

  .tech-badge {
    padding: 6px 10px;
  }

  .tech-badge span {
    font-size: 11px;
  }

  .social-box {
    gap: 12px;
  }

  .social-box a {
    padding: 12px 16px;
    font-size: 14px;
  }

  .contact-box input,
  .contact-box textarea {
    font-size: 14px;
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

  .hero-info h2,
  .hero-info p {
    max-width: 100%;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 10px 20px;
  background: var(--accent-cyan);
  color: #000;
  z-index: 9999;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   RTL SUPPORT (Arabic)
   ======================================== */
[dir="rtl"] { text-align: right; }
[dir="rtl"] header { flex-direction: row-reverse; }
[dir="rtl"] .hero-info { left: auto; right: 5%; }
[dir="rtl"] .project-card:nth-child(odd) { flex-direction: row-reverse; }
[dir="rtl"] .project-card:nth-child(even) { flex-direction: row; }
[dir="rtl"] .project-info { align-items: flex-end; }
[dir="rtl"] .project-info button:hover { transform: translateX(-5px); }
[dir="rtl"] .sidebar { right: auto; left: -100%; border-left: none; border-right: 1px solid rgba(0,255,255,0.1); }
[dir="rtl"] .sidebar.open-sidebar { left: 0; right: auto; }
[dir="rtl"] .close-icon { right: auto; left: 20px; }
[dir="rtl"] .contact-box button { align-self: flex-end; }
[dir="rtl"] .skip-link { left: auto; right: 0; }

/* ========================================
   CHINESE FONT FALLBACK
   ======================================== */
[lang="zh"] body { font-family: 'Noto Sans SC', 'Space Mono', sans-serif; }

/* ========================================
   LANGUAGE SWITCHER
   ======================================== */
.lang-switcher { position: relative; z-index: 1000; }
.lang-switcher__toggle {
  background: transparent;
  border: 1px solid rgba(0,255,255,0.2);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}
.lang-switcher__toggle:hover { border-color: var(--accent-cyan); }
.lang-switcher__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid rgba(0,255,255,0.15);
  border-radius: 10px;
  overflow: hidden;
  z-index: 1000;
  min-width: 80px;
}
.lang-switcher__dropdown.open { display: flex; flex-direction: column; }
.lang-switcher__dropdown a {
  padding: 10px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}
.lang-switcher__dropdown a:hover { background: rgba(0,255,255,0.1); }

/* AJAX Language Switch Transition */
.container.lang-transition {
  opacity: 0;
  transition: opacity 0.25s ease;
}
