@import 'base.css';
@import 'layout.css';
@import 'components/buttons.css';
@import 'components/cards.css';
@import 'components/work-carousel.css';
@import 'components/contact-modal.css';
@import 'components/resume-modal.css';
@import 'pages/about.css';
@import 'pages/project-detail.css';

/* Note: Root variables are defined in base.css */

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  line-height: 1.6;
  font-weight: 400;
  padding-top: 80px; /* Account for fixed header height */
  overflow-x: hidden; /* Prevent horizontal scroll */
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Hero Section */
#hero {
  height: 100vh;
  min-height: 500px;
  margin-top: -80px; /* Offset the body padding for full-screen hero */
  padding-top: 80px; /* Add back padding so content isn't under header */
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
#waveCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.4;
}
.hero-content {
  z-index: 10;
  animation: fadeIn 1.6s ease-out;
}
#hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.role {
  margin-top: .4rem;
  font-size: 1.2rem;
  color: var(--accent);
}
.subtitle {
  margin-top: .6rem;
  font-size: 1rem;
  opacity: .85;
}
/* btn-primary styles are defined in components/buttons.css */

/* Section Titles */
section {
  padding: 4rem 2%;
  text-align: center;
}
h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Section Waveform Backgrounds */
section.wave-section {
  position: relative;
  overflow: var(--overflow-clip);
  background: var(--bg);
  /* Ensures content stays within bounds during scroll */
  isolation: isolate;
}
.section-wave-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.25;
  z-index: 1;
  pointer-events: none;
}
section.wave-section > *:not(.section-wave-canvas) {
  position: relative;
  z-index: 2;
}
#work.wave-section {
  background: var(--bg);
}
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.6rem;
  margin-top: 2rem;
}
.work-card {
  background: var(--card-bg);
  padding: 1.6rem;
  border-radius: var(--radius-md);
  overflow: var(--overflow-clip);
  transition: transform var(--transition), box-shadow var(--transition);
}
.work-card:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
}
.work-preview {
  height: 160px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  margin-bottom: .8rem;
  overflow: var(--overflow-clip);
}

/* Scroll Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s ease-out, transform .9s ease-out;
}
[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* 动画 keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Intro Section */
#intro {
  background: var(--bg);
  position: relative;
  padding: 4rem 2rem;
  margin-top: 0;
}
.intro-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2.4rem;
  align-items: center;
  padding: 0 2rem;
}
.intro-photo {
  width: 320px;
  height: 320px;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.03);
  overflow: var(--overflow-clip);
}
.intro-card h2 { text-align: left; font-size: 1.8rem; font-weight: 700; margin-bottom: .25rem; }
.intro-lead { text-align: left; margin-top: 0; opacity: .95; }
.intro-type { color: var(--accent); font-weight: 500; margin-top: .6rem; text-align: left; min-height: 1.4rem; font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.skills-list { list-style: none; padding: 0; margin: 1rem 0; display: flex; gap: .6rem; flex-wrap: wrap; }
.skill { background: rgba(255,255,255,0.03); padding: .45rem .7rem; border-radius: var(--radius-full); font-size: .9rem; }
.intro-ctas { margin-top: 1rem; display: flex; gap: .8rem; }
.intro-ctas .btn { padding: .6rem 1rem; border-radius: var(--radius-sm); background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,0.06); text-decoration: none; overflow: var(--overflow-clip); }

/* Contact Section Styles */
.contact-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.contact-icons li {
  display: inline-block;
}

.contact-icons a {
  display: inline-block;
  width: 40px;
  height: 40px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-full);
  overflow: var(--overflow-clip);
}

.contact-icons a.email {
  background-image: url('../assets/icons/email-icon.png');
}

.contact-icons a.linkedin {
  background-image: url('../assets/icons/linkedin-icon.png');
}

.contact-icons a.github {
  background-image: url('../assets/icons/github-icon.png');
}

