/* ============================================================
   Concept A — sidebar layout, al-folio inspired
   Shared stylesheet for every page under /A
   ============================================================ */

:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --text: #1c1c1c;
  --muted: #67707a;
  --border: #e6e6e6;
  --accent: #2b5d8c;
  --accent-soft: #eaf1f7;
  --shadow: 0 1px 2px rgba(20, 30, 45, 0.04);
  --shadow-hover: 0 10px 24px rgba(20, 30, 45, 0.08);
  --sidebar-w: 350px;
  --code-bg: #1e1e2e;
  --code-text: #cdd6f4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --panel: #1b1e23;
    --text: #eaeaea;
    --muted: #a3abb5;
    --border: #2c2f35;
    --accent: #82b8e8;
    --accent-soft: #1f2c37;
    --shadow: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-hover: 0 10px 24px rgba(0,0,0,0.4);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

/* ---------- Sidebar ---------- */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  padding: 60px 32px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-right: 1px solid var(--border);
}
.avatar-ring {
  display: block;
  width: 152px;
  height: 152px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(160deg, var(--accent), transparent 65%);
  margin-bottom: 24px;
  transition: opacity .15s;
}
.avatar-ring:hover { opacity: 0.85; }
.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--panel);
}
.sidebar h1 {
  font-size: 27px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 5px 0;
  letter-spacing: -0.01em;
}
.sidebar h1 a { color: inherit; }
.sidebar h1 a:hover { text-decoration: none; color: var(--accent); }
.role {
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--muted);
  margin: 0 0 3px 0;
}
.location {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  margin: 0 0 20px 0;
}
.location i { margin-right: 6px; color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.tag:hover { text-decoration: none; opacity: 0.8; }

.bio {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 22px;
}
.edu {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.edu div { display: flex; align-items: flex-start; }
.edu i { width: 14px; flex-shrink: 0; color: var(--accent); margin-right: 8px; margin-top: 2px; }
.edu a { color: var(--muted); }
.edu a:hover { color: var(--accent); }

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 30px;
}
.social-icons a {
  color: var(--muted);
  font-size: 16px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel);
  transition: color .15s, border-color .15s, transform .15s;
}
.social-icons a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.social-icons img { width: 15px; height: 15px; filter: grayscale(1) opacity(.75); }
.social-icons a:hover img { filter: none; opacity: 1; }

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.side-nav a {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 7px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color .15s, border-color .15s;
}
.side-nav a:hover { color: var(--accent); border-left-color: var(--accent); text-decoration: none; }
.side-nav a.active { color: var(--accent); border-left-color: var(--accent); }

/* ---------- Main content ---------- */
.main {
  flex: 1 1 auto;
  padding: 60px 56px 90px 56px;
  max-width: 960px;
}
.section { margin-bottom: 58px; scroll-margin-top: 24px; }
.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label i { font-size: 13px; }
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Research + Software cards (shared style) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card img { width: 32px; height: 32px; object-fit: contain; margin-top: 2px; }
.card .card-icon { width: 32px; flex-shrink: 0; font-size: 20px; color: var(--accent); margin-top: 2px; text-align: center; }
.card h3 { font-size: 15.5px; font-weight: 600; margin: 0 0 5px 0; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card p { font-size: 13.5px; color: var(--muted); margin: 0; }

/* Writing / blog list */
.post-list { display: flex; flex-direction: column; }
.post-row {
  display: flex;
  gap: 20px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  transition: background .15s;
}
.post-row:hover { background: var(--accent-soft); }
.post-row:last-child { border-bottom: none; }
.post-row.current { background: var(--accent-soft); }
.post-date {
  flex: 0 0 68px;
  font-size: 12.5px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  padding-top: 3px;
}
.post-body a {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--text);
}
.post-body a:hover { color: var(--accent); }
.post-excerpt {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 3px;
}
.post-list.compact .post-row { padding: 10px 4px; }
.post-list.compact .post-excerpt { display: none; }

/* Philosophy / notes tiles */
.split-two { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.quote-box {
  padding: 24px 26px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: 12px;
  font-size: 15px;
}
.quote-box .section-label { margin-bottom: 12px; }

footer.site-footer {
  padding: 28px 56px 60px 56px;
  font-size: 15px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.footer-quote {
  font-style: normal;
  margin-bottom: 14px;
}
.footer-quote a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border); }
.footer-quote a:hover { color: var(--accent); text-decoration-color: var(--accent); }
footer.site-footer .fa-bluesky, footer.site-footer .fa-linkedin { margin-right: 2px; }

/* ---------- Individual post pages ---------- */
.crumbs { margin-bottom: 22px; font-size: 13px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

.page-date {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
  margin-bottom: 10px;
}
.page-title {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 34px 0;
  letter-spacing: -0.01em;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}
.page-title a { color: inherit; }

.post-content { font-size: 16px; line-height: 1.75; color: var(--text); font-weight: 300; }
.post-content p { margin: 0 0 1em 0; }
.post-content b { font-weight: 600; }
.post-content ul { padding-left: 22px; margin: 0 0 1em 0; }
.post-content li { margin-bottom: 6px; }
.post-content center { display: block; margin: 10px 0; }
.post-content iframe { border-radius: 10px; }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

.post-content pre {
  position: relative;
  background: var(--code-bg);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 22px 0;
  overflow-x: auto;
  border: none;
}
.post-content pre code {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--code-text);
  background: none;
  padding: 0;
}
.post-content .copy-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.08);
  color: #b7c0cc;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: background .15s, color .15s;
}
.post-content .copy-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }

.refs { font-size: 14.5px; color: var(--muted); margin-top: 8px; }
.refs-item {
  font-size: 13.5px;
  color: var(--muted);
  text-indent: -20px;
  padding-left: 20px;
  padding-top: 6px;
  text-align: justify;
}
.refs-item i { margin-right: 4px; }

/* ---------- Poems page ---------- */
.poem-intro { font-size: 15px; color: var(--muted); margin-bottom: 30px; }
.poem-list { display: flex; flex-direction: column; gap: 18px; }
.poem {
  padding: 22px 26px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
}
.poem-title {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ---------- Philosophy page (styled the same as the Poems page) ---------- */
.phil-intro, .intro-text { display: block; font-size: 15px; color: var(--muted); margin-bottom: 30px; }
.quote-list { display: flex; flex-direction: column; gap: 18px; }
.blockquote {
  padding: 22px 26px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 0;
}
.blockquote-footer {
  display: block;
  margin-top: 14px;
  padding-top: 0;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.blockquote-footer::before { content: ''; }

/* image lightbox (shared across all post pages) */
.blog-img { cursor: zoom-in; transition: opacity 0.15s; border-radius: 10px; }
.blog-img:hover { opacity: 0.85; }
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  cursor: default;
}
#lightbox-close {
  position: fixed;
  top: 18px;
  right: 24px;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  user-select: none;
}
#lightbox-close:hover { opacity: 1; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { position: static; height: auto; width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 14px; }
  .side-nav a { border-left: none; padding-left: 0; border-bottom: 2px solid transparent; }
  .side-nav a:hover { border-left: none; border-bottom-color: var(--accent); }
  .card-grid { grid-template-columns: 1fr; }
  .split-two { grid-template-columns: 1fr; }
  .main { padding: 44px 24px 70px 24px; }
  .page-title { font-size: 26px; }
}
