@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

:root {
  /* Dark Mode Color Palette */
  --bg-color: #0b0e14;
  --sidebar-bg: #11141b;
  --card-bg: #161b22;
  --header-bg: rgba(11, 14, 20, 0.9);
  
  --text-primary: #f0f6fc;
  --text-secondary: #a6b0bb; /*#8b949e;*/
  --text-muted: #7d8590; /*#6e7681;*/
  
  /* Purple Accent - Vibrant but not too dark */
  --accent-color: #a371f7;
  --accent-hover: #b893f9;
  --border-color: #30363d;
  
  /* Professional System Font Stack - No "funky" fonts */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  
  --max-width: 1200px;
  --sidebar-width: 280px;
  --header-height: 64px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 2rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Navigation (Centered) --- */
header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--header-bg);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-color);
}

/* --- Layout (Centered Page) --- */
.page {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 3rem;
}

/* --- Sidebar --- */
.sidebar {
  position: sticky;
  top: 6rem;
  height: fit-content;
  background: var(--sidebar-bg);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.sidebar-profile {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-img {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-color), #8957e5);
  border-radius: 6px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 700;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.profile-bio {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sidebar h2 {
  font-size: 0.7rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li a {
  display: block;
  padding: 0.4rem 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

/* --- Main Content --- */
.content {
  min-width: 0;
}

h1, h2, h3 {
  color: var(--accent-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 2.25rem; margin-top: 0; }
h2 { font-size: 1.5rem; margin-top: 2.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
h3 { font-size: 1.2rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

/* --- Vulnerability List --- */
.vulnerability-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.vulnerability-item {
  scroll-margin-top: 6rem;
}

.vulnerability-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.vulnerability-header h2 {
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
  font-size: 1.75rem;
}

.vulnerability-tag {
  background: rgba(163, 113, 247, 0.1);
  color: var(--accent-color);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(163, 113, 247, 0.2);
}

.vulnerability-body ul {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
}

.vulnerability-body li {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.appendix-link {
  display: inline-block;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.appendix-link:hover {
  text-decoration: underline;
}

/* --- Components --- */
.highlight-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.research-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.research-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.card-number {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.button {
  display: inline-flex;
  background-color: var(--accent-color);
  color: #0b0e14 !important;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th { color: var(--text-primary); }

code {
  background: #21262d;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .page {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .sidebar {
    position: static;
    width: 100%;
  }
}

@media (max-width: 768px) {
  :root {
    --max-width: 100%;
  }

  nav {
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
  }

  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .nav-links a {
    font-size: 0.8rem;
    padding: 0.5rem 0.25rem;
  }

  .page {
    margin: 1rem auto;
    padding: 0 1rem;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }

  .vulnerability-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .vulnerability-header h2 {
    font-size: 1.4rem;
  }

  /* Responsive Tables */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Reference list text wrapping fix */
  .reference-list li {
    padding-left: 1.5rem !important;
    text-indent: -1.5rem !important;
    font-size: 0.9rem;
    word-wrap: break-word;
    word-break: break-word;
  }
  
  .reference-list a {
    word-break: break-all;
  }

  .highlight-item code {
    font-size: 0.75rem;
  }
  
  .demo-image {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .nav-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: 0.5rem;
  }
  
  .nav-links li {
    width: 100%;
  }
  
  .logo {
    font-size: 1.1rem;
  }
}
