/* ==========================================================================
   DevSpace - Modern Dark Theme Portfolio Stylesheet
   ========================================================================== */

/* 1. CSS Custom Properties / Design Tokens */
:root {
  /* Color Palette - Deep Navy, Purple & Electric Blue */
  --bg-primary: #070913;
  --bg-secondary: #0d1224;
  --bg-card: rgba(16, 23, 44, 0.7);
  --bg-card-hover: rgba(25, 36, 68, 0.85);

  --border-color: rgba(99, 102, 241, 0.18);
  --border-color-hover: rgba(99, 102, 241, 0.45);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --accent-purple: #8b5cf6;
  --accent-blue: #06b6d4;
  --accent-indigo: #6366f1;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 50%, #06b6d4 100%);
  --gradient-border: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(6, 182, 212, 0.5));
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Spacing & Layout */
  --container-width: 1100px;
  --nav-height: 72px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. Global Resets & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  background-image: 
    radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  background-repeat: no-repeat;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

/* 3. Utility Classes & Container */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 4vw, 1.75rem);
  padding-right: clamp(1rem, 4vw, 1.75rem);
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

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

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-smooth), border-color var(--transition-normal), box-shadow var(--transition-smooth);
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15);
}

/* 4. Section Headers */
.section {
  padding: 5rem 0;
}

.section-header {
  margin-bottom: 2.5rem;
  text-align: left;
}

.section-kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-blue);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 40px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* 5. Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(7, 9, 19, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

.navbar.scrolled {
  background: rgba(7, 9, 19, 0.95);
  border-bottom-color: var(--border-color);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.brand-logo {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo-symbol {
  font-family: var(--font-mono);
  color: var(--accent-purple);
  font-size: 1.1rem;
}

.nav-menu {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  flex-wrap: nowrap;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger-bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  background-color: var(--text-main);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* 6. Hero Section */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-height) + 2.5rem);
  padding-bottom: 4rem;
  width: 100%;
}

.hero-container {
  width: 100%;
}

.hero-content {
  width: 100%;
  max-width: 780px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.4rem);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  overflow-wrap: break-word;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-subtle);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

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

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

/* 7. About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.about-text strong {
  color: var(--text-main);
}

.about-meta {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--accent-purple);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.meta-value {
  color: var(--text-main);
  font-size: 0.95rem;
}

/* 8. Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.category-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.tag:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-blue);
}

/* 9. Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.75rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.project-badge {
  font-size: 0.75rem;
  color: var(--accent-blue);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 0.4rem;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

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

.project-links {
  display: flex;
  gap: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.link-item {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-purple);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

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

.link-item .arrow {
  transition: transform var(--transition-fast);
}

.link-item:hover .arrow {
  transform: translate(2px, -2px);
}

/* 10. Learning Journey Section */
.learning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.step-indicator {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-blue);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.learning-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

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

/* 11. Contact Section */
.contact-card {
  max-width: 700px;
}

.contact-intro {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-icon {
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-blue);
}

.detail-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  font-weight: 600;
}

.detail-link, .detail-text {
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: break-word;
}

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

.social-links-wrapper {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.social-title {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

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

.social-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.social-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-purple);
  color: #ffffff;
  transform: translateY(-2px);
}

/* 12. Footer */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2.5rem 0;
  margin-top: 4rem;
  background: var(--bg-secondary);
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-container {
    flex-direction: row;
    text-align: left;
  }
}

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

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

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

/* 13. Scroll Reveal Animation Classes */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 14. Responsive Mobile Navigation & Viewport Adjustments */
@media (max-width: 868px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: rgba(7, 9, 19, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out;
  }

  .nav-menu.open {
    max-height: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 2rem;
    gap: 1.25rem;
    width: 100%;
  }

  .nav-link {
    font-size: 1.1rem;
    width: 100%;
    display: block;
    padding: 0.4rem 0;
  }

  /* Hamburger transform when menu open */
  .nav-toggle.open .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle.open .hamburger-bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (max-width: 768px) {
  .section {
    padding: 3.5rem 0;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 1.5rem);
    padding-bottom: 3rem;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .glass-card {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .contact-item {
    align-items: flex-start;
  }
}

/* 15. Accessibility: Respect User's Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }

  .glass-card:hover {
    transform: none !important;
  }
}
