/* ==========================================================================
   Siddharth Kote - Hardware & PCB Design Portfolio
   Theme: Precision Dark Navy + Electric Cyan/Blue (#080D1A / #101827 / #38BDF8 / #2563EB)
   ========================================================================== */

:root {
  --bg-dark: #080D1A;
  --bg-card: #101827;
  --bg-card-hover: #141f33;
  --bg-secondary: #0c1322;
  --bg-subtle: #090e1c;
  
  --border-color: #1E293B;
  --border-hover: rgba(56, 189, 248, 0.4);
  
  --accent-primary: #38BDF8;
  --accent-secondary: #2563EB;
  --accent-glow: rgba(56, 189, 248, 0.18);
  --accent-glow-strong: rgba(56, 189, 248, 0.35);
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  background-color: var(--bg-dark);
}

/* Subtle circuit grid background */
.grid-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(56, 189, 248, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.025) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

/* Ambient glow orbs */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.07), transparent 70%);
  top: -100px;
  right: -50px;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.05), transparent 70%);
  bottom: 10%;
  left: -150px;
}

/* Container */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Typography Helpers */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, #38BDF8 0%, #60a5fa 60%, #2563EB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 13, 26, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.9rem 0;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.brand-circuit {
  color: var(--accent-primary);
  display: flex;
  align-items: center;
}

.brand-sub {
  font-size: 0.65rem;
  background: #0c1424;
  border: 1px solid var(--border-color);
  color: var(--accent-primary);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-primary);
}

.btn-nav {
  padding: 0.45rem 1.1rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--accent-primary) !important;
}

.btn-nav:hover {
  background: var(--accent-primary);
  color: var(--bg-dark) !important;
  box-shadow: 0 2px 14px var(--accent-glow);
}

.mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: var(--transition);
  touch-action: manipulation;
  z-index: 101;
}

.mobile-toggle:hover {
  border-color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.08);
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-main);
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}

.mobile-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero Section */
.hero-section {
  padding: 4.8rem 0 3.8rem;
  position: relative;
  z-index: 1;
}

.hero-container {
  max-width: 860px;
}

.hero-content {
  max-width: 820px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.4rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  margin-bottom: 1.3rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(56, 189, 248, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.hero-title {
  font-size: clamp(2.4rem, 4.8vw, 3.8rem);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.hero-role {
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-size: 1.05rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

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

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

.hero-cta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-dark);
  font-weight: 700;
  box-shadow: 0 4px 18px var(--accent-glow);
}

.btn-primary:hover {
  background: #60a5fa;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow-strong);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
}

/* Sections Common */
.section {
  padding: 5rem 0;
  position: relative;
  z-index: 1;
}

.section-header {
  margin-bottom: 2.8rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  margin-bottom: 0.5rem;
}

.section-description {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 680px;
  line-height: 1.65;
}

/* About Grid */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
}

.about-card.highlight {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.2rem;
}

.about-card h3 {
  font-size: 1.35rem;
  margin-bottom: 1.1rem;
  color: var(--text-main);
}

.about-card p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.98rem;
  line-height: 1.7;
}

.about-features {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  transition: var(--transition);
}

.feature-box:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.feature-icon {
  color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.15);
  padding: 0.55rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-box h4 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.feature-box p {
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Education Section */
.education-section {
  background: rgba(16, 24, 39, 0.4);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
}

.timeline-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-primary);
}

.card-heading {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.card-subheading {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.8rem;
}

.card-body-text {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.6;
}

.cert-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cert-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cert-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}

.cert-issuer {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-primary);
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  transition: var(--transition);
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 28px rgba(0,0,0,0.5), 0 0 18px var(--accent-glow);
}

.skill-icon {
  color: var(--accent-primary);
  margin-bottom: 0.9rem;
}

.skill-title {
  font-size: 1.15rem;
  margin-bottom: 0.9rem;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.skill-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.skill-list .bullet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
  flex-shrink: 0;
}

/* Education Grid */
.education-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

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

/* Project Filter Controls */
.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 2.2rem;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.filter-btn.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
}

