/* Professional Handbook Styling */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e2e8f0;
  --pre-bg: #f1f5f9;
  --pre-text: #334155;
  --code-bg: #f1f5f9;
  --code-text: #1e293b;
  --max-width: 1120px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
}

/* Base Typography */
html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }

body {
  font-family: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.65;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.site-brand a {
  color: var(--text);
  text-decoration: none;
}

.site-brand a:hover {
  text-decoration: none;
}

.site-desc {
  margin: 2px 0 0 0;
  color: var(--muted);
  font-size: 13px;
}

.site-brand img {
  display: block;
  border-radius: 6px;
}

/* Navigation */
.site-nav {
  display: flex;
  gap: 8px;
}

.site-nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg);
  text-decoration: none;
}

/* Layout Grid */
.main-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 8px;
}

/* Sidebar Categories */
.categories {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius);
  position: sticky;
  top: 24px;
}

.categories h3 {
  margin: 0 0 16px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}

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

.categories li {
  margin: 0;
}

.categories a {
  display: block;
  padding: 8px 12px;
  margin: 0 -12px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  border-radius: 6px;
  transition: background 0.15s;
}

.categories a:hover {
  background: var(--bg);
  text-decoration: none;
}

/* Search */
.search-bar {
  margin: 0 0 24px 0;
}

.search-bar input {
  width: 100%;
  max-width: 400px;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-bar input::placeholder {
  color: var(--muted);
}

/* Topics List */
.topics-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topics-list h3 {
  margin: 0 0 8px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}

.topic-list-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.topic-list-item:hover {
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.topic-list-item h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
}

.topic-list-item h4 a {
  color: var(--text);
}

.topic-list-item h4 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.topic-list-item .summary {
  margin: 0 0 12px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.topic-list-item .meta {
  color: var(--muted);
  font-size: 13px;
}

.topic-list-item .meta a {
  color: var(--muted);
  font-weight: 500;
}

.topic-list-item .meta a:hover {
  color: var(--accent);
}

/* Tags */
.tag {
  display: inline-block;
  background: var(--bg);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* Topic/Article Page */
.topic {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: var(--radius);
}

.topic header h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
}

.topic .meta {
  color: var(--muted);
  font-size: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.topic-body {
  margin-top: 24px;
}

.topic-body h1,
.topic-body h2,
.topic-body h3 {
  margin-top: 32px;
  margin-bottom: 12px;
}

.topic-body p {
  margin: 0 0 16px 0;
}

.topic-body ul,
.topic-body ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

.topic-body li {
  margin-bottom: 6px;
}

/* Code Blocks */
pre {
  background: var(--pre-bg);
  color: var(--pre-text);
  padding: 16px 20px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border);
  margin: 16px 0;
}

code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Intro paragraph */
.intro {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: var(--card);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-author {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.footer-author strong {
  font-weight: 600;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: var(--accent);
  font-weight: 500;
  transition: color 0.15s;
}

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

.footer-divider {
  color: var(--border);
}

.footer-copyright {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 880px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .categories {
    position: static;
  }

  .site-header .container {
    flex-wrap: wrap;
    gap: 16px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .container {
    padding: 16px;
  }

  .topic {
    padding: 20px;
  }
}

/* Utilities */
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Images */
img {
  max-width: 100%;
  height: auto;
}

/* ==================== Profile Page ==================== */
.profile-page {
  max-width: 900px;
}

.profile-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}

.profile-info h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
}

.profile-title {
  margin: 0 0 16px 0;
  color: var(--accent);
  font-size: 16px;
  font-weight: 500;
}

.profile-summary {
  margin: 0 0 20px 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}

.profile-links {
  display: flex;
  gap: 12px;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.profile-links a:hover {
  background: var(--card);
  border-color: var(--accent);
  text-decoration: none;
}

.profile-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
}

.profile-section h2 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.skill-category h3 {
  margin: 0 0 12px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

/* Experience Items */
.experience-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.experience-item:first-of-type {
  padding-top: 0;
}

.experience-item:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.experience-header {
  margin-bottom: 12px;
}

.experience-header h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
}

.experience-company {
  display: block;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.experience-date {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.experience-item ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.experience-item li {
  margin-bottom: 4px;
}

/* Patent Item */
.patent-item h3 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
}

.patent-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Focus List */
.focus-list {
  margin: 0;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.8;
}

.focus-list li {
  margin-bottom: 8px;
}

.focus-list strong {
  color: var(--text);
}

/* Responsive Profile */
@media (max-width: 880px) {
  .profile-header,
  .profile-section {
    padding: 20px;
  }

  .profile-info h1 {
    font-size: 24px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .profile-links {
    flex-wrap: wrap;
  }
}
