/*
Theme Name: omegaC
Theme URI: https://muki.tw
Author: MUKI
Author URI: https://muki.tw
Description: A hand-drawn, retro-inspired personal blog theme with paper textures, tape decorations, and editorial layouts.
Version: 1.0.2
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: omegac
Tags: blog, portfolio, one-column, two-columns, custom-menu, featured-images, translation-ready
*/

/* ── Selection ── */
::selection { background: #D9444A; color: #F5F3EE; }

/* ── Base body ── */
html,
body {
  overflow-x: hidden;
}
body {
  font-family: 'Betinya Sans', 'Plus Jakarta Sans', sans-serif;
  background: #EDEBE6;
  color: #2C2822;
  min-height: 100vh;
}

/* ── Noise texture overlay ── */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Nav links ── */
.nav99 {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: none;
  padding-bottom: 2px;
  transition: all 0.2s ease;
  color: #A09B90;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
}
.nav99:hover { color: #D9444A; }
.nav99.active {
  color: #D9444A;
  border-bottom: 1.5px solid #D9444A;
}

header + nav::-webkit-scrollbar {
  display: none;
}

/* ── Paper card ── */
.paper-card {
  background: #FAF8F4;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.paper-card:hover { box-shadow: 2px 6px 16px rgba(0,0,0,0.08); }

/* ── Decorative elements ── */
.tape { position: absolute; width: 50px; height: 18px; background: rgba(210,200,170,0.5); z-index: 10; }
.pushpin {
  position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; background: radial-gradient(circle at 40% 35%, #E8666B, #D9444A);
  border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); z-index: 10;
}

/* ── Hand underline (red wavy, for emphasis in articles) ── */
.hand-underline {
  text-decoration: underline;
  text-decoration-color: #D9444A;
  text-decoration-style: wavy;
  text-underline-offset: 4px;
}

/* ── Animations ── */
@keyframes sparkle { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.6)} }
.sparkle { animation: sparkle 2s ease-in-out infinite; display: inline-block; }

.doodle-float { animation: bob 3.5s ease-in-out infinite; }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
@keyframes waveScroll { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.section-panel { animation: fadeIn 0.3s ease; }

/* ── Board items ── */
.board-item { transition: transform 0.4s cubic-bezier(0.22,1,0.36,1); }
.board-item:hover { z-index: 50 !important; transform: scale(1.05) rotate(0deg) !important; }

/* ── Link items ── */
.link-item { position: relative; padding-left: 1rem; }
.link-item::before { content: '\2192'; position: absolute; left: 0; color: #D9444A; font-size: 14px; }

/* ── Visitor counter digits ── */
.counter-digit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.4rem; height: 1.7rem;
  background: #FDFBF7;
  border: 1px solid #D4CEBF;
  color: #2C2822;
  font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 500;
  margin: 0 1.5px;
  box-shadow: 1px 2px 3px rgba(44,40,34,0.1), inset 0 0 0 1px rgba(255,255,255,0.5);
  position: relative;
}
.counter-digit::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(44,40,34,0.02) 2px, rgba(44,40,34,0.02) 3px);
  pointer-events: none;
}
.counter-digit:nth-child(1) { transform: rotate(-1.2deg); }
.counter-digit:nth-child(2) { transform: rotate(0.8deg); }
.counter-digit:nth-child(3) { transform: rotate(-0.5deg); }
.counter-digit:nth-child(4) { transform: rotate(1.5deg); }
.counter-digit:nth-child(5) { transform: rotate(-0.8deg); }

