/* --- Progress bar --- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--green);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
  isolation: isolate;
}

/* ========================================
   ChunkyMonkey — stylesheet
   Fonts: DM Sans (body), IBM Plex Mono (mono)
   ======================================== */

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

:root {
  --bg:         #24181f;
  --text:       #f6e9db;
  --accent:     #f59a4a;
  --mono-dim:   #c3a291;
  --green:      #6e3145;
  --border:     rgba(110, 49, 69, 0.4);
  --max-w:      1380px;
  --layout-w:   1472px;
  --gap:        4px;
}

html { font-size: 18px; scroll-behavior: smooth; }


/* vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* --- Header --- */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1.5rem 0;
}

.logo-link {
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.22));
  transition: transform 0.22s ease, filter 0.22s ease, opacity 0.22s ease;
}

.site-logo {
  width: clamp(260px, 46vw, 560px);
  height: auto;
  filter: saturate(1.02) contrast(1.03);
}

.logo-link:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.26));
}

header nav {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.85rem;
  margin-bottom: 1.2rem;
  padding: 0.2rem 0.2rem 0.35rem;
  border-bottom: 1px solid rgba(246, 233, 219, 0.08);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  width: fit-content;
  max-width: min(calc(100vw - 3rem), 100%);
  overflow-x: auto;
  scrollbar-width: none;
}

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

header nav a {
  color: var(--accent);
  position: relative;
  font-weight: 400;
  opacity: 0.72;
  padding: 0.52rem 0.85rem;
  border-radius: 4px;
  transition: color 0.2s, opacity 0.2s, background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
header nav a::after {
  content: '';
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.18rem;
  height: 2px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.35);
  transform-origin: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
header nav a:hover {
  opacity: 1;
  background: rgba(245, 154, 74, 0.04);
  transform: translateY(-1px);
}
header nav a:hover::after {
  opacity: 0.5;
  transform: scaleX(0.92);
}
header nav a.nav-active {
  color: #f6d0b2;
  opacity: 1;
  background: rgba(245, 154, 74, 0.07);
  box-shadow: inset 0 0 0 1px rgba(245, 154, 74, 0.08);
}
header nav a.nav-active::after {
  opacity: 1;
  transform: scaleX(1);
}

/* --- Gallery Grid (home) --- */
/* Fluid: auto-fill with min ~560px per column — matches original WP behavior.
   1 col on mobile, 2 cols on tablet/desktop, 3+ on very wide screens. */
.gallery-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
  width: min(var(--layout-w), 100%);
  margin: 0 auto 0.4rem;
  padding: 0 min(30px, 5vw);
}