.contact-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 20px 0;
  flex-wrap: wrap;
}

.contact-buttons li {
  display: inline-block;
}

/* Unified Contact Button Style */
.contact-buttons .contact-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  text-decoration: none;
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  background: transparent;
  overflow: var(--overflow-clip);
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
  height: 48px;
  transition: 
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease,
    background 0.3s ease;
}

.contact-buttons .contact-btn .btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
  transition: transform 0.3s ease;
}

/* Ensure all buttons have same min-width for uniform size */
.contact-buttons .contact-btn {
  min-width: 140px;
  justify-content: center;
}

/* Flowing light effect for all contact buttons */
.contact-buttons .contact-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 30%,
    rgba(106, 176, 243, 0.15) 45%,
    rgba(106, 176, 243, 0.3) 50%,
    rgba(106, 176, 243, 0.15) 55%,
    transparent 70%,
    transparent 100%
  );
  transition: left 0.6s ease;
  pointer-events: none;
  z-index: 1;
}

.contact-buttons .contact-btn:hover::before {
  left: 100%;
}

.contact-buttons .contact-btn:hover {
  box-shadow: 
    0 0 20px rgba(106, 176, 243, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: rgba(106, 176, 243, 0.8);
  background: rgba(106, 176, 243, 0.08);
}

.contact-buttons .contact-btn:hover .btn-icon {
  transform: scale(1.1);
}

.contact-buttons .contact-btn:active {
  transform: scale(0.98);
}

/* Focus states for contact buttons */
.contact-buttons .contact-btn:focus {
  outline: none;
  box-shadow: 
    0 0 0 3px rgba(106, 176, 243, 0.4),
    0 0 20px rgba(106, 176, 243, 0.15);
}

.contact-buttons .contact-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* My Contact button - subtle highlight as primary action */
.contact-buttons .contact-btn.my-contact {
  background: linear-gradient(135deg, rgba(106, 176, 243, 0.1) 0%, rgba(74, 141, 195, 0.05) 100%);
}

.contact-buttons .contact-btn.my-contact:hover {
  background: linear-gradient(135deg, rgba(106, 176, 243, 0.2) 0%, rgba(74, 141, 195, 0.1) 100%);
}

/* Resume button - document-themed styling */
.contact-buttons .contact-btn.resume {
  background: linear-gradient(135deg, rgba(156, 136, 255, 0.1) 0%, rgba(106, 90, 205, 0.05) 100%);
}

.contact-buttons .contact-btn.resume:hover {
  background: linear-gradient(135deg, rgba(156, 136, 255, 0.2) 0%, rgba(106, 90, 205, 0.1) 100%);
}

/* Header Styles */
header {
  background: var(--bg);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  position: absolute;
  top: 1rem;
  right: 2rem; /* Ensure alignment to the top right corner */
}

.nav-links li {
  display: inline;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

.lang-toggle {
  position: relative;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.9rem;
  overflow: var(--overflow-clip);
  transition: 
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* Flowing light effect for language toggle */
.lang-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 30%,
    rgba(106, 176, 243, 0.15) 45%,
    rgba(106, 176, 243, 0.3) 50%,
    rgba(106, 176, 243, 0.15) 55%,
    transparent 70%,
    transparent 100%
  );
  transition: left 0.6s ease;
  pointer-events: none;
  z-index: 1;
}

.lang-toggle:hover::before {
  left: 100%;
}

.lang-toggle:hover {
  box-shadow: 
    0 0 15px rgba(106, 176, 243, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.15);
  border-color: rgba(106, 176, 243, 0.8);
}

.lang-toggle:focus {
  outline: none;
  box-shadow: 
    0 0 0 3px rgba(106, 176, 243, 0.4),
    0 0 15px rgba(106, 176, 243, 0.15);
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Vision Section Styles */
.centered-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg);
}

.vision-content {
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center; /* Center the image */
}

