/* Professional Light Theme - TI/Microchip Style */
:root {
  --primary: #003087;
  --primary-dark: #001f5c;
  --primary-light: #0052cc;
  --secondary: #0066cc;
  --accent: #00a3e0;
  --text: #1a1a1a;
  --text-muted: #666666;
  --text-light: #999999;
  --bg: #ffffff;
  --bg-light: #f8f9fa;
  --bg-section: #f5f7fa;
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --success: #28a745;
  --warning: #ffc107;
  --error: #dc3545;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-hover: rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--primary);
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-top: 2rem; }
h3 { font-size: 1.5rem; margin-top: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--text);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

code {
  font-family: 'Source Code Pro', 'Courier New', monospace;
  font-size: 0.9em;
  background: var(--bg-light);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  color: var(--primary-dark);
}

pre {
  background: var(--bg-light);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background: none;
  padding: 0;
}

/* Header */
.site-header {
  background: var(--primary-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.875rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: block;
}

.brand a {
  display: inline-block;
  text-decoration: none;
}

.brand a img {
  height: 90px;
  width: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.brand a:hover {
  text-decoration: none;
  opacity: 0.9;
}


.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.35rem 0;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Main Content */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 5rem 3rem;
  background: linear-gradient(135deg, var(--bg-section) 0%, var(--bg-light) 100%);
  border-radius: 12px;
  margin-bottom: 3rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.eyebrow {
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  margin-bottom: 2rem;
  display: inline-block;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--primary-dark);
}

.lead {
  font-size: 1.25rem;
  color: var(--text);
  max-width: 900px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.poc-note {
  background: #fff3cd;
  border-left: 5px solid var(--warning);
  padding: 1.25rem 1.75rem;
  margin: 2.5rem auto 0;
  max-width: 900px;
  border-radius: 6px;
  color: #856404;
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.poc-note strong {
  font-weight: 600;
}

/* Sections */
.section {
  margin-bottom: 4rem;
}

#projects {
  scroll-margin-top: 120px;
}

.section h2 {
  border-bottom: 3px solid var(--primary);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

/* Category (MCU grouping) */
.category {
  margin-bottom: 3rem;
}

.category:last-of-type {
  margin-bottom: 0;
}

.category-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0 0 1rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.category-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1rem 0;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 0;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px var(--shadow);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-hover);
  border-color: var(--primary-light);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.card h3 a {
  color: var(--primary);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

.card p {
  color: var(--text-muted);
  margin-bottom: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Project Page Styles */
.project-header {
  background: linear-gradient(135deg, var(--bg-section) 0%, var(--bg-light) 100%);
  padding: 3rem 2rem;
  border-radius: 8px;
  margin-bottom: 3rem;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.project-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}

.subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  background: var(--warning);
  color: #856404;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.badge-nogithub {
  display: inline-block;
  background: var(--text-muted);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.project-image {
  width: 100%;
  max-width: 600px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 2rem 0;
  box-shadow: 0 4px 8px var(--shadow);
}

.project-content {
  max-width: 900px;
}

.project-content h2 {
  margin-top: 3rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.project-content h2:first-of-type {
  margin-top: 0;
}

/* Spec Lists */
.spec-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.spec-list li {
  padding: 0.75rem 1rem;
  background: var(--bg-light);
  border-left: 3px solid var(--primary);
  margin-bottom: 0.5rem;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.9rem;
  color: var(--text);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--bg);
  box-shadow: 0 2px 4px var(--shadow);
  border-radius: 4px;
  overflow: hidden;
}

th {
  background: var(--primary);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: var(--bg-light);
}

/* Links Section */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

.links a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.links a:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: 0 4px 8px var(--shadow);
}

.links a:first-child {
  background: var(--bg-light);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.links a:first-child:hover {
  background: var(--primary);
  color: white;
}

/* Footer */
footer {
  background: var(--primary-dark);
  color: white;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.footer-inner a {
  color: white;
  text-decoration: underline;
}

.footer-inner a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
  .site-header-inner {
    flex-direction: column;
    gap: 1rem;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1.125rem;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 1rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* External Link Indicator */
a.ext::after {
  content: " ↗";
  font-size: 0.8em;
  opacity: 0.7;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h1 {
  margin: 0;
  font-size: 1.75rem;
  color: var(--primary-dark);
}

.modal-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 2rem;
}

.modal-body h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.modal-body h3:first-child {
  margin-top: 0;
}
