/* ============================================================
   Moin Uddin Ahmed — Personal Site
   Clean, calm, editorial
   ============================================================ */

/* --- Design tokens --- */
:root {
  --bg:            #0a0a0b;
  --bg-soft:       #121214;
  --bg-elevated:   #1a1a1e;
  --bg-hover:      #222228;
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text:          #f4f2ee;
  --text-muted:    #9a968c;
  --text-faint:    #6b675f;

  --accent:        #c4a574;
  --accent-soft:   rgba(196, 165, 116, 0.14);
  --accent-hover:  #d4b98a;

  --font-serif:    'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-sans:     'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, monospace;

  --max-prose:     42rem;
  --max-page:      68rem;
  --nav-h:         4rem;
  --radius:        12px;
  --radius-sm:     8px;
  --ease:          180ms ease;
  --shadow:        0 12px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg:            #f7f5f1;
  --bg-soft:       #efece6;
  --bg-elevated:   #ffffff;
  --bg-hover:      #e8e4db;
  --border:        rgba(20, 18, 14, 0.08);
  --border-strong: rgba(20, 18, 14, 0.14);

  --text:          #16140f;
  --text-muted:    #5c574c;
  --text-faint:    #8a8478;

  --accent:        #8b6914;
  --accent-soft:   rgba(139, 105, 20, 0.1);
  --accent-hover:  #6f5210;

  --shadow:        0 12px 40px rgba(20, 18, 14, 0.08);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

/* --- Layout helpers --- */
.container {
  width: 100%;
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container.narrow,
.page-content .container.narrow {
  max-width: 48rem;
}

.section {
  padding: 4.5rem 0;
}

.section-muted {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-title.tight {
  margin-bottom: 0.75rem;
}

.section-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

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

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 0.75rem;
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

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

.nav-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
}

.nav-logo-text {
  display: none;
}

@media (min-width: 480px) {
  .nav-logo-text {
    display: inline;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-links > a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition: color var(--ease), background var(--ease);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.5rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--border);
}

.nav-search-btn,
.nav-theme-btn,
.nav-rss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ease), background var(--ease);
}

.nav-search-btn:hover,
.nav-theme-btn:hover,
.nav-rss:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.45rem;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}

/* --- Reading progress --- */
.reading-progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  z-index: 999;
  transition: width 80ms linear;
}

/* --- Main --- */
.main-content {
  min-height: calc(100vh - 12rem);
  padding-top: var(--nav-h);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 550;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
}

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

a.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg);
  transform: translateY(-1px);
}

a.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

a.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* --- Hero --- */
.hero {
  position: relative;
  padding: 6.5rem 0 5rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 20%, var(--accent-soft), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 70%, rgba(255, 255, 255, 0.03), transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 42rem;
}

.hero-eyebrow {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.hero-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}

/* Appends the cursor dash to the end of the text */
.hero-role::after {
  content: "_"; /* Changes the dash symbol if you prefer a vertical bar like "|" */
  animation: blink 0.5s infinite;
}

/* Creates the repeating on/off visibility toggle for the cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}


.hero-lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 34rem;
  margin-bottom: 2rem;
  text-align: justify;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --- Featured slideshow --- */
.section-featured {
  padding: 3rem 0 2rem;
}

.featured-slideshow {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 200px;
}

.slideshow-track {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.slideshow-slide {
  flex: 0 0 100%;
  min-width: 0;
  padding: 2rem 2rem 2.5rem;
}

.slideshow-card {
  max-width: 100%;
}

.slideshow-count {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.slideshow-category {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.slideshow-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0.65rem 0 0.5rem;
}

.slideshow-title a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--ease);
}

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

.slideshow-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.slideshow-meta {
  font-size: 0.85rem;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.slideshow-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0 1.25rem;
}

.slideshow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
  padding: 0;
}

.slideshow-dot:hover {
  border-color: var(--accent);
  transform: scale(1.25);
}

.slideshow-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.25);
}

/* --- Post list (home) --- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.25rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.post-row:first-child {
  border-top: 1px solid var(--border);
}

.post-row-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  padding-top: 0.3rem;
}

.post-row-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

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

.post-row-title a:hover {
  color: var(--accent);
}

.post-row-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --- About teaser --- */
.about-teaser {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  max-width: 42rem;
}

.about-teaser-photo {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
}

.about-teaser-copy p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

/* --- Empty states --- */
.empty-card {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-soft);
  border: 1px dashed var(--border-strong);
  border-radius: calc(var(--radius) + 4px);
}

