/* Self-hosted Alegreya (latin + latin-ext); avoids render-blocking fonts.googleapis.com → gstatic chain */
@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/alegreya-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/alegreya-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/alegreya-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/alegreya-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/alegreya-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/alegreya-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/alegreya-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Alegreya';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/alegreya-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

body {
  font-family: 'Alegreya', serif;
  line-height: 1.6;
  color: #333;
  background-color: #fafafa;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

h1, h2, h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #0066cc;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #0052a3;
  text-decoration: underline;
}

/* Keep underline off Bootstrap icon glyphs (underline is for text only) */
a:hover .bi,
a:hover i.bi {
  text-decoration: none;
}

section {
  margin-bottom: 1.25rem;
  margin-top: 0;
}

section:first-of-type {
  margin-top: 0;
}

/* Header */
header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #ddd;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

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

.profile-banner {
  width: 260px;
  aspect-ratio: 1;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-banner img {
  width: 100%;
  height: 100%;
  display: block;
}

/* object-fit matches profileImageFit in header.html: cover | contain | fill */
.profile-banner.profile-fit-cover img {
  object-fit: cover;
  object-position: center;
}

.profile-banner.profile-fit-contain {
  background-color: #f0f0f0;
}

.profile-banner.profile-fit-contain img {
  object-fit: contain;
  object-position: center;
}

.profile-banner.profile-fit-fill img {
  object-fit: fill;
}

header h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.site-title-link {
  color: inherit;
  text-decoration: none;
}

.site-title-link:hover {
  text-decoration: underline;
}

header p {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 0;
}

/* Header social (icon-only; labels via aria-label) */
.header-social-wrap {
  margin-bottom: 1rem;
}

.header-intro .header-social-wrap {
  margin-top: 0.75rem;
}

.header-social {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  justify-content: flex-start;
  margin: 0;
  padding: 0;
}

.header-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 6px;
  color: #444;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.header-social__link:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: #0066cc;
  text-decoration: none;
}

.header-social__link .bi {
  font-size: 1.15rem;
}

/* Navigation */
.nav-links ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Current page: still an <a> for semantics, non-interactive */
a.nav-links__current {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #999;
  cursor: default;
  user-select: none;
  text-decoration: none;
  pointer-events: none;
}

a.nav-links__current:hover {
  color: #999;
  text-decoration: none;
}

.nav-links .bi {
  font-size: 1rem;
}

/* Content List */
.content-list {
  list-style: none;
}

