:root {
  /* Dark Theme Colors (Default) */
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --text-muted: #a0a0a0;
  --accent-color: #58a6ff;
  --card-bg: #1e1e1e;
  --border-color: #333333;
  --header-bg: rgba(18, 18, 18, 0.85);
}

[data-theme="light"] {
  /* Light Theme Colors */
  --bg-color: #ffffff;
  --text-color: #24292f;
  --text-muted: #57606a;
  --accent-color: #0969da;
  --card-bg: #f6f8fa;
  --border-color: #e1e4e8;
  --header-bg: rgba(255, 255, 255, 0.85);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-color);
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

p,
ul,
ol {
  margin-bottom: 1.2rem;
  color: var(--text-color);
}

li {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Layout */
.wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-content {
  flex: 1;
  padding: 40px 0;
}

/* Page Typographic Improvements */
.page-title {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

.page-content h1 {
  font-size: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3rem;
  margin-top: 2rem;
}

.page-content h2 {
  font-size: 1.5rem;
  color: var(--accent-color);
  margin-top: 2rem;
}

.page-content h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

.page-content p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-color);
}

.page-content ul,
.page-content ol {
  font-size: 1.05rem;
  line-height: 1.7;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.page-content li {
  margin-bottom: 0.5rem;
}

.page-content hr {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 2rem 0;
}

/* Header & Nav */
.site-header {
  border-bottom: 1px solid var(--border-color);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 20px;
  gap: 1rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
}

.site-title:hover {
  text-decoration: none;
}

.mobile-title {
  display: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Firefox */
}

.nav-links::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

@media (max-width: 650px) {
  .nav-container {
    padding: 0.5rem 12px;
    gap: 0.8rem;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: inline;
    font-size: 1.2rem;
  }

  .nav-links {
    gap: 1.2rem;
    flex: 1;
    justify-content: flex-start;
    padding-right: 2rem;
    /* Creates empty space at the end of scroll */
    /* Fades the right edge to visually hint that there is more content */
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 2rem), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 2rem), transparent 100%);
  }

  .nav-links a {
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .theme-toggle {
    flex-shrink: 0;
  }
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

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

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

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

/* Hero Section (Home) */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
  margin-bottom: 3rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .hero {
    flex-direction: row;
    text-align: left;
    gap: 4rem;
    align-items: flex-start;
  }
}

.hero-profile {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--border-color);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .hero-profile {
    width: 240px;
    height: 240px;
  }
}

.hero-content h1 {
  font-size: 2rem;
  margin-top: 0;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .hero-content h1 {
    font-size: 3rem;
  }
}

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

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

@media (min-width: 768px) {
  .hero-actions {
    justify-content: flex-start;
  }
}

/* Project Cards */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.project-title {
  font-size: 1.25rem;
  margin-top: 0;
}

