/* =============================
   styles.css — Portfolio v3.1
   Fixed Modals & Improved Typography
   ============================= */

/* -------------------------
   Root variables
-------------------------- */
:root {
  --bg: #07102a;
  --panel: #0f1724;
  --muted: #98a3b6;
  --accent-start: #6f8cff;
  --accent-end: #7dd3fc;
  --glass: rgba(255,255,255,0.03);
  --radius: 16px;
  --header-h: 70px;
  --maxwidth: 1200px;
  --profile-ring-size: 180px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #04060a, var(--bg));
  color: #e6eef8;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure proper scaling on zoom */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

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

/* -------------------------
   Scroll progress bar
-------------------------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
  border-radius: 0 4px 4px 0;
  z-index: 1200;
  transition: width 0.12s linear;
}

/* -------------------------
   Header - Mobile First
-------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  z-index: 1100;
  background: rgba(7, 16, 42, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
  padding: 0 1rem;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--maxwidth);
  margin: 0 auto;
}

/* -------------------------
   Header Brand - Simple Enhanced
-------------------------- */
.brand {
  color: var(--accent-start);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.brand-shayan {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}

.brand-portfolio {
  color: #fff;
  font-weight: 700;
}

.brand:hover {
  transform: translateY(-2px);
}

.brand:hover {
  color: var(--accent-end);
  transform: translateY(-1px);
}

/* Main Navigation */
.main-nav {
  display: none;
  gap: 0.5rem;
}

.main-nav a {
  color: var(--muted);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.main-nav a.active {
  color: var(--accent-start);
  background: rgba(111, 140, 255, 0.1);
}

/* Mobile Menu Toggle */
#nav-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: var(--transition);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#nav-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(7, 16, 42, 0.98), rgba(7, 16, 42, 0.99));
    backdrop-filter: blur(20px);
    flex-direction: column;
    gap: 0;
    padding: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    display: flex;
  }

  .main-nav a {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 0.25rem 0;
    font-size: 1rem;
  }
}

/* Desktop Navigation */
@media (min-width: 769px) {
  .main-nav {
    display: flex;
  }

  #nav-toggle {
    display: none;
  }
}

/* -------------------------
   Hero Section - Mobile First
-------------------------- */
.hero {
  padding: calc(var(--header-h) + 2rem) 1rem 4rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* =========================
   BETTER PARTICLE VISIBILITY
========================= */

/* Ensure canvas is properly visible */
#hero-canvas,
#contact-canvas,
#appointment-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 1 !important; /* Force visibility */
}

/* Hero section background contrast */
.hero {
  position: relative;
  background: linear-gradient(180deg, #04060a, var(--bg));
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(111, 140, 255, 0.1) 0%, transparent 70%);
  z-index: 0;
}

/* Modal background contrast */
.modal-content {
  position: relative;
  z-index: 2; /* Above particles */
}

.modal-container {
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: var(--maxwidth);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
  align-items: center;
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.eyebrow {
  font-size: 0.9rem;
  color: var(--accent-start);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

/* UPDATED HERO TITLE - Single line with larger Shayan */
.hero-title {
  font-size: 2.5rem;
  font-weight: 750;
  line-height: 1.1;
  margin: 0.5rem 0;
  color: #fff;
}

.hero-title .accent {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 3.2rem; /* Larger Shayan */
  font-weight: 900;
  display: inline-block;
  margin: 0 0.2rem;
}

.hero-tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
  font-weight: 500;
  font-size: 0.95rem;
}

.tag-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
}

.tag-item i {
  color: var(--accent-start);
}

.sep {
  color: var(--muted);
}

.hero-lead {
  color: #c9d6ea;
  line-height: 1.7;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
  min-height: 50px;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: #07102a;
  box-shadow: 0 8px 30px rgba(111, 140, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(111, 140, 255, 0.4);
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.btn-outline:hover {
  border-color: var(--accent-start);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(111, 140, 255, 0.2);
}

/* Profile Card */
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
}

.profile-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(2, 6, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  max-width: 320px;
  width: 100%;
  backdrop-filter: blur(10px);
}

.profile-ring {
  width: var(--profile-ring-size);
  height: var(--profile-ring-size);
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  animation: pulseRing 3s infinite ease-in-out;
  box-shadow: 0 0 50px rgba(111, 140, 255, 0.4);
}

.profile-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
}

