/* ═══ Shared styles — yichengyang-ethan.github.io ═══ */

:root {
  --bg: #faf9f7;
  --text: #1a1a1a;
  --text-secondary: #555;
  --accent: #c4170c;
  --accent-light: #fef2f1;
  --border: #e5e3df;
  --card-bg: #fff;
  --code-bg: #f5f4f0;
  --blue: #2563eb;
  --green: #16a34a;
  --orange: #ea580c;
  --purple: #7c3aed;
}

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

body {
  font-family: 'Source Serif 4', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ── Nav ── */
nav {
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

nav .nav-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
}

nav .nav-links {
  display: flex;
  gap: 24px;
}

nav .nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

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

/* ── Header ── */
header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

header .label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

h1 {
  font-size: 42px;
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.meta {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
}

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

/* ── Article ── */
article p { margin-bottom: 24px; }
article h2 {
  font-size: 28px;
  margin: 56px 0 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
article h3 {
  font-size: 22px;
  margin: 40px 0 16px;
  font-weight: 600;
}

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  transition: box-shadow 0.2s;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.card .card-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.card .card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.card .card-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.card .card-meta {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
}

.card .card-meta a {
  color: var(--accent);
}

/* ── Featured grid (2 col) ── */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0;
}

/* ── Project grid (2 col) ── */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.2s;
}
.project-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  opacity: 1;
}

.project-card .project-name {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.project-card .project-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  font-family: 'Inter', sans-serif;
}

.project-card .project-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Section heading ── */
.section-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 56px 0 20px;
}

/* ── Blog list ── */
.post-list {
  list-style: none;
}

.post-list li {
  border-bottom: 1px solid var(--border);
}

.post-list li:last-child { border-bottom: none; }

.post-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  text-decoration: none;
  color: var(--text);
  font-size: 17px;
  transition: color 0.15s;
}

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

.post-list .post-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 16px;
}

/* ── Stats row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.stat-card .number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.stat-card .desc {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

/* ── Callout ── */
.callout {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  margin: 32px 0;
  border-radius: 0 8px 8px 0;
}
.callout p { margin: 0; font-size: 16px; }
.callout strong { color: var(--accent); }

/* ── CTA section ── */
.cta-section {
  background: var(--text);
  color: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  margin: 56px 0;
  text-align: center;
}
.cta-section h3 { color: #fff; margin: 0 0 8px; font-size: 24px; }
.cta-section p { color: #ccc; font-size: 16px; }

.cta-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.cta-links a {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}
.cta-links a.primary { background: var(--accent); color: #fff; }
.cta-links a.secondary { background: transparent; color: #fff; border: 1px solid #555; }
.cta-links a:hover { opacity: 0.85; }

/* ── Figure ── */
.figure { margin: 36px 0; }
.figure img { width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.figure figcaption {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.5;
}

/* ── Timeline ── */
.timeline-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.timeline-title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.timeline-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ── Tag ── */
.tag {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--text-secondary);
  margin-right: 6px;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 56px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}
footer a { color: var(--text-secondary); }

/* ── Responsive ── */
@media (max-width: 640px) {
  h1 { font-size: 30px; }
  .subtitle { font-size: 18px; }
  .featured-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .cta-links { flex-direction: column; align-items: center; }
  nav .nav-links { gap: 16px; }
  nav .nav-links a { font-size: 13px; }
  .timeline-header { flex-direction: column; }
}