.empty-card.large {
  padding: 4rem 1.5rem;
}

.empty-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.empty-card h2,
.empty-card h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.empty-card p {
  color: var(--text-muted);
  max-width: 28rem;
  margin: 0 auto 1.5rem;
  font-size: 0.98rem;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* --- Page layout --- */
.page-header {
  padding: 3rem 0 1.75rem;
}

.page-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.page-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 32rem;
}

.page-body {
  padding-bottom: 4rem;
}

.page-lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.65;
}

/* --- About page --- */
.about-page {
  max-width: var(--max-prose);
}

.about-hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.about-photo {
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-strong);
  flex-shrink: 0;
}

.about-summary .lead {
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.7;
}

.about-summary p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.about-block {
  margin-bottom: 2.5rem;
}

.about-block h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.45rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.focus-list {
  list-style: none;
}

.focus-list li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.25rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.focus-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.about-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

a.btn-social {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color var(--ease), background var(--ease), color var(--ease);
}

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

/* --- Contact page --- */
.contact-page {
  max-width: 40rem;
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

a.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.35rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  transition: border-color var(--ease), transform var(--ease), background var(--ease);
}

a.contact-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  color: inherit;
}

.contact-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.contact-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.contact-value {
  font-size: 0.92rem;
  color: var(--text);
  word-break: break-all;
}

/* --- Blog --- */
.blog-toolbar {
  margin-bottom: 1.5rem;
}

.blog-search {
  position: relative;
}

.blog-search > i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 0.9rem;
  pointer-events: none;
}

.blog-search .search-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.6rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.blog-search .search-input::placeholder {
  color: var(--text-faint);
}

.blog-search .search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.featured-banner {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.featured-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
}

.featured-banner h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.5rem;
  margin: 0.75rem 0 0.5rem;
  letter-spacing: -0.01em;
}

.featured-banner h2 a {
  color: var(--text);
}

.featured-banner h2 a:hover {
  color: var(--accent);
}

.featured-banner p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.featured-banner-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-featured {
  background: var(--accent-soft);
  color: var(--accent);
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

.post-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.post-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.post-card-body {
  padding: 1.35rem;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 0.6rem;
}

.post-card-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
}

.post-card-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

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

.post-card-title a:hover {
  color: var(--accent);
}

.post-card-excerpt {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: color var(--ease), border-color var(--ease);
}

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

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.pag-info {
  font-size: 0.85rem;
  color: var(--text-faint);
}

.pagination .pag-prev,
.pagination .pag-next {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pagination .pag-prev:hover,
.pagination .pag-next:hover {
  color: var(--accent);
}

.pagination .is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* --- Article / post --- */
.article-container {
  max-width: var(--max-page);
}

.breadcrumbs {
  font-size: 0.85rem;
  padding: 1.5rem 0 0.5rem;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

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

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

.breadcrumbs .sep {
  color: var(--border-strong);
}

.breadcrumbs span:last-child {
  color: var(--text);
}

.article-header {
  padding: 1.25rem 0 1.75rem;
  max-width: var(--max-prose);
}

.article-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.article-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.meta-sep {
  color: var(--text-faint);
}

.category-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
}

.article-layout {
  display: flex;
  gap: 2.5rem;
  position: relative;
}

.article-content {
  flex: 1;
  min-width: 0;
  max-width: var(--max-prose);
  padding-bottom: 3rem;
}

/* TOC */
.toc-wrapper {
  width: 13.5rem;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + 1.25rem);
  align-self: flex-start;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  order: -1;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.toc-header h5 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.toc-toggle {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem;
}

.toc-body {
  font-size: 0.85rem;
}

.toc-body ul {
  list-style: none;
  border-left: 1px solid var(--border);
}

.toc-body a {
  display: block;
  padding: 0.3rem 0.85rem;
  color: var(--text-muted);
  border-left: 1px solid transparent;
  margin-left: -1px;
  transition: color var(--ease), border-color var(--ease);
}

.toc-body a:hover,
.toc-body a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc-body .h3_nav a {
  padding-left: 1.5rem;
  font-size: 0.8rem;
}

/* Article typography */
.article-content h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.55rem;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 2.25rem 0 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.article-content h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--text);
  margin: 1.75rem 0 0.65rem;
}

.article-content h4 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.35rem 0 0.5rem;
}

.article-content p {
  margin-bottom: 1.2rem;
  color: var(--text);
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.4rem;
  color: var(--text);
}

.article-content li {
  margin-bottom: 0.4rem;
}

