/* ============================================
   Rahul Kashyap — Personal Blog
   Minimal, developer-focused, light mode only
   ============================================ */

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

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;

  --color-bg:        #ffffff;
  --color-surface:   #f8f8f7;
  --color-border:    #e8e8e4;
  --color-border-light: #f0f0ec;
  --color-text:      #1a1a18;
  --color-text-2:    #5a5a54;
  --color-text-3:    #6c6c67;
  --color-accent:    #2563eb;
  --color-accent-bg: #eff6ff;
  --color-tag-bg:    #f1f1ee;
  --color-code-bg:   #f6f6f3;
  --color-pre-bg:    #1e1e1e;
  --color-pre-text:  #d4d4d4;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --nav-h: 60px;
  --content-w: 720px;
  --wide-w: 1100px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* --- Nav ------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo:hover { text-decoration: none; opacity: 0.8; }

.nav-logo-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--color-border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
  background: var(--color-surface);
}

/* --- Page Layout ----------------------------------------- */
.page {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* --- Home Hero ------------------------------------------- */
.home-hero {
  padding: 72px 0 52px;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 52px;
}

.home-hero h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: 12px;
}

.home-hero p {
  font-size: 16px;
  color: var(--color-text-2);
  max-width: 480px;
  line-height: 1.6;
}

/* --- Post Cards ------------------------------------------ */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 80px;
}

.post-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--color-border-light);
  text-decoration: none;
  color: inherit;
  transition: none;
}

.post-card:hover { text-decoration: none; }
.post-card:hover .post-card-title { color: var(--color-accent); }
.post-card:hover .post-card-thumb { opacity: 0.88; }

.post-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.post-card-thumb {
  width: 160px;
  aspect-ratio: 16 / 9;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  border: 1px solid var(--color-border-light);
  transition: opacity 0.15s;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-3);
}

.post-card-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-border);
}

.post-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--color-text);
  transition: color 0.15s;
  margin: 0;
}

.post-card-excerpt {
  font-size: 15px;
  color: var(--color-text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-2);
  background: var(--color-tag-bg);
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.01em;
}

/* --- Article Page ---------------------------------------- */

/* Featured image */
.article-hero {
  width: 100%;
  max-width: 900px;
  margin: 40px auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Article header */
.article-header {
  padding: 40px 0 36px;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 48px;
}

.article-header .post-card-tags { margin-bottom: 16px; }

.article-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-text);
  margin-bottom: 20px;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
}

.article-author-info {}

.article-author-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.article-author-meta {
  font-size: 13px;
  color: var(--color-text-3);
  line-height: 1.3;
}

/* Article body prose */
.article-body {
  font-size: 17px;
  line-height: 1.78;
  color: var(--color-text);
  margin-bottom: 80px;
}

.article-body > * + * { margin-top: 1.4em; }

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--color-text);
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.article-body h1 { font-size: 28px; }
.article-body h2 { font-size: 23px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border-light); }
.article-body h3 { font-size: 19px; }
.article-body h4 { font-size: 17px; }

.article-body p { margin: 0; }
.article-body p + p { margin-top: 1.25em; }

.article-body a { color: var(--color-accent); text-underline-offset: 3px; }

.article-body strong { font-weight: 600; }
.article-body em { font-style: italic; }

.article-body ul,
.article-body ol {
  padding-left: 1.6em;
}

.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }

.article-body li { margin-top: 0.35em; }
.article-body li + li { margin-top: 0.35em; }

/* Inline code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-code-bg);
  color: #c7254e;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
}

/* Code blocks */
.article-body pre {
  background: var(--color-pre-bg);
  color: var(--color-pre-text);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  margin: 1.75em 0;
}

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

/* Code block with language label */
.code-block {
  position: relative;
  margin: 1.75em 0;
}

.code-block-lang {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.code-block pre { margin: 0; }

/* Blockquote */
.article-body blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.75em 0;
  padding: 4px 0 4px 20px;
  color: var(--color-text-2);
  font-style: italic;
}

.article-body blockquote p { margin: 0; }

/* Horizontal rule */
.article-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5em 0;
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 1.75em 0;
}

