@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Space+Mono:wght@400;700&display=swap');

:root {
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
}

nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--bg-tertiary);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
}

.sun-icon, .moon-icon {
    display: none;
}

:root:not([data-theme="dark"]) .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Main Content */
main {
    padding: 48px 24px;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 0;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Social Links Section */
.social-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 0 0 64px;
}

.divider-label {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 480px;
}
.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}
.divider-label span {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

.link-cards {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
  justify-content: center;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  min-width: 200px;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
}

.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
  pointer-events: none;
}

/* All direct children sit above the tint layer */
.link-card > * {
  position: relative;
  z-index: 1;
}

.link-card.linkedin { --accent-card: #0a66c2; --glow: rgba(10,102,194,0.15); }
.link-card.resume   { --accent-card: #1fc557; --glow: rgba(37, 235, 100, 0.15); }
.link-card.github   { --accent-card: #7c3aed; --glow: rgba(124,58,237,0.15); }

.link-card:hover {
  border-color: var(--accent-card);
  box-shadow: 0 0 24px var(--glow), 0 8px 24px rgba(0,0,0,0.1);
  transform: translateY(-3px);
}
.link-card:hover::before { opacity: 1; background: var(--glow); }

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.25s;
}
.link-card:hover .card-icon { background: var(--accent-card); }
.card-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--text-secondary);
  transition: fill 0.2s;
}
.link-card:hover .card-icon svg { fill: #fff; }

.card-text { display: flex; flex-direction: column; gap: 2px; }
.card-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.link-card:hover .card-label { color: var(--accent-card); }
.card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-arrow {
  margin-left: auto;
  padding-left: 10px;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: color 0.2s, transform 0.2s;
}
.link-card:hover .card-arrow {
  color: var(--accent-card);
  transform: translateX(3px);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin: 64px 0;
}

.stat-card {
    text-align: center;
    padding: 24px;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-secondary);
}

/* Featured Section */
.featured-section {
    margin-top: 80px;
}

.featured-section h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.project-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-content {
    padding: 24px;
}

.project-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.project-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    padding: 4px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 16px;
    font-size: 13px;
}

.project-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.project-link:hover {
    background-color: var(--bg-tertiary);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 48px;
    flex-wrap: wrap;
    gap: 24px;
}

.page-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
}

.page-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
}

/* Journal */
.journal-entries {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.journal-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.journal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.journal-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.journal-category {
    padding: 4px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 16px;
    font-size: 13px;
}

.journal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.journal-preview {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.read-more {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

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

/* Detail pages */
.project-detail-card,
.journal-detail-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

/* Blog / long‑form post styling */
.blog-post {
    max-width: 800px;
    margin: 0 auto 64px;
    line-height: 1.75;
    padding: 32px;
}

.blog-post h2,
.blog-post h3 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 700;
}

.blog-post p {
    margin-bottom: 24px;
}

.blog-image {
    width: 100%;
    display: block;
    margin: 24px 0;
    border-radius: 8px;
}

.post-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.project-detail-card .project-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.project-detail-card .project-content {
    padding: 32px;
}

.journal-detail-card {
    padding: 32px;
}

/* About Page */
.about-content {
    max-width: 800px;
}
.about-intro {
    font-size: 20px;
    margin-bottom: 32px;
}

.about-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
}

.about-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.text-muted {
    color: var(--text-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        gap: 16px;
    }

    .hero-title {
        font-size: 32px;
    }

    .page-title {
        font-size: 36px;
    }

    .hero-buttons {
        flex-direction: column;
    }

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

    .page-header {
        flex-direction: column;
    }
}