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

:root {
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 720px;
  --nav-height: 60px;
  --transition: 0.3s ease;

  /* Dark theme (default) */
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-heading: #f1f5f9;
  --accent: #38bdf8;
  --accent-secondary: #22c55e;
  --border: #1e293b;
  --code-bg: #1e293b;
  --grid: rgba(148, 163, 184, 0.06);
  --glow-1: rgba(56, 189, 248, 0.08);
  --glow-2: rgba(139, 92, 246, 0.06);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-heading: #0f172a;
  --accent: #3b82f6;
  --accent-secondary: #22c55e;
  --border: #e2e8f0;
  --code-bg: #f1f5f9;
  --grid: rgba(15, 23, 42, 0.03);
  --glow-1: rgba(56, 189, 248, 0.06);
  --glow-2: rgba(139, 92, 246, 0.04);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 10% 0%, var(--glow-1), transparent),
    radial-gradient(ellipse 60% 60% at 90% 100%, var(--glow-2), transparent),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  background-attachment: fixed;
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--accent-secondary);
}

/* === Navigation === */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition), border-color var(--transition);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  text-decoration: none;
  letter-spacing: -0.5px;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color var(--transition);
}

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

.theme-toggle {
  display: flex;
  gap: 1px;
  background: var(--border);
  border-radius: 6px;
  padding: 2px;
}

.theme-toggle button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  transition: all var(--transition);
  line-height: 1;
}

.theme-toggle button.active {
  background: var(--bg);
  color: var(--text-heading);
}

.theme-toggle button:hover:not(.active) {
  color: var(--text-heading);
}

/* === Main Content === */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  width: 100%;
}

/* === Hero Section === */
.hero {
  margin-bottom: 4rem;
}

.hero-prompt {
  color: var(--accent-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 16px;
  background-color: var(--accent-secondary);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hero-meta span {
  margin-right: 1.5rem;
}

/* === Social Links === */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all var(--transition);
}

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

/* === Sections === */
.section {
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* === Experience === */
.exp-item {
  margin-bottom: 2rem;
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.exp-role {
  font-weight: 700;
  color: var(--text-heading);
  font-size: 0.95rem;
}

.exp-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.exp-company {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.exp-details {
  list-style: none;
  padding: 0;
}

.exp-details li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
  color: var(--text);
}

.exp-details li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--accent-secondary);
  font-weight: 700;
}

/* === Projects === */
.project-item {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color var(--transition);
}

.project-item:hover {
  border-color: var(--accent);
}

.project-name {
  font-weight: 700;
  color: var(--text-heading);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.project-tech {
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* === Skills === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.skill-category h4 {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.skill-category p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* === Achievements === */
.achievements-list {
  list-style: none;
}

.achievements-list li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.achievements-list li::before {
  content: "*";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* === Education === */
.edu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.edu-school {
  font-weight: 700;
  color: var(--text-heading);
  font-size: 0.9rem;
}

.edu-degree {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.edu-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === Blog === */
.blog-list {
  list-style: none;
}

.blog-item {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.blog-item:last-child {
  border-bottom: none;
}

.blog-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.blog-item-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.blog-item-title a {
  color: var(--text-heading);
}

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

.blog-item-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.blog-item-tags {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.7rem;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

/* === Post === */
.post-header {
  margin-bottom: 2.5rem;
}

.post-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.post-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-content {
  font-size: 0.9rem;
  line-height: 1.9;
}

.post-content h2 {
  font-size: 1.2rem;
  color: var(--text-heading);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-content h3 {
  font-size: 1rem;
  color: var(--text-heading);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content p {
  margin-bottom: 1.2rem;
  color: var(--text);
}

.post-content code {
  background-color: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
  border: 1px solid var(--border);
}

.post-content pre {
  background-color: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
}

.post-content ul, .post-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
  display: block;
}

.post-content figure {
  margin: 1.5rem 0;
}

.post-content figcaption {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

.post-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-nav a {
  font-size: 0.85rem;
}

/* === Footer === */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: border-color var(--transition);
}

footer a {
  color: var(--text-muted);
}

footer a:hover {
  color: var(--accent);
}

/* === Page Header === */
.page-header {
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 600px) {
  body {
    font-size: 13px;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  .nav-container {
    padding: 0 1rem;
  }

  main {
    padding: 2rem 1rem;
  }

  .exp-header {
    flex-direction: column;
    gap: 0.2rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .edu-item {
    flex-direction: column;
    gap: 0.2rem;
  }

  .social-links {
    gap: 0.5rem;
  }
}
