:root {
  --bg: #0f0f0f;
  --bg-alt: #161616;
  --text: #e8e8e8;
  --text-dim: #9a9a9a;
  --accent: #5B8CFF;
  --border: #262626;
  --photo-border: #1B2540;

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius: 10px;
  --max-width: 900px;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-alt: #ffffff;
  --text: #1a1a1a;
  --text-dim: #6b6b6b;
  --border: #e2e2e2;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  font-size: 16px;
  transition: background 0.2s ease, color 0.2s ease;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: 2.4rem; margin-bottom: 12px; }
h2 { font-size: 1.4rem; margin-bottom: 20px; }
h3 { font-size: 1.1rem; margin-bottom: 8px; }

p { color: var(--text-dim); }

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

a:hover { opacity: 0.75; }

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

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
}

nav .logo {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
}

nav a {
  color: var(--text-dim);
  font-size: 14px;
}

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

.theme-toggle, .nav-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.theme-toggle {
  width: auto;
  padding: 6px 12px;
  font-size: 13px;
}

.nav-toggle {
  width: 32px;
  height: 32px;
  display: none;
}

section {
  margin: 64px 0;
}

.hero {
  margin-top: 56px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.profile-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--photo-border);
  flex-shrink: 0;
}

.hero p {
  font-size: 1.05rem;
  margin-bottom: 20px;
}

.hero .links {
  display: flex;
  gap: 20px;
}

.hero .links a {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 14px;
}

.hero .links a:hover {
  border-color: var(--accent);
  opacity: 1;
}

.hero-text .links {
  justify-content: center;
}

.project-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.2s ease;
}

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

.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.project-card .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.project-card .links a {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
}

.project-card .links a:hover {
  border-color: var(--accent);
  opacity: 1;
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.status-badge {
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.project-card-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.project-card.expanded .project-card-details {
  max-height: 2000px;
}

.long-desc {
  margin: 14px 0;
  white-space: pre-wrap;
}

.short-desc {
  display: inline;
}

.read-more-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
  font-weight: 500;
  display: inline;
}

.read-more-btn:hover {
  text-decoration: underline;
}

.tag {
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
}

.dot {
  color: var(--text-dim);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

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

.blog-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.blog-section-header {
  width: 100%;
  background: var(--bg-alt);
  border: none;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
}

.blog-section-header:hover {
  color: var(--accent);
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-count {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
}

.header-desc {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim);
}

.chevron {
  transition: transform 0.2s ease;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-top: 2px;
}

.blog-section.open .chevron {
  transform: rotate(180deg);
}

.blog-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.blog-section-note {
  padding: 16px 22px 0;
  color: var(--text-dim);
  font-size: 14px;
  font-style: italic;
}

.blog-post-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.blog-post-row:hover {
  background: var(--bg);
}

.blog-post-row h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.blog-post-row p {
  font-size: 14px;
  margin: 0;
}

.blog-post-row .post-date {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.4s ease;
}

#page-loader.loading {
  width: 70%;
}

.page-fade {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.page-visible {
  opacity: 1;
}

footer {
  border-top: 1px solid var(--border);
  padding: 32px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

@media (max-width: 640px) {
  nav ul {
    display: none;
  }
  nav ul.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    right: 24px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    gap: 16px;
  }
  .nav-toggle { display: block; }
  h1 { font-size: 1.9rem; }
  
  .hero-inner {
    flex-direction: column;
    text-align: center;
  }
  .hero-text .links {
    justify-content: center;
  }
  
  .blog-post-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (min-width: 640px) {
  .hero-inner {
    flex-direction: row;
    text-align: left;
    align-items: center;
  }
  .hero-text .links {
    justify-content: flex-start;
  }
}
