/* ==========================================================================
   List pages: home hero, quest-log post list, categories, search, 404
   ========================================================================== */

/* ---------- Hero / player card ---------- */
.hero {
  position: relative;
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 22px 22px 20px;
  margin: 6px 0 44px;
}
.hero::after {
  /* corner screws */
  content: '';
  position: absolute;
  right: 10px;
  top: 10px;
  width: 6px;
  height: 6px;
  background: var(--line);
  box-shadow: -12px 0 0 var(--accent), -24px 0 0 var(--gold);
}
.hero-avatar {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  background: var(--surface-2);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line);
  cursor: crosshair;
}
.hero-avatar img,
.hero-avatar canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-avatar canvas { image-rendering: pixelated; }
.hero-avatar .avatar-tip {
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.hero-body { min-width: 0; flex: 1; }
.hero-kicker {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent-2);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.hero-title {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.25;
  min-height: 30px;
  -webkit-font-smoothing: none;
}
.hero-title .tw-c { visibility: hidden; }
.hero-title .tw-c.on { visibility: visible; }
.hero-title .caret {
  display: inline-block;
  width: 12px;
  height: 3px;
  margin-left: 4px;
  vertical-align: baseline;
  background: var(--accent);
  animation: blink 1s steps(1, end) infinite;
}
.hero-desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 16px;
}
.hud > div { display: flex; align-items: baseline; gap: 6px; }
.hud dt {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--muted);
}
.hud dd {
  font-family: var(--font-dots);
  font-size: 20px;
  color: var(--ink);
  min-width: 1.2em;
}

.exp {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-family: var(--font-pixel);
  font-size: 12px;
}
.exp-label { color: var(--accent-2); }
.exp-val { color: var(--muted); white-space: nowrap; }
.exp-bar {
  position: relative;
  flex: 1;
  height: 12px;
  background: var(--surface-2);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line);
}
.exp-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--accent-2) 0 9px, transparent 9px 12px);
  transition: width 1200ms steps(12, end);
}

@media screen and (max-width: 600px) {
  .hero { flex-direction: column; align-items: flex-start; gap: 40px; padding: 18px; }
  .hero-title { font-size: 24px; }
}

/* ---------- Section titles (years / categories) ---------- */
.list-post { margin-bottom: 30px; }
.list-post > h2,
.year-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 14px;
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 400;
  scroll-margin-top: 100px;
}
.year-badge {
  display: inline-block;
  padding: 6px 9px;
  background: var(--line);
  color: var(--bg);
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.1em;
}
.year-badge::before { content: 'LV.'; color: var(--gold); margin-right: 2px; }
.list-post[data-category] .year-badge::before { content: '#'; }
.year-line {
  flex: 1;
  height: var(--px);
  background-image: linear-gradient(90deg, var(--line) 50%, transparent 50%);
  background-size: calc(var(--px) * 3) 100%;
  opacity: 0.35;
}
.year-count { color: var(--muted); font-size: 12px; }

.list-post:target .year-badge,
.list-post.is-flash .year-badge { animation: flash 900ms steps(2, end) 3; }
@keyframes flash { 50% { background: var(--accent); color: var(--accent-ink); } }

/* ---------- Quest-log rows ---------- */
.list-post ul { padding: 0; }
.list-post li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px 8px 30px;
  transition: background-color 120ms steps(2, end), transform 120ms steps(2, end);
}
.list-post li::before {
  /* RPG selection cursor */
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -6px;
  border-style: solid;
  border-width: 6px 0 6px 9px;
  border-color: transparent transparent transparent var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 120ms steps(2, end), transform 120ms steps(2, end);
}
.list-post li:hover,
.list-post li:focus-within {
  background-color: var(--surface);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line);
}
.list-post li:hover::before,
.list-post li:focus-within::before {
  opacity: 1;
  transform: none;
  animation: nudge 600ms steps(2, end) infinite;
}
@keyframes nudge { 50% { transform: translateX(3px); } }

