/* ===========================
   CSS Variables
   =========================== */
:root {
  --color-bg: #fafafa;
  --color-bg-card: #ffffff;
  --color-text: #1d1d1f;
  --color-text-muted: #6e6e73;
  --color-text-subtle: #48484a;
  --color-accent: #0066cc;
  --color-border: #e5e7eb;
  --color-hover-bg: #f5f5f7;
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', 'JetBrains Mono', monospace;
  --radius: 8px;
  --max-width: 640px;
}

/* ===========================
   Reset & Global
   =========================== */
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  opacity: 0.7;
}

::selection {
  background: rgba(0, 102, 204, 0.12);
}

/* ===========================
   Header / Nav
   =========================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  font-family: var(--font-mono);
}

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

header h1 a:hover {
  opacity: 0.7;
}

nav a {
  margin-left: 24px;
  font-size: 15px;
  color: var(--color-text-muted);
  font-weight: 400;
}

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

nav a.active {
  color: var(--color-text);
  font-weight: 500;
}

.social-links-text {
  display: none;
}

/* ===========================
   Main Content
   =========================== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px 80px;
}

h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

h3 {
  font-size: 20px;
  margin-top: 32px;
  font-family: var(--font-sans);
}

/* ===========================
   Hero (Home)
   =========================== */
.hero {
  text-align: left;
  padding: 60px 20px 40px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-greeting {
  font-size: 15px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-weight: 400;
}

.hero-name {
  font-size: 48px;
  margin: 0 0 4px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: var(--font-mono);
  background: linear-gradient(135deg, #1d1d1f 0%, #2d3a8c 50%, #6e3fae 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 20px;
  color: var(--color-text-muted);
  margin: 0 0 20px;
  font-weight: 400;
  line-height: 1.4;
}

.hero-bio {
  font-size: 16px;
  color: var(--color-text-subtle);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 28px;
}

.hero-links {
  font-size: 14px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.hero-links a {
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

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

.hero-links .sep {
  margin: 0 8px;
  color: var(--color-border);
}

.home-posts {
  margin-top: 48px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.btn-primary {
  display: inline-block;
  padding: 10px 24px;
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-mono);
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.8;
  color: var(--color-bg);
}

.btn-secondary {
  display: inline-block;
  padding: 10px 24px;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-mono);
}

.btn-secondary:hover {
  color: var(--color-text);
  opacity: 1;
}

/* ===========================
   Page Subtitle
   =========================== */
.page-subtitle,
.blog-subtitle {
  color: var(--color-text-muted);
  font-size: 16px;
  margin-top: -4px;
  margin-bottom: 32px;
}

/* ===========================
   Blog Timeline List
   =========================== */
.blog-list-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: left;
  padding: 40px 20px 80px;
}

.blog-list-wrapper h2 {
  text-align: left;
}

.blog-year {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 40px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-mono);
}

.blog-year:first-of-type {
  margin-top: 24px;
}

.blog-timeline {
  display: flex;
  flex-direction: column;
}

.blog-entry {
  display: flex;
  gap: 20px;
  padding: 14px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s;
  align-items: baseline;
}

.blog-entry:hover {
  background: var(--color-hover-bg);
}

.blog-entry time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  min-width: 90px;
}

.blog-entry-content {
  flex: 1;
}

.blog-entry-content h3 {
  font-size: 16px;
  color: var(--color-text);
  margin: 0;
  font-weight: 500;
  line-height: 1.4;
  font-family: var(--font-sans);
}

.blog-entry-content p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 2px 0 0;
  line-height: 1.5;
}

.blog-entry-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ===========================
   Card Component (Projects)
   =========================== */
.projects-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
}

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

.project-card:hover {
  border-color: var(--color-text-muted);
}

.project-card h3 {
  color: var(--color-text);
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.project-card p {
  color: var(--color-text-subtle);
  font-size: 15px;
  margin: 0 0 12px;
  line-height: 1.6;
}

.project-card ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.project-card li {
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-hover-bg);
  padding: 4px 10px;
  border-radius: 4px;
  margin: 0;
  font-family: var(--font-mono);
}

.project-card a {
  font-size: 14px;
  font-weight: 500;
  margin-right: 16px;
  font-family: var(--font-mono);
}

/* ===========================
   Blog Post Article
   =========================== */
.article-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: left;
  padding: 40px 20px 80px;
}

.blog-header {
  text-align: left;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.blog-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-family: var(--font-mono);
}

.blog-header .author {
  font-size: 15px;
  color: var(--color-text-subtle);
  margin: 0;
}

.blog-header .date {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 4px 0 0;
  font-family: var(--font-mono);
}

.post {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text-subtle);
}

.post p {
  margin-bottom: 1.5em;
}

.post .intro {
  font-size: 18px;
  color: var(--color-text);
  font-weight: 400;
  line-height: 1.7;
}

.post strong {
  color: var(--color-text);
  font-weight: 600;
}

.post a {
  color: var(--color-accent);
  border-bottom: 1px solid rgba(0, 102, 204, 0.3);
}

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

.post h3 {
  color: var(--color-text);
  font-size: 20px;
  text-align: left;
  margin-top: 2em;
  font-family: var(--font-mono);
}

.post blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.5em 0;
  padding: 0.5em 1em;
  color: var(--color-text-subtle);
  font-style: italic;
  background: var(--color-hover-bg);
  border-radius: 0 6px 6px 0;
}

.reference {
  margin-top: 2em;
  font-style: italic;
  color: var(--color-accent);
}

.back-link {
  margin: 3rem 0 1rem;
  font-size: 15px;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
}

.back-link a {
  color: var(--color-text-muted);
}

.back-link a:hover {
  color: var(--color-text);
  opacity: 1;
}

/* ===========================
   About Page
   =========================== */
main section {
  margin-bottom: 2rem;
}

main section h2 {
  font-size: 28px;
}

main section h3 {
  font-size: 18px;
  color: var(--color-text);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

main section p {
  color: var(--color-text-subtle);
  font-size: 16px;
  line-height: 1.7;
}

main section ul {
  list-style: none;
  padding: 0;
}

main section li {
  color: var(--color-text-subtle);
  font-size: 16px;
  margin: 6px 0;
}

/* ===========================
   Contact Page
   =========================== */
.contact-container {
  text-align: left;
  padding: 40px 20px 80px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.contact-container a {
  color: var(--color-accent);
}

.social-links {
  margin-top: 20px;
}

.social-links a {
  margin-right: 16px;
  font-size: 16px;
}

/* ===========================
   Footer
   =========================== */
footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 12px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  max-width: var(--max-width);
  margin: 0 auto;
  font-family: var(--font-mono);
}

/* ===========================
   Page Transition
   =========================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

main, main.hero {
  animation: fadeIn 0.3s ease-out;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  nav {
    margin: 0;
  }

  nav a {
    margin-left: 0;
    margin-right: 16px;
  }

  .hero-name {
    font-size: 36px;
  }

  .hero-tagline {
    font-size: 18px;
  }

  .hero {
    padding: 32px 20px 24px;
  }

  .blog-entry {
    flex-direction: column;
    gap: 2px;
    padding: 12px 8px;
  }

  .blog-entry time {
    min-width: auto;
  }

  .blog-header h1 {
    font-size: 26px;
  }

  .project-card {
    padding: 20px;
  }

  .projects-container {
    gap: 12px;
  }
}
