/* === Base Reset & Typography === */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;0,8..60,600;1,8..60,400&family=JetBrains+Mono:wght@400;500&display=swap");

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

:root {
  --bg: #0e1016;
  --bg-surface: #151820;
  --bg-elevated: #1b1f2b;
  --border: #282d3e;
  --border-subtle: #1e2233;
  --text-primary: #eceef5;
  --text-secondary: #b0b8d0;
  --text-muted: #636b88;
  --accent: #c9a96e;
  --accent-dim: rgba(201, 169, 110, 0.1);
  --accent-glow: rgba(201, 169, 110, 0.04);
  --font-heading: "Space Grotesk", -apple-system, "Segoe UI", sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
  --max-width: 780px;
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 17px;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(201, 169, 110, 0.03) 0%, transparent 60%);
  min-height: 100vh;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

/* === Top Bar === */
.top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 10px 32px;
  background: rgba(14, 16, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-muted);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--border-subtle);
}

.top-bar .left {
  font-weight: 500;
}

.top-bar .right {
  opacity: 0.6;
}

/* === Layout === */
.container {
  margin-top: 48px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 48px 32px 96px;
}

/* === Navigation === */
nav {
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
}

nav ul {
  display: flex;
  gap: 36px;
  list-style: none;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

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

nav a.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* === Header === */
header {
  text-align: center;
  margin-bottom: 8px;
}

header h1 {
  font-size: 1.85rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.small-text {
  font-size: 0.48em;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 8px;
  font-style: italic;
  font-family: var(--font-body);
}

/* === Divider === */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* === Profile Photo (Home) === */
.profile-photo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.profile-photo img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-surface);
  transition: border-color var(--transition);
  cursor: pointer;
}

.profile-photo img:hover {
  border-color: var(--accent);
}

/* === Intro Section (Home) === */
.intro {
  margin-bottom: 36px;
}

.intro p {
  margin: 0 0 18px 0;
  line-height: 1.85;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.intro p:first-child {
  font-size: 1.15rem;
  color: var(--text-primary);
}

.intro strong {
  color: var(--accent);
  font-weight: 600;
}

.intro em {
  color: var(--text-muted);
  font-style: italic;
}

.intro ul {
  margin: 16px 0 26px 22px;
  padding: 0;
  font-size: 1.02rem;
  color: var(--text-secondary);
}

.intro ul li {
  margin-bottom: 10px;
  line-height: 1.75;
}

.intro ul li::marker {
  color: var(--text-muted);
}

/* === Highlight Cards (Home) === */
.highlights {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 28px 0;
}

.highlight-card {
  padding: 16px 20px;
  color: var(--text-secondary);
  font-size: 1rem;
  border-left: 2px solid var(--accent);
  background: var(--bg-surface);
  border-radius: 0 6px 6px 0;
  line-height: 1.7;
}

.highlight-card strong {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: block;
  margin-bottom: 4px;
}

.highlight-card em {
  color: var(--accent);
}

/* === Social Links === */
.socials {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-links a {
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 9px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  transition: color var(--transition), border-color var(--transition),
    background var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
}

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

.social-links a svg {
  opacity: 0.6;
  transition: opacity var(--transition);
}

.social-links a:hover svg {
  opacity: 1;
}

/* === Projects List === */
.projects-list {
  margin-top: 16px;
}

.project-item {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

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

.project-item h3 {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 500;
}

.project-item a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

.project-item p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
  line-height: 1.75;
}

/* === Blogs List — Timeline === */
.blogs-list {
  margin-top: 16px;
  position: relative;
  padding-left: 32px;
}

/* Vertical timeline line */
.blogs-list::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

/* Year separator label */
.timeline-year {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  margin-top: 8px;
  padding-left: 4px;
}

.timeline-year::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.blog-item {
  position: relative;
  margin-bottom: 18px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  transition: border-color var(--transition), background var(--transition);
}

/* Timeline dot for each blog */
.blog-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 24px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg);
  transition: background var(--transition);
}

.blog-item:hover {
  border-color: rgba(201, 169, 110, 0.3);
}

.blog-item:hover::before {
  background: var(--accent);
}

.blog-item h3 {
  margin: 0 0 5px 0;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 500;
}

.blog-item a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

.blog-item p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin: 0;
  line-height: 1.65;
}

.blog-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

/* === Blog Post (Individual) === */
.blog-post {
  margin-top: 16px;
}

.blog-post h2 {
  margin: 44px 0 16px 0;
  font-size: 1.4rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.blog-post h3 {
  margin: 32px 0 12px 0;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--accent);
  position: relative;
  padding-left: 14px;
}

.blog-post h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
}