.profile-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: #07102a;
  font-size: 3rem;
  font-weight: 800;
  border: 4px solid var(--bg);
}

@keyframes pulseRing {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 50px rgba(111, 140, 255, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 70px rgba(111, 140, 255, 0.6);
  }
}

.profile-body {
  text-align: center;
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.socials {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.social {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.1rem;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.social:hover {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: #07102a;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(111, 140, 255, 0.3);
}

/* Scroll Indicator */
.scroll-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.mouse {
  width: 30px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10px;
}

.wheel {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent-start);
  animation: wheelAnim 2s infinite ease-in-out;
}

@keyframes wheelAnim {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(10px);
    opacity: 0.6;
  }
}

.scroll-text {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Desktop Hero Layout */
@media (min-width: 1024px) {
  .hero {
    padding: calc(var(--header-h) + 4rem) 2rem 6rem;
  }

  .hero-grid {
    grid-template-columns: 1fr 400px;
    gap: 4rem;
  }

  .hero-left {
    text-align: left;
  }

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

  .hero-title .accent {
    font-size: 4.2rem; /* Even larger Shayan on desktop */
  }

  .hero-tagline {
    justify-content: flex-start;
  }

  .hero-cta {
    justify-content: flex-start;
  }

  .hero-right {
    margin-top: 0;
  }
}

/* -------------------------
   Sections & Container
-------------------------- */
.section {
  padding: 4rem 1rem;
}

.container {
  max-width: var(--maxwidth);
  margin: 0 auto;
  width: 100%;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  text-align: center;
  color: #fff;
}

.section-title i {
  color: var(--accent-start);
  margin-right: 0.75rem;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: #07102a;
  font-size: 1.5rem;
}

.edu-card, .cert-card, .project-card {
  background: var(--panel);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(2, 6, 18, 0.6);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.edu-card::before, .cert-card::before, .project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.edu-card:hover::before, .cert-card:hover::before, .project-card:hover::before {
  transform: scaleX(1);
}

.edu-card:hover, .cert-card:hover, .project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 60px rgba(2, 6, 18, 0.8);
}

.edu-card h3, .cert-card h3, .project-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #fff;
}

/* Project Specific */
.project-image {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: #07102a;
  font-size: 2rem;
}

.project-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

.project-actions .btn {
  flex: 1;
  min-height: 44px;
}

/* Cards Grid Responsive */
@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

/* -------------------------
   Skills Section - Enhanced
-------------------------- */
.skills-container {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
}

.skills-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 2rem 1rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.skills-scroll::-webkit-scrollbar {
  display: none;
}

.skill-card {
  flex: 0 0 280px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  scroll-snap-align: center;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  position: relative;
  backdrop-filter: blur(10px);
}

.skill-card.active {
  border-color: var(--accent-start);
  box-shadow: 0 20px 50px rgba(111, 140, 255, 0.3);
  transform: scale(1.05);
}

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

.skill-ico {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--accent-start);
}

.skill-card h4 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
}

/* Skills Navigation */
.skills-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 0 1rem;
}

.skill-nav-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-nav-btn:hover:not(:disabled) {
  border-color: var(--accent-start);
  color: var(--accent-start);
  background: rgba(111, 140, 255, 0.1);
  transform: scale(1.1);
}

.skill-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.skill-dots {
  display: flex;
  gap: 0.75rem;
}

.skill-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: var(--transition);
}

.skill-dot.active {
  background: var(--accent-start);
  transform: scale(1.2);
}

.skill-dot:hover {
  background: var(--accent-start);
  transform: scale(1.1);
}

/* Skills Section Responsive */
@media (max-width: 480px) {
  .skill-card {
    flex: 0 0 260px;
    padding: 2rem 1.5rem;
  }

  .skills-nav {
    gap: 1rem;
  }

  .skill-nav-btn {
    width: 44px;
    height: 44px;
  }
}