.article-content strong {
  font-weight: 600;
}

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.15rem;
  margin: 1.5rem 0;
  background: var(--bg-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.article-content pre {
  background: var(--bg-soft);
  border: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 0.9rem 1rem;
  margin: 0;
  overflow-x: auto;
  position: relative;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
}

.article-content :not(pre) > code {
  background: var(--bg-elevated);
  color: var(--accent);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  border: 1px solid var(--border);
}

/* --- GitHub-style tables --- */
.article-content table {
  display: block;
  max-width: 100%;
  width: fit-content;
  overflow-x: auto;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1.5rem 0;
  font-size: 0.925rem;
  line-height: 1.6;
  white-space: normal;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.article-content table th,
.article-content table td {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border-strong);
  text-align: left;
  vertical-align: top;
}

.article-content table th {
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--text);
  border-bottom-width: 2px;
}

.article-content table td {
  color: var(--text);
}

.article-content table thead th {
  border-bottom-color: var(--border-strong);
}

.article-content table tbody tr:nth-child(even) {
  background: var(--bg-soft);
}

.article-content table tbody tr:hover {
  background: var(--bg-hover);
}

/* --- GitHub-like code wrapper and header */
.code-wrapper {
  margin: 0.85rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.article-content .highlighter-rouge,
.article-content .highlight {
  margin: 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.34rem 0.65rem;
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-faint);
}

.code-header .code-lang {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
}

.code-wrapper pre {
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--bg-soft);
}

.code-block {
  display: block;
}

.code-row {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.line-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.42;
  color: var(--text-faint);
  text-align: right;
  user-select: none;
  padding: 0.03rem 0.45rem 0.03rem 0;
  border-right: 1px solid var(--border);
}

.code-line {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.42;
  color: inherit;
  padding: 0.03rem 0;
}

.code-copy-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.2rem 0.48rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease), transform var(--ease);
}

.code-header .code-copy-btn {
  opacity: 0.98;
}

.code-copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Rouge table styling: gutter (line numbers) vs code column */
.rouge-table { width: 100%; border-collapse: collapse; }
/* hide line-number gutter produced by Rouge */
.rouge-gutter { display: none; }
.rouge-gutter pre { margin: 0; padding: 0; }
.rouge-code { padding-left: 0; }

/* Keep code compact */
.article-content pre,
.code-wrapper pre,
.rouge-code pre {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-x: visible;
}

.article-content pre code,
.rouge-code pre,
.highlight pre {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.48;
}

/* --- Syntax Highlighting: VS Code Dark+ (default dark theme) --- */
.highlight,
.highlight pre,
.rouge-code pre {
  color: #d4d4d4;
}

.highlight .c,
.highlight .cm,
.highlight .c1,
.highlight .cs,
.highlight .cp {
  color: #6a9955;
  font-style: italic;
}

.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt,
.highlight .ow {
  color: #569cd6;
}

.highlight .nb,
.highlight .bp,
.highlight .fm,
.highlight .nf,
.highlight .nc {
  color: #dcdcaa;
}

.highlight .s,
.highlight .sa,
.highlight .sb,
.highlight .sc,
.highlight .dl,
.highlight .sd,
.highlight .s2,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sx,
.highlight .sr,
.highlight .s1,
.highlight .ss {
  color: #ce9178;
}

.highlight .m,
.highlight .mb,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .il,
.highlight .mo {
  color: #b5cea8;
}

.highlight .na,
.highlight .no,
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi,
.highlight .vm,
.highlight .nt,
.highlight .nx {
  color: #9cdcfe;
}

.highlight .o,
.highlight .p,
.highlight .w {
  color: #d4d4d4;
}

/* --- Syntax Highlighting: GitHub Light (light theme) --- */
[data-theme="light"] .highlight,
[data-theme="light"] .highlight pre,
[data-theme="light"] .rouge-code pre {
  color: #24292f;
}

[data-theme="light"] .highlight .c,
[data-theme="light"] .highlight .cm,
[data-theme="light"] .highlight .c1,
[data-theme="light"] .highlight .cs,
[data-theme="light"] .highlight .cp {
  color: #6e7781;
  font-style: italic;
}

[data-theme="light"] .highlight .k,
[data-theme="light"] .highlight .kc,
[data-theme="light"] .highlight .kd,
[data-theme="light"] .highlight .kn,
[data-theme="light"] .highlight .kp,
[data-theme="light"] .highlight .kr,
[data-theme="light"] .highlight .kt,
[data-theme="light"] .highlight .ow {
  color: #cf222e;
}