.blog-post p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin: 0 0 16px 0;
  line-height: 1.9;
}

.blog-post ul,
.blog-post ol {
  margin: 10px 0 20px 22px;
  padding: 0;
}

.blog-post li {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 10px;
  line-height: 1.8;
}

.blog-post li strong {
  color: var(--text-primary);
}

.blog-post a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.blog-post a:hover {
  border-bottom-color: var(--accent);
}

.blog-post code {
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
  border: 1px solid var(--border);
}

.blog-post .screenshot-placeholder img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.blog-post blockquote {
  border-left: 2px solid var(--accent);
  margin: 20px 0;
  padding: 12px 18px;
  background: var(--bg-surface);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
  font-size: 1rem;
  font-style: italic;
}

/* === Project Detail Page === */
.project-detail {
  margin-top: 16px;
}

.project-detail .subtitle {
  color: var(--accent);
  font-size: 1rem;
  font-family: var(--font-body);
  margin-top: 6px;
  margin-bottom: 18px;
  font-weight: 400;
  text-align: center;
}

.project-detail h2 {
  font-size: 1.35rem;
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 600;
  margin: 36px 0 14px 0;
}

.project-detail h3 {
  font-size: 1.08rem;
  font-family: var(--font-heading);
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.project-detail p,
.project-detail li {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.project-detail ul {
  margin: 8px 0 18px 20px;
}

.project-detail li {
  margin-bottom: 8px;
}

.project-detail li strong {
  color: var(--text-primary);
}

.features-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.feature-card,
.metric-card {
  background: var(--bg-surface);
  padding: 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.feature-card h3,
.metric-card h3 {
  color: var(--accent);
  font-size: 0.9rem;
  font-family: var(--font-heading);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.feature-card ul,
.metric-card ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.feature-card li,
.metric-card li {
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.vote-flow {
  display: flex;
  gap: 8px;
  margin: 24px 0;
}

.vote-step {
  text-align: center;
  flex: 1;
  padding: 18px 12px;
  background: var(--bg-surface);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.vote-step h3 {
  font-size: 0.95rem;
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.vote-step i {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

.vote-step p {
  font-size: 0.88rem;
  margin: 0;
}

.screenshot-placeholder {
  text-align: center;
  margin: 20px 0;
}

.screenshot-placeholder img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* === GitHub Heatmap === */
.github-heatmap {
  margin-top: 2rem;
  width: 100%;
}

.github-heatmap h2 {
  font-size: 1rem;
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.heatmap-container {
  display: flex;
  flex-direction: column;
  margin-top: 0.75rem;
  overflow-x: auto;
}

.heatmap-header {
  display: flex;
  margin-left: 30px;
}

.month-labels {
  display: flex;
  height: 20px;
  color: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-mono);
}

.month-label {
  width: 28px;
  text-align: center;
}

.heatmap-body {
  display: flex;
}

.day-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 8px;
  color: var(--text-muted);
  font-size: 10px;
  width: 30px;
  font-family: var(--font-mono);
}

.day-label {
  height: 10px;
  line-height: 10px;
  margin: 3px 0;
}

.heatmap {
  display: flex;
  flex-direction: column;
}

.heatmap-row {
  display: flex;
  gap: 3px;
  margin-bottom: 3px;
}

.day {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  transition: transform 0.1s ease;
}

.day:hover {
  transform: scale(1.3);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 10px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.legend-cells {
  display: flex;
  margin: 0 8px;
  gap: 3px;
}

.legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.tooltip {
  position: absolute;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* === Footer === */
footer {
  margin: 48px 0 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer .social-links {
  justify-content: center;
  margin-bottom: 12px;
}

footer p,
.copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* === Back link === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.92rem;
  font-family: var(--font-heading);
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--accent);
}

/* === Responsive === */
@media (max-width: 600px) {
  .container {
    padding: 32px 18px 64px;
  }

  nav ul {
    gap: 22px;
  }

  nav a {
    font-size: 0.88rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .profile-photo img {
    width: 95px;
    height: 95px;
  }

  .top-bar {
    padding: 8px 16px;
    font-size: 0.72rem;
  }

  .highlights {
    gap: 8px;
  }

  .blog-post {
    margin-left: 0;
    margin-right: 0;
  }

  .features-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .vote-flow {
    flex-direction: column;
  }

  .social-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Timeline responsive */
  .blogs-list {
    padding-left: 26px;
  }

  .blogs-list::before {
    left: 6px;
  }

  .timeline-year::before {
    left: -23px;
    width: 7px;
    height: 7px;
  }

  .blog-item::before {
    left: -23px;
    width: 5px;
    height: 5px;
  }

  .blog-item {
    padding: 14px 16px;
  }
}