/* Each card: meta on top, image below, gap 20px between — exact WP structure */
.gallery-item a {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.gallery-item {
  display: flex;
  height: 100%;
  min-width: 0;
}

/* META BLOCK — rounded top-right corner like original */
.gallery-meta {
  display: flex;
  align-items: stretch;
  border-radius: 0;
  padding: 0 0 0 0;
  width: 100%;
  min-width: 0;
}

.gallery-head {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 2.3rem;
  min-width: 0;
  border: 1px solid rgba(110, 49, 69, 0.2);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(110, 49, 69, 0.1) 0%, rgba(110, 49, 69, 0.03) 100%);
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

/* TITLE — teal/green like original (not pink) */
.gallery-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  display: block;
  flex: 1;
  padding: 0.53rem 0.82rem 0.5rem 0.82rem;
  min-width: 0;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* DATE PILL — rounded top corners, calendar icon via mask-image */
.gallery-date {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.61rem;
  color: rgba(214, 168, 136, 0.9);
  padding: 0.53rem 0.72rem 0.5rem 0.62rem;
  flex-shrink: 0;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-left: 1px solid rgba(110, 49, 69, 0.1);
  background: rgba(7, 21, 18, 0.12);
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

/* Calendar icon via SVG mask — exactly as the original */
.gallery-date::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M19.5 7.5H4.5V19.0005C4.5 19.2764 4.72363 19.5 4.9995 19.5H19.0005C19.2764 19.5 19.5 19.2764 19.5 19.0005V7.5ZM3 7.5V4.9995V4.995C3 3.89319 3.89319 3 4.995 3H4.9995H19.0005H19.005C20.1068 3 21 3.89319 21 4.995V4.9995V7.5V19.0005C21 20.1048 20.1048 21 19.0005 21H4.9995C3.89521 21 3 20.1048 3 19.0005V7.5ZM7.5 10.5H9V12H7.5V10.5ZM9 15H7.5V16.5H9V15ZM11.25 10.5H12.75V12H11.25V10.5ZM12.75 15H11.25V16.5H12.75V15ZM15 10.5H16.5V12H15V10.5ZM16.5 15H15V16.5H16.5V15Z' fill='currentColor'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M19.5 7.5H4.5V19.0005C4.5 19.2764 4.72363 19.5 4.9995 19.5H19.0005C19.2764 19.5 19.5 19.2764 19.5 19.0005V7.5ZM3 7.5V4.9995V4.995C3 3.89319 3.89319 3 4.995 3H4.9995H19.0005H19.005C20.1068 3 21 3.89319 21 4.995V4.9995V7.5V19.0005C21 20.1048 20.1048 21 19.0005 21H4.9995C3.89521 21 3 20.1048 3 19.0005V7.5ZM7.5 10.5H9V12H7.5V10.5ZM9 15H7.5V16.5H9V15ZM11.25 10.5H12.75V12H11.25V10.5ZM12.75 15H11.25V16.5H12.75V15ZM15 10.5H16.5V12H15V10.5ZM16.5 15H15V16.5H16.5V15Z' fill='currentColor'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* IMAGE WRAPPER — shadow + slight background tint + top-right micro-radius */
.gallery-thumb-wrap {
  width: 100%;
  box-shadow: rgba(0, 0, 0, 0.2) 6px 6px 9px 0px;
}

.gallery-thumb {
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: rgba(171, 183, 194, 0.07);
  border-radius: 0 0 4px 4px;
  position: relative;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.gallery-item:hover .gallery-thumb img {
  transform: scale(1.02);
  opacity: 0.88;
}

.card-index {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  color: rgba(245, 240, 229, 0.65);
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

/* --- Post detail --- */
.post-main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.post-header {
  padding: 2.35rem 0 1.9rem;
}

.post-head {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-bottom: 1px solid rgba(110, 49, 69, 0.18);
  background: linear-gradient(90deg, rgba(110, 49, 69, 0.06) 0%, rgba(110, 49, 69, 0.015) 100%);
}

.post-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
}

.post-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.08rem, 1.35vw, 1.34rem);
  font-weight: 400;
  color: var(--accent);
  width: 100%;
  padding: 0.88rem 1.08rem 0.84rem 1.05rem;
  line-height: 1.18;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.post-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.post-figure {
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: auto;
  margin: 0;
  position: relative;
}

.post-figure a {
  display: block;
}

.post-figure img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.3s ease;
}

.post-figure:hover img {
  opacity: 0.85;
}

@media (max-width: 480px) {
  .post-gallery { gap: 4px; }
  .post-figure { flex-basis: 100%; }
}

/* Post nav */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1rem;
  margin-top: 4rem;
  position: relative;
}

.post-nav-line {
  display: none;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-family: 'IBM Plex Mono', monospace;
  min-height: 100%;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 1px solid rgba(110, 49, 69, 0.2);
  background: linear-gradient(90deg, rgba(110, 49, 69, 0.06) 0%, rgba(110, 49, 69, 0.01) 55%, rgba(110, 49, 69, 0) 100%);
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, padding-left 0.2s ease;
}

