/* ==========================================================================
   PROTO PCB - Professional Web Application Design System
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Brand Color Tokens */
  --primary-navy: #162e54;
  --primary-dark: #0b1526;
  --primary-deep: #070e1b;
  --accent-cyan: #00d2ff;
  --accent-cyan-glow: rgba(0, 210, 255, 0.25);
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-orange: #f59e0b;
  
  /* Neutral Color Tokens */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  
  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Layout & Spacing */
  --container-width: 1280px;
  --header-height: 92px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Elevative Shadows & Effects */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 16px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 25px rgba(0, 210, 255, 0.3);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--gray-800);
  background-color: var(--gray-50);
  line-height: 1.6;
  padding-top: var(--header-height);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--gray-900);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: all var(--transition-fast);
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Containers */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.py-xl { padding-top: 5rem; padding-bottom: 5rem; }
.py-lg { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.py-md { padding-top: 2rem; padding-bottom: 2rem; }

.text-center { text-align: center; }
.text-cyan { color: var(--accent-cyan) !important; }
.text-green { color: var(--accent-green) !important; }
.text-navy { color: var(--primary-navy) !important; }

/* Buttons & Interactive Elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-navy) 0%, #1e3a68 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(22, 46, 84, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #122442 0%, var(--primary-navy) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22, 46, 84, 0.35);
  color: var(--white);
}

.btn-cyan {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #00b4db 100%);
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: var(--shadow-glow);
}

.btn-cyan:hover {
  background: linear-gradient(135deg, #33dcff 0%, var(--accent-cyan) 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.5);
  color: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--primary-navy);
  color: var(--primary-navy);
}

.btn-outline:hover {
  background: var(--primary-navy);
  color: var(--white);
}

.btn-outline-white {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--white);
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--white);
  color: var(--white);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Header & Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-img {
  height: 68px;
  width: auto;
  object-fit: contain;
}

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

.nav-item {
  position: relative;
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-700);
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

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

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-cyan);
  border-radius: 2px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-navy);
  cursor: pointer;
}

/* Hero Section */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary-navy) 60%, #173766 100%);
  color: var(--white);
  padding: 5rem 0 6rem;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(rgba(0, 210, 255, 0.12) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
  opacity: 0.6;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.badge-tag span.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  color: var(--white);
  font-size: 3.4rem;
  letter-spacing: -0.5px;
  margin-bottom: 1.25rem;
}

.hero-title span.highlight {
  background: linear-gradient(120deg, var(--accent-cyan) 0%, #a5f3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 2rem;
  max-width: 600px;
}

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

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.stat-item h4 {
  font-size: 1.6rem;
  color: var(--accent-cyan);
  margin-bottom: 0.2rem;
}

.stat-item p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Quick Gerber Card in Hero */
.hero-card-preview {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), var(--shadow-glow);
  backdrop-filter: blur(10px);
}

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-card-header h3 {
  color: var(--white);
  font-size: 1.3rem;
}

.hero-card-header span {
  font-size: 0.85rem;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

/* PCB Instant Quote Calculator Widget */
.quote-section {
  background-color: var(--gray-100);
}

.calculator-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
}

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

.calc-inputs {
  padding: 2.5rem;
}