.project-title a {
  color: var(--text-color);
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  background: var(--border-color);
  color: var(--text-color);
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Syntax Highlighting */
[data-theme="dark"] .highlight table td {
  padding: 5px;
}

[data-theme="dark"] .highlight table pre {
  margin: 0;
}

[data-theme="dark"] .highlight .c,
[data-theme="dark"] .highlight .ch,
[data-theme="dark"] .highlight .cd,
[data-theme="dark"] .highlight .cpf {
  color: #75715e;
  font-style: italic;
}

[data-theme="dark"] .highlight .cm {
  color: #75715e;
  font-style: italic;
}

[data-theme="dark"] .highlight .c1 {
  color: #75715e;
  font-style: italic;
}

[data-theme="dark"] .highlight .cp {
  color: #75715e;
  font-weight: bold;
}

[data-theme="dark"] .highlight .cs {
  color: #75715e;
  font-weight: bold;
  font-style: italic;
}

[data-theme="dark"] .highlight .err {
  color: #960050;
  background-color: #1e0010;
}

[data-theme="dark"] .highlight .gi {
  color: #ffffff;
  background-color: #324932;
}

[data-theme="dark"] .highlight .gd {
  color: #ffffff;
  background-color: #493131;
}

[data-theme="dark"] .highlight .ge {
  color: #000000;
  font-style: italic;
}

[data-theme="dark"] .highlight .gr {
  color: #aa0000;
}

[data-theme="dark"] .highlight .gt {
  color: #aa0000;
}

[data-theme="dark"] .highlight .gh {
  color: #999999;
}

[data-theme="dark"] .highlight .go {
  color: #888888;
}

[data-theme="dark"] .highlight .gp {
  color: #555555;
}

[data-theme="dark"] .highlight .gs {
  font-weight: bold;
}

[data-theme="dark"] .highlight .gu {
  color: #aaaaaa;
}

[data-theme="dark"] .highlight .k,
[data-theme="dark"] .highlight .kv {
  color: #66d9ef;
  font-weight: bold;
}

[data-theme="dark"] .highlight .kc {
  color: #66d9ef;
  font-weight: bold;
}

[data-theme="dark"] .highlight .kd {
  color: #66d9ef;
  font-weight: bold;
}

[data-theme="dark"] .highlight .kp {
  color: #66d9ef;
  font-weight: bold;
}

[data-theme="dark"] .highlight .kr {
  color: #66d9ef;
  font-weight: bold;
}

[data-theme="dark"] .highlight .kt {
  color: #66d9ef;
  font-weight: bold;
}

[data-theme="dark"] .highlight .kn {
  color: #f92672;
  font-weight: bold;
}

[data-theme="dark"] .highlight .ow {
  color: #f92672;
  font-weight: bold;
}

[data-theme="dark"] .highlight .o {
  color: #f92672;
  font-weight: bold;
}

[data-theme="dark"] .highlight .mf {
  color: #ae81ff;
}

[data-theme="dark"] .highlight .mh {
  color: #ae81ff;
}

[data-theme="dark"] .highlight .il {
  color: #ae81ff;
}

[data-theme="dark"] .highlight .mi {
  color: #ae81ff;
}

[data-theme="dark"] .highlight .mo {
  color: #ae81ff;
}

[data-theme="dark"] .highlight .m,
[data-theme="dark"] .highlight .mb,
[data-theme="dark"] .highlight .mx {
  color: #ae81ff;
}

[data-theme="dark"] .highlight .se {
  color: #ae81ff;
}

[data-theme="dark"] .highlight .sa {
  color: #66d9ef;
  font-weight: bold;
}

[data-theme="dark"] .highlight .sb {
  color: #e6db74;
}

[data-theme="dark"] .highlight .sc {
  color: #e6db74;
}

[data-theme="dark"] .highlight .sd {
  color: #e6db74;
}

[data-theme="dark"] .highlight .s2 {
  color: #e6db74;
}

[data-theme="dark"] .highlight .sh {
  color: #e6db74;
}

[data-theme="dark"] .highlight .si {
  color: #e6db74;
}

[data-theme="dark"] .highlight .sx {
  color: #e6db74;
}

[data-theme="dark"] .highlight .sr {
  color: #e6db74;
}

[data-theme="dark"] .highlight .s1 {
  color: #e6db74;
}

[data-theme="dark"] .highlight .ss {
  color: #e6db74;
}

[data-theme="dark"] .highlight .s,
[data-theme="dark"] .highlight .dl {
  color: #e6db74;
}

[data-theme="dark"] .highlight .na {
  color: #a6e22e;
}

[data-theme="dark"] .highlight .nc {
  color: #a6e22e;
  font-weight: bold;
}

[data-theme="dark"] .highlight .nd {
  color: #a6e22e;
  font-weight: bold;
}

[data-theme="dark"] .highlight .ne {
  color: #a6e22e;
  font-weight: bold;
}

[data-theme="dark"] .highlight .nf,
[data-theme="dark"] .highlight .fm {
  color: #a6e22e;
  font-weight: bold;
}

[data-theme="dark"] .highlight .no {
  color: #66d9ef;
}

[data-theme="dark"] .highlight .bp {
  color: #f8f8f2;
}

[data-theme="dark"] .highlight .nb {
  color: #f8f8f2;
}

[data-theme="dark"] .highlight .ni {
  color: #f8f8f2;
}

[data-theme="dark"] .highlight .nn {
  color: #f8f8f2;
}

[data-theme="dark"] .highlight .vc {
  color: #f8f8f2;
}

[data-theme="dark"] .highlight .vg {
  color: #f8f8f2;
}

[data-theme="dark"] .highlight .vi {
  color: #f8f8f2;
}

[data-theme="dark"] .highlight .nv,
[data-theme="dark"] .highlight .vm {
  color: #f8f8f2;
}

[data-theme="dark"] .highlight .w {
  color: #f8f8f2;
}

[data-theme="dark"] .highlight .nl {
  color: #f8f8f2;
  font-weight: bold;
}

[data-theme="dark"] .highlight .nt {
  color: #f92672;
}

[data-theme="dark"] .highlight {
  color: #f8f8f2;
  background-color: #49483e;
}

[data-theme="light"] .highlight table td {
  padding: 5px;
}

[data-theme="light"] .highlight table pre {
  margin: 0;
}

[data-theme="light"] .highlight .cm {
  color: #999988;
  font-style: italic;
}

[data-theme="light"] .highlight .cp {
  color: #999999;
  font-weight: bold;
}

[data-theme="light"] .highlight .c1 {
  color: #999988;
  font-style: italic;
}

[data-theme="light"] .highlight .cs {
  color: #999999;
  font-weight: bold;
  font-style: italic;
}

[data-theme="light"] .highlight .c,
[data-theme="light"] .highlight .ch,
[data-theme="light"] .highlight .cd,
[data-theme="light"] .highlight .cpf {
  color: #999988;
  font-style: italic;
}

[data-theme="light"] .highlight .err {
  color: #a61717;
  background-color: #e3d2d2;
}

[data-theme="light"] .highlight .gd {
  color: #000000;
  background-color: #ffdddd;
}

[data-theme="light"] .highlight .ge {
  color: #000000;
  font-style: italic;
}

[data-theme="light"] .highlight .gr {
  color: #aa0000;
}

[data-theme="light"] .highlight .gh {
  color: #999999;
}

[data-theme="light"] .highlight .gi {
  color: #000000;
  background-color: #ddffdd;
}

[data-theme="light"] .highlight .go {
  color: #888888;
}

[data-theme="light"] .highlight .gp {
  color: #555555;
}

[data-theme="light"] .highlight .gs {
  font-weight: bold;
}

[data-theme="light"] .highlight .gu {
  color: #aaaaaa;
}

[data-theme="light"] .highlight .gt {
  color: #aa0000;
}

[data-theme="light"] .highlight .kc {
  color: #000000;
  font-weight: bold;
}

[data-theme="light"] .highlight .kd {
  color: #000000;
  font-weight: bold;
}

[data-theme="light"] .highlight .kn {
  color: #000000;
  font-weight: bold;
}

[data-theme="light"] .highlight .kp {
  color: #000000;
  font-weight: bold;
}

[data-theme="light"] .highlight .kr {
  color: #000000;
  font-weight: bold;
}

[data-theme="light"] .highlight .kt {
  color: #445588;
  font-weight: bold;
}

[data-theme="light"] .highlight .k,
[data-theme="light"] .highlight .kv {
  color: #000000;
  font-weight: bold;
}

[data-theme="light"] .highlight .mf {
  color: #009999;
}

[data-theme="light"] .highlight .mh {
  color: #009999;
}

[data-theme="light"] .highlight .il {
  color: #009999;
}

[data-theme="light"] .highlight .mi {
  color: #009999;
}

[data-theme="light"] .highlight .mo {
  color: #009999;
}

[data-theme="light"] .highlight .m,
[data-theme="light"] .highlight .mb,
[data-theme="light"] .highlight .mx {
  color: #009999;
}

[data-theme="light"] .highlight .sa {
  color: #000000;
  font-weight: bold;
}

[data-theme="light"] .highlight .sb {
  color: #d14;
}

[data-theme="light"] .highlight .sc {
  color: #d14;
}

[data-theme="light"] .highlight .sd {
  color: #d14;
}

[data-theme="light"] .highlight .s2 {
  color: #d14;
}

[data-theme="light"] .highlight .se {
  color: #d14;
}

[data-theme="light"] .highlight .sh {
  color: #d14;
}

[data-theme="light"] .highlight .si {
  color: #d14;
}

[data-theme="light"] .highlight .sx {
  color: #d14;
}

[data-theme="light"] .highlight .sr {
  color: #009926;
}

[data-theme="light"] .highlight .s1 {
  color: #d14;
}

[data-theme="light"] .highlight .ss {
  color: #990073;
}

[data-theme="light"] .highlight .s,
[data-theme="light"] .highlight .dl {
  color: #d14;
}

[data-theme="light"] .highlight .na {
  color: #008080;
}

[data-theme="light"] .highlight .bp {
  color: #999999;
}

[data-theme="light"] .highlight .nb {
  color: #0086B3;
}

[data-theme="light"] .highlight .nc {
  color: #445588;
  font-weight: bold;
}

[data-theme="light"] .highlight .no {
  color: #008080;
}

[data-theme="light"] .highlight .nd {
  color: #3c5d5d;
  font-weight: bold;
}

[data-theme="light"] .highlight .ni {
  color: #800080;
}

[data-theme="light"] .highlight .ne {
  color: #990000;
  font-weight: bold;
}

[data-theme="light"] .highlight .nf,
[data-theme="light"] .highlight .fm {
  color: #990000;
  font-weight: bold;
}

[data-theme="light"] .highlight .nl {
  color: #990000;
  font-weight: bold;
}

[data-theme="light"] .highlight .nn {
  color: #555555;
}

[data-theme="light"] .highlight .nt {
  color: #000080;
}

[data-theme="light"] .highlight .vc {
  color: #008080;
}

[data-theme="light"] .highlight .vg {
  color: #008080;
}

[data-theme="light"] .highlight .vi {
  color: #008080;
}

[data-theme="light"] .highlight .nv,
[data-theme="light"] .highlight .vm {
  color: #008080;
}

[data-theme="light"] .highlight .ow {
  color: #000000;
  font-weight: bold;
}

[data-theme="light"] .highlight .o {
  color: #000000;
  font-weight: bold;
}

[data-theme="light"] .highlight .w {
  color: #bbbbbb;
}

[data-theme="light"] .highlight {
  background-color: #f8f8f8;
}