.post-nav-link:hover {
  border-color: rgba(110, 49, 69, 0.28);
  background: linear-gradient(90deg, rgba(110, 49, 69, 0.1) 0%, rgba(110, 49, 69, 0.02) 60%, rgba(110, 49, 69, 0) 100%);
  transform: translateY(-1px);
  padding-left: 1.1rem;
}

.post-nav-meta {
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}

.post-nav-title {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--mono-dim);
}

.post-nav-prev { align-items: flex-start; }
.post-nav-next {
  align-items: flex-end;
  text-align: right;
  padding-left: 0;
  padding-right: 1rem;
  border-left: none;
  border-right: 1px solid rgba(110, 49, 69, 0.2);
  background: linear-gradient(270deg, rgba(110, 49, 69, 0.06) 0%, rgba(110, 49, 69, 0.01) 55%, rgba(110, 49, 69, 0) 100%);
}

.post-nav-next:hover {
  padding-left: 0;
  padding-right: 1.1rem;
  border-right-color: rgba(110, 49, 69, 0.28);
  background: linear-gradient(270deg, rgba(110, 49, 69, 0.1) 0%, rgba(110, 49, 69, 0.02) 60%, rgba(110, 49, 69, 0) 100%);
}

.post-nav-link.is-empty {
  visibility: hidden;
  pointer-events: none;
}

/* --- Footer --- */
footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: min(var(--layout-w), 100%);
  margin: auto auto 0 auto;
  padding: 1.4rem min(30px, 5vw) 2rem;
  gap: 2rem;
}

.footer-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.footer-copy {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--mono-dim);
}

.footer-right {
  text-align: right;
}

.footer-archive-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--green);
  margin-bottom: 0.4rem;
}

.footer-archive {
  list-style: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--mono-dim);
  line-height: 1.9;
}

.footer-archive a {
  color: var(--mono-dim);
  transition: color 0.2s;
}
.footer-archive a:hover { color: var(--text); }

/* --- Post description --- */
.post-date {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  color: rgba(214, 168, 136, 0.9);
  padding: 0.75rem 0.85rem 0.72rem 0.75rem;
  flex-shrink: 0;
  border-left: 1px solid rgba(110, 49, 69, 0.1);
  background: rgba(7, 21, 18, 0.12);
}

.post-date::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M19.5 7.5H4.5V19.0005C4.5 19.2764 4.72363 19.5 4.9995 19.5H19.0005C19.2764 19.5 19.5 19.2764 19.5 19.0005V7.5ZM3 7.5V4.9995V4.995C3 3.89319 3.89319 3 4.995 3H4.9995H19.0005H19.005C20.1068 3 21 3.89319 21 4.995V4.9995V7.5V19.0005C21 20.1048 20.1048 21 19.0005 21H4.9995C3.89521 21 3 20.1048 3 19.0005V7.5ZM7.5 10.5H9V12H7.5V10.5ZM9 15H7.5V16.5H9V15ZM11.25 10.5H12.75V12H11.25V10.5ZM12.75 15H11.25V16.5H12.75V15ZM15 10.5H16.5V12H15V10.5ZM16.5 15H15V16.5H16.5V15Z' fill='currentColor'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M19.5 7.5H4.5V19.0005C4.5 19.2764 4.72363 19.5 4.9995 19.5H19.0005C19.2764 19.5 19.5 19.2764 19.5 19.0005V7.5ZM3 7.5V4.9995V4.995C3 3.89319 3.89319 3 4.995 3H4.9995H19.0005H19.005C20.1068 3 21 3.89319 21 4.995V4.9995V7.5V19.0005C21 20.1048 20.1048 21 19.0005 21H4.9995C3.89521 21 3 20.1048 3 19.0005V7.5ZM7.5 10.5H9V12H7.5V10.5ZM9 15H7.5V16.5H9V15ZM11.25 10.5H12.75V12H11.25V10.5ZM12.75 15H11.25V16.5H12.75V15ZM15 10.5H16.5V12H15V10.5ZM16.5 15H15V16.5H16.5V15Z' fill='currentColor'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.post-description {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--mono-dim);
  line-height: 1.82;
  margin: 0 0 2.35rem;
  padding: 0;
}

