/* ========================================
   Minimal Theme — rohitsaini.me
   ======================================== */

html {
  overflow-y: scroll;
}
/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.65;
  color: #e5e5e5;
  background-color: #161616;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Container --- */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* --- Header --- */
.site-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 0;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.site-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #e5e5e5;
  letter-spacing: -0.02em;
}

.site-name:hover {
  color: #aaa;
}

.site-tagline {
  font-size: 0.85rem;
  color: #666;
  font-weight: 400;
}

.header-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-nav {
  display: flex;
  gap: 16px;
}

.site-nav a {
  font-size: 0.85rem;
  color: #888;
  font-weight: 400;
  position: relative;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: #e5e5e5;
}

.site-nav a.active {
  color: #e5e5e5;
  font-weight: 500;
}

.site-nav a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #e5e5e5;
  transition: width 0.2s ease;
}

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 100%;
}

.site-links {
  display: flex;
  gap: 10px;
  align-items: center;
}

.site-links a {
  color: #666;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.site-links a:hover {
  color: #e5e5e5;
}

/* --- Footer --- */
.site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 20px 40px;
}

.footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 28px;
  border-top: 1px solid #2a2a2a;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-name {
  display: block;
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

.footer-note {
  display: block;
  font-size: 0.7rem;
  color: #3a3a3a;
  letter-spacing: 0.02em;
}

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

.footer-links a {
  color: #444;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #ccc;
}

/* --- Home Page --- */
.home-intro {
  margin-bottom: 56px;
  padding-top: 20px;
}

.home-description {
  font-size: 1.05rem;
  color: #999;
  line-height: 1.7;
  max-width: 640px;
}

.home-recent h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: #e5e5e5;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.post-card {
  margin-bottom: 32px;
}

.post-card-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: #e5e5e5;
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: 8px;
  transition: color 0.15s ease;
}

.post-card-title:hover {
  color: #aaa;
}

.post-card-excerpt {
  font-size: 0.95rem;
  color: #999;
  line-height: 1.6;
  margin-bottom: 6px;
}

.read-more {
  font-weight: 500;
  color: #999;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #444;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.read-more:hover {
  color: #ccc;
  text-decoration-color: #888;
}

.post-item {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  transition: padding-left 0.15s ease;
}

.post-item:hover {
  padding-left: 8px;
}

.post-title {
  font-size: 1rem;
  font-weight: 500;
  color: #e5e5e5;
}

.post-meta {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

.view-all {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.85rem;
  color: #777;
  transition: color 0.15s ease;
}

.view-all:hover {
  color: #e5e5e5;
}

/* --- Writings Page --- */
.writings-page h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  padding-top: 20px;
}

.year-group {
  margin-bottom: 32px;
}

.year-heading {
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2a2a2a;
}

/* --- Blog Post --- */
.blog-post {
  padding-top: 20px;
}

.post-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 8px;
}

.post-header .post-meta {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0;
}

.post-divider {
  border: none;
  border-top: 1px solid #2a2a2a;
  margin: 24px 0 32px;
}

.post-body {
  font-size: 1rem;
  line-height: 1.7;
  color: #b0b0b0;
}

.post-body p {
  margin-bottom: 1.1em;
}

.post-body h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2.5em;
  margin-bottom: 0.8em;
  letter-spacing: -0.01em;
  color: #e5e5e5;
}

.post-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.6em;
  color: #e5e5e5;
}

.post-body ul,
.post-body ol {
  margin-bottom: 1.1em;
  padding-left: 1.5em;
}

.post-body li {
  margin-bottom: 0.3em;
}

.post-body blockquote {
  border-left: 2px solid #333;
  padding-left: 16px;
  color: #888;
  margin: 1.5em 0;
  font-style: italic;
}

.post-body code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  font-size: 0.88em;
  background: #1e1e1e;
  padding: 2px 6px;
  border-radius: 3px;
  color: #ccc;
}

.post-body pre {
  background: #1a1a1a;
  padding: 16px 20px;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid #2a2a2a;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
  line-height: 1.6;
}

.post-back {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #2a2a2a;
}

.post-back a {
  font-size: 0.85rem;
  color: #777;
  transition: color 0.15s ease;
}

.post-back a:hover {
  color: #e5e5e5;
}

/* --- Page Content (About, etc.) --- */
.page-content {
  padding-top: 20px;
}

.page-content h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.page-content h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2.5em;
  margin-bottom: 0.8em;
  letter-spacing: -0.01em;
}

.page-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.6em;
}

.page-content p {
  color: #b0b0b0;
  margin-bottom: 1.1em;
  line-height: 1.65;
  font-size: 0.9rem;
}

.page-content ul,
.page-content ol {
  margin-bottom: 1.1em;
  padding-left: 1.5em;
  color: #b0b0b0;
}

.page-content li {
  margin-bottom: 0.3em;
  line-height: 1.7;
  font-size: 0.95rem;
}

/* --- Feed Page --- */
.feed-page h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  padding-top: 20px;
}

.feed-subtitle {
  font-size: 1.05rem;
  color: #777;
  margin-bottom: 48px;
}

.feed-entry {
  padding: 20px 0;
}

.feed-date {
  display: block;
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 6px;
  font-weight: 400;
}

.feed-content {
  font-size: 1rem;
  color: #b0b0b0;
  line-height: 1.65;
}

.feed-content p {
  margin: 0;
}

.feed-divider {
  border: none;
  border-top: 1px solid #2a2a2a;
  margin: 0;
}

/* --- Markdown Links --- */
.page-content a,
.post-body a,
.feed-content a {
  color: #e5e5e5;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #555;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.page-content a:hover,
.post-body a:hover,
.feed-content a:hover {
  color: #fff;
  text-decoration-color: #999;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .header-inner {
    gap: 4px;
  }

  .header-bottom {
    gap: 16px;
  }

  .site-nav {
    gap: 14px;
  }

  .site-name {
    font-size: 1.3rem;
  }

  .container {
    padding: 24px 16px;
  }

  .site-header {
    padding: 24px 16px 0;
  }

  .post-card-title {
    font-size: 1.15rem;
  }

  .writings-page h1,
  .feed-page h1,
  .page-content h1 {
    font-size: 1.6rem;
  }

  .post-header h1 {
    font-size: 1.5rem;
  }
}

/* --- Selection --- */
::selection {
  background: #333;
  color: #fff;
}

/* --- Print --- */
@media print {
  .site-header,
  .site-footer,
  .post-back {
    display: none;
  }

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

/* --- 404 Page --- */
.error-page {
  text-align: center;
  padding: 120px 20px 80px;
}

.error-page h1 {
  font-size: 4rem;
  color: #555;
  margin-bottom: 16px;
  font-weight: 600;
}

.error-page p {
  font-size: 1rem;
  color: #888;
  margin-bottom: 32px;
}
