@import url("https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Ubuntu+Mono:wght@400;700&display=swap");

:root {
  --bg: #0a0e14;
  --bg-card: #121821;
  --bg-hover: #1a2230;
  --border: #1f2733;
  --text: #d6e2ef;
  --text-muted: #7d8a9c;
  --accent: #6cc6ff;
  --accent-hover: #9bd8ff;
  --accent-dim: rgba(108, 198, 255, 0.1);
  --accent-glow: rgba(108, 198, 255, 0.18);
  --green: #3fb950;
  --update: #c9a227;
  --max-width: 1040px;
  --radius: 8px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

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

.navbar-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

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

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

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

/* ---------- Hero (Homepage) ---------- */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
}

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

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--text);
}

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

.btn-primary:hover {
  background: rgba(88, 166, 255, 0.2);
  color: var(--accent-hover);
}

/* ---------- Social Links ---------- */
.social-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}

.social-links.align-start {
  justify-content: flex-start;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.social-link:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ---------- Section ---------- */
.section {
  margin-bottom: 56px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  transition: border-color 0.2s;
}

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

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.card-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--accent-dim);
  color: var(--accent);
  margin-right: 6px;
  margin-top: 8px;
}

/* ---------- About ---------- */
.about-intro {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 32px;
}

.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 32px;
  border-left: 2px solid var(--border);
}

.timeline-item:last-child {
  border-left: 2px solid transparent;
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-role {
  font-size: 1.1rem;
  font-weight: 600;
}

.timeline-org {
  color: var(--accent);
  font-size: 0.95rem;
}

.timeline-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

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

/* ---------- Tech badges ---------- */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- Blog ---------- */
.blog-list {
  display: grid;
  gap: 20px;
}

.blog-post-link {
  display: block;
  color: inherit;
}

.blog-post-link:hover {
  color: inherit;
}

/* ---------- Article ---------- */
.article-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-weight: 600;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body ul,
.article-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body code {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "Ubuntu Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.article-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.article-body pre code {
  background: none;
  padding: 0;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Loading / Empty states ---------- */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  .home-right {
    order: -1;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }
  .hero .tagline {
    font-size: 1.05rem;
  }
  .navbar-links {
    gap: 16px;
  }
  .card-header {
    flex-direction: column;
  }
}

/* ---------- Intro Section (Homepage) ---------- */
.intro-section {
  margin-bottom: 56px;
}

.intro-lede {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 20px;
}

.intro-body {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.intro-body:last-child {
  margin-bottom: 0;
}

/* ---------- Homepage (hybrid About + Blog) ---------- */
.home-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}

/* Left column */
.home-left {
  min-width: 0;
}

.home-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: 0 0 0 1px rgba(108, 198, 255, 0.04);
}

.home-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.home-blog .section-title {
  margin-bottom: 20px;
}

/* ---------- Recent Updates feed ---------- */
.feed-link {
  display: block;
  color: inherit;
}

.feed-link:hover {
  color: inherit;
}

.feed-link:hover .feed-item--post {
  border-color: var(--accent);
}

.feed-item {
  padding: 16px 0 16px 14px;
  margin-bottom: 4px;
  border-left: 2px solid var(--border);
}

.feed-item--update {
  border-left-color: var(--update);
}

.feed-item--post {
  border-left-color: var(--accent);
  transition: border-color 0.2s;
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.feed-kind {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.feed-item--update .feed-kind {
  color: var(--update);
}

.feed-item--post .feed-kind {
  color: var(--accent);
}

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

.feed-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.feed-summary {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.view-all {
  margin-top: 16px;
  font-size: 0.9rem;
}

/* Right column */
.home-right {
  position: sticky;
  top: 88px;
}

.home-name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.home-nick {
  color: var(--accent);
  font-size: 0.95rem;
  margin-top: 6px;
  margin-bottom: 28px;
}

.home-bio p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 16px;
}

.home-bio p:last-child {
  margin-bottom: 0;
}

.home-interests {
  list-style: none;
  padding: 0;
  margin: 12px 0 20px;
}

.home-interests li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text);
}

.home-interests li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.home-right .social-links {
  margin-top: 32px;
  justify-content: flex-start;
  gap: 10px;
}

.home-right .social-link {
  padding: 8px 14px;
  font-size: 0.85rem;
}