.calc-summary-panel {
  background: linear-gradient(180deg, var(--primary-navy) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.form-group-title {
  font-size: 1.1rem;
  color: var(--primary-navy);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid var(--gray-100);
  padding-bottom: 0.5rem;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.option-btn {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-700);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-btn:hover {
  border-color: var(--primary-navy);
  color: var(--primary-navy);
}

.option-btn.selected {
  background: var(--primary-navy);
  color: var(--white);
  border-color: var(--primary-navy);
  box-shadow: 0 2px 6px rgba(22, 46, 84, 0.3);
}

/* Color Swatches */
.swatch-grid {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.swatch-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  background: var(--white);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.swatch-btn.selected {
  border-color: var(--primary-navy);
  background: var(--gray-100);
  font-weight: 700;
}

/* Gerber Upload Dropzone */
.dropzone {
  border: 2px dashed var(--accent-blue);
  background: rgba(37, 99, 235, 0.04);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: 1.5rem;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  background: rgba(0, 210, 255, 0.08);
  border-color: var(--accent-cyan);
}

.dropzone i {
  font-size: 2.5rem;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
}

.file-analyzing {
  display: none;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--accent-green);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  color: var(--gray-800);
}

.file-analyzing.active {
  display: block;
}

/* Layer Stackup Configurator Section */
.stackup-visualizer {
  background: var(--primary-dark);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.stackup-layer {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  justify-content: space-between;
  transition: transform var(--transition-fast);
}

.stackup-layer:hover {
  transform: scale(1.01);
}

.layer-soldermask { background: rgba(16, 185, 129, 0.25); border: 1px dashed #10b981; color: #6ee7b7; }
.layer-copper { background: rgba(245, 158, 11, 0.3); border: 1fr solid #f59e0b; color: #fde047; }
.layer-prepreg { background: rgba(59, 130, 246, 0.25); border: 1px solid #3b82f6; color: #93c5fd; }
.layer-core { background: rgba(139, 92, 246, 0.3); border: 1px solid #8b5cf6; color: #c4b5fd; }

/* PCBA & Turnkey Assembly Showcase */
.pcba-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.pcba-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-blue);
}

.icon-box-lg {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(22, 46, 84, 0.08);
  color: var(--primary-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.pcba-card:hover .icon-box-lg {
  background: var(--primary-navy);
  color: var(--accent-cyan);
}

/* Searchable Capabilities Matrix Table */
.table-wrapper {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  border: 1px solid var(--gray-200);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.specs-table th {
  background: var(--primary-navy);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 1.1rem 1.25rem;
  font-size: 0.95rem;
}

.specs-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
}

.specs-table tr:hover td {
  background: rgba(0, 210, 255, 0.04);
}

.search-input {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-navy);
  box-shadow: 0 0 0 3px rgba(22, 46, 84, 0.15);
}

/* DFM Rule Checker Accordion */
.accordion-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.accordion-header {
  padding: 1.25rem 1.5rem;
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--gray-900);
}

.accordion-header:hover {
  background: var(--gray-50);
}

.accordion-content {
  display: none;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-700);
  font-size: 0.95rem;
}

.accordion-item.active .accordion-content {
  display: block;
}

/* Quality & Certification Badges */
.cert-badge-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 2rem 0;
}

.cert-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.cert-card h4 {
  font-size: 1.2rem;
  color: var(--primary-navy);
  margin-bottom: 0.2rem;
}

.cert-card p {
  font-size: 0.8rem;
  color: var(--gray-600);
}

/* Contact RFQ Form */
.rfq-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

.form-field {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
  margin-top: 0.35rem;
}

.form-field:focus {
  outline: none;
  border-color: var(--primary-navy);
  box-shadow: 0 0 0 3px rgba(22, 46, 84, 0.15);
}

label.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700);
}

/* Footer */
.footer {
  background: var(--primary-deep);
  color: var(--gray-300);
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo img {
  height: 64px;
  filter: brightness(0) invert(1);
  margin-bottom: 1rem;
}

.footer h4 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.footer-links a {
  color: var(--gray-400);
  font-size: 0.9rem;
}

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

.footer-bottom {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-400);
}

/* Mobile responsive menu */
@media (max-width: 992px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--white);
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--gray-200);
  }

  .nav-menu.show {
    display: flex;
  }

  .mobile-toggle {
    display: block;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-desc {
    margin: 0 auto 2rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* YouTube Lightbox Modal */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.video-modal.active {
  opacity: 1;
  visibility: visible;
}

.video-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 14, 27, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.video-modal-container {
  position: relative;
  width: 90%;
  max-width: 960px;
  z-index: 10;
  transform: scale(0.95);
  transition: transform var(--transition-base);
}

.video-modal.active .video-modal-container {
  transform: scale(1);
}

.video-modal-close-btn {
  position: absolute;
  top: -45px;
  right: 0;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

.video-modal-iframe-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(0, 210, 255, 0.4);
  background: var(--primary-dark);
}

.video-modal-iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
