/* ============================================================
   Om Arora — Personal Site
   Paper + ink. Scholar's study. No flashiness.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #f7f5f0;
  --bg-sidebar: #f0ede6;
  --bg-hover: #e8e4db;
  --ink: #1c1a16;
  --ink-2: #3a3630;
  --ink-3: #7a756c;
  --ink-4: #a09a90;
  --rule: #d4cfc5;
  --rule-strong: #b8b2a6;
  --accent: #1a3a5c;
  --accent-mid: #2d5986;
  --serif: 'EB Garamond', Georgia, serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --sidebar-w: 240px;
}

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

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--ink-2);
  line-height: 1.75;
  min-height: 100vh;
}

/* ── Typography ─────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.25;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1.2rem;
  font-weight: 500;
}

p {
  margin-bottom: 1.1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

a:hover {
  color: var(--accent-mid);
  border-bottom-color: var(--accent-mid);
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--bg-hover);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--ink);
}

pre {
  font-family: var(--mono);
  background: #1c1a16;
  color: #e8e4dc;
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.55;
  font-size: 0.8rem;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

blockquote {
  border-left: 3px solid var(--rule-strong);
  margin: 1.5rem 0;
  padding: 0.1rem 1.25rem;
  color: var(--ink-3);
  font-style: italic;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul,
ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.3rem;
}

/* ── Layout ─────────────────────────────────────────────── */
.site-wrapper {
  display: flex;
  min-height: 100vh;
  margin: 0;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar-column {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.5rem 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.sidebar-column::-webkit-scrollbar {
  width: 4px;
}

.sidebar-column::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border-radius: 2px;
}

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

.sidebar-site-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 0.2rem;
  text-decoration: none;
  border: none;
}

.sidebar-site-name:hover {
  color: var(--accent);
  border: none;
}

.sidebar-tagline {
  font-size: 0.72rem;
  color: var(--ink-4);
  font-style: italic;
}

.sidebar-nav {
  flex: 1;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
}

.sidebar-nav>ul>li>a,
.menu-header {
  display: block;
  font-family: var(--serif);
  font-size: 0.88rem;
  color: var(--ink-3);
  padding: 0.28rem 0.5rem;
  border-radius: 3px;
  text-decoration: none;
  border: none;
  transition: color 0.15s, background 0.15s;
}

.sidebar-nav>ul>li>a:hover,
.menu-header:hover {
  color: var(--ink);
  background: var(--bg-hover);
  border: none;
}

.sidebar-nav>ul>li>a.active {
  color: var(--accent);
  font-weight: 500;
}

.menu-group {
  margin-bottom: 0.1rem;
}

.menu-header {
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
}

.menu-header::after {
  content: ' ›';
  font-size: 0.75rem;
  opacity: 0.5;
  display: inline-block;
  transition: transform 0.2s;
}

.menu-group.open .menu-header::after {
  transform: rotate(90deg);
}

.submenu {
  list-style: none !important;
  padding: 0 0 0.25rem 0.85rem !important;
  margin: 0 0 0 0.5rem !important;
  display: none;
  border-left: 1px solid var(--rule);
}

.menu-group.open .submenu {
  display: block;
}

.submenu li {
  margin-bottom: 0 !important;
}

.submenu a {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-4);
  padding: 0.2rem 0.4rem;
  text-decoration: none;
  border: none;
  transition: color 0.15s;
}

.submenu a:hover {
  color: var(--ink-2);
  border: none;
}

.sidebar-block h3 {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  margin: 1.25rem 0 0.5rem;
  font-weight: 500;
}

.quick-links {
  list-style: none !important;
  padding: 0 !important;
}

.quick-links a {
  font-size: 0.82rem;
  color: var(--ink-3);
  text-decoration: none;
  border: none;
}

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

.sidebar-footer {
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  margin-top: 1.5rem;
}

.sidebar-footer p {
  font-size: 0.72rem;
  color: var(--ink-4);
  margin: 0;
}