/* -------------------------
   Contact Section
-------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

.contact-content h3 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.contact-lead {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
}

.contact-info {
  margin-bottom: 2.5rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(8px);
  border-color: rgba(111, 140, 255, 0.2);
}

.contact-item i {
  font-size: 1.4rem;
  color: var(--accent-start);
  margin-top: 0.2rem;
  min-width: 24px;
}

.contact-item h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
}

.contact-item p {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
}

.contact-socials h4 {
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  color: #fff;
  font-weight: 600;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.3rem;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.social-links a:hover {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: #07102a;
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(111, 140, 255, 0.3);
}

/* Contact Form */
.contact-form-wrapper {
  background: var(--panel);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(2, 6, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.form-group label {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #e6eef8;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-start);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(111, 140, 255, 0.1);
}

.form-group textarea {
  min-height: 140px;
}

.btn-full {
  width: 100%;
  margin-top: 0.5rem;
}

/* Contact Section Responsive */
@media (min-width: 1024px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

@media (max-width: 480px) {
  .contact-form-wrapper {
    padding: 2rem 1.5rem;
  }

  .contact-item {
    padding: 1.25rem;
  }

  .social-links a {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

/* -------------------------
   MODALS - COMPLETELY FIXED
-------------------------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000; /* Higher z-index */
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 16, 42, 0.98); /* Darker backdrop */
  backdrop-filter: blur(25px); /* More blur */
  animation: backdropFadeIn 0.3s ease;
}

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

.modal-container {
  position: relative;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2001; /* Higher than backdrop */
  margin: 1rem;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.contact-modal-container {
  max-width: 480px;
}

.appointment-container {
  max-width: 650px;
}

.modal-content {
  position: relative;
  background: var(--panel);
  padding: 2.5rem;
  border-radius: 24px;
  box-shadow: 0 40px 100px rgba(2, 6, 18, 0.95); /* Stronger shadow */
  border: 1px solid rgba(255, 255, 255, 0.15); /* Brighter border */
  backdrop-filter: blur(30px); /* More blur */
  z-index: 2002; /* Highest in modal */
}

.modal-content h3 {
  margin-top: 0;
  color: var(--accent-start);
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 700;
}

.modal-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: var(--transition);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); /* Brighter background */
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 2003; /* Above modal content */
}

.close-btn:hover {
  color: var(--accent-start);
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

/* Contact Modal Specific */
.contact-info-modal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-item-modal {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.05); /* Brighter background */
  border-radius: 16px;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-item-modal:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(5px);
}

.contact-item-modal i {
  font-size: 1.3rem;
  color: var(--accent-start);
  width: 24px;
  text-align: center;
}

.contact-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.contact-value {
  display: block;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.contact-value:hover {
  color: var(--accent-start);
}

/* Appointment Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.form-actions {
  margin-top: 2rem;
}

/* Form Status */
.form-status {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-top: 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.form-status.success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.form-status.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.form-status.sending {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Modal Responsive */
@media (min-width: 640px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 2rem 1.5rem;
  }

  .contact-modal-container,
  .appointment-container {
    max-width: 95%;
  }

  .close-btn {
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
  }
}

/* -------------------------
   Footer
-------------------------- */
.site-footer {
  background: var(--panel);
  padding: 3rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--maxwidth);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.footer-left {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-right {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Footer Responsive */
@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* -------------------------
   Animations & Utilities
-------------------------- */
.reveal, .card-animated {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition);
}

.reveal.show, .card-animated.show {
  opacity: 1;
  transform: translateY(0);
}

/* Body scroll lock */
body.modal-open {
  overflow: hidden;
}

/* Canvas positioning */
#contact-canvas,
#appointment-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  border-radius: 24px;
}

/* Ensure modal is properly centered */
.modal.show {
  display: flex !important;
}

/* -------------------------
   High DPI Screens Support
-------------------------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-title {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* -------------------------
   Print Styles
-------------------------- */
@media print {
  .site-header,
  .hero-cta,
  .modal,
  .site-footer {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .section {
    padding: 2rem 0 !important;
    break-inside: avoid;
  }
}