/* ── Retro window frame ── */
.retro-window {
  background: #F5F3EE;
  border: 1px solid #C8C3B8;
  box-shadow: 2px 2px 0 rgba(160,155,144,0.3), 3px 3px 8px rgba(44,40,34,0.06);
  position: relative;
}
.retro-titlebar {
  background: linear-gradient(90deg, #2C2822 0%, #5C564A 100%);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
  user-select: none;
}
.retro-titlebar-text {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #EDEBE6;
  letter-spacing: 0.05em;
}
.retro-titlebar-btns { display: flex; gap: 6px; }
.retro-titlebar-btns span { width: 12px; height: 12px; border-radius: 50%; display: block; }
.retro-btn-close { background: #D9444A; }
.retro-btn-min { background: #D4A843; }
.retro-btn-max { background: #6B8F5E; }
.retro-statusbar {
  background: #E8E4DA;
  border-top: 1px solid #DDD9D0;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #A09B90;
}
.retro-statusbar .blink { animation: blink 1.2s step-end infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Article body typography ── */
.article-body h2 {
  font-family: 'Huninn', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0;
  position: relative;
}
.article-body h2::before {
  content: '\00A7';
  color: #D9444A;
  margin-right: 0.5rem;
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
}
.article-body h3 {
  font-family: 'Huninn', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.8rem 0 0.8rem;
}
.article-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.6rem;
  color: #2C2822;
  padding-left: 0.8rem;
  border-left: 2px solid #D9444A;
}
.article-body p {
  font-size: 15px;
  line-height: 1.9;
  margin-bottom: 1.2rem;
  color: #3D3830;
}
.article-body ul, .article-body ol {
  margin: 1rem 0 1.2rem 1.5rem;
  font-size: 15px;
  line-height: 1.9;
  color: #3D3830;
}
.article-body ul { list-style-type: square; }
.article-body ol { list-style-type: decimal; }
.article-body li { margin-bottom: 0.4rem; }
.article-body li::marker { color: #D9444A; }
.article-body blockquote {
  border-left: 3px solid #D4A843;
  background: #FAF8F2;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #6B6560;
  font-size: 15px;
  line-height: 1.8;
  position: relative;
}
.article-body blockquote::before {
  content: '\201C';
  font-family: 'Caveat', cursive;
  font-size: 3rem;
  color: #D4A843;
  position: absolute;
  top: -0.3rem;
  left: 0.5rem;
  opacity: 0.4;
}
.article-body code {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  background: #F0ECE4;
  padding: 2px 6px;
  border-radius: 2px;
  color: #D9444A;
}
.article-body pre {
  margin: 1.5rem 0;
  padding: 1.2rem 1.5rem;
  background: #2C2822;
  color: #E8E4DA;
  border-left: 3px solid #D9444A;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
}
.article-body pre code {
  display: block;
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  line-height: inherit;
  white-space: pre;
}
.series-chapter-content pre {
  margin: 1.5rem 0;
  padding: 1.2rem 1.5rem;
  background: #2C2822;
  color: #E8E4DA;
  border-left: 3px solid #D9444A;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
}
.series-chapter-content pre code {
  display: block;
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  line-height: inherit;
  white-space: pre;
}
/* CodeMirror block wrapper */
.article-body .wp-block-codemirror-blocks-code-block {
  margin: 1.5rem 0;
  border-radius: 4px;
  overflow: hidden;
}
.article-body .wp-block-codemirror-blocks-code-block pre {
  margin: 0;
  padding: 0;
  background: transparent;
  border-left: none;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
.series-chapter-content .wp-block-codemirror-blocks-code-block pre {
  margin: 0;
  border-radius: 0;
  padding: 1.2rem 1.5rem;
  background: #2C2822;
  color: #E8E4DA;
  border-left: 3px solid #D9444A;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}
/* Links */
.article-body a {
  color: #6E6860;
  text-decoration: none;
  border-bottom: 1px dashed #C8C3B8;
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.article-body a:hover {
  color: #D9444A;
  border-color: #D9444A;
}

/* Callout / Notice blocks (Advanced Gutenberg Blocks plugin) */
.wp-block-advanced-gutenberg-blocks-notice {
  display: block;
  background: #FAF8F4;
  border: 1px solid #DDD9D0;
  border-left: 3px solid #D4A843;
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}
.wp-block-advanced-gutenberg-blocks-notice > svg {
  color: #D4A843;
  margin-bottom: 0.5rem;
}
.wp-block-advanced-gutenberg-blocks-notice__title {
  font-size: 14px;
  font-weight: 600;
  color: #D4A843;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed #DDD9D0;
}
.wp-block-advanced-gutenberg-blocks-notice__content {
  font-size: 15px;
  line-height: 1.75;
  color: #4A4540;
}
/* Variation: warning */
.wp-block-advanced-gutenberg-blocks-notice.is-variation-warning {
  border-left-color: #D9444A;
}
.wp-block-advanced-gutenberg-blocks-notice.is-variation-warning > svg { color: #D9444A; }
.wp-block-advanced-gutenberg-blocks-notice.is-variation-warning .wp-block-advanced-gutenberg-blocks-notice__title {
  color: #D9444A;
}
/* Variation: success */
.wp-block-advanced-gutenberg-blocks-notice.is-variation-success {
  border-left-color: #6B8F5E;
}
.wp-block-advanced-gutenberg-blocks-notice.is-variation-success > svg { color: #6B8F5E; }
.wp-block-advanced-gutenberg-blocks-notice.is-variation-success .wp-block-advanced-gutenberg-blocks-notice__title {
  color: #6B8F5E;
}
.article-body img {
  max-width: 100%;
  margin: 1.5rem 0;
  box-shadow: 2px 3px 8px rgba(44,40,34,0.1);
  cursor: zoom-in;
}
.article-body .wp-block-table,
.article-body figure.wp-block-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: visible;
  margin: 1.5rem 0;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 14px;
  line-height: 1.7;
  color: #3D3830;
  background: #FAF8F4;
}
.article-body th,
.article-body td {
  padding: 0.85rem 1rem;
  border: 1px solid #DDD9D0;
  vertical-align: top;
  text-align: left;
}
.article-body th {
  background: #DDECF8;
  color: #2C2822;
  font-weight: 600;
}
.article-body th:first-child,
.article-body td:first-child {
  min-width: 0;
}
.article-body th:nth-child(2),
.article-body td:nth-child(2),
.article-body th:nth-child(3),
.article-body td:nth-child(3) {
  min-width: 0;
}
.article-body td code,
.article-body th code {
  white-space: normal;
  overflow-wrap: anywhere;
}


.article-body hr,
.article-body .wp-block-separator {
  border: none;
  margin: 2.5rem 0;
  text-align: center;
  overflow: visible;
}
.article-body hr::after,
.article-body .wp-block-separator::after {
  content: '\00B7 \00B7 \00B7';
  display: block;
  color: #A09B90;
  font-size: 1.2rem;
  letter-spacing: 0.5rem;
}

/* ── Series badge ── */
.series-badge {
  display: inline-block;
  padding: 2px 8px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── TOC links ── */
.toc-link {
  font-size: 14px;
  color: #A09B90;
  text-decoration: none;
  transition: color 0.2s;
  display: block;
  padding: 0.3rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
}
.toc-link:hover {
  color: #D9444A;
  border-left-color: #D9444A;
}

/* ── Related posts ── */
.related-list-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  padding: 0.7rem 0;
  transition: all 0.2s ease;
}
.related-list-item + .related-list-item {
  background-image: linear-gradient(90deg, #DDD9D0 0, #DDD9D0 33%, transparent 33%);
  background-size: 6px 1px;
  background-repeat: repeat-x;
  background-position: top;
}
.related-list-item:hover .related-title { color: #D9444A; }
.related-list-item:hover .related-num { color: #D9444A; transform: scale(1.1); }
.related-num {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  color: #C8C3B8;
  min-width: 2rem;
  text-align: center;
  transition: all 0.2s ease;
  line-height: 1;
}

/* ── Sidebar series link ── */
.sidebar-series-link:hover { color: #D9444A !important; }
.sidebar-series-link:hover .font-hand { color: #D9444A !important; }

/* ── Journal page: sidebar + content grid ── */
.journal-page-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ── Journal filter: Left sidebar ── */
.journal-filter-wrap {
  position: sticky;
  top: 2rem;
  background: transparent;
  padding: 0;
  margin-bottom: 0;
}

.journal-filter-path {
  font-size: 13px;
  color: #8C8680;
  margin-bottom: 0.5rem;
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.journal-filter-path .path-segment { color: #6E6860; }
.journal-filter-path .path-sep { color: #C8C3B8; }
.journal-filter-path .path-current { color: #D9444A; font-weight: 500; }
.journal-filter-path .path-reset {
  margin-left: 0.4rem;
  color: #8C8680;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  background: none; border: none;
  font-size: 13px; padding: 0;
  transition: color 0.15s;
  font-family: inherit;
}
.journal-filter-path .path-reset:hover { color: #D9444A; }

.journal-filter-toggle {
  display: none;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid #DDD9D0;
  background: #FAF8F4;
  color: #6E6860;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.journal-filter-toggle:hover {
  color: #2C2822;
  border-color: #B8B3A8;
}

.journal-filter-row {
  border-top: 1px solid #DDD9D0;
  padding: 0.55rem 0;
  display: none;
  animation: jfSlideIn 0.18s ease;
}
.journal-filter-row.visible { display: block; }
@keyframes jfSlideIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.journal-filter-row-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #8C8680;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

/* Sidebar: pills wrap within sidebar width */
.journal-filter-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

/* Pill shared styles — sidebar mode */
.journal-filter-pill {
  font-size: 13px;
  color: #6E6860;
  text-decoration: none;
  padding: 0.2rem 0.55rem;
  background: transparent;
  border: 1px solid #DDD9D0;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  cursor: pointer;
  display: inline-block;
  font-family: inherit;
  line-height: 1.4;
}
.journal-filter-pill:hover {
  color: #2C2822;
  border-color: #B8B3A8;
  text-decoration: none;
}
.journal-filter-pill.active {
  color: #D9444A;
  border-color: #D9444A;
  background: rgba(217,68,74,0.05);
}
button.journal-filter-pill { line-height: 1.4; }

.journal-filter-count {
  opacity: 0.4;
  margin-left: 4px;
  font-size: 11px;
}

/* ── Journal year separator ── */
.journal-year-sep {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  position: relative;
}

/* ── Pagination ── */
.navigation.pagination {
  margin-top: 2.5rem;
}
.navigation.pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.navigation.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  font-size: 14px;
  color: #6E6860;
  text-decoration: none;
  border: 1px solid #DDD9D0;
  background: transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.navigation.pagination a.page-numbers:hover {
  color: #D9444A;
  border-color: #D9444A;
  background: rgba(217,68,74,0.04);
}
.navigation.pagination .page-numbers.current {
  color: #fff;
  background: #D9444A;
  border-color: #D9444A;
  font-weight: 500;
}
.navigation.pagination .page-numbers.dots {
  border: none;
  min-width: auto;
  padding: 0 0.2rem;
  color: #B8B3A8;
}
.navigation.pagination .prev,
.navigation.pagination .next {
  font-size: 13px;
  letter-spacing: 0.03em;
  border: none;
  color: #6E6860;
}
.navigation.pagination .prev:hover,
.navigation.pagination .next:hover {
  color: #D9444A;
  background: transparent;
  border: none;
}

/* ── Breadcrumb ── */
.breadcrumb-link:hover { color: #D9444A !important; }

/* ── Post prev/next nav hover ── */
.post-nav-link:hover p { color: #D9444A; }

/* ── Like button & comment link in statusbar ── */
.retro-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #A09B90;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  transition: color 0.2s;
}
.retro-like-btn:hover { color: #D9444A; }
.retro-like-btn.liked { color: #D9444A; }
.retro-like-btn.liked .like-icon { fill: #D9444A; }
.retro-comment-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #A09B90;
  text-decoration: none;
  font-size: 13px;
  border-bottom: none !important;
  transition: color 0.2s;
}
.retro-comment-link:hover { color: #D9444A; }

/* ── Comments: Terminal / BBS style ── */
#comments {
  background: #2C2822;
  border: 1px solid #3D3830;
  border-radius: 6px;
  overflow: hidden;
}
#comments .comments-title,
#comments > h2,
#comments > h3 {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  color: #E8E4DA;
  letter-spacing: 0.06em;
  padding: 0.6rem 1rem;
  background: #1A1816;
  border-bottom: 1px solid #3D3830;
  margin: 0;
}
ol.commentlist,
ul.commentlist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1rem 1.5rem;
  margin: 0;
  counter-reset: comment-counter;
}
ol.commentlist > .comment {
  counter-increment: comment-counter;
}
ol.commentlist > .comment > .comment-body::before {
  content: counter(comment-counter) '.';
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #5A554E;
  float: left;
  margin-right: 0.5rem;
  margin-top: 2px;
}
ol.commentlist > .comment,
ul.commentlist > .comment {
  padding: 0.8rem 0;
  border-bottom: 1px solid #3D3830;
}
ol.commentlist > .comment:last-child { border-bottom: none; }

.comment .comment-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.comment .comment-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.comment .comment-author .avatar { display: none; }
.comment .comment-author .fn {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: #6B8F5E;
}
.comment .comment-author .fn::before {
  content: '>';
  color: #D4A843;
  margin-right: 4px;
}
.comment .comment-author .says { display: none; }

/* Author badge */
.comment.bypostauthor > .comment-body .comment-author .fn {
  color: #D4A843;
}
.comment.bypostauthor > .comment-body .comment-author .fn::after {
  content: ' [author]';
  font-size: 11px;
  font-weight: 300;
  color: #D9444A;
}

.comment .comment-metadata {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #A09B90;
  margin-left: auto;
}
.comment .comment-metadata a {
  color: #A09B90;
  text-decoration: none;
  border-bottom: none;
}
.comment .comment-metadata .edit-link { display: none; }

.comment .comment-content {
  font-size: 15px;
  line-height: 1.7;
  color: #E8E4DA;
  padding-left: 1rem;
}
.comment .comment-content p { margin-bottom: 0.4rem; }
.comment .comment-content p:last-child { margin-bottom: 0; }
.comment .comment-content a {
  color: #D9444A;
  border-bottom-color: #5A554E;
}

.comment .reply { margin-top: 0.3rem; padding-left: 1rem; }
.comment .reply a {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #8C8680;
  text-decoration: none;
  border-bottom: none;
  transition: color 0.15s;
}
.comment .reply a::before { content: '\2514\0020'; }
.comment .reply a:hover { color: #D4A843; }

/* Nested comments */
.comment .children {
  list-style: none;
  padding-left: 1.5rem;
  border-left: 1px dashed #3D3830;
  margin: 0.3rem 0 0;
}
.comment .children .comment {
  border-bottom: none;
  padding: 0.5rem 0;
}

/* ── Comment form: terminal input ── */
.comment-respond {
  border-top: 1px solid #3D3830;
  padding: 1.2rem 1.5rem;
  background: #1A1816;
}
.comment-respond .comment-reply-title {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 400;
  color: #6B8F5E;
  margin-bottom: 0.8rem;
}
.comment-respond .comment-reply-title::before { content: '$ '; color: #D4A843; }
.comment-respond .comment-reply-title small { display: none; }

.comment-form .logged-in-as {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #A09B90;
  margin-bottom: 0.6rem;
}
.comment-form .logged-in-as a {
  color: #6B8F5E;
  border-bottom: none;
}
.comment-form .required-field-message {
  color: #A09B90;
}

.comment-form label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #8C8680;
  margin-bottom: 0.2rem;
}
.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  width: 100%;
  background: #2C2822;
  border: 1px solid #3D3830;
  padding: 0.5rem 0.7rem;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: #E8E4DA;
  margin-bottom: 0.6rem;
  outline: none;
  transition: border-color 0.15s;
  border-radius: 0;
}
.comment-form textarea:focus,
.comment-form input:focus { border-color: #6B8F5E; }
.comment-form textarea { min-height: 80px; resize: vertical; }

.comment-form .required-field-message {
  font-size: 12px;
  color: #5A554E;
  margin-bottom: 0.6rem;
}

.form-submit input[type="submit"] {
  font-family: 'DM Mono', monospace;
  background: none;
  color: #6B8F5E;
  border: 1px solid #6B8F5E;
  padding: 0.4rem 1.2rem;
  font-size: 13px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}
.form-submit input[type="submit"]:hover {
  background: #6B8F5E;
  color: #1A1816;
}

/* ── All comment body text must be light on dark bg ── */
#comments .comment-body {
  color: #E8E4DA;
}
/* Pingback / trackback */
#comments .pingback .comment-body,
#comments .trackback .comment-body {
  font-size: 13px;
  color: #A09B90;
}
#comments .pingback .comment-body a,
#comments .trackback .comment-body a {
  color: #6B8F5E;
  border-bottom: none;
}

/* ── Work external link hover effect ── */
.work-external-link {
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
}
.work-external-link:hover {
  animation: linkShake 0.4s ease;
  box-shadow: 0 0 12px rgba(107,143,94,0.3), 0 0 24px rgba(107,143,94,0.15);
}
.work-external-link:hover a { color: #6B8F5E; }
.work-external-link:hover svg:first-child { filter: drop-shadow(0 0 4px rgba(255,255,255,0.4)); }
@keyframes linkShake {
  0% { transform: translateX(0); }
  15% { transform: translateX(-3px) rotate(-1deg); }
  30% { transform: translateX(3px) rotate(1deg); }
  45% { transform: translateX(-2px) rotate(-0.5deg); }
  60% { transform: translateX(2px) rotate(0.5deg); }
  75% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}

/* ── Search overlay ── */
.search-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  background: #2C2822;
  border-bottom: 1px solid #3D3830;
  padding: 0;
  animation: searchSlideDown 0.15s ease;
}
.search-overlay.open { display: block; }
@keyframes searchSlideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}
.search-form-terminal {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
}
.search-prompt {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: #6B8F5E;
  white-space: nowrap;
  flex-shrink: 0;
}
.search-form-terminal input[type="search"] {
  flex: 1;
  background: none;
  border: none;
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  color: #E8E4DA;
  outline: none;
  caret-color: #D9444A;
}
.search-form-terminal input[type="search"]::placeholder {
  color: #5A554E;
}
.search-submit-btn,
.search-close-btn {
  background: none;
  border: none;
  color: #5A554E;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.search-submit-btn:hover { color: #6B8F5E; }
.search-close-btn:hover { color: #D9444A; }

.search-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1.5rem 0.8rem;
}
.search-tags-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #A09B90;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.search-tag-pill {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #C8C3B8;
  padding: 1px 8px;
  border: 1px solid #4A4540;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.search-tag-pill:hover {
  color: #D4A843;
  border-color: #D4A843;
}

/* ── Back to top button ── */
#back-to-top {
  position: fixed;
  bottom: 4rem;
  right: calc(50% - 36rem + 1rem);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: #FAF8F4;
  border: 1px solid #DDD9D0;
  padding: 0.5rem 0.6rem 0.4rem;
  cursor: pointer;
  box-shadow: 2px 3px 8px rgba(44,40,34,0.1);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, border-color 0.15s;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top svg {
  color: #6E6860;
  transition: color 0.15s;
}
#back-to-top span {
  font-family: 'Caveat', cursive;
  font-size: 11px;
  color: #8C8680;
  letter-spacing: 0.08em;
  transition: color 0.15s;
}
#back-to-top:hover {
  border-color: #D9444A;
}
#back-to-top:hover svg { color: #D9444A; }
#back-to-top:hover span { color: #D9444A; }

/* ── Media shelf (retro OS window) ── */
.media-page,
.media-page-hero,
.media-shelf {
  overflow-x: hidden;
}
.media-shelf {
  background: #FAF8F4;
  border: 1px solid #DDD9D0;
  margin-bottom: 2rem;
}
.media-shelf-titlebar {
  background: #2C2822;
  padding: 0.45rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.media-shelf-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #DDD9D0;
}
.media-shelf-tab {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: #8C8680;
  padding: 0.55rem 1.2rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-right: 1px solid #DDD9D0;
  text-decoration: none;
  display: inline-block;
  border-bottom: 2px solid transparent;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  border-top: 0;
  border-left: 0;
  border-right: 1px solid #DDD9D0;
}
.media-shelf-tab:hover {
  color: #2C2822;
  background: rgba(44,40,34,0.03);
}
.media-shelf-tab.active {
  color: #D9444A;
  background: #FAF8F4;
  border-bottom-color: #D9444A;
  margin-bottom: -1px;
}
.media-shelf-tab-count {
  font-size: 10px;
  opacity: 0.5;
  margin-left: 3px;
}
.media-poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.6rem;
}
.media-poster-item {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #E8E4DA;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #DDD9D0;
}
.media-poster-item::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
  pointer-events: none;
}
.media-poster-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(44,40,34,0.15);
  z-index: 10;
  border-color: #D4A843;
}
.media-poster-item.is-hidden {
  display: none;
}
.media-poster-item img {
  transition: filter 0.2s;
}
.media-poster-item:hover img {
  filter: brightness(1.05);
}
.media-poster-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(44,40,34,0.92) 0%, rgba(44,40,34,0.5) 60%, transparent 100%);
  padding: 2rem 0.5rem 0.45rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.media-poster-item:hover .media-poster-overlay { opacity: 1; }
.media-poster-title {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
  display: block;
}
.media-poster-cat {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: #D4A843;
  letter-spacing: 0.06em;
  margin-top: 2px;
  display: block;
}
.media-shelf-status {
  border-top: 1px solid #DDD9D0;
  padding: 0.4rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #8C8680;
  background: rgba(44,40,34,0.02);
}
.media-shelf-status span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.media-shelf-status svg {
  flex-shrink: 0;
}

/* ── Article sidebar responsive ── */
#article-sidebar {
  display: none;
}
@media (min-width: 1024px) {
  #article-sidebar {
    display: block;
  }
}

/* ── Muki Floating TOC override ── */
#muki-floating-toc {
  transform: translateX(-30px) !important;
}

/* ── Series chapter accordion ── */
.series-chapter-list {
  display: flex;
  flex-direction: column;
}
.series-chapter {
  border-bottom: 1px solid #DDD9D0;
}
.series-chapter-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 0;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.series-chapter-header:hover {
  background: rgba(44,40,34,0.02);
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}
.series-chapter.open .series-chapter-header {
  position: sticky;
  top: 52px;
  background: #EDEBE6;
  z-index: 50;
  padding: 0.8rem 0;
  border-bottom: 1px solid #DDD9D0;
}
.series-chapter.open .series-chapter-header:hover {
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
.series-chapter-num {
  font-size: 13px;
  color: #8C8680;
  width: 28px;
  flex-shrink: 0;
  text-align: right;
  padding-top: 3px;
  letter-spacing: 0.03em;
}
.series-chapter.open .series-chapter-num { color: #D9444A; }
.series-chapter-info { flex: 1; min-width: 0; }
.series-chapter-name {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: #2C2822;
  margin-bottom: 0.2rem;
  transition: color 0.15s;
}
.series-chapter-header:hover .series-chapter-name { color: #D9444A; }
.series-chapter.open .series-chapter-name { color: #D9444A; font-weight: 600; }
.series-chapter-preview {
  font-size: 14px;
  color: #8C8680;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.series-chapter.open .series-chapter-preview { display: none; }
.series-chapter-date {
  font-size: 12px;
  color: #8C8680;
  flex-shrink: 0;
  padding-top: 4px;
  letter-spacing: 0.04em;
}
.series-chapter-arrow {
  font-size: 10px;
  color: #8C8680;
  flex-shrink: 0;
  padding-top: 6px;
  transition: transform 0.2s;
}
.series-chapter.open .series-chapter-arrow { transform: rotate(180deg); color: #D9444A; }
.series-chapter-body {
  display: none;
  padding: 0 0 1.5rem 0;
}
.series-chapter.open .series-chapter-body { display: block; }
.series-chapter-content {
  background: #FAF8F4;
  border: 1px solid #DDD9D0;
  padding: 1.8rem 2rem;
  font-size: 16px;
  line-height: 1.9;
  color: #4A4540;
}
.series-chapter-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed #DDD9D0;
}

/* ── Journal entry title hover ── */
.journal-entry-title {
  color: #2C2822;
  transition: color 0.2s ease;
}
.journal-card:hover .journal-entry-title {
  color: #D9444A;
}

/* ── Journal card ── */
.journal-card {
  background: #FAF8F4;
  border: 1px solid #DDD9D0;
  background-image:
    linear-gradient(#E8E4DA 1px, transparent 1px);
  background-size: 100% 1.8rem;
  background-position: 0 1rem;
  position: relative;
  overflow: visible;
}
.journal-card::after {
  content: '';
  position: absolute;
  left: 2.5rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #E8C8C8;
  opacity: 0.5;
}
.journal-card.has-fold::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #EDEBE6 50%, #DDD9D0 50%);
  border-bottom-left-radius: 2px;
}

/* ── Paper clip — realistic double-loop wire ── */
.paper-clip {
  position: absolute;
  top: -12px;
  left: 7px;
  transform: rotate(-5deg);
  width: 14px;
  height: 48px;
  z-index: 10;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='48' viewBox='0 0 14 48'%3E%3Cpath d='M3 48 L3 6 C3 2.5 5 0.5 7 0.5 C9 0.5 11 2.5 11 6 L11 38 C11 41 9.5 43 7 43 C4.5 43 3.5 41 5 38 L5 15' fill='none' stroke='%23B5AFA5' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ── Work card ── */
.work-card {
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
}
.work-card:hover {
  transform: scale(1.03) rotate(0deg) !important;
  box-shadow: 4px 8px 20px rgba(44,40,34,0.12);
  z-index: 50 !important;
}

/* ── Featured article title ── */
.featured-title-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.featured-title-link .featured-title {
  transition: color 0.2s ease;
}
.featured-title-link:hover .featured-title {
  color: #D9444A;
}

/* ── Skill meter ── */
.skill-meter {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  background: #FAF8F4;
  border: 1px solid #E8E4DA;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
}
.skill-meter:hover {
  transform: translateY(-1px);
  box-shadow: 1px 3px 10px rgba(44,40,34,0.06);
}
.skill-meter-label {
  font-size: 14px;
  color: #3D3830;
  min-width: 140px;
  white-space: nowrap;
}
.skill-meter-track {
  flex: 1;
  height: 4px;
  background: #E8E4DA;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.skill-meter-fill {
  height: 100%;
  border-radius: 2px;
  position: absolute;
  left: 0;
  top: 0;
  background: linear-gradient(90deg, #D9444A, #E8666B);
}
.skill-meter-value {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #A09B90;
  letter-spacing: 0.05em;
  min-width: 2rem;
  text-align: right;
}

/* ── About page sections ── */
.about-section {
  animation: fadeIn 0.5s ease both;
}
.about-section:nth-child(2) { animation-delay: 0.1s; }
.about-section:nth-child(3) { animation-delay: 0.2s; }
.about-section:nth-child(4) { animation-delay: 0.3s; }

/* ── Timeline ── */
.timeline-item {
  position: relative;
  padding-left: 2rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D9444A;
}
.timeline-item::after {
  content: '';
  position: absolute;
  left: 3.5px;
  top: 1.2rem;
  bottom: -1rem;
  width: 1px;
  background: #DDD9D0;
}
.timeline-item:last-child::after { display: none; }

/* ── Skill tags ── */
.skill-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 13px;
  border: 1px solid #DDD9D0;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}
a.skill-tag { cursor: pointer; }
.skill-tag:hover {
  border-color: #D9444A;
  color: #D9444A;
}

/* ── Conference polaroid ── */
.conf-polaroid {
  display: block;
  background: #FAF8F4;
  padding: 0.6rem 0.6rem 1.2rem;
  box-shadow: 2px 3px 10px rgba(44,40,34,0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
}
.conf-polaroid:hover {
  transform: scale(1.04) rotate(0deg) !important;
  box-shadow: 4px 8px 20px rgba(44,40,34,0.14);
}
.conf-polaroid-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: #EDE9E1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.7rem;
}
.conf-polaroid-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.conf-polaroid-label {
  font-family: 'Caveat', cursive;
  font-size: 1.05rem;
  color: #2C2822;
  line-height: 1.2;
  padding: 0 0.3rem;
}
.conf-polaroid-sub {
  font-size: 12px;
  color: #A09B90;
  margin-top: 0.2rem;
  padding: 0 0.3rem;
  line-height: 1.4;
}

/* ── Book card (legacy) ── */
.book-card {
  position: relative;
  background: #FAF8F4;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.06);
  padding: 1.2rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
}
.book-card:hover {
  transform: translateY(-2px);
  box-shadow: 2px 6px 14px rgba(44,40,34,0.08);
}

/* ── Book card with cover ── */
.book-card-cover {
  position: relative;
  background: #FAF8F4;
  box-shadow: 2px 3px 10px rgba(44,40,34,0.08);
  padding: 0.6rem 0.6rem 1rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
}
a.book-card-cover:hover {
  transform: translateY(-3px);
  box-shadow: 3px 8px 20px rgba(44,40,34,0.12);
}
.book-cover-img {
  width: 100%;
  aspect-ratio: 3/4;
  background: #EDE9E1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.7rem;
}
.book-cover-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-cover-info {
  padding: 0 0.3rem;
}

/* ── Book slider ── */
.book-slider-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.3rem 0;
}
.book-slider-btn {
  background: none;
  border: 1px solid #DDD9D0;
  color: #A09B90;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}
.book-slider-btn:hover {
  border-color: #D9444A;
  color: #D9444A;
}
.book-slider-dots {
  display: flex;
  gap: 5px;
}
.book-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #DDD9D0;
  cursor: pointer;
  transition: background 0.2s ease;
}
.book-dot.active {
  background: #D9444A;
}

/* ── Social link (legacy) ── */
.social-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
  padding: 0.8rem 0.9rem;
  background: #f5f1e9;
  border: 1px solid #e5ddd0;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.2s ease;
}
.social-link:hover {
  color: #D9444A;
  border-color: #d8c8b5;
  background: #faf6ef;
  transform: translateY(-1px);
}
.social-link-badge {
  display: inline-block;
  padding: 2px 8px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #8a8478;
  background: rgba(255,255,255,0.7);
  border: 1px solid #e5ddd0;
}
.social-link-label {
  font-size: 14px;
}

/* ── Retro 88x31 badge ── */
.retro-badge {
  display: inline-flex;
  align-items: stretch;
  width: 125px;
  height: 45px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #C8C3B8;
  background: #F0EDE6;
  transition: filter 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
  overflow: hidden;
}
.retro-badge:hover {
  filter: brightness(1.05);
  animation: linkShake 0.4s ease;
  border-color: #A09B90;
}
.retro-badge-icon {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.retro-badge-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 7px;
  background: #F0EDE6;
  border-left: 1px solid rgba(0,0,0,0.15);
  gap: 2px;
  overflow: hidden;
}
.retro-badge-name {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #6B6560;
  line-height: 1;
}
.retro-badge-handle {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: #2C2822;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Page loading overlay ── */
body.is-page-loading {
  cursor: progress;
}
body.is-page-loading a {
  pointer-events: none;
}
.page-loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(237, 235, 230, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  z-index: 10000;
}
.page-loading-overlay.is-ready {
  visibility: visible;
}
.page-loading-overlay.is-visible {
  opacity: 1;
}
.page-loading-card {
  position: relative;
  min-width: 220px;
  padding: 1rem 1.2rem;
  background: #FFF9E6;
  border: 1px solid #DDD9D0;
  box-shadow: 0 10px 30px rgba(44,40,34,0.08);
  transform: rotate(-1.5deg);
}
.page-loading-card::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 18px;
  width: 74px;
  height: 22px;
  background: rgba(210,200,170,0.55);
  transform: rotate(-8deg);
}
.page-loading-label {
  margin: 0 0 0.55rem;
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  color: #D9444A;
}
.page-loading-dots {
  display: flex;
  gap: 0.45rem;
}
.page-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #D9444A;
  opacity: 0.28;
  animation: omegacLoadingDot 1s ease-in-out infinite;
}
.page-loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.page-loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes omegacLoadingDot {
  0%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (max-width: 900px) {
  .site-header,
  .site-nav,
  .site-footer {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .site-header,
  .site-footer,
  .front-page-bottom-bar,
  .works-page-footer {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .site-nav {
    justify-content: flex-start !important;
    gap: 0.9rem !important;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .journal-page,
  .media-page,
  .works-page,
  .single-article-page,
  .single-work-page,
  .search-page,
  .guestbook-page,
  .error-page,
  .fallback-page,
  .profile-page {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .front-page-shell {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .journal-page-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .journal-filter-wrap {
    position: static;
    top: auto;
  }

  .journal-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .journal-filter-wrap:not(.is-open) .journal-filter-row {
    display: none !important;
  }

  .journal-page-hero-word,
  .media-page-hero-word,
  .works-page-hero-word,
  .profile-page-hero-word {
    left: 0 !important;
  }

  .journal-page-hero-inner,
  .media-page-hero-inner,
  .works-page-hero-inner {
    padding-top: 2.6rem !important;
  }

  .journal-page-hero-copy,
  .media-page-intro,
  .works-page-hero-copy {
    max-width: 32rem;
  }

  .journal-entry {
    gap: 0.9rem !important;
  }

  .journal-entry-date {
    width: 60px !important;
  }

  .journal-entry-thumb {
    width: 64px !important;
    height: 64px !important;
  }

  .journal-year-sep {
    gap: 0.9rem;
  }

  .journal-timeline-line {
    left: 64px !important;
  }

  .media-shelf-titlebar {
    gap: 0.6rem;
    flex-wrap: wrap;
  }

  .media-shelf-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .media-shelf-tabs::-webkit-scrollbar {
    display: none;
  }

  .media-shelf-tab {
    flex: 0 0 auto;
  }

  .front-page-hero-grid,
  .front-page-featured-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .front-page-hero-copy {
    padding: 0.5rem 0 0 !important;
  }

  .front-page-side-stack {
    margin-right: 0 !important;
    padding-top: 0.5rem !important;
  }

  .front-page-stats-row {
    justify-content: flex-start !important;
  }

  .front-page-kicker {
    text-align: left !important;
    margin-bottom: 1.25rem !important;
  }

  .works-page-board {
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .works-page-board .work-card {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    transform: none !important;
    z-index: auto !important;
  }

  .works-page-note,
  .works-page-doodle {
    display: none !important;
  }

  .single-layout {
    flex-direction: column;
    gap: 1.5rem !important;
    align-items: stretch !important;
  }

  .single-post-nav {
    flex-direction: column;
    gap: 1rem !important;
  }

  .single-post-nav a {
    text-align: left !important;
  }

  .single-work-hero {
    padding-top: 1.5rem !important;
  }

  .profile-page-hero-inner {
    gap: 1.25rem !important;
    padding-top: 2.25rem !important;
  }

  .profile-conference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.9rem !important;
  }

  .profile-career-grid {
    gap: 1.5rem !important;
  }
}

@media (max-width: 640px) {
  #muki-floating-toc {
    display: none !important;
  }

  .site-header {
    align-items: flex-start !important;
    padding-top: 0.75rem;
    padding-bottom: 0.2rem;
  }

  .site-header-counter {
    width: 100%;
    justify-content: flex-start;
  }

  .site-footer {
    flex-direction: column;
  }

  .journal-page,
  .media-page,
  .works-page,
  .single-article-page,
  .single-work-page,
  .search-page,
  .guestbook-page,
  .error-page,
  .fallback-page,
  .profile-page {
    padding-bottom: 3rem !important;
  }

  .single-article-page {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  .retro-window > div {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  .journal-page-hero,
  .media-page-hero,
  .works-page-hero,
  .profile-page-hero {
    margin-bottom: 1.75rem !important;
  }

  .journal-page-hero-inner,
  .media-page-hero-inner,
  .works-page-hero-inner {
    padding-top: 2.1rem !important;
  }

  .front-page-shell {
    padding-top: 2rem !important;
    padding-bottom: 3rem !important;
  }

  .front-page-hero-quote {
    white-space: normal !important;
    font-size: 1.25rem !important;
  }

  .front-page-bottom-bar {
    align-items: flex-start !important;
  }

  .journal-timeline-line {
    display: none;
  }

  .journal-entry {
    gap: 0.65rem !important;
    padding-bottom: 1rem !important;
  }

  .journal-entry-date {
    width: 46px !important;
    padding-top: 1rem !important;
  }

  .journal-entry-dot {
    margin-top: 1.2rem !important;
  }

  .journal-card {
    transform: none !important;
  }

  .journal-card::after {
    left: 1.35rem;
  }

  .journal-card {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .journal-entry-thumb {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    margin-top: 0 !important;
    order: -1;
  }

  .journal-entry-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
  }

  .journal-entry-tags span:last-child {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 0.25rem;
  }

  .media-page-stats {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem !important;
  }

  .media-page-stat {
    flex: 1 1 0;
  }

  .media-shelf-titlebar-left,
  .media-shelf-titlebar-right {
    width: 100%;
  }

  .media-shelf-titlebar-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .media-poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .media-shelf-tab {
    padding: 0.5rem 0.85rem;
    font-size: 12px;
  }

  .media-poster-overlay {
    opacity: 1;
    padding-top: 1.5rem;
  }

  .works-page-board .work-card {
    padding: 0.85rem !important;
  }

  .works-page-footer {
    align-items: flex-start;
  }

  .single-breadcrumb {
    margin-bottom: 1.25rem !important;
  }

  .single-support-banner {
    margin-top: 1.5rem !important;
  }

  .single-work-page #seriesProgress {
    top: 0;
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
  }

  .work-external-link {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .work-external-link a {
    overflow-wrap: anywhere;
  }

  .series-chapter-header {
    gap: 0.75rem;
    padding: 0.9rem 0;
  }

  .series-chapter-date {
    display: none;
  }

  .search-page .paper-card,
  .guestbook-page .paper-card,
  .fallback-page .paper-card {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .article-body .wp-block-table,
  .article-body figure.wp-block-table {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .article-body table {
    width: 100%;
  }

  .article-body th,
  .article-body td {
    padding: 0.75rem 0.85rem;
    font-size: 13px;
  }

  .profile-page-hero-inner {
    padding-top: 2rem !important;
  }

  .profile-conference-grid {
    grid-template-columns: 1fr !important;
  }

  .front-page-stats-row a {
    justify-content: space-between !important;
  }

  .works-page-board .work-card h2 {
    font-size: 1.1rem !important;
  }
}