.content-list li {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

.content-list li:last-child {
  border-bottom: none;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Title row only — not meta / tag links inside the card */
.content-list > li > a {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.content-list > li > a .bi {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.content-list p {
  margin: 0.25rem 0 0 0;
  color: #666;
  font-size: 0.95rem;
}

.section-more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Experience cards: tight gap after date, compact bullets */
.content-list .experience-period {
  margin: 0.2rem 0 0.35rem 0;
  color: #666;
  font-size: 0.9rem;
}

.content-list .experience-body {
  color: #555;
  line-height: 1.5;
  font-size: 0.95rem;
}

.content-list .experience-body > p:first-of-type {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.content-list .experience-body p {
  margin-bottom: 0.4rem;
}

.content-list .experience-body ul {
  margin-top: 0.1rem;
  margin-bottom: 0;
  margin-left: 1.1rem;
  padding-left: 0.45rem;
}

.content-list .experience-body li {
  margin-bottom: 0.2rem;
  line-height: 1.42;
}

.content-list .experience-body li:last-child {
  margin-bottom: 0;
}

.content-kind-row {
  margin-bottom: 0.35rem;
}

.content-kind {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  color: #555;
  background-color: #eee;
}

.content-kind .bi {
  font-size: 0.85rem;
}

.content-kind--post {
  background-color: #e8f1f8;
  color: #1e5a7a;
}

.content-kind--paper {
  background-color: #f3efe6;
  color: #5c4a32;
}

.content-kind--project,
.content-kind--page {
  background-color: #eaeaea;
  color: #444;
}

/* Breadcrumb — Home / Section / Page */
.breadcrumb {
  margin-bottom: 1.35rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #555;
  background-color: #f3f3f3;
  border: 1px solid #e4e4e4;
  border-radius: 6px;
}

.breadcrumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0;
  row-gap: 0.2rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: baseline;
  max-width: 100%;
}

/* Slash between segments (not after the last one) */
.breadcrumb-item:not(:last-child)::after {
  content: "/";
  display: inline-block;
  margin: 0 0.55rem;
  color: #b0b0b0;
  font-weight: 400;
  font-size: 0.92em;
  user-select: none;
  pointer-events: none;
  vertical-align: baseline;
}

.breadcrumb-item a {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.breadcrumb-item a:hover {
  text-decoration: none;
  border-bottom-color: currentColor;
}

.breadcrumb-current {
  color: #1a1a1a;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Article */
article {
  line-height: 1.8;
}

article h1 {
  margin-top: 0;
}

/* Markdown body (Goldmark): lists, tables, quotes, headings inside .content */
article .content > *:first-child {
  margin-top: 0;
}

article .content > *:last-child {
  margin-bottom: 0;
}

article .content h2 {
  margin-top: 1.85rem;
  margin-bottom: 0.65rem;
  padding-top: 0.2rem;
  font-size: 1.55rem;
}

article .content h2:first-child {
  margin-top: 0;
}

article .content h3 {
  margin-top: 1.45rem;
  margin-bottom: 0.5rem;
  font-size: 1.22rem;
  border-bottom: none;
  padding-bottom: 0;
}

article .content h4 {
  margin-top: 1.25rem;
  margin-bottom: 0.45rem;
  font-size: 1.08rem;
  font-weight: 600;
}

article .content h5 {
  margin-top: 1.1rem;
  margin-bottom: 0.35rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: #444;
}

article .content h6 {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

article .content p {
  margin-bottom: 0.9rem;
}

article .content ul,
article .content ol {
  margin: 0 0 1.05rem 0;
  padding-left: 1.65rem;
}

article .content ul {
  list-style-type: disc;
  list-style-position: outside;
}

article .content ol {
  list-style-type: decimal;
  list-style-position: outside;
}

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

article .content li::marker {
  color: #555;
}

article .content li > ul,
article .content li > ol {
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
}

article .content ul ul {
  list-style-type: circle;
}

article .content ul ul ul {
  list-style-type: square;
}

article .content ol ol {
  list-style-type: lower-alpha;
}

article .content ol ol ol {
  list-style-type: lower-roman;
}

article .content li > p {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

article .content li > p:first-child {
  margin-top: 0;
}

article .content li > p:last-child {
  margin-bottom: 0;
}

/* Task-style list items (checkbox), if enabled in Goldmark */
article .content li input[type="checkbox"] {
  margin-right: 0.4rem;
  vertical-align: 0.1em;
}

article .content blockquote {
  margin: 1.2rem 0;
  padding: 0.75rem 1rem 0.75rem 1.15rem;
  border-left: 3px solid #bbb;
  background-color: #f5f5f5;
  color: #3a3a3a;
  border-radius: 0 4px 4px 0;
}

article .content blockquote p {
  margin-bottom: 0.55rem;
}

article .content blockquote p:last-child {
  margin-bottom: 0;
}

article .content blockquote > :first-child {
  margin-top: 0;
}

article .content hr {
  margin: 1.85rem 0;
  border: none;
  border-top: 1px solid #d8d8d8;
  background: none;
}

article .content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.94rem;
  line-height: 1.45;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  overflow: hidden;
}

article .content thead {
  background-color: #eceef1;
}

article .content thead th {
  border-bottom: 1px solid #cbcbcb;
}

article .content th,
article .content td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e4e4e4;
}

article .content th {
  font-weight: 600;
  color: #222;
}

article .content tbody tr:last-child td {
  border-bottom: none;
}

article .content tbody tr:hover td {
  background-color: #fafafa;
}

article .content dl {
  margin: 1rem 0;
}

article .content dt {
  font-weight: 600;
  margin-top: 0.75rem;
  color: #222;
}

article .content dt:first-child {
  margin-top: 0;
}

article .content dd {
  margin: 0.3rem 0 0.65rem 1.2rem;
}

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

article .content a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

article .content del,
article .content s {
  color: #777;
}

article .content sup,
article .content sub {
  line-height: 0;
}

/* Tags / non-prose h3 below post body */
article h3 {
  margin-top: 1.5rem;
}

/* Code — fenced blocks (Hugo Chroma + line numbers) + inline `code` */
.content .highlight {
  margin: 1.15rem 0;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #fff;
}

.content .highlight > .chroma {
  margin: 0;
}

.content .highlight .lntable {
  width: 100%;
  max-width: 100%;
}

.content .highlight .lntd:first-child {
  width: 1%;
  vertical-align: top;
  border-right: 1px solid #eaeaea;
  background-color: #f6f6f6;
}

.content .highlight .lntd:last-child {
  width: 99%;
  vertical-align: top;
}

.content .highlight pre {
  margin: 0;
  padding: 0.85rem 0.65rem;
  overflow: visible;
  border: none;
  border-radius: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  tab-size: 4;
  background: transparent;
}

.content .highlight .lntd:last-child pre {
  padding-left: 0.85rem;
  padding-right: 1rem;
}

.content .highlight .lntd:first-child pre {
  text-align: right;
  padding-left: 0.75rem;
  padding-right: 0.5rem;
}

.content .highlight pre code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: inherit;
  line-height: inherit;
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

.content :not(pre) > code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.12em 0.38em;
  border-radius: 4px;
  background-color: #f0f0f0;
  color: #333;
}

/* KaTeX (params.math) */
.content .katex-display {
  margin: 1.1rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
}

.content p .katex {
  font-size: 1.05em;
}

/* Images & figures (markdown / figure shortcode) */
.content img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 8px;
  border: 1px solid #e2e2e2;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.content figure,
.content-fig {
  margin: 1.35rem 0;
  text-align: center;
}

.content-fig__link {
  display: inline-block;
  text-decoration: none;
  border: none;
}

.content-fig__link:hover img {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.content figure img,
.content-fig img {
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.content figcaption,
.content-fig__caption,
.content .caption {
  margin-top: 0.55rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #666;
  text-align: center;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.content figcaption p,
.content-fig__caption p {
  margin: 0;
}

.content p:has(> img:only-child) {
  text-align: center;
  margin: 1.25rem 0;
}

.content p:has(> img:only-child) img {
  display: inline-block;
  margin: 0;
}

/* Literal shortcode / sample source (HTML &lt;…&gt; in markdown) */
.content pre.content-sample,
.content-sample {
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid #e2e2e2;
  font-size: 0.88rem;
  line-height: 1.55;
  tab-size: 4;
  background: #fff;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}

.content pre.content-sample code,
.content-sample code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

/* Meta Information */
.meta {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.85rem 1.1rem;
  flex-wrap: wrap;
  line-height: 1.35;
}

/* Single post: add space between meta row and body */
article.post-single .meta {
  margin-bottom: 1rem;
}

.content-list .meta-group,
.content-list > li > .meta {
  margin-top: 0.45rem;
}

/*
 * List cards: two bands — (1) date / read time / status in one horizontal row,
 * (2) all outbound links together on a separate row below.
 */
.content-list .meta-group {
  gap: 0.3rem;
}

.content-list .meta-group > .meta:not(.meta--row2),
.content-list > li > .meta:not(.meta--row2) {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  font-size: 0.9rem;
  line-height: 1.35;
  max-width: 100%;
}

.content-list .meta--row2 {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 1rem;
  padding: 0.35rem 0 0;
  margin-top: 0.05rem;
  border-top: 1px solid #e8e8e8;
  font-size: 0.9rem;
  line-height: 1.35;
}

.content-list .meta--row2 .meta-inline-link {
  white-space: nowrap;
}

.meta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
}

.meta-group > .meta {
  margin-bottom: 0;
}

.meta--row2 {
  padding: 0.4rem 0 0 0;
  margin: 0;
  border-top: 1px solid #ececec;
  gap: 0.75rem 1.1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.35;
}

/* Shared icon box: calendar / DOI / external links line up on one grid */
.meta-item > .bi,
.meta-inline-link .bi {
  line-height: 1;
  width: 1.25rem;
  min-width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  color: #777;
  vertical-align: middle;
}

.meta-item > span:not(.bi) {
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  line-height: 1.35;
}

.meta-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
  color: #0066cc;
}

.meta-inline-link:hover {
  text-decoration: none;
  color: #0052a3;
}

.meta-inline-link:hover > span {
  text-decoration: underline;
}

.meta-inline-link > span {
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  line-height: 1.35;
}

.paper-meta-extra {
  margin: 0.5rem 0 0 0;
}

.paper-meta-extra__label {
  margin-bottom: 0.35rem !important;
}

.paper-meta-link-list {
  margin: 0 0 0 1.25rem;
  padding: 0;
  list-style: disc;
}

.paper-meta-link-list li {
  margin-bottom: 0.25rem;
}

/* Paper Meta */
.paper-meta {
  background-color: #f7f7f7;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-left: 3px solid #999;
}

.paper-meta p {
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.paper-meta .bi {
  font-size: 1rem;
  color: #666;
}

/* Project detail page */
.project-single .project-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e6e6e6;
}

.project-header__title {
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.project-facts {
  list-style: none;
  margin: 0 0 1.1rem 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.35rem;
  font-size: 0.92rem;
  color: #555;
}

.project-facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.project-facts .bi {
  font-size: 1rem;
  color: #777;
  flex-shrink: 0;
}

.project-facts strong {
  font-weight: 600;
  color: #333;
  margin-right: 0.2rem;
}

.project-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  background-color: #eee;
  color: #444;
  border: 1px solid #ddd;
}

.project-status--active,
.project-status--completed,
.project-status--done,
.project-status--archived,
.project-status--deprecated,
.project-status--planned,
.project-status--idea {
  background-color: #eee;
  color: #444;
  border-color: #ddd;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
}

.project-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid #ccc;
  color: #333;
  background-color: #fafafa;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.project-action:hover {
  text-decoration: none;
  border-color: #999;
  color: #111;
  background-color: #f0f0f0;
}

.project-action .bi {
  font-size: 1rem;
  color: #555;
}

.project-action:hover .bi {
  color: #333;
}

.project-tech-card {
  margin: 0 0 1.5rem 0;
  padding: 1rem 1.1rem;
  background-color: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.project-tech-card__title {
  margin: 0 0 0.55rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  border: none !important;
  border-bottom: none !important;
  padding: 0;
}

.project-tech-card__stack {
  margin-top: 0;
}

.tag--tech {
  background-color: #fff;
  border: 1px solid #ddd;
}

.tag--tech:hover {
  background-color: #eaeaea;
  border-color: #ccc;
  color: #222;
}

.tag--link {
  text-decoration: none;
  color: inherit;
}

.tag--link:hover {
  text-decoration: none;
}

/* Post / project footer block (tags, etc.) */
.article-end {
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid #e0e0e0;
}

.article-end__title {
  margin: 0 0 0.65rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #333;
  border: none !important;
  border-bottom: none !important;
  padding: 0;
}

/* Tech Stack */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  background-color: #f0f0f0;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tag:hover {
  background-color: #e5e5e5;
  color: #222;
}

.tag .bi {
  font-size: 0.8rem;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #ddd;
  color: #666;
  font-size: 0.85rem;
}

footer .footer-meta {
  margin: 0;
  text-align: center;
}

/* Underline + sufficient contrast: links not identifiable by color alone (WCAG 1.4.1) */
footer .footer-meta a {
  color: #0d4f8c;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

footer .footer-meta a:hover {
  color: #0a3d6e;
  text-decoration-thickness: 2px;
}

/* Links Section */
.links-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #ddd;
}

.links-section ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.links-section a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.links-section .bi {
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    --profile-pad: 1.25rem;
    padding: 1rem max(1rem, env(safe-area-inset-right)) 1rem max(1rem, env(safe-area-inset-left));
  }

  h1 {
    font-size: 1.85rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem;
  }

  header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
  }

  /* Photo above title/tagline on all pages (matches DOM: intro, then profile; reverse stacks profile first) */
  .header-top {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    /* Spacing around the profile uses margin on .profile-banner only so vertical matches horizontal gutter */
    gap: 0;
    margin-bottom: 1.25rem;
  }

  .header-intro {
    width: 100%;
  }

  header p {
    font-size: 1rem;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
  }

  /*
   * Square profile: horizontal inset = (100% - width) / 2 should match --profile-pad when possible.
   * Use full calc width (capped) so narrow viewports do not leave huge side gutters vs margin-block.
   */
  .profile-banner {
    width: calc(100% - 2 * var(--profile-pad));
    max-width: min(320px, 100%);
    margin-inline: auto;
    margin-block: var(--profile-pad);
  }

  .header-social {
    justify-content: center;
  }

  .nav-links ul {
    justify-content: center;
    gap: 0.35rem 0.65rem;
    flex-wrap: wrap;
    row-gap: 0.5rem;
    padding: 0.15rem 0;
    margin: 0 -0.25rem;
  }

  .nav-links li {
    flex: 0 0 auto;
  }

  .nav-links a {
    padding: 0.45rem 0.55rem;
    min-height: 2.75rem;
    border-radius: 6px;
  }

  .nav-links a:not(.nav-links__current):active {
    background-color: rgba(0, 0, 0, 0.05);
  }

  article .content table {
    font-size: 0.86rem;
  }

  article .content th,
  article .content td {
    padding: 0.45rem 0.55rem;
  }

  article .content ul,
  article .content ol {
    padding-left: 1.35rem;
  }

  article .content blockquote {
    padding-left: 0.85rem;
    padding-right: 0.75rem;
  }

  .project-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .project-action {
    justify-content: center;
  }

  .links-section ul {
    gap: 1rem;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 1.65rem;
  }

  .nav-links ul {
    gap: 0.25rem 0.45rem;
  }

  .nav-links a {
    font-size: 0.9rem;
    padding: 0.4rem 0.45rem;
  }
}