.vision-image {
  width: 1000px;
  height: 600px;
  border-radius: var(--radius-md); /* Chamfered rectangle */
  object-fit: cover;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* Enhanced shadow effect */
  overflow: var(--overflow-clip);
}

.vision-header {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent); /* Make the header pop */
  margin-bottom: 1rem;
}

.vision-text {
  font-size: 1.0rem;
  color: var(--text);
  line-height: 1.6;
}

@media (max-width: 880px) {
  .intro-grid { grid-template-columns: 1fr; text-align: center; }
  .intro-photo { margin: 0 auto; width: 220px; height: 220px; }
  .intro-card h2, .intro-lead, .intro-type { text-align: center; }
  .skills-list { justify-content: center; }
  .intro-ctas { justify-content: center; }
}

/* =============================================
   Comprehensive Mobile Responsive Styles
   ============================================= */

/* Tablet breakpoint */
@media (max-width: 768px) {
  body {
    padding-top: 56px;
  }

  /* Nav Links Mobile - Override gap from desktop */
  .nav-links {
    gap: 0;
  }

  .nav-links li {
    display: block;
  }

  /* Hero Section Mobile */
  #hero {
    height: 100vh;
    min-height: 400px;
    margin-top: -56px;
    padding-top: 56px;
  }

  #hero h1 {
    font-size: 2.2rem;
    letter-spacing: -0.01em;
  }

  .role {
    font-size: 1rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  /* Intro Section Mobile */
  #intro {
    padding: 3rem 1.5rem;
    margin-top: 0;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0;
  }

  .intro-photo {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }

  /* Section Styles Mobile */
  section {
    padding: 3rem 1.5rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  /* Work Grid Mobile */
  .work-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 0 0.5rem;
  }

  /* Contact Buttons Mobile */
  .contact-buttons {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 1rem;
  }

  .contact-buttons .contact-btn {
    width: 100%;
    max-width: 280px;
    min-width: auto;
    justify-content: center;
  }

  /* Vision Section Mobile */
  .vision-content {
    max-width: 100%;
    padding: 0 1rem;
  }

  .vision-header {
    font-size: 1.4rem;
  }

  .vision-text {
    font-size: 0.95rem;
  }
}

/* Small Mobile breakpoint */
@media (max-width: 480px) {
  body {
    padding-top: 48px;
  }

  /* Hero Section Small Mobile */
  #hero {
    height: 100vh;
    min-height: 350px;
    margin-top: -48px;
    padding-top: 48px;
  }

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

  .role {
    font-size: 0.9rem;
  }

  .subtitle {
    font-size: 0.85rem;
  }

  /* Intro Section Small Mobile */
  #intro {
    padding: 2.5rem 1rem;
  }

  .intro-grid {
    padding: 0;
    gap: 1rem;
  }

  .intro-photo {
    width: 160px;
    height: 160px;
  }

  .intro-card h2 {
    font-size: 1.4rem;
  }

  .intro-lead {
    font-size: 0.9rem;
  }

  .skills-list {
    gap: 0.4rem;
  }

  .skill {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
  }

  /* Section Styles Small Mobile */
  section {
    padding: 2.5rem 1rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  /* Contact Buttons Small Mobile */
  .contact-buttons .contact-btn {
    height: 44px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .contact-buttons .contact-btn .btn-icon {
    width: 16px;
    height: 16px;
  }
}

/* =============================================
   Reduced Motion Support for Style.css Buttons
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  .contact-buttons a::before,
  .lang-toggle::before {
    transition: none;
  }
  
  .contact-buttons a:hover::before,
  .lang-toggle:hover::before {
    left: -100%;
  }
  
  .contact-buttons a,
  .lang-toggle {
    transition: 
      box-shadow 0.3s ease,
      border-color 0.3s ease;
  }
}

/* Site Footer */
.site-footer {
  background: var(--bg);
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.site-footer p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  margin: 0;
}
