/* ═══════════════════════════════════════════
   Aaron Johnson – Personal Site
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:             #f5f5f0;
  --bg-sidebar:     #edeee8;
  --bg-body:        #e8e8e2;
  --surface:        #ffffff;
  --surface-hover:  #f0f1ec;
  --border:         #d8d9d0;
  --text:           #2c2c2c;
  --text-muted:     #6b6e64;
  --accent:         #3d6bb5;
  --accent-glow:    rgba(61, 107, 181, 0.08);
  --green:          #4a8c5c;
  --orange:         #b5793d;
  --teal:           #2a8a7a;
  --code-bg:        #2c2c2c;
  --code-text:      #c0caf5;
}

[data-theme="dark"] {
  --bg:             #1a1b26;
  --bg-sidebar:     #16171f;
  --bg-body:        #13141b;
  --surface:        #1f2133;
  --surface-hover:  #262840;
  --border:         #2e3047;
  --text:           #c0caf5;
  --text-muted:     #7a82ab;
  --accent:         #7aa2f7;
  --accent-glow:    rgba(122, 162, 247, 0.1);
  --green:          #9ece6a;
  --orange:         #e0af68;
  --teal:           #73daca;
  --code-bg:        #13141b;
  --code-text:      #c0caf5;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-body);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body *, body *::before, body *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--teal); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── Animations ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 140, 92, 0.2); }
  50%      { box-shadow: 0 0 12px 3px rgba(74, 140, 92, 0.25); }
}

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */

.site-wrapper {
  display: flex;
  max-width: 1120px;
  margin: 0 auto;
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: 280px;
  min-width: 280px;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  animation: slideInLeft 0.5s ease-out both;
}

.main-panel {
  flex: 1;
  padding: 48px 44px 80px;
  min-height: 100vh;
  min-width: 0;
  overflow-y: auto;
}

.main-content {
  max-width: 100%;
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */

.sidebar__name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar__name {
  font-family: 'DM Serif Display', serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Theme Toggle */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-hover);
}

/* Light mode: show moon, hide sun */
.theme-toggle__sun { display: none; }
.theme-toggle__moon { display: block; }

/* Dark mode: show sun, hide moon */
[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }

.sidebar__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.sidebar__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: pulseGlow 2.5s ease-in-out infinite;
}
.status-text {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.sidebar__divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
  opacity: 0.7;
}

.sidebar__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 10px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--surface-hover);
  color: var(--accent);
  transform: translateX(3px);
}
.nav-item.active {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.nav-item.active:hover { transform: none; }

.nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-icon svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.sidebar__social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}
.social-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.social-btn svg {
  width: 14px; height: 14px;
  stroke-width: 1.8; fill: none; stroke: currentColor;
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 20px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════
   SECTION SHOW/HIDE
   ═══════════════════════════════════════════ */

.page-section {
  display: none;
}
.page-section.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* ═══════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════ */

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.section-header__icon {
  font-size: 22px;
  display: flex;
  align-items: center;
}
.section-header__icon svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.section-header__title {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.section-intro {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════════ */

.home-hero {
  margin-bottom: 40px;
}
.home-hero__heading {
  font-family: 'DM Serif Display', serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}
.home-hero__heading .accent { color: var(--accent); }
.home-hero__text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* Home divider */
.home-divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 36px 0 32px;
}

/* ═══════════════════════════════════════════
   CARD GRID (Projects & Skills)
   ═══════════════════════════════════════════ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.3;
}
.card__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

/* Show More / Less Buttons */
.show-more-btn,
.show-less-btn {
  display: inline-block;
  margin-top: 16px;
  margin-right: 8px;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}
.show-more-btn:hover,
.show-less-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════
   DETAIL VIEW (replaces cards inline)
   ═══════════════════════════════════════════ */

.detail-view {
  animation: fadeIn 0.25s ease-out;
}

.detail-view__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 24px;
}
.detail-view__back:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.detail-view__back svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.detail-view__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.detail-view__title {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.detail-view__subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.detail-view__divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 20px;
}

.detail-view__body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   NOTES
   ═══════════════════════════════════════════ */

.note-item {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}
.note-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.note-date {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.note-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

/* ═══════════════════════════════════════════
   ABOUT ME — Profile Card
   ═══════════════════════════════════════════ */

.profile-card {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.profile-card__image {
  width: 50%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.profile-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-card__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

.profile-card__name {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
}

.profile-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 8px;
}

.profile-card__details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-card__detail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}
.profile-card__detail svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ─── About Me Sections ─── */

.section-subtitle {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 10px;
  margin-top: 28px;
  color: var(--text);
}
.section-subtitle:first-child { margin-top: 0; }

.section-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   MARKDOWN RENDERED CONTENT
   ═══════════════════════════════════════════ */

.markdown-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.markdown-body h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.markdown-body h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  font-weight: 400;
  margin-top: 32px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.markdown-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.markdown-body p {
  margin-bottom: 14px;
  color: var(--text-muted);
}

.markdown-body strong {
  color: var(--text);
  font-weight: 600;
}

.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.markdown-body a:hover {
  color: var(--teal);
}

.markdown-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 14px 20px;
  color: var(--text-muted);
}
.markdown-body li {
  margin-bottom: 4px;
}
.markdown-body li > ul,
.markdown-body li > ol {
  margin-top: 4px;
  margin-bottom: 4px;
}

.markdown-body blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-style: italic;
}
.markdown-body blockquote p {
  margin-bottom: 0;
}

.markdown-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

.markdown-body pre {
  margin: 16px 0;
  padding: 18px 20px;
  background: var(--code-bg);
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid var(--border);
}
.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--code-text);
  font-size: 13px;
  line-height: 1.6;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.markdown-body th {
  background: var(--bg-sidebar);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.markdown-body td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.markdown-body tr:hover td {
  background: var(--surface-hover);
}

.markdown-body input[type="checkbox"] {
  margin-right: 6px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 960px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .site-wrapper {
    flex-direction: column;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }
  .sidebar {
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 28px 24px;
  }
  .main-panel {
    padding: 28px 24px;
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }
  .profile-card__image {
    width: 45%;
  }
  .profile-card__info {
    align-items: center;
  }
  .profile-card__name {
    font-size: 24px;
  }
  .profile-card__title {
    font-size: 13px;
  }
  .profile-card__details {
    align-items: center;
  }
}

@media (max-width: 560px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .profile-card__image {
    width: 50%;
  }
  .home-hero__heading {
    font-size: 28px;
  }
  .section-header__title {
    font-size: 22px;
  }
  .sidebar__name {
    font-size: 22px;
  }
  .detail-view__card {
    padding: 20px;
  }
  .detail-view__title {
    font-size: 22px;
  }
}