/* Card View Header & Interactive Tabs */
.card-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090e1c;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.view-tabs {
  display: flex;
  gap: 0.35rem;
}

.view-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.view-tab-btn:hover {
  color: var(--text-main);
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.04);
}

.view-tab-btn.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-primary);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.view-tab-btn.active::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 6px var(--accent-primary);
}

.interactive-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-primary);
  opacity: 0.85;
}

.schematic-view-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-primary);
  font-weight: 600;
}

/* Project Preview Viewport */
.project-preview {
  height: clamp(190px, 45vw, 220px);
  background: #070c18;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.project-preview.has-image {
  background: #070c18;
  padding: 0.75rem;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease, opacity 0.18s ease;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
  max-width: 100%;
}

.project-card:hover .project-img {
  transform: scale(1.04);
}

.schematic-svg {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  padding: 0.5rem;
  display: block;
}

.preview-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(8, 13, 26, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  z-index: 2;
}

.zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 13, 26, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 600;
  z-index: 3;
}

.clickable-preview {
  cursor: pointer;
}

.clickable-preview:hover .zoom-overlay {
  opacity: 1;
}

/* Project Info Area */
.project-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent-primary);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
}

.project-title {
  font-size: 1.25rem;
  margin-bottom: 0.7rem;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

.specs-table {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.spec-name {
  color: var(--text-dim);
}

.spec-val {
  color: var(--text-main);
  font-weight: 500;
  text-align: right;
  max-width: 62%;
}

.project-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.icon-link {
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
}

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

/* Workflow Visual Flow Ribbon */
.workflow-flow-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 2rem;
  width: 100%;
}

.flow-step {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.flow-arrow {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.95rem;
  user-select: none;
}

/* Workflow Steps */
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.6rem 1.2rem;
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.5), 0 0 14px var(--accent-glow);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-primary);
  opacity: 0.8;
  display: block;
  margin-bottom: 0.5rem;
}

.step-card h4 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Contact Section */
.contact-box {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.contact-box::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12), transparent 70%);
  filter: blur(55px);
  pointer-events: none;
}

.contact-title {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

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

.contact-info-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.1rem;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  background: #090e1c;
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 56px;
}

.contact-info-item:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 18px var(--accent-glow);
  transform: translateY(-2px);
}

#email-address {
  word-break: break-all;
}

.contact-info-item svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.contact-info-item a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.contact-info-item a:hover {
  color: var(--accent-primary);
}

.copy-btn {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid var(--border-color);
  color: var(--accent-primary);
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  border-radius: 4px;
  cursor: pointer;
  margin-left: auto;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--accent-primary);
  color: var(--bg-dark);
}

/* Modal / Project Details */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 15, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  width: 92%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.2rem;
  z-index: 10;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.8), 0 0 28px var(--accent-glow);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-gallery-title {
  font-size: 0.98rem;
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.modal-gallery-item {
  background: #070c18;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.modal-gallery-item:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.modal-gallery-item img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: #050913;
  padding: 0.4rem;
  display: block;
}

.modal-gallery-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-primary);
  text-align: center;
  padding: 0.35rem 0.4rem;
  background: #0d1527;
  border-top: 1px solid var(--border-color);
  display: block;
  width: 100%;
}

/* Modal Content Details */
.modal-header-block {
  margin-bottom: 1.25rem;
}

.modal-project-title {
  font-size: 1.5rem;
  color: #F8FAFC;
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
}

.modal-section-block {
  margin-bottom: 1.4rem;
}

.modal-subheading {
  font-size: 1rem;
  color: #38BDF8;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.modal-body-text {
  color: #94A3B8;
  font-size: 0.92rem;
  line-height: 1.6;
}

.modal-components-grid {
  background: #070c18;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.modal-comp-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  flex-wrap: wrap;
  gap: 0.25rem;
}

.comp-name {
  color: #38BDF8;
  font-weight: 600;
}

.comp-role {
  color: #CBD5E1;
  text-align: right;
}

.modal-tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-process-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-left: 0;
}