.list-post li .date {
  flex-shrink: 0;
  min-width: 84px;
  font-family: var(--font-dots);
  font-size: 15px;
  color: var(--muted);
}
.list-post li .title {
  width: 0;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-post li .title a {
  font-size: 15px;
  line-height: 1.4;
}
.list-post li .title a::after { display: none; }
.list-post li:hover .title a { color: var(--accent); }
.list-post li .categories {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}
.list-post li .categories a {
  padding: 3px 6px;
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  background: var(--surface-2);
}
.list-post li .categories a::after { display: none; }
.list-post li .categories a:hover { background: var(--gold); color: var(--line); }

/* scroll reveal (only when JS is ready) */
html.js-reveal .list-post li.reveal {
  opacity: 0;
  transform: translateX(-12px);
}
html.js-reveal .list-post li.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 300ms steps(4, end) var(--d, 0ms), transform 300ms steps(4, end) var(--d, 0ms), background-color 120ms steps(2, end);
}

@media screen and (max-width: 600px) {
  .list-post li { padding: 8px 8px 8px 26px; gap: 10px; }
  .list-post li::before { left: 6px; }
  .list-post li .date { min-width: 0; font-size: 14px; }
  .list-post li .title a { font-size: 14px; }
  .list-post .categories { display: none !important; }
}

/* ---------- Categories page ---------- */
.list-category {
  padding: 20px 20px 18px;
  margin: 6px 0 40px;
}
.list-category h2 {
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 400;
  color: var(--accent-2);
  letter-spacing: 0.08em;
  padding-bottom: 16px;
}
.list-category h2::before { content: '▶ '; }
.list-category .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  padding: 0 0 6px 3px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1;
  background: var(--surface);
  color: var(--ink);
  transition: transform 90ms steps(2, end), background-color 90ms steps(2, end);
}
.chip::after { display: none; }
.chip:hover { background: var(--gold); transform: translate(-1px, -2px); }
.chip:active { transform: translate(var(--px), var(--px)); }
.chip-count {
  padding: 2px 4px;
  background: var(--line);
  color: var(--bg);
  font-size: 12px;
}

/* ---------- Search ---------- */
.page-search #search-input {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-pixel);
  font-size: 12px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line);
}
.page-search h1 { padding: 20px 0 12px; }
.page-search h1 span { font-family: var(--font-pixel); font-size: 12px; font-weight: 400; vertical-align: middle; }
.page-search h1 img { display: inline-block; width: 21px; margin-left: 8px; vertical-align: middle; opacity: 0; }
.page-search .list-search li { margin-bottom: 18px; padding-left: 18px; position: relative; }
.page-search .list-search li::before { content: '▶'; position: absolute; left: 0; color: var(--accent); font-size: 10px; top: 4px; }
.page-search .list-search .title { display: inline-block; word-break: break-all; font-size: 14px; font-weight: bold; }
.page-search .list-search .content { display: block; font-size: 14px; color: var(--muted); word-break: break-all; padding: 8px 0; }
.page-search .list-search .hint { font-size: inherit; font-weight: bold; color: var(--accent); }

/* ---------- 404 ---------- */
.page-404 {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}
.gameover {
  width: 100%;
  max-width: 460px;
  padding: 36px 24px 30px;
  text-align: center;
}
.go-title {
  font-family: var(--font-pixel);
  font-size: 48px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-shadow: var(--px) var(--px) 0 var(--line);
  animation: go-drop 700ms steps(7, end) both;
}
@keyframes go-drop {
  from { transform: translateY(-60px); opacity: 0; }
  60% { transform: translateY(6px); opacity: 1; }
  to { transform: none; }
}
.go-sub { margin-top: 18px; font-family: var(--font-pixel); font-size: 12px; color: var(--muted); }
.go-continue { margin-top: 26px; font-family: var(--font-pixel); font-size: 24px; }
.go-continue b { color: var(--gold); font-weight: 400; display: inline-block; min-width: 1em; }
.go-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 26px; }

/* ---------- Home: projects strip ---------- */
.home-projects { margin: -14px 0 40px; }
.home-projects .year-badge::before { content: '▶ '; color: var(--gold); }
.home-more {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.home-more:hover { color: var(--accent); }
.mini-carts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  padding: 4px 3px 0;
}
.mini-cart { gap: 8px; }
.mini-cart i {
  display: block;
  width: 9px;
  height: 9px;
  background: var(--cart);
  box-shadow: 0 0 0 2px var(--line);
}
.mini-cart span { color: var(--muted); }
.mini-cart:hover span { color: var(--line); }
