/* CSS Variables for design system */
:root {
  --font-header: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Color Palette - based on tech.jpg */
  --bg-deep: #010214;
  /* Obsidian Navy */
  --bg-section: #050a24;
  /* Dark indigo-blue */
  --bg-card: rgba(8, 14, 44, 0.7);
  /* Translucent glass card */
  --accent-cyan: #00f0ff;
  /* Neon/Ethereal cyan */
  --accent-blue: #0066ff;
  /* Electric cobalt */
  --accent-glow: rgba(0, 240, 255, 0.3);

  /* Text colors */
  --text-white: #ffffff;
  --text-primary: #f1f5f9;
  /* Soft ice-white */
  --text-secondary: #dedeee;
  /* Muted slate-grey */
  --text-muted: #64748b;

  /* Spacing */
  --header-height: 70px;
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scrollbar-color: rgba(0, 102, 255, 0.4) var(--bg-deep);
  scrollbar-width: thin;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(0, 102, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(0, 240, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(5, 10, 36, 1) 0%, rgba(1, 2, 20, 1) 100%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 102, 255, 0.3);
  border-radius: 4px;
  transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-header);
  color: var(--text-white);
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--text-white);
}

p {
  color: var(--text-secondary);
  font-weight: 300;
}

/* Header Ribbon Style */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: var(--header-height);
  background: rgba(1, 2, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  transition: var(--transition);
}

.site-header-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-white) 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.site-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 2px;
  transition: var(--transition);
}

/* Main Content Containers */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 0;
}

/* Common Section Header */
.section-title {
  font-size: 2.2rem;
  margin-bottom: 50px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 2px;
}

/* Hero Section */
.hero-section {
  display: flex;
  align-items: stretch;
  gap: 5%;
  min-height: auto;
}

.hero-image-container {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: relative;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: 540px;
  border-radius: var(--border-radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 102, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.2);
  transition: var(--transition);
}

.hero-image-container:hover .hero-image {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 240, 255, 0.3);
  border-color: rgba(0, 240, 255, 0.5);
}

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  font-size: 2.5rem;
  line-height: 1.25;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--text-white) 40%, #a5f3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text {
  font-size: 1.1rem;
  margin-bottom: 30px;
}

/* Featured Projects Section */
.projects-section {
  background-color: rgba(5, 10, 36, 0.4);
  border-top: 1px solid rgba(29, 47, 111, 0.3);
  border-bottom: 1px solid rgba(29, 47, 111, 0.3);
  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

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

/* Grid collapses matching design requirements */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Styling */
.project-card {
  display: block;
  /* whole card clickable */
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--border-radius);
  border: 1px solid rgba(29, 47, 111, 0.5);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
  height: 100%;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 240, 255, 0.25);
  border-color: rgba(0, 240, 255, 0.4);
}

.project-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: var(--bg-deep);
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-image {
  transform: scale(1.05);
}

.project-info {
  padding: 24px;
}

.project-name {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text-white);
  line-height: 1.4;
  transition: var(--transition);
}

.project-card:hover .project-name {
  color: var(--accent-cyan);
}

.project-description {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Bio Section */
.bio-section {
  display: block;
  content-visibility: auto;
  contain-intrinsic-size: 500px;
}

.bio-content-wrapper {
  display: flow-root;
}

.bio-pic {
  float: left;
  width: 100%;
  max-width: 320px;
  margin-right: 32px;
  margin-bottom: 16px;
  border-radius: var(--border-radius);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(29, 47, 111, 0.6);
  transition: var(--transition);
}

.bio-pic:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 102, 255, 0.2);
}

.bio-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.bio-text:last-of-type {
  margin-bottom: 0;
}

/* Call to Action (CTA) Section */
.cta-section {
  background: linear-gradient(135deg, rgba(16, 24, 76, 0.9) 0%, rgba(24, 38, 110, 0.85) 100%);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--border-radius);
  padding: 60px 40px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 240, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.cta-title {
  font-size: 2.2rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-white) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cta-text {
  max-width: 750px;
  margin: 0 auto 35px;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Premium Button Styling */
.btn {
  display: inline-block;
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 14px 32px;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #0099ff 100%);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3), 0 0 15px rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.5), 0 0 25px rgba(0, 240, 255, 0.4);
  border-color: var(--accent-cyan);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Footer Styling */
.site-footer {
  background: rgba(1, 2, 20, 0.95);
  border-top: 1px solid rgba(29, 47, 111, 0.4);
  padding: 24px 5%;
}

.site-footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.social-icon {
  color: var(--text-secondary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.social-icon:hover {
  color: var(--accent-cyan);
  transform: translateY(-2px);
  filter: drop-shadow(0 0 5px var(--accent-cyan));
}

/* Interactive Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(1, 2, 20, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: #060b26;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), 0 0 35px rgba(0, 240, 255, 0.15);
  transform: translateY(30px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  overflow: hidden;
  position: relative;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 24px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(29, 47, 111, 0.4);
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--text-white) 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--accent-cyan);
  transform: scale(1.1);
}

.modal-body {
  padding: 24px;
}

/* Form Styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.form-label {
  font-family: var(--font-header);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
}

.form-control {
  background: rgba(1, 2, 20, 0.6);
  border: 1px solid rgba(29, 47, 111, 0.8);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
  background: rgba(1, 2, 20, 0.8);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Animations CSS classes */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Delay for staggered entries */
.delay-100 {
  transition-delay: 100ms;
}

.delay-200 {
  transition-delay: 200ms;
}

.delay-300 {
  transition-delay: 300ms;
}

.delay-400 {
  transition-delay: 400ms;
}

/* Responsive Media Queries (Mobile First & Adjustments) */
@media (max-width: 900px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .hero-image-container {
    width: 100%;
    order: 1;
    justify-content: center;
  }

  .hero-image {
    height: auto;
    max-width: 500px;
    aspect-ratio: 3 / 2;
  }

  .hero-content {
    width: 100%;
    order: 2;
    align-items: center;
  }

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

@media (max-width: 640px) {
  .bio-pic {
    float: none;
    display: block;
    margin: 0 auto 24px;
    max-width: 280px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .site-subtitle {
    display: none;
  }
}

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

  .site-header {
    padding: 0 4%;
  }

  .site-title {
    font-size: 1.2rem;
  }

  .container {
    width: 92%;
    padding: 25px 0;
  }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }

  .cta-section {
    padding: 40px 20px;
  }

  .cta-title {
    font-size: 1.8rem;
  }

  .site-footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* Accessibility: Respect user preference for 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 !important;
    transform: none !important;
  }
}