/* ============================================
   Dhilip's Blog — Premium Dark Theme
   ============================================ */

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

:root {
  --bg-primary: #0a0f1e;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-code: #0d1117;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
  --accent-gradient: linear-gradient(135deg, #38bdf8, #818cf8);
  --border: rgba(56, 189, 248, 0.1);
  --border-hover: rgba(56, 189, 248, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.8;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle animated background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(56, 189, 248, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(129, 140, 248, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* --- Navigation --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
  transition: width var(--transition);
}

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

.nav-links a:hover::after {
  width: 100%;
}

/* --- Main Content --- */
main {
  position: relative;
  z-index: 1;
}

/* --- Post Container --- */
.post-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* --- Blog Hero --- */
.blog-hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.blog-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--border);
  margin-right: 8px;
  margin-bottom: 16px;
}

.blog-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.post-container > h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 48px 0 16px;
}

.post-container > h2,
.post-container h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 48px 0 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.post-container > h3,
.post-container h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--accent);
}

p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
}

b, strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Links --- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: all var(--transition);
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Resource Links --- */
.resource-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none !important;
  color: var(--text-primary);
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 10px;
}

.resource-link:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.1);
}

.link-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.resources-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  padding: 24px 28px;
  border-radius: var(--radius);
  margin: 20px 0;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.story-card {
  padding-left: 40px;
}

.card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-gradient);
  border-radius: 4px 0 0 4px;
}

.result-card {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(129, 140, 248, 0.08));
  border-color: rgba(56, 189, 248, 0.2);
}

.result-list {
  list-style: none;
  padding: 0;
  margin-top: 12px;
}

.result-list li {
  padding: 8px 0;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}

.check {
  font-size: 1.1rem;
}

/* --- Step Cards --- */
.step-card {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.step-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--bg-primary);
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h3 {
  margin-top: 6px;
  margin-bottom: 16px;
}

/* --- Code Blocks --- */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
  background: var(--bg-code);
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--accent);
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-code);
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid var(--border);
  margin: 12px 0 16px;
  position: relative;
}

pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.65;
}

/* --- Images --- */
.blog-img,
.post-container img {
  width: 100%;
  border-radius: var(--radius);
  margin: 16px 0;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.blog-img:hover,
.post-container img:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.img-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.img-row .blog-img {
  margin: 0;
}

/* --- Horizontal Rule --- */
hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 40px 0;
}

/* --- Lists --- */
ul, ol {
  padding-left: 24px;
  color: var(--text-secondary);
}

li {
  margin-bottom: 8px;
}

/* --- Blog Footer --- */
.blog-footer {
  text-align: center;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.blog-footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* --- Home Page --- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* --- Selection --- */
::selection {
  background: rgba(56, 189, 248, 0.3);
  color: var(--text-primary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .blog-title {
    font-size: 1.8rem;
  }

  .blog-subtitle {
    font-size: 1rem;
  }

  .post-container h2 {
    font-size: 1.35rem;
  }

  .step-card {
    flex-direction: column;
    gap: 12px;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .img-row {
    grid-template-columns: 1fr;
  }

  .post-container {
    padding: 32px 16px 60px;
  }
}

/* --- Animations --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-container {
  animation: fadeIn 0.6s ease-out;
}

.card,
.step-card,
.resource-link {
  animation: fadeIn 0.5s ease-out both;
}
