/* ==========================================================================
   Embedded Bare-Metal Radar-Inertial Odometry
   Refined Dark Navy Blue Theme & Academic Aesthetic
   ========================================================================== */

:root {
  /* Primary Theme: Sophisticated Dark Navy Blue */
  --bg-page: #0a1124;
  --bg-card: #101c38;
  --bg-card-subtle: #142347;
  --bg-surface: #1a2d59;

  --border: #1e3567;
  --border-subtle: #15274d;
  --border-focus: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --text-link: #60a5fa;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.15);
  --accent-navy: #1d4ed8;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --shadow-subtle: 0 1px 3px rgba(3, 7, 18, 0.4);
  --shadow-card: 0 4px 14px rgba(3, 7, 18, 0.45);
  --shadow-lg: 0 12px 30px rgba(3, 7, 18, 0.6);

  --max-width: 1060px;
  --header-height: 64px;
  --transition: 0.18s ease;
}

[data-theme="light"] {
  /* Secondary Option: Clean Navy-Tinted Light Theme */
  --bg-page: #f5f8fc;
  --bg-card: #ffffff;
  --bg-card-subtle: #edf3fa;
  --bg-surface: #e1ebf7;

  --border: #cbdbe9;
  --border-subtle: #e2ecf5;
  --border-focus: #1d4ed8;

  --text-main: #0a1931;
  --text-muted: #334155;
  --text-light: #64748b;
  --text-link: #1d4ed8;

  --accent: #1d4ed8;
  --accent-hover: #2563eb;
  --accent-light: rgba(29, 78, 216, 0.08);
  --accent-navy: #1e3a8a;

  --shadow-subtle: 0 1px 3px rgba(10, 25, 49, 0.05);
  --shadow-card: 0 4px 12px rgba(10, 25, 49, 0.06);
  --shadow-lg: 0 12px 28px rgba(10, 25, 49, 0.08);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-page);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
}

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

code, pre {
  font-family: var(--font-mono);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ==========================================================================
   Header & Navbar (Clean Dark Navy)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background-color var(--transition), border-color var(--transition);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  text-decoration: none;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  background-color: var(--accent-light);
  color: var(--accent-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 22px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

.btn-small-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-small-link:hover {
  background: var(--bg-surface);
  text-decoration: none;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding-top: 48px;
  padding-bottom: 36px;
  text-align: center;
}

.hero-title {
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  margin-bottom: 22px;
}

.authors {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.authors a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}

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

.affiliation {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.venue {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 26px;
}

/* Hero Action Buttons */
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-subtle);
  color: var(--accent-hover);
  border-color: var(--accent);
  text-decoration: none;
}

/* Highlights Pill Bar */
.highlights-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.highlight-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  box-shadow: var(--shadow-subtle);
}

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

/* ==========================================================================
   Sections & Content Blocks
   ========================================================================== */

.section {
  padding-top: 44px;
  padding-bottom: 44px;
  border-top: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
  margin-bottom: 8px;
}

.section-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin-bottom: 22px;
  max-width: 820px;
}

/* Abstract Box */
.abstract-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 28px;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-muted);
}

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

/* Architecture & Hardware Grid */
.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

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

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-subtle);
}

.panel-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-frame {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 14px;
}

.image-frame img {
  max-height: 280px;
  width: auto;
  object-fit: contain;
}

.image-caption {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Interactive Tabs (Hardware) */
.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab-link {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.tab-link:hover {
  color: var(--text-main);
}

.tab-link.active {
  color: var(--accent-hover);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Specs List */
.specs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.spec-badge {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

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

/* ==========================================================================
   Method Section (Concise 4-Step Grid)
   ========================================================================== */

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.method-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: var(--shadow-subtle);
  position: relative;
}

.method-num {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.method-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.method-text {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ==========================================================================
   Results & Visualizations
   ========================================================================== */

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 26px;
}

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

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
}

.result-image-box {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  cursor: pointer;
}

.result-image-box img {
  max-height: 240px;
  width: auto;
  object-fit: contain;
}

.result-body {
  padding: 16px;
  flex: 1;
}

.result-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.result-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Consolidated Data Table
   ========================================================================== */

.table-wrapper {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.clean-table th, .clean-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.clean-table th {
  background: var(--bg-card-subtle);
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clean-table tr:last-child td {
  border-bottom: none;
}

.clean-table td.num {
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.clean-table td.highlight {
  color: var(--accent-hover);
  font-weight: 600;
}

/* ==========================================================================
   Code & Citation
   ========================================================================== */

.code-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-main);
  overflow-x: auto;
}

.copy-button {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.copy-button:hover {
  background: var(--border);
  color: var(--text-main);
}

.copy-button.copied {
  color: #10b981;
  border-color: #10b981;
}

.bibtex-pre {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding-top: 36px;
  padding-bottom: 36px;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 16px;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
}

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

/* ==========================================================================
   Lightbox Modal
   ========================================================================== */

.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 17, 36, 0.94);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  margin-top: 12px;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.lightbox-close {
  position: absolute;
  top: -38px;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-buttons .btn {
    justify-content: center;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}