.modal-process-list li {
  font-size: 0.88rem;
  color: #CBD5E1;
  display: flex;
  gap: 0.6rem;
  line-height: 1.5;
}

.modal-footer-block {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* Dedicated Hardware Inspection Lightbox (Touch & Swipe Enabled) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 15, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lightbox-dialog {
  position: relative;
  z-index: 10;
  width: 95%;
  max-width: 960px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0c1424;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.85), 0 0 30px var(--accent-glow);
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  background: rgba(8, 13, 26, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 25;
  touch-action: manipulation;
}

.lightbox-close:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.lightbox-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
}

.lightbox-img {
  max-width: 100%;
  max-height: 68vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #050913;
  border: 1px solid var(--border-color);
  transition: opacity 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.75rem;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.lightbox-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.lightbox-label {
  color: var(--text-main);
  font-weight: 600;
}

.lightbox-counter {
  color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.lightbox-raw-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  transition: var(--transition);
}

.lightbox-raw-link:hover {
  text-decoration: underline;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(8, 13, 26, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 50%;
  color: var(--accent-primary);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 20;
  touch-action: manipulation;
}

.lightbox-nav:hover {
  background: var(--accent-primary);
  color: var(--bg-dark);
  box-shadow: 0 0 16px var(--accent-glow);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2.2rem 0;
  position: relative;
  z-index: 1;
  background: var(--bg-dark);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
  gap: 1rem;
}

.back-to-top {
  color: var(--accent-primary);
  text-decoration: none;
  font-family: var(--font-mono);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.back-to-top:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Responsive Breakpoints Framework
   - Large Desktop: 1440px+
   - Desktop: 1024px–1439px
   - Tablet: 768px–1023px
   - Mobile: below 768px
   - Small Mobile: below 480px (and down to 320px)
   ========================================================================== */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .container {
    max-width: 1240px;
  }
}

/* Tablet & Intermediate Desktop (768px - 1023px) */
@media (max-width: 1023px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .contact-box {
    padding: 2.4rem 1.8rem;
  }
}

/* Mobile Devices (below 768px) */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 0;
  }

  .mobile-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 61px;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100%;
    background: rgba(8, 13, 26, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1rem 1.25rem 1.5rem;
    gap: 0.5rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
    z-index: 99;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
  }

  .nav-link:hover,
  .nav-link.active {
    background: rgba(56, 189, 248, 0.08);
    color: var(--accent-primary);
  }

  .btn-nav {
    justify-content: center;
    margin-top: 0.5rem;
    min-height: 44px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .education-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

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

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Small Mobile Devices (below 480px, down to 320px) */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .nav-container {
    padding: 0 1rem;
  }

  .hero-section {
    padding: 3rem 0 2.2rem;
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 0.35rem 0.75rem;
  }

  .card-view-header {
    flex-direction: column;
    align-items: stretch;
  }

  .view-tabs {
    width: 100%;
  }

  .view-tab-btn {
    flex: 1;
    justify-content: center;
    min-height: 38px;
    padding: 0.3rem 0.2rem;
    font-size: 0.68rem;
  }

  .interactive-hint {
    display: none;
  }

  .spec-row {
    flex-direction: column;
    gap: 0.15rem;
  }

  .spec-val {
    text-align: left;
    max-width: 100%;
  }

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

  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .workflow-flow-strip {
    padding: 0.6rem 0.75rem;
    gap: 0.35rem 0.45rem;
  }

  .flow-step {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .flow-arrow {
    font-size: 0.8rem;
  }

  .modal-comp-item {
    flex-direction: column;
    gap: 0.1rem;
  }

  .comp-role {
    text-align: left;
  }

  .contact-box {
    padding: 1.4rem 1.1rem;
  }

  .modal-dialog {
    padding: 1.25rem 1rem;
    width: 95%;
  }

  .modal-gallery {
    grid-template-columns: 1fr;
  }

  .lightbox-dialog {
    padding: 1rem 0.6rem;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .lightbox-img {
    max-height: 60vh;
  }
}
