/* Hermes Architecture - Editorial Light Theme */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #FAF9F6;
  --bg-secondary: #F5F3EF;
  --bg-card: #FFFFFF;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #8a8a8a;
  --accent: #D4A574;
  --accent-light: #E8DFD3;
  --accent-dark: #B8935F;
  --border: #E5E2DC;
  --sidebar-bg: #F5F3EF;
  --code-bg: #1e1e2e;
  --success: #059669;
  --warning: #D97706;
  --error: #DC2626;
}

body {
  font-family: 'Source Serif Pro', Georgia, serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

/* Typography */
h1, h2, h3, h4, .font-display {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.3;
}

code, pre {
  font-family: 'JetBrains Mono', monospace;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  margin-bottom: 0.25rem;
  transition: all 0.2s;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(212, 165, 116, 0.1);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(212, 165, 116, 0.15);
  color: var(--accent-dark);
  border-left-color: var(--accent);
}

.layer-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  background: rgba(212, 165, 116, 0.2);
  color: var(--accent-dark);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

.nav-item.active .layer-num {
  background: var(--accent);
  color: white;
}

/* Main Content */
.main-content {
  margin-left: 280px;
  flex: 1;
  padding: 2.5rem;
  max-width: calc(100% - 280px);
  min-height: 100vh;
}

.content-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.content-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.content-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.blue { background: rgba(59, 130, 246, 0.15); color: #2563EB; }
.badge.cyan { background: rgba(6, 182, 212, 0.15); color: #0891B2; }
.badge.emerald { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge.amber { background: rgba(245, 158, 11, 0.15); color: #D97706; }
.badge.purple { background: rgba(168, 85, 247, 0.15); color: #9333EA; }
.badge.rose { background: rgba(244, 63, 94, 0.15); color: #E11D48; }

/* Diagrams */
.diagram-title {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  margin-top: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.diagram-title:first-of-type {
  margin-top: 0;
}

.diagram-container {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

svg {
  width: 100%;
  min-width: 900px;
  display: block;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.cards-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(212, 165, 116, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.card-dot.blue { background: #3b82f6; }
.card-dot.cyan { background: #06b6d4; }
.card-dot.emerald { background: #10b981; }
.card-dot.amber { background: #f59e0b; }
.card-dot.purple { background: #a855f7; }
.card-dot.rose { background: #f43f5e; }

.card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card ul {
  list-style: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.card li {
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  position: relative;
}

.card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* Card Highlight */
.card-highlight {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.card-highlight.blue-text { color: #3B82F6; }
.card-highlight.amber-text { color: #D97706; }
.card-highlight.emerald-text { color: #10B981; }
.card-highlight.purple-text { color: #7C3AED; }
.card-highlight.rose-text { color: #E11D48; }

/* Index Cards Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid .card {
  text-decoration: none;
  cursor: pointer;
}

.grid .card:hover {
  transform: translateY(-3px);
}

/* Code Blocks */
.code-block {
  background: var(--code-bg);
  border-radius: 12px;
  overflow: hidden;
  margin: 1rem 0;
}

.code-block .header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #16161e;
  border-bottom: 1px solid #2a2a3c;
}

.code-block .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #cdd6f4;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent);
}

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 1.5rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .content-title {
    font-size: 1.75rem;
  }
}