/* ── Main Content ───────────────────────────────────────── */
.main-content-column {
  flex: 1;
  padding: 3.5rem 3rem 4rem;
  min-width: 0;
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Homepage ───────────────────────────────────────────── */
.home-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.home-name {
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  line-height: 1.1;
}

.home-descriptor {
  font-size: 0.88rem;
  color: var(--ink-3);
  font-style: italic;
}

.profile-block {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.profile-photo-wrap {
  flex-shrink: 0;
}

.profile-photo {
  width: 170px;
  height: 228px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--rule);
  display: block;
}

/* Bio content */
.bio-text h1 {
  display: none;
}

.bio-text h2 {
  font-size: 1.15rem;
  color: var(--ink);
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
}

.bio-text p {
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--ink-2);
}

.bio-text strong {
  display: block;
  font-weight: 600;
  color: var(--ink);
  margin-top: 1rem;
  margin-bottom: 0.15rem;
}

.bio-text hr {
  margin: 1.5rem 0;
}

.bio-text em {
  font-style: italic;
  color: var(--ink-3);
}

.bio-text a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
}

.bio-text a:hover {
  border-bottom-color: var(--accent-mid);
}

/* Recent section */
.recent-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  font-weight: 500;
  margin-bottom: 1rem;
  font-family: var(--mono);
}

.recent-list {
  list-style: none;
  padding: 0;
}

.recent-list li {
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
}

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

.date-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-4);
  white-space: nowrap;
  flex-shrink: 0;
}

.recent-list a {
  font-size: 0.92rem;
  color: var(--ink-2);
  border: none;
  transition: color 0.15s;
}

.recent-list a:hover {
  color: var(--accent);
  border: none;
}

/* ── List / Blog page ───────────────────────────────────── */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.page-header h1 {
  font-size: 1.8rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.page-intro {
  font-size: 0.92rem;
  color: var(--ink-3);
  font-style: italic;
  margin: 0;
}

.blog-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-card {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--rule);
}

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

.card-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-4);
}

.card-tags {
  font-size: 0.7rem;
  color: var(--accent);
  font-family: var(--mono);
}

.card-title {
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
  font-weight: 500;
  line-height: 1.35;
}

.card-title a {
  color: var(--ink);
  border: none;
}

.card-title a:hover {
  color: var(--accent);
}

.card-summary {
  font-size: 0.88rem;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0 0 0.5rem;
}

.read-more {
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--accent);
  border: none;
}

.read-more:hover {
  color: var(--accent-mid);
  border: none;
}

/* ── Single post ────────────────────────────────────────── */
.post header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.post header h1 {
  font-size: 1.8rem;
  margin-top: 0;
  line-height: 1.2;
}

.post-meta {
  font-size: 0.78rem;
  color: var(--ink-4);
  font-family: var(--mono);
  margin: 0.5rem 0 0;
}

.post-meta a {
  color: var(--ink-3);
  border: none;
}

.post-meta a:hover {
  color: var(--accent);
}

.post-content {
  font-size: 1rem;
  line-height: 1.85;
}

.post-content h2,
.post-content h3 {
  margin-top: 2.25rem;
}

.katex-display {
  margin: 1.5rem 0;
  overflow-x: auto;
}

/* ── Mobile nav toggle ──────────────────────────────────── */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--bg-sidebar);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  line-height: 1;
}

.mobile-nav-toggle:hover {
  background: var(--bg-hover);
}

.mobile-nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink-2);
  margin: 3.5px 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 22, 0.35);
  z-index: 140;
}

.sidebar-overlay.visible {
  display: block;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .mobile-nav-toggle {
    display: block;
  }

  .site-wrapper {
    display: block;
  }

  .sidebar-column {
    position: fixed;
    top: 0;
    left: -100%;
    width: 260px;
    height: 100vh;
    z-index: 150;
    transition: left 0.3s ease;
    box-shadow: none;
  }

  .sidebar-column.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  }

  .main-content-column {
    padding: 4.5rem 1.25rem 3rem;
    max-width: 100%;
  }

  .profile-block {
    flex-direction: column;
    gap: 1.5rem;
  }

  .profile-photo-wrap {
    align-self: center;
  }

  .profile-photo {
    width: 120px;
    height: 160px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .home-name {
    font-size: 1.9rem;
  }

  .main-content-column {
    padding: 4rem 1rem 2.5rem;
  }

  .recent-list li {
    flex-direction: column;
    gap: 0.2rem;
  }
}

@media print {

  .sidebar-column,
  .mobile-nav-toggle {
    display: none !important;
  }

  .main-content-column {
    padding: 0;
    max-width: 100%;
    animation: none;
  }

  body {
    background: white;
    color: black;
  }
}