.post-nav-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-nav-row:last-child {
  text-align: right;
}

/* --- About page --- */
.about-main {
  flex: 1;
  width: min(var(--layout-w), 100%);
  margin: 0 auto;
  padding: 2.2rem min(30px, 5vw) 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.about-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: -20%;
  width: 38%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 154, 74, 0.28), transparent);
  opacity: 0.45;
  pointer-events: none;
  animation: aboutScan 9s ease-in-out infinite;
}

.about-section {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  max-width: 64rem;
}

@keyframes aboutScan {
  0%, 12% {
    transform: translateX(0);
    opacity: 0;
  }
  18% {
    opacity: 0.45;
  }
  52% {
    transform: translateX(370%);
    opacity: 0.2;
  }
  100% {
    transform: translateX(370%);
    opacity: 0;
  }
}

.about-section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  opacity: 0;
  text-shadow: 0 0 0 rgba(245, 154, 74, 0);
  animation: aboutHeadingIn 0.6s ease both;
  animation-delay: calc(0.08s + (var(--section-order, 0) * 1.45s));
}

@keyframes aboutHeadingIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.about-main p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
  line-height: 1.92;
  color: var(--text);
  width: 100%;
  max-width: 64rem;
  position: relative;
  text-align: left;
}

.about-panorama {
  margin: 0.8rem 0 0;
  width: 100%;
  max-width: 64rem;
  border: 1px solid rgba(245, 154, 74, 0.14);
  background: rgba(171, 183, 194, 0.05);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.about-panorama img {
  display: block;
  width: 100%;
  aspect-ratio: 2.15 / 1;
  object-fit: cover;
}

.about-word {
  display: inline-block;
  opacity: 0;
  color: #f3bd77;
  text-shadow: 0 0 12px rgba(245, 154, 74, 0.14);
  animation: aboutWordIn 0.85s ease both;
  animation-delay: calc(
    0.34s +
    (var(--section-order, var(--section-index, 0)) * 1.45s) +
    (var(--word-index, 0) * 0.03s)
  );
}

@keyframes aboutWordIn {
  from {
    opacity: 0;
    color: #ffffff;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.16);
  }
  38% {
    opacity: 0.82;
    color: #f7e7d6;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
  }
  to {
    opacity: 1;
    color: var(--accent);
    text-shadow: 0 0 0 rgba(245, 154, 74, 0);
  }
}

.about-word.typing-cursor::after {
  content: '_';
  display: inline-block;
  margin-left: 0.15rem;
  color: var(--accent);
  animation: cursorBlink 1.1s steps(1, end) infinite;
}

@keyframes cursorBlink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

/* --- Not found --- */
.not-found {
  padding: 3rem 0;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--mono-dim);
}
.not-found a { color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 700px) {
  header nav {
    gap: 0.45rem;
    margin-top: 1rem;
    padding: 0.14rem 0.14rem 0.3rem;
    border-radius: 6px;
    font-size: 0.8rem;
  }

  header nav a {
    padding: 0.46rem 0.68rem;
    border-radius: 4px;
    white-space: nowrap;
  }

  .post-head {
    flex-direction: column;
  }

  .post-date {
    border-left: none;
    border-top: 1px solid rgba(110, 49, 69, 0.1);
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-next {
    align-items: flex-start;
    text-align: left;
    padding-right: 0;
    padding-left: 1rem;
    border-right: none;
    border-left: 1px solid rgba(110, 49, 69, 0.2);
    background: linear-gradient(90deg, rgba(110, 49, 69, 0.06) 0%, rgba(110, 49, 69, 0.01) 55%, rgba(110, 49, 69, 0) 100%);
  }

  footer {
    flex-direction: column;
    gap: 1.5rem;
  }

  .footer-right {
    text-align: left;
  }

  .lightbox-close,
  .lightbox-full {
    top: 0.9rem;
    padding: 0.46rem 0.68rem;
    font-size: 0.68rem;
  }

  .lightbox-close {
    right: 0.9rem;
  }

  .lightbox-full {
    right: 4.5rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 2.7rem;
    height: 2.7rem;
  }

  .lightbox-prev { left: 0.65rem; }
  .lightbox-next { right: 0.65rem; }

  .lightbox-counter {
    bottom: 0.95rem;
    padding: 0.42rem 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-main::before,
  .about-section-title,
  .about-word,
  .about-word.typing-cursor::after {
    animation: none;
  }

  .about-section-title,
  .about-word {
    opacity: 1;
    color: var(--accent);
    text-shadow: none;
  }
}
.footer-archive a.active {
  color: var(--green);
}

/* --- Toolbar (size slider + year filter) --- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  width: min(var(--layout-w), 100%);
  margin: 0 auto 1.35rem;
  padding: 0 min(30px, 5vw);
}

.toolbar-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  border-bottom: 1px solid rgba(110, 49, 69, 0.14);
}

.toolbar-panel-archive {
  flex: 1;
  justify-content: space-between;
  padding: 0.2rem 0 0.45rem;
 }

.toolbar-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d6a888;
  white-space: nowrap;
}

.toolbar-years-wrap {
  position: relative;
}

.toolbar-years {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.year-indicator {
  position: absolute;
  bottom: -3px;
  left: 0;
  height: 1px;
  background: var(--green);
  transition: width 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.toolbar-years li + li::before {
  content: '·';
  padding: 0 10px;
  color: var(--mono-dim);
  opacity: 0.4;
}

.toolbar-years a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: #cda590;
  letter-spacing: 0.1em;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s;
  text-transform: uppercase;
}

.toolbar-years a:hover { color: var(--text); }

.toolbar-years a.active {
  color: var(--green);
}

@media (max-width: 600px) {
  .toolbar {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1rem;
  }

  .toolbar-panel {
    width: 100%;
  }

  .toolbar-panel-archive {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr !important; gap: 20px; }
  .gallery-thumb { aspect-ratio: 4/3; }
  .toolbar {
    margin-bottom: 0.85rem;
  }
  .toolbar-right {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .toolbar-years {
    justify-content: flex-start;
  }
}

@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.gallery-grid.view-list .gallery-item a {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(110, 49, 69, 0.1);
}

.gallery-grid.view-list .gallery-thumb-wrap {
  flex-shrink: 0;
  width: 80px;
  box-shadow: none;
}

.gallery-grid.view-list .gallery-thumb {
  width: 80px;
  height: 50px;
  aspect-ratio: unset;
  border-radius: 2px;
}

.gallery-grid.view-list .gallery-meta {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.gallery-grid.view-list .gallery-date {
  border-radius: 0;
  padding: 0;
}

/* --- Scroll to top button --- */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 36px;
  height: 36px;
  background: var(--bg);
  color: var(--green);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top:hover {
  transform: translateY(-2px);
}

/* --- Hover transform --- */
.gallery-thumb img,
.post-figure img {
  transition: transform 0.45s ease, opacity 0.3s ease;
}

.gallery-item:hover .gallery-thumb img.loaded {
  transform: scale(1.012);
  opacity: 0.92;
}

/* --- Page transitions --- */
body {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fade-out {
  animation: fadeOut 0.25s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* --- Card cascade entry animation --- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gallery-item {
  animation: cardIn 0.4s ease both;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 18, 22, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  opacity: 0;
  cursor: zoom-in;
  transition: opacity 0.2s ease;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-img.visible {
  opacity: 1;
}

.lightbox-close,
.lightbox-full,
.lightbox-prev,
.lightbox-next,
.lightbox-counter {
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(36, 24, 31, 0.78);
  border: 1px solid rgba(245, 154, 74, 0.12);
  box-shadow: inset 0 0 0 1px rgba(245, 154, 74, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-close {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.52rem 0.8rem;
  border-radius: 4px;
  transition: color 0.18s, background-color 0.18s, transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  z-index: 201;
}

.lightbox-close:hover {
  color: #f6d0b2;
  background: rgba(245, 154, 74, 0.07);
  border-color: rgba(245, 154, 74, 0.22);
  box-shadow: inset 0 0 0 1px rgba(245, 154, 74, 0.08);
  transform: translateY(-1px);
}

.lightbox-full {
  position: fixed;
  top: 1.2rem;
  right: 5rem;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.52rem 0.8rem;
  border-radius: 4px;
  text-decoration: none;
  transition: color 0.18s, background-color 0.18s, transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  z-index: 201;
}

.lightbox-full:hover {
  color: #f6d0b2;
  background: rgba(245, 154, 74, 0.07);
  border-color: rgba(245, 154, 74, 0.22);
  box-shadow: inset 0 0 0 1px rgba(245, 154, 74, 0.08);
  transform: translateY(-1px);
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  cursor: pointer;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s, background-color 0.18s, transform 0.18s, box-shadow 0.18s, border-color 0.18s, opacity 0.18s;
  z-index: 201;
  user-select: none;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev:hover,
.lightbox-next:hover {
  color: #f6d0b2;
  background: rgba(245, 154, 74, 0.07);
  border-color: rgba(245, 154, 74, 0.22);
  box-shadow: inset 0 0 0 1px rgba(245, 154, 74, 0.08);
  transform: translateY(-50%) scale(1.03);
}

.lightbox-prev.hidden,
.lightbox-next.hidden { opacity: 0; pointer-events: none; }

.lightbox-counter {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.45rem 0.78rem;
  border-radius: 999px;
  color: #f6d0b2;
  z-index: 201;
}

/* --- 404 page --- */
.error-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 20rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  margin: 0;
}

.error-msg {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  color: var(--mono-dim);
  margin: 0.8rem 0 2rem;
}

.error-back {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--green);
  transition: opacity 0.2s;
}

.error-back:hover { opacity: 0.7; }

/* --- Works counter --- */
.works-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: #d2ac98;
  letter-spacing: 0.08em;
  white-space: nowrap;
  line-height: 1;
  align-self: center;
  padding: 0.2rem 0 0.2rem 0.8rem;
  border-left: 1px solid rgba(110, 49, 69, 0.12);
  background: transparent;
  border-radius: 0;
}

/* --- Toolbar right group --- */
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

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

header, main, footer, .toolbar {
  position: relative;
  z-index: 1;
}

/* --- Card hover --- */
.gallery-thumb-wrap {
  position: relative;
}

.gallery-thumb-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s ease;
  z-index: 2;
}

.gallery-item:hover .gallery-thumb-wrap::before {
  transform: scaleX(1);
}

.gallery-thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  mix-blend-mode: overlay;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.gallery-item:hover .gallery-thumb-wrap::after {
  opacity: 0.12;
}

.gallery-thumb-wrap {
  transition: box-shadow 0.28s ease, transform 0.28s ease;
}

.gallery-item:hover .gallery-thumb-wrap {
  transform: translateY(-1px);
  box-shadow: rgba(0, 0, 0, 0.24) 8px 10px 18px -4px;
}

.gallery-item:hover .gallery-title {
  color: var(--text);
}

.gallery-item:hover .gallery-date {
  color: #f1c59f;
  background: rgba(245, 154, 74, 0.08);
  border-left-color: rgba(245, 154, 74, 0.18);
}

.gallery-item:hover .gallery-head {
  border-color: rgba(110, 49, 69, 0.35);
  background: linear-gradient(90deg, rgba(110, 49, 69, 0.16) 0%, rgba(110, 49, 69, 0.06) 100%);
  box-shadow: inset 0 -1px 0 rgba(110, 49, 69, 0.15), 0 6px 14px rgba(0, 0, 0, 0.08);
}
