/* ======== VARIABLES ======== */
:root {
  --bg-color: #1a0b2e;
  --text-main: #ffffff;
  --text-secondary: #ccd6f6;
  --text-muted: #8892b0;

  --card-bg-primary: #2b0b3a;
  --card-bg-secondary: #2b215a;
  --card-bg-gradient: linear-gradient(135deg, #130428 0%, #251043 35%, #38126d 60%, #261045 85%, #190634 100%);

  --accent-color: #763cac;
  --accent-light: #9857d3;
  --accent-hover: #b87cf4;

  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Montserrat', sans-serif;
  --font-ui: 'Montserrat', sans-serif;

  --transition: all 0.3s ease;
}

/* ======== LOCAL RTL FONT ======== */
@font-face {
  font-family: 'Thamanyah';
  src: url('assets/fonts/thmanyahsans/otf/thmanyahsans-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah';
  src: url('assets/fonts/thmanyahsans/otf/thmanyahsans-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah';
  src: url('assets/fonts/thmanyahsans/otf/thmanyahsans-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah';
  src: url('assets/fonts/thmanyahsans/otf/thmanyahsans-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah';
  src: url('assets/fonts/thmanyahsans/otf/thmanyahsans-Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Thamanyah Serif Display */
@font-face {
  font-family: 'Thamanyah Serif Display';
  src: url('assets/fonts/thmanyahserifdisplay/otf/thmanyahserifdisplay-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah Serif Display';
  src: url('assets/fonts/thmanyahserifdisplay/otf/thmanyahserifdisplay-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah Serif Display';
  src: url('assets/fonts/thmanyahserifdisplay/otf/thmanyahserifdisplay-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah Serif Display';
  src: url('assets/fonts/thmanyahserifdisplay/otf/thmanyahserifdisplay-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah Serif Display';
  src: url('assets/fonts/thmanyahserifdisplay/otf/thmanyahserifdisplay-Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Thamanyah Serif Text */
@font-face {
  font-family: 'Thamanyah Serif Text';
  src: url('assets/fonts/thmanyahseriftext/otf/thmanyahseriftext-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah Serif Text';
  src: url('assets/fonts/thmanyahseriftext/otf/thmanyahseriftext-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah Serif Text';
  src: url('assets/fonts/thmanyahseriftext/otf/thmanyahseriftext-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah Serif Text';
  src: url('assets/fonts/thmanyahseriftext/otf/thmanyahseriftext-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thamanyah Serif Text';
  src: url('assets/fonts/thmanyahseriftext/otf/thmanyahseriftext-Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

html[dir="rtl"] {
  --font-heading: 'Thamanyah Serif Display', sans-serif;
  --font-body: 'Thamanyah Serif Text', serif;
  --font-ui: 'Thamanyah', sans-serif;
}

.nav-links li a,
.btn,
.social-links a,
.text-link,
.project-links a,
.recommendation-author,
.study-date,
.carousel-dots button {
  font-family: var(--font-ui);
}

/* ======== GLOBAL ======== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ======== SKIP LINK (keyboard accessibility) ======== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent-color);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  z-index: 10001;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

html[dir="rtl"] .skip-link {
  left: auto;
  right: 1rem;
}

/* ======== FOCUS STATES (keyboard accessibility) ======== */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.tech-tag:focus-visible,
.avatar-wrapper:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
  border-radius: 4px;
}

.back-to-top:focus-visible,
.feedback-fab:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 3px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

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

/* ======== GLOW EFFECTS ======== */
.glow-effect {
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(118, 60, 172, 0.4) 0%, rgba(50, 15, 133, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(50px);
}

.glow-effect.top-right {
  top: -200px;
  right: -100px;
}

.glow-effect.bottom-left {
  bottom: -200px;
  left: -200px;
}

.glow-effect.center-left {
  top: 30%;
  left: -300px;
}

/* ======== TYPOGRAPHY ======== */
@font-face {
  font-family: 'Agustina';
  src: url('assets/fonts/Agustina.woff') format('woff');
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  text-wrap: balance;
}

.section-subtitle {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3rem;
}

/* ======== NAVBAR ======== */
#navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1.5rem 0;
  z-index: 1000;
  transition: var(--transition);
}

#navbar.scrolled {
  background: rgba(26, 11, 46, 0.95);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo {
  font-family: 'Agustina', cursive;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.profile-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-color);
  transition: var(--transition);
}

.profile-photo:hover {
  border-color: var(--accent-hover);
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links li a {
  font-weight: 600;
  transition: var(--transition);
}

.nav-links li a:hover {
  color: var(--accent-light);
}

.hamburger {
  display: none;
  cursor: pointer;
}

.hamburger .line {
  width: 25px;
  height: 3px;
  background-color: var(--text-main);
  margin: 5px;
  transition: var(--transition);
}

/* ======== BUTTONS ======== */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
}

.btn.large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

.primary-btn {
  background: var(--accent-color);
  color: white;
  border: 1px solid var(--accent-color);
}

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

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

.secondary-btn:hover {
  background: var(--accent-color);
}

/* ======== HERO SECTION ======== */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 0 0;
  padding-top: 5rem;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5rem;
  width: 100%;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 500px;
  animation: heroFadeUp 0.8s ease both;
  animation-delay: 0.6s;
}

@keyframes floatHero {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }

  100% {
    transform: translateY(0px);
  }
}

.hero-image img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  animation: floatHero 4s ease-in-out infinite;
  transition: filter 0.3s ease;
}

.hero-image img.loading {
  filter: blur(10px);
  transform: scale(1.1);
}

.hero-image img.loaded {
  filter: blur(0px);
  transform: scale(1);
}

.hero-image img:hover {
  filter: drop-shadow(0 10px 20px rgba(118, 60, 172, 0.4));
}

.greeting {
  color: var(--accent-light);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 3.0rem;
  font-weight: 700;
  margin-bottom: 1.0rem;
  line-height: 1.1;
  min-height: 2.2em;
  /* Reserve 2 lines of height — prevents vertical layout shift during typing */
  display: block;
  /* Ensure it's always full-width so centering of parent stays stable */
  text-wrap: balance;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
}

/* ======== ABOUT SECTION ======== */
.about {
  padding: 100px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.skills-list ul li {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-content: flex-start;
}

.tech-tag {
  background: rgba(118, 60, 172, 0.2);
  border: 1px solid rgba(118, 60, 172, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--accent-hover);
  transition: var(--transition);
}

.tech-tag:hover {
  background: rgba(118, 60, 172, 0.4);
  transform: translateY(-2px);
}

/* ======== CARDS COMPONENT ======== */
.card {
  background: var(--card-bg-gradient);
  border-radius: 15px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  border-color: rgba(118, 60, 172, 0.3);
}

/* ======== EXPERIENCE SECTION ======== */
.experience {
  padding: 100px 0;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.timeline-content h3 {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.timeline-content h4 {
  font-size: 1.1rem;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.date {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.timeline-content p {
  color: var(--text-secondary);
}

/* ======== PROJECTS SECTION ======== */
.projects {
  padding: 100px 0;
}

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.featured-text {
  color: var(--accent-light);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: block;
}

.project-content h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.project-desc {
  color: var(--text-secondary);
  background: rgba(43, 11, 58, 0.5);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.project-links {
  display: flex;
  gap: 1.5rem;
}

.text-link {
  color: var(--text-main);
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.text-link::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-hover);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

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

.text-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* ======== RECOMMENDATIONS SECTION ======== */
.recommendations {
  padding: 100px 0;
}

.testimonials-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  margin-top: 3rem;
}

.testimonials-avatars {
  display: flex;
  gap: 1.5rem;
  flex: 1;
}

.avatar-wrapper {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  padding: 4px;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  opacity: 0.5;
  filter: grayscale(80%);
}

.avatar-wrapper.active,
.avatar-wrapper:hover {
  opacity: 1;
  filter: grayscale(0%);
  border-color: var(--accent-hover);
  transform: scale(1.1);
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-content-display {
  flex: 2;
  position: relative;
  min-height: 150px;
}

.testimonial-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(10px);
}

.testimonial-item.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  position: relative;
}

.recommendation-text {
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 1.1rem;
}

.author-info h4 {
  color: var(--text-main);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.author-info p {
  color: var(--accent-light);
  font-size: 0.9rem;
  margin: 0;
}

@media (max-width: 768px) {
  .testimonials-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
  }

  .testimonials-avatars {
    margin-bottom: 2rem;
    flex-wrap: wrap;
  }
}

/* ======== STUDY SECTION ======== */
.study {
  padding: 100px 0;
}

.study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.study-card {
  background: var(--card-bg-gradient);
  border-radius: 15px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.study-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  border-color: rgba(118, 60, 172, 0.3);
}

.study-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.study-degree {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.university-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem;
  flex-shrink: 0;
}

.degree-info h3 {
  color: var(--text-main);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.degree-info h4 {
  color: var(--accent-light);
  font-size: 1rem;
  font-weight: 500;
}

.study-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(118, 60, 172, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(118, 60, 172, 0.2);
}

.study-desc {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.study-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  background: rgba(118, 60, 172, 0.1);
  color: var(--accent-light);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(118, 60, 172, 0.2);
}

/* ======== CONTACT SECTION ======== */
.contact {
  padding: 100px 0 150px;
}

.contact-sub {
  color: var(--text-secondary);
  margin-bottom: 3rem;
  text-transform: none;
  font-weight: 400;
}

.social-links {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.social-links a {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.social-links a:hover {
  color: var(--accent-hover);
}

/* ======== FOOTER ======== */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ======== UTILITIES & LOGOS ======== */
.header-with-logo {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.company-logo,
.university-logo,
.project-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.company-logo[alt="Freelance Flutter"] {
  object-fit: cover;
}

.project-header {
  margin-bottom: 1.5rem;
}

.project-header h3 {
  margin-bottom: 0 !important;
}

/* ======== REDUCED MOTION ======== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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

  #particle-canvas,
  .cursor-glow {
    display: none;
  }
}

/* ======== RESPONSIVE ======== */
@media (max-width: 768px) {
  .hero-container {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2rem;
  }

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

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

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

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 2rem;
    background: rgba(26, 11, 46, 0.97);
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(118, 60, 172, 0.2);
    backdrop-filter: blur(15px);
    gap: 0.5rem;
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .hamburger {
    display: block;
  }
}

/* ======================================================
   ANIMATIONS
   ====================================================== */

/* ---- Particle Canvas ---- */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Elevate all content above canvas */
nav,
main,
footer {
  position: relative;
  z-index: 1;
}

/* ---- Cursor Glow ---- */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(118, 60, 172, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: transform 0.12s ease-out;
  will-change: transform;
}

/* ---- Scroll Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Tech tags fan in individually */
.tech-tag.reveal {
  transform: translateY(20px) scale(0.9);
}

.tech-tag.reveal.is-visible {
  transform: translateY(0) scale(1);
}

/* ---- Hero Section Entrance ---- */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.greeting {
  animation: heroFadeUp 0.8s ease both;
  animation-delay: 0.1s;
}

.hero-title {
  animation: heroFadeUp 0.8s ease both;
  animation-delay: 0.25s;
}

.hero-subtitle {
  animation: heroFadeUp 0.8s ease both;
  animation-delay: 0.4s;
}

.hero-actions {
  animation: heroFadeUp 0.8s ease both;
  animation-delay: 0.55s;
}

/* ---- Typing Cursor ---- */
.hero-title::after {
  content: '|';
  animation: blink 0.8s infinite;
  color: var(--accent-hover);
  margin-left: 3px;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ---- Floating / Pulsing Glow ---- */
@keyframes floatGlow {
  0% {
    transform: translateY(0px) scale(1);
  }

  50% {
    transform: translateY(-30px) scale(1.05);
  }

  100% {
    transform: translateY(0px) scale(1);
  }
}

.glow-effect.top-right {
  animation: floatGlow 8s ease-in-out infinite;
}

.glow-effect.bottom-left {
  animation: floatGlow 10s ease-in-out infinite reverse;
}

.glow-effect.center-left {
  animation: floatGlow 12s ease-in-out infinite 2s;
}

/* ---- Card Shimmer on Hover ---- */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 15px;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.04) 50%,
      rgba(255, 255, 255, 0) 100%);
  transform: translateX(-100%) skewX(-15deg);
  transition: none;
  pointer-events: none;
}

.card:hover::before {
  transform: translateX(200%) skewX(-15deg);
  transition: transform 0.7s ease;
}

/* ---- Logo Hover Bounce ---- */
.company-logo,
.project-logo {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.company-logo:hover,
.project-logo:hover {
  transform: scale(1.15) rotate(-3deg);
}

/* ---- Nav Link Active Underline ---- */
@keyframes slideIn {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.nav-links li a {
  position: relative;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-hover);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links li a:hover::after {
  transform: scaleX(1);
}

/* ---- Button Pulse on Hover ---- */
.primary-btn {
  position: relative;
  overflow: hidden;
}

.primary-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.primary-btn:hover::after {
  opacity: 1;
}

/* ---- Section Title Gradient ---- */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.section-title {
  background: linear-gradient(270deg, #ffffff, #b87cf4, #ccd6f6, #9857d3);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease infinite;
}

/* ---- Contact Button Radiate ---- */
.btn.primary-btn.large {
  box-shadow: 0 0 0 0 rgba(118, 60, 172, 0.5);
  animation: radiate 2.5s ease-out infinite;
}

@keyframes radiate {
  0% {
    box-shadow: 0 0 0 0 rgba(118, 60, 172, 0.5);
  }

  70% {
    box-shadow: 0 0 0 18px rgba(118, 60, 172, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(118, 60, 172, 0);
  }
}

/* ======== BACK TO TOP ======== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(118, 60, 172, 0.4);
}

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

.back-to-top:hover {
  transform: translateY(-5px);
  background: var(--accent-hover);
  box-shadow: 0 8px 25px rgba(118, 60, 172, 0.6);
}

html[dir="rtl"] .back-to-top {
  right: auto;
  left: 30px;
}

/* ======== RECOMMENDATIONS HEADER ROW ======== */
.rec-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.rec-header-row .section-subtitle {
  margin-bottom: 0;
}

.add-rec-btn {
  flex-shrink: 0;
  font-size: 0.9rem;
  padding: 0.6rem 1.4rem;
  white-space: nowrap;
  align-self: center;
  margin-bottom: 3rem;
}

/* ======== FLOATING FEEDBACK FAB ======== */
.feedback-fab {
  position: fixed;
  bottom: 92px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 6px 20px rgba(118, 60, 172, 0.5);
  transition: all 0.3s ease;
  animation: fabSlideIn 0.4s ease 0.8s both;
}

@keyframes fabSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.feedback-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(118, 60, 172, 0.65);
  background: linear-gradient(135deg, var(--accent-light), var(--accent-hover));
}

.feedback-fab:active {
  transform: translateY(0);
}

html[dir="rtl"] .feedback-fab {
  right: auto;
  left: 30px;
}

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

.feedback-modal.open {
  opacity: 1;
  visibility: visible;
}

.feedback-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 3, 20, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.feedback-modal-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: linear-gradient(145deg, rgba(43, 11, 58, 0.98), rgba(37, 16, 67, 0.98));
  border: 1px solid rgba(118, 60, 172, 0.35);
  border-radius: 20px;
  padding: 2.2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transform: translateY(30px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  overflow-y: auto;
  max-height: 90vh;
}

.feedback-modal.open .feedback-modal-box {
  transform: translateY(0) scale(1);
}

/* Close Button */
.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(118, 60, 172, 0.3);
  color: #fff;
  border-color: var(--accent-color);
}

html[dir="rtl"] .modal-close-btn {
  right: auto;
  left: 1rem;
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(118, 60, 172, 0.4), rgba(152, 87, 211, 0.2));
  border: 1px solid rgba(118, 60, 172, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-hover);
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Type Tabs */
.message-type-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.type-tab {
  flex: 1;
  padding: 0.55rem 0.8rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.25s ease;
}

.type-tab.active {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
  color: #fff;
  box-shadow: 0 4px 12px rgba(118, 60, 172, 0.35);
}

.type-tab:not(.active):hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

/* Form */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(118, 60, 172, 0.25);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(136, 146, 176, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-light);
  background: rgba(118, 60, 172, 0.1);
  box-shadow: 0 0 0 3px rgba(118, 60, 172, 0.15);
}

.form-group input.invalid,
.form-group textarea.invalid {
  border-color: #f06292;
  box-shadow: 0 0 0 3px rgba(240, 98, 146, 0.15);
}

.field-error {
  font-size: 0.78rem;
  color: #f06292;
  min-height: 1rem;
  display: block;
}

/* Submit Button */
.submit-btn {
  margin-top: 0.4rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
  padding: 0.9rem;
  border: none;
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

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

.spin {
  animation: spin 0.9s linear infinite;
}

/* Success State */
.modal-success {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(56, 142, 60, 0.1));
  border: 2px solid rgba(76, 175, 80, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
  color: #81c784;
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
  from {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
  }

  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.modal-success h3 {
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 0.6rem;
}

.modal-success p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ======================================================
   RTL OVERRIDES — All new modal/feedback elements
   ====================================================== */

/*
 * KEY RULE: direction:rtl on .feedback-modal-box propagates to ALL children.
 * Flex containers automatically flow right-to-left — no flex-direction:row-reverse needed.
 * Only override things that don't inherit (form elements, fixed positions).
 */

/* FAB: bottom-left in RTL */
html[dir="rtl"] .feedback-fab {
  right: auto;
  left: 30px;
}

/* Modal box: direction propagates to all child flex/text nodes */
html[dir="rtl"] .feedback-modal-box {
  direction: rtl;
  text-align: right;
}

/* Close button: mirror to top-left corner */
html[dir="rtl"] .modal-close-btn {
  right: auto;
  left: 1rem;
}

/* Inputs & Textarea: form elements don't inherit direction — must be explicit */
html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group textarea {
  direction: rtl;
  text-align: right;
}

/* Email fields are inherently LTR, forcing RTL breaks layout/validation on some browsers */
html[dir="rtl"] .form-group input[type="email"] {
  direction: ltr;
  text-align: right;
}

/* Error messages */
html[dir="rtl"] .field-error {
  text-align: right;
}

/* Photo upload label text */
html[dir="rtl"] .photo-upload-label {
  text-align: center;
  /* keep centered */
}

/* ======================================================
   PHOTO UPLOAD — Recommendation flow
   ====================================================== */

.photo-upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.photo-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
  user-select: none;
}

.photo-upload-label:hover {
  color: var(--accent-hover);
}

.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(118, 60, 172, 0.15);
  border: 2px dashed rgba(118, 60, 172, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
}

.photo-preview:hover {
  border-color: var(--accent-hover);
  background: rgba(118, 60, 172, 0.25);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.photo-preview svg {
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.photo-preview:hover svg {
  opacity: 1;
}

.photo-upload-label .photo-optional {
  font-size: 0.75rem;
  color: rgba(136, 146, 176, 0.5);
}

.photo-remove-btn {
  background: none;
  border: none;
  color: #f06292;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
  display: none;
}

.photo-remove-btn:hover {
  background: rgba(240, 98, 146, 0.1);
}

.photo-remove-btn.visible {
  display: inline-block;
}