.article-body th,
.article-body td {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
}

.article-body th {
  background: var(--color-surface);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-2);
}

.article-body tr:nth-child(even) td { background: var(--color-surface); }

/* Images in article */
.article-body img {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin: 1.75em auto;
}

.article-body figure {
  margin: 1.75em 0;
}

.article-body figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-3);
  margin-top: 8px;
}

/* Callout / note box */
.callout {
  background: var(--color-accent-bg);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 15px;
  color: #1e40af;
  margin: 1.75em 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.callout-icon { flex-shrink: 0; font-size: 16px; margin-top: 1px; }

/* Article footer */
.article-footer {
  padding: 32px 0 80px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.back-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover { color: var(--color-text); text-decoration: none; }

/* --- About Page ------------------------------------------ */
.about-header {
  padding: 64px 0 48px;
  display: flex;
  align-items: flex-start;
  gap: 32px;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 52px;
}

.about-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-border);
  flex-shrink: 0;
}

.about-header-info { flex: 1; }

.about-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.about-title {
  font-size: 15px;
  color: var(--color-text-2);
  margin-bottom: 14px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 5px 12px;
  border-radius: 100px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.about-link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  text-decoration: none;
}

.about-section { margin-bottom: 48px; }

.about-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-3);
  margin-bottom: 20px;
}

.about-bio {
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text-2);
}

.about-bio p + p { margin-top: 1em; }

/* Skills grid */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.skill-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-2);
  min-width: 160px;
  flex-shrink: 0;
}

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

/* Experience */
.exp-list { display: flex; flex-direction: column; gap: 32px; }

.exp-item {}

.exp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.exp-company {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.exp-period {
  font-size: 13px;
  color: var(--color-text-3);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

.exp-role {
  font-size: 14px;
  color: var(--color-text-2);
  font-weight: 500;
  margin-bottom: 10px;
}

.exp-desc {
  font-size: 14px;
  color: var(--color-text-2);
  line-height: 1.65;
}

.exp-desc ul {
  padding-left: 1.4em;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.exp-tech {
  font-size: 12px;
  color: var(--color-text-3);
  margin-top: 10px;
}

.exp-tech strong { color: var(--color-text-2); }

.exp-divider {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: 0;
}

/* --- Footer ---------------------------------------------- */
.footer {
  border-top: 1px solid var(--color-border-light);
  padding: 28px 0;
  text-align: center;
}

.footer-inner {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 13px;
  color: var(--color-text-3);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  font-size: 13px;
  color: var(--color-text-3);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* --- Utilities ------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- Responsive ------------------------------------------ */
@media (max-width: 640px) {
  :root { --nav-h: 52px; }

  .nav-inner { padding: 0 16px; }
  .page, .page-wide { padding: 0 16px; }

  .home-hero { padding: 48px 0 36px; }
  .home-hero h1 { font-size: 22px; }

  .post-card {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 24px 0;
  }

  .post-card-thumb {
    order: -1;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .article-title { font-size: 26px; }
  .article-body { font-size: 16px; }
  .article-hero { border-radius: var(--radius-md); margin-top: 24px; }

  .about-header { flex-direction: column; gap: 20px; padding: 40px 0 36px; }
  .about-avatar { width: 72px; height: 72px; }
  .about-name { font-size: 22px; }

  .skill-row { flex-direction: column; gap: 6px; }
  .skill-label { min-width: unset; }

  .exp-header { flex-direction: column; gap: 2px; }
  .exp-period { padding-top: 0; }

  .footer-inner { flex-direction: column; align-items: center; }
}

/* --- Syntax Highlight (Prism theme override) ------------- */
/* Keep code blocks dark/neutral on light bg */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6a9955; }
.token.punctuation { color: #d4d4d4; }
.token.property, .token.tag, .token.boolean, .token.number { color: #b5cea8; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: #ce9178; }
.token.operator, .token.entity, .token.url { color: #d4d4d4; }
.token.atrule, .token.attr-value, .token.keyword { color: #569cd6; }
.token.function, .token.class-name { color: #dcdcaa; }
.token.regex, .token.important, .token.variable { color: #d16969; }
