/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
  /* Dark theme (default) */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-hover: #1e1e1e;
  --text-primary: #e0e0e0;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #4fd1a5;
  --accent-dim: rgba(79, 209, 165, 0.15);
  --border: #222222;
  --severity-critical: #ff4444;
  --severity-high: #ff8c00;
  --severity-medium: #ccaa00;
  --severity-low: #44bb44;
  --nav-bg: rgba(10, 10, 10, 0.9);
  --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1000px;
  --nav-height: 56px;
}

[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f0;
  --bg-tertiary: #e8e8e8;
  --bg-hover: #e0e0e0;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #999999;
  --accent: #0d9668;
  --accent-dim: rgba(13, 150, 104, 0.1);
  --border: #d0d0d0;
  --nav-bg: rgba(250, 250, 250, 0.9);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.7;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.75;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ========================================
   Navigation
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 13px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-icon {
  display: block;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s, opacity 0.3s;
}

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

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

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

/* ========================================
   Hero
   ======================================== */
.hero {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 24px 16px;
  text-align: center;
}

.hero-content {
  max-width: var(--max-width);
}

.avatar-wrapper {
  margin-bottom: 24px;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  font-size: 48px;
  color: var(--accent);
  opacity: 0.6;
}

.hero h1 {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-title {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

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

/* ========================================
   Sections
   ======================================== */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.prompt {
  color: var(--accent);
  margin-right: 6px;
}

.section-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 15px;
}

.section-content p:last-child {
  margin-bottom: 0;
}

/* ========================================
   Tables
   ======================================== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: var(--bg-secondary);
}

th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

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

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: var(--bg-hover);
}

td a {
  color: var(--accent);
}

.date-col {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 12px;
}

/* Severity badges */
.severity {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.severity-critical {
  background: rgba(255, 68, 68, 0.15);
  color: var(--severity-critical);
}

.severity-high {
  background: rgba(255, 140, 0, 0.15);
  color: var(--severity-high);
}

.severity-medium {
  background: rgba(204, 170, 0, 0.15);
  color: var(--severity-medium);
}

.severity-low {
  background: rgba(68, 187, 68, 0.15);
  color: var(--severity-low);
}

/* Disclosures toggle */
.disclosure-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  margin-bottom: 16px;
}

.disclosure-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.disclosure-toggle .arrow {
  transition: transform 0.2s;
  font-size: 10px;
}

.disclosure-toggle.expanded .arrow {
  transform: rotate(90deg);
}

.disclosure-table-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.disclosure-table-wrapper.expanded {
  max-height: 1000px;
}

/* ========================================
   Misc List
   ======================================== */
.misc-list {
  list-style: none;
  padding: 0;
}

.misc-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.misc-list li:last-child {
  border-bottom: none;
}

.misc-date {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer blockquote {
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

.footer blockquote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 12px;
}

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

/* ========================================
   Skeletons
   ======================================== */
.skeleton-text {
  color: var(--text-muted);
}

.skeleton-block {
  height: 60px;
  background: var(--bg-secondary);
  border-radius: 6px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* Error state */
.error-msg {
  color: var(--severity-high);
  font-size: 13px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 220px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: calc(var(--nav-height) + 16px) 24px 24px;
    gap: 16px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 15px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .section {
    padding: 32px 16px;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 8px 10px;
  }

  .misc-list li {
    flex-direction: column;
    gap: 2px;
  }
}