[data-theme="light"] .highlight .nb,
[data-theme="light"] .highlight .bp,
[data-theme="light"] .highlight .fm,
[data-theme="light"] .highlight .nf,
[data-theme="light"] .highlight .nc {
  color: #8250df;
}

[data-theme="light"] .highlight .s,
[data-theme="light"] .highlight .sa,
[data-theme="light"] .highlight .sb,
[data-theme="light"] .highlight .sc,
[data-theme="light"] .highlight .dl,
[data-theme="light"] .highlight .sd,
[data-theme="light"] .highlight .s2,
[data-theme="light"] .highlight .se,
[data-theme="light"] .highlight .sh,
[data-theme="light"] .highlight .si,
[data-theme="light"] .highlight .sx,
[data-theme="light"] .highlight .sr,
[data-theme="light"] .highlight .s1,
[data-theme="light"] .highlight .ss {
  color: #0a3069;
}

[data-theme="light"] .highlight .m,
[data-theme="light"] .highlight .mb,
[data-theme="light"] .highlight .mf,
[data-theme="light"] .highlight .mh,
[data-theme="light"] .highlight .mi,
[data-theme="light"] .highlight .il,
[data-theme="light"] .highlight .mo {
  color: #0550ae;
}

[data-theme="light"] .highlight .na,
[data-theme="light"] .highlight .no,
[data-theme="light"] .highlight .nv,
[data-theme="light"] .highlight .vc,
[data-theme="light"] .highlight .vg,
[data-theme="light"] .highlight .vi,
[data-theme="light"] .highlight .vm,
[data-theme="light"] .highlight .nt,
[data-theme="light"] .highlight .nx {
  color: #116329;
}

.callout {
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

.callout.warning {
  border-color: #d4a017;
  background: rgba(212, 160, 23, 0.1);
}

.callout.tip {
  border-color: #5a9e6f;
  background: rgba(90, 158, 111, 0.1);
}

.article-tags {
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.article-tags strong {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.article-pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.article-pagination .pag-prev,
.article-pagination .pag-next {
  flex: 1;
  padding: 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--ease);
  color: inherit;
}

.article-pagination .pag-prev:hover,
.article-pagination .pag-next:hover {
  border-color: var(--accent);
}

.pag-direction {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.pag-title {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  color: var(--text);
}

.article-pagination .pag-next {
  text-align: right;
}

.related-posts {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  margin-top: 1rem;
}

.related-posts-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.35rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.related-posts-grid {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* --- Tags / Archive --- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag-cloud-item {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  transition: all var(--ease);
  text-decoration: none;
  cursor: pointer;
}

.tag-cloud-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.tag-cloud-item.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.tag-section {
  margin-bottom: 2rem;
}

.tag-section h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tag-post-list {
  list-style: none;
}

.tag-post-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.tag-post-list a {
  color: var(--text);
  font-size: 1rem;
}

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

.tag-post-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 0.15rem;
}

.archive-year {
  margin-bottom: 2.5rem;
}

.archive-year-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.archive-month {
  margin-bottom: 1.5rem;
}

.archive-month-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.archive-list {
  list-style: none;
}

.archive-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.archive-list .archive-item-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.archive-list a {
  color: var(--text);
  font-size: 0.98rem;
}

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

.archive-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
  flex-shrink: 0;
}

.tag-page-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.tag-page-badges .tag-badge {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  background: var(--bg-elevated);
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  display: inline-block;
}


/* --- 404 --- */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 65vh;
  text-align: center;
  padding: 3rem 0;
}

.error-code {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 15vw, 8rem);
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.error-message {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.error-description {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 26rem;
  margin-left: auto;
  margin-right: auto;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
  margin-top: 2rem;
  background: var(--bg-soft);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
    align-items: center;
  }
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

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

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

.footer-links {
  display: flex;
  gap: 0.35rem;
}

@media (min-width: 700px) {
  .footer-links {
    justify-content: flex-end;
  }
}

.footer-links a {
  color: var(--text-muted);
  font-size: 1.05rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: color var(--ease), background var(--ease);
}

.footer-links a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-align: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* --- Search overlay --- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 2rem;
}

.search-overlay.active {
  display: flex;
}

.search-modal {
  width: 100%;
  max-width: 34rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.search-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 0 0.25rem 0 1rem;
}

.search-icon {
  color: var(--text-faint);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  padding: 1rem 0.85rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.05rem;
}

.search-input::placeholder {
  color: var(--text-faint);
}

.search-input:focus {
  outline: none;
}

.search-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.search-close:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.search-results {
  max-height: 55vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-result-item {
  display: block;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  transition: background var(--ease);
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-title {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
}

.search-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-faint);
  font-size: 0.95rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .toc-wrapper {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 4.5rem 0 3.5rem;
  }

  .hero-lede {
    font-size: 1.05rem;
  }

  .section {
    padding: 3.25rem 0;
  }

  .post-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .post-row-date {
    padding-top: 0;
  }

  .about-teaser {
    flex-direction: column;
    text-align: center;
  }

  .about-teaser-copy .section-title {
    text-align: center;
  }

  .about-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-summary {
    text-align: left;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.85rem 1rem 1rem;
    gap: 0.15rem;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links > a {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
  }

  .nav-actions {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    margin-left: 0;
    padding-left: 0;
    padding-top: 0.75rem;
    margin-top: 0.35rem;
    justify-content: center;
  }

  .article-title {
    font-size: 1.75rem;
  }

  .page-title {
    font-size: 1.85rem;
  }

  .article-pagination {
    flex-direction: column;
  }

  .article-pagination .pag-next {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1.1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .about-photo {
    width: 7rem;
    height: 7rem;
  }
}

/* ============================================================
   Resume page
   ============================================================ */
.resume-page {
  max-width: 56rem;
  margin: 0 auto;
}

/* Resume header */
.resume-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 2rem 0 2rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 2rem;
}

.resume-photo {
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  flex-shrink: 0;
}

.resume-header-info {
  flex: 1;
  min-width: 0;
}

.resume-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  letter-spacing: -0.02em;
  color: var(--text);
}

.resume-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}

.resume-title {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.65rem;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.resume-contact a {
  color: var(--text-muted);
  transition: color var(--ease);
}

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

.resume-contact i {
  width: 1rem;
  text-align: center;
  margin-right: 0.3rem;
  color: var(--accent);
}

.resume-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.resume-dl-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.resume-dl-btn i {
  font-size: 0.85rem;
}

/* Resume summary */
.resume-summary {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.7;
  text-align: justify;
}

/* Resume grid – two-column layout */
.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .resume-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .resume-name-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* Resume blocks */
.resume-block {
  margin-bottom: 1.75rem;
}

.resume-block-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.resume-block-title i {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Education items */
.resume-edu-item {
  margin-bottom: 1.25rem;
}

.resume-edu-item:last-child {
  margin-bottom: 0;
}

.resume-edu-school {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.resume-edu-degree {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.resume-edu-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
  display: flex;
  gap: 0.75rem;
}

/* Experience items */
.resume-exp-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.resume-exp-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.resume-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.resume-exp-role {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.resume-exp-company {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.88rem;
}

.resume-exp-date {
  font-size: 0.8rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.resume-exp-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  text-align: justify;
}

/* Skills grid */
.resume-skills-group {
  margin-bottom: 1rem;
}

.resume-skills-group:last-child {
  margin-bottom: 0;
}

.resume-skills-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.resume-skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.resume-skill-tag {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.resume-skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Projects */
.resume-project-item {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.resume-project-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.resume-project-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.resume-project-tech {
  font-size: 0.78rem;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 0.35rem;
}

.resume-project-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: justify;
}

/* Accomplishments */
.resume-acc-item {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: justify;
}

.resume-acc-item:last-child {
  margin-bottom: 0;
}

.resume-acc-icon {
  color: var(--accent);
  font-size: 0.75rem;
  margin-top: 0.3rem;
  flex-shrink: 0;
}

/* References */
.resume-ref-item {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.resume-ref-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.resume-ref-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.resume-ref-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.resume-ref-contact {
  font-size: 0.82rem;
  color: var(--text-faint);
}

.resume-ref-contact a {
  color: var(--text-muted);
}

.resume-ref-contact a:hover {
  color: var(--accent);
}

/* Print styles */
@media print {
  .navbar,
  .site-footer,
  .search-overlay,
  .reading-progress,
  .nav-actions,
  .nav-search-btn,
  .nav-theme-btn {
    display: none !important;
  }

  .main-content {
    padding-top: 0;
  }

  .resume-page {
    max-width: 100%;
  }

  .resume-header {
    border-bottom-color: #000;
  }

  .resume-block-title {
    border-bottom-color: #ccc;
  }

  body {
    background: #fff;
    color: #000;
  }

  .resume-summary {
    background: #f5f5f5;
    border-color: #ddd;
  }

  .resume-skill-tag {
    background: #eee;
    border-color: #ddd;
    color: #333;
  }
}
