/*
Theme Name: ZHUPANICH
Theme URI: https://zhupanich.com
Author: Matija Zhupanich
Author URI: https://zhupanich.com
Description: Standalone, modern custom WordPress spatial theme for visual archives, design systems, photography, and essays.
Version: 1.6.0
Text Domain: zhupanich
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --bg: #0e0e10;
  --card-bg: #161619;
  --card-dim: rgba(0, 0, 0, 0.55);
  --text: #ecece9;
  --subtext: #8e8e8b;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.25);
  --radius: 0px;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'Xanh Mono', monospace;
  font-weight: 400;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 140px 0 0 0;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.article-date {
  font-size: 10px;
  font-family: monospace;
  color: var(--subtext);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* --- UNIFIED CONTAINER ALIGNMENT --- */
.container-aligned {
  width: 90%;
  max-width: 1800px;
  margin: 0 auto;
}

/* --- TOP HEADER NAV --- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  padding: 36px 0;
  pointer-events: none;
  transition: padding 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, border-color 0.3s ease;
}

.top-nav.is-scrolled {
  padding: 16px 0;
  background: rgba(14, 14, 16, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.top-nav-inner > *,
.brand-group > * {
  pointer-events: auto;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.brand-mark {
  font-size: 16px;
  font-weight: 600;
  font-family: monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  transition: opacity 0.2s ease;
  order: 1;
}

.brand-mark:hover {
  opacity: 0.8;
}

/* Top Back to Archive Button (Single Post) */
.top-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--subtext);
  font-family: monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: all 0.2s ease;
  order: 2;
}

.top-back-link:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.08);
}

/* Nav Controller & Collapse Toggle */
.nav-controller {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  order: 3;
}

.nav-collapse-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-hover);
  color: var(--text);
  font-family: monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.nav-collapse-toggle:hover,
.nav-controller.is-open .nav-collapse-toggle {
  background: #ffffff;
  color: #0c0c0d;
  border-color: #ffffff;
}

.nav-current-filter {
  color: var(--subtext);
  font-weight: 400;
  transition: color 0.2s ease;
}

.nav-collapse-toggle:hover .nav-current-filter,
.nav-controller.is-open .nav-collapse-toggle .nav-current-filter {
  color: #0c0c0d;
}

.nav-collapse-arrow {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-controller.is-open .nav-collapse-arrow {
  transform: rotate(45deg);
}

.menu-filters {
  display: flex;
  gap: 8px;
}

.menu-filters button {
  background: none;
  border: none;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--subtext);
  transition: all 0.2s ease;
}

.menu-filters button.active,
.menu-filters button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

/* Scrolled state: collapse nav into button right next to the logo */
.top-nav.is-scrolled .brand-group {
  gap: 14px;
  flex: none;
}

.top-nav.is-scrolled .brand-mark {
  order: 1;
}

.top-nav.is-scrolled .nav-controller {
  order: 2;
  margin-left: 0;
}

.top-nav.is-scrolled .top-back-link {
  order: 3;
}

.top-nav.is-scrolled .nav-collapse-toggle {
  display: inline-flex;
}

.top-nav.is-scrolled .menu-filters {
  display: none;
}

.top-nav.is-scrolled .nav-controller.is-open .menu-filters {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-hover);
  padding: 8px;
  gap: 4px;
  min-width: 175px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  z-index: 1002;
  animation: navDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes navDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.top-nav.is-scrolled .nav-controller.is-open .menu-filters button {
  text-align: left;
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-family: monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-nav.is-scrolled .nav-controller.is-open .menu-filters button.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
}

/* Mobile Hamburger Menu Button */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 12px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  align-items: center;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text);
  transition: all 0.3s ease;
}

/* --- FLAT CURSOR (FULLSCREEN EXPAND BADGE) --- */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
  will-change: transform;
}

.cursor-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  font-family: monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0c0c0d;
  background: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.cursor-expand-icon {
  width: 11px;
  height: 11px;
  stroke: #0c0c0d;
  flex-shrink: 0;
}

.artifact.interactive {
  cursor: none !important;
}

/* --- CANVAS GRID ENGINE --- */
.canvas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
  gap: 56px;
  align-items: start;
}

.artifact {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.3s ease, transform 0.3s ease;
  transform: translateY(var(--shift, 0px));
  will-change: transform;
}

.artifact .dim-overlay {
  position: absolute;
  inset: 0;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.artifact.interactive:hover .dim-overlay {
  opacity: 0.55;
}

.artifact.interactive:hover {
  border-color: var(--border-hover);
}

/* Pinned Sticky Post Styling */
.artifact.is-sticky {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.05);
}

.pinned-badge-above {
  background: #ffffff;
  color: #0c0c0d;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-bottom: 8px;
  z-index: 5;
  position: relative;
}

.pinned-badge-above svg {
  width: 13px;
  height: 13px;
  stroke: #0c0c0d;
}

/* --- CLASSIC HERO SECTION --- */
.classic-hero {
  margin-bottom: 120px;
  padding-bottom: 16px;
  border-bottom: none;
}

.hero-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: monospace;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}

.classic-hero h1 {
  font-size: clamp(38px, 6vw, 84px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #ffffff;
  margin-bottom: 24px;
}

.hero-subhead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--subtext);
  max-width: 720px;
  margin-bottom: 32px;
}

/* --- HERO MAIN ROW (HEADLINE + ABOUT THE AUTHOR) --- */
.hero-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}

.hero-main h1 {
  margin-bottom: 0;
}

/* --- ABOUT THE AUTHOR WIDGET --- */
.author-widget {
  position: relative;
  flex-shrink: 0;
  z-index: 50;
}

.author-toggle {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--text);
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 18px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.author-toggle:hover,
.author-widget.is-open .author-toggle {
  background: #ffffff;
  color: #0c0c0d;
  border-color: #ffffff;
}

.author-toggle-icon {
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.author-widget.is-open .author-toggle-icon {
  transform: rotate(45deg);
}

.author-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: auto;
  width: min(560px, 90vw);
  display: flex;
  gap: 24px;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border-hover);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top left;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.author-panel[hidden] {
  display: none;
}

.author-widget.is-open .author-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.author-photo {
  flex: 0 0 160px;
  width: 160px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg);
}

.author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-text {
  flex: 1;
  min-width: 0;
  max-height: 320px;
  overflow-y: auto;
}

.author-name {
  font-size: 28px;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 12px;
}

.author-bio {
  font-size: 14px;
  line-height: 1.7;
  color: var(--subtext);
}

.author-bio p + p {
  margin-top: 12px;
}

.author-bio a {
  color: var(--text);
  text-decoration: underline;
}


/* --- MODAL TYPES & CARD VARIANTS --- */

/* Photography Modal — ORIGINAL ASPECT RATIO (NO CROPPING)
   The card itself is a transparent wrapper: a white "tab" sits flush on top-right,
   attached directly to the bordered .photo-frame that holds the image. */
.modal-photo {
  background: transparent;
  border: none;
  height: auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  overflow: visible;
}

.modal-photo .photo-frame {
  position: relative;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.modal-photo.interactive:hover .photo-frame {
  border-color: var(--border-hover);
}

.modal-photo.is-sticky {
  border: none;
  box-shadow: none;
}

.modal-photo.is-sticky .photo-frame {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.05);
}

.modal-photo img {
  width: 100%;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-photo:hover img {
  transform: scale(1.02);
}

.photo-tag {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  align-self: flex-end !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  left: auto !important;
  right: 0 !important;
  background: #ffffff !important;
  color: #0c0c0d !important;
  padding: 6px 14px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  font-family: monospace !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  text-align: right !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  z-index: 5 !important;
}

/* Design Case Study Modal */
.modal-design {
  padding: 36px 30px;
  min-height: 380px;
  background: var(--card-bg);
}
.design-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 3;
}
.design-preview {
  margin: 48px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  z-index: 3;
}
.design-preview h3 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.design-footer {
  font-size: 11px;
  color: var(--subtext);
  font-family: monospace;
  z-index: 3;
}

/* Writing / Essay Modal */
.modal-writing {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 24px 8px;
}
.modal-writing .dim-overlay { display: none; }
.modal-writing .essay-tag {
  font-size: 11px;
  font-family: monospace;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.modal-writing h2 {
  font-family: 'Xanh Mono', monospace;
  font-size: 36px;
  line-height: 1.15;
  margin-bottom: 18px;
  font-weight: normal;
  letter-spacing: -0.02em;
  color: #ffffff;
  transition: color 0.2s ease;
}
.modal-writing.interactive:hover h2 { color: #cfcfd4; }
.modal-writing p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--subtext);
}
.modal-writing .design-footer { margin-top: 18px; }

/* Link / Bookmark Modal (One Column, No Background) */
.artifact.modal-link {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 12px 0;
  justify-content: flex-start;
  align-items: flex-start;
  min-height: auto;
  overflow: visible;
}

.artifact.modal-link .dim-overlay {
  display: none !important;
}

.artifact.modal-link.is-sticky {
  border: none !important;
  box-shadow: none !important;
}

.modal-link-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.modal-link-title {
  font-family: 'Xanh Mono', monospace;
  font-size: 36px;
  line-height: 1.15;
  font-weight: normal;
  letter-spacing: -0.02em;
  color: #3b82f6; /* default link blue */
  text-decoration: underline;
  text-underline-offset: 6px;
  transition: color 0.2s ease;
  word-break: break-word;
}

.artifact.modal-link.interactive:hover .modal-link-title {
  color: #60a5fa;
}

.modal-link-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--subtext);
  margin: 0;
}

/* Apple Stickies Note Modal */
.modal-note {
  padding: 26px 22px 22px 22px;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  min-height: 180px;
}
.modal-note::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.modal-note .dim-overlay {
  background: rgba(0, 0, 0, 0.12);
}

/* Yellow Stickie (Default) */
.modal-note,
.modal-note.sticky-yellow {
  background: #fcf4a7;
  border: 1px solid #f6de59;
  color: #1c1917;
}
.modal-note .note-label,
.modal-note.sticky-yellow .note-label {
  font-size: 10px;
  font-family: monospace;
  color: #713f12;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  z-index: 3;
}
.modal-note p,
.modal-note.sticky-yellow p {
  font-size: 14px;
  line-height: 1.65;
  color: #292524;
  font-weight: 500;
  z-index: 3;
}

/* Pink Stickie */
.modal-note.sticky-pink {
  background: #fbcfe8;
  border: 1px solid #f9a8d4;
  color: #4c0519;
}
.modal-note.sticky-pink .note-label { color: #9f1239; }
.modal-note.sticky-pink p { color: #701a75; }

/* Green Stickie */
.modal-note.sticky-green {
  background: #c3fdaa;
  border: 1px solid #98ed79;
  color: #064e3b;
}
.modal-note.sticky-green .note-label { color: #14532d; }
.modal-note.sticky-green p { color: #14532d; }

/* Blue Stickie */
.modal-note.sticky-blue {
  background: #bcf2fd;
  border: 1px solid #7ee0f9;
  color: #0c4a6e;
}
.modal-note.sticky-blue .note-label { color: #0369a1; }
.modal-note.sticky-blue p { color: #0c4a6e; }

/* Purple Stickie */
.modal-note.sticky-purple {
  background: #bac9fb;
  border: 1px solid #8da3f8;
  color: #1e1b4b;
}
.modal-note.sticky-purple .note-label { color: #3730a3; }
.modal-note.sticky-purple p { color: #1e1b4b; }

/* Telemetry & Stats Modal */
.modal-stats {
  padding: 32px 28px;
  background: #111113;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
}
.modal-stats .stats-header {
  font-size: 11px;
  font-family: monospace;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.modal-stats .stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}
.modal-stats .stat-val {
  font-size: 26px;
  font-family: monospace;
  font-weight: 600;
  color: #ffffff;
}
.modal-stats .stat-lbl {
  font-size: 10px;
  font-family: monospace;
  color: var(--subtext);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Code Modal */
.modal-code {
  padding: 24px 22px;
  background: #09090b;
  border: 1px solid var(--border);
  font-family: monospace;
  font-size: 12px;
  line-height: 1.6;
  min-height: 220px;
}
.modal-code .code-header {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--subtext);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.modal-code pre {
  color: #34d399;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 11px;
}

/* Sticker (Unclickable) */
.modal-sticker {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: monospace;
  font-size: 12px;
  color: var(--subtext);
  pointer-events: none;
}

/* 2-Column Spanning Cards */
.span-2, .artifact.wide, .modal-photo.wide, .modal-writing.wide {
  grid-column: span 2 !important;
}

.modal-writing.wide {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  padding: 44px 40px !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 360px;
}
.modal-writing.wide .dim-overlay { display: block; }
.modal-writing.wide h2 {
  font-family: 'Xanh Mono', monospace;
  font-size: 40px;
  line-height: 1.15;
  margin-bottom: 20px;
  color: #ffffff;
  transition: color 0.2s ease;
  z-index: 3;
}
.modal-writing.wide.interactive:hover h2 { color: #cfcfd4; }
.modal-writing.wide p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--subtext);
  max-width: 92%;
  z-index: 3;
}
.modal-writing.wide .essay-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-family: monospace;
  font-size: 11px;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 3;
}

/* --- DEDICATED SINGLE POST VIEW STYLES (EXACT LEFT ALIGNMENT WITH LOGO) --- */
.single-post-container {
  /* Inherits .container-aligned (width: 90%; max-width: 1800px; margin: 0 auto) */
}

.single-back-nav {
  margin-bottom: 48px;
}

.single-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtext);
  padding: 8px 16px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.single-back-link:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.05);
}

.single-hero-header {
  margin-bottom: 56px;
}

.single-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: monospace;
  font-size: 11px;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.single-meta-tag {
  color: var(--text);
  border: 1px solid var(--border);
  padding: 3px 8px;
}

.single-post-title {
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 24px;
}

/* Media Stage - ORIGINAL UNCROPPED ASPECT RATIO (LEFT-ALIGNED) */
.single-media-stage {
  margin-bottom: 64px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 1300px;
  margin-left: 0;
  margin-right: auto;
}

.single-media-stage img {
  width: 100%;
  height: auto !important;
  max-height: 850px !important;
  object-fit: contain !important;
  display: block;
}

/* Featured Photo - NO FRAME, NATURAL SIZE, LEFT-ALIGNED */
.single-media-stage.single-media-photo {
  background: none;
  border: none;
  overflow: visible;
  max-width: 100%;
}

.single-media-stage.single-media-photo img {
  width: auto;
  max-width: 100%;
  height: auto !important;
  max-height: 850px !important;
  margin: 0 auto 0 0;
}

.single-content-body {
  font-size: 18px;
  line-height: 1.8;
  color: #d1d1d6;
  max-width: 900px;
  margin-left: 0;
  margin-right: auto;
  margin-bottom: 80px;
}

.single-content-body p {
  margin-bottom: 28px;
}

.single-content-body img {
  display: block;
  max-width: 100%;
  height: auto !important;
  margin: 32px auto 32px 0;
}

.single-content-body h2, 
.single-content-body h3 {
  color: #ffffff;
  margin-top: 48px;
  margin-bottom: 20px;
}

.single-content-body blockquote {
  border-left: 2px solid var(--border-hover);
  padding-left: 24px;
  font-style: italic;
  color: var(--subtext);
  margin: 36px 0;
}

.single-content-body code {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  font-size: 0.9em;
  color: #34d399;
}

/* Monospace Key-Value Spec Grid */
.single-specs-section {
  border-top: 1px solid var(--border);
  padding-top: 48px;
  margin-top: 64px;
  max-width: 1300px;
  margin-left: 0;
  margin-right: auto;
}

.single-specs-title {
  font-family: monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtext);
  margin-bottom: 24px;
}

.single-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 32px;
}

.single-spec-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: monospace;
}

.single-spec-label {
  font-size: 10px;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.single-spec-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* --- SINGLE: PREVIOUS / NEXT ARTIFACT NAV --- */
.single-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 96px;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 180px;
  padding: 32px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.post-nav-next {
  align-items: flex-end;
  text-align: right;
}

a.post-nav-link:hover {
  border-color: var(--border-hover);
  background: #19191c;
}

.post-nav-label {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtext);
  transition: color 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

a.post-nav-link:hover .post-nav-label {
  color: var(--text);
}

a.post-nav-prev:hover .post-nav-label { transform: translateX(-6px); }
a.post-nav-next:hover .post-nav-label { transform: translateX(6px); }

.post-nav-title {
  font-family: 'Xanh Mono', monospace;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-top: auto;
}

.post-nav-meta {
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtext);
}

.post-nav-link.is-empty {
  background: transparent;
  border-style: dashed;
}

.post-nav-link.is-empty .post-nav-title {
  color: var(--subtext);
  opacity: 0.6;
}

/* --- SINGLE: RELATED ARTIFACTS --- */
.single-related {
  margin-top: 120px;
}

.single-related-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-bottom: 20px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.single-related-title {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtext);
}

.single-related-all {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtext);
  transition: color 0.2s ease;
}

.single-related-all:hover {
  color: var(--text);
}

/* --- CANVAS PAGINATION --- */
.canvas-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 120px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pagination-step {
  padding: 12px 18px;
  border: 1px solid var(--border-hover);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

a.pagination-step:hover {
  background: #ffffff;
  color: #0c0c0d;
  border-color: #ffffff;
}

.pagination-step.is-disabled {
  border-color: var(--border);
  color: var(--subtext);
  opacity: 0.4;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.pagination-num,
.pagination-gap {
  display: inline-block;
  min-width: 40px;
  padding: 10px 8px;
  text-align: center;
  color: var(--subtext);
  transition: color 0.2s ease, background 0.2s ease;
}

a.pagination-num:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.pagination-num.is-current {
  background: #ffffff;
  color: #0c0c0d;
  font-weight: 700;
}

.pagination-count {
  display: none;
  color: var(--subtext);
}

/* --- SITE FOOTER --- */
.site-footer {
  margin-top: 120px;
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-contact-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 32px;
}

.footer-email {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 18px;
  border: 1px solid var(--border-hover);
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.footer-email:hover {
  background: #ffffff;
  color: #0c0c0d;
  border-color: #ffffff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 32px;
  padding-top: 0;
  border-top: none;
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtext);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
}

.footer-links a,
.footer-top-btn {
  color: var(--subtext);
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-top-btn:hover {
  color: var(--text);
}

.footer-time {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-clock {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.footer-top-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

/* --- RESPONSIVE BREAKPOINTS & MOBILE HAMBURGER --- */
@media (max-width: 1024px) {
  .canvas-grid { grid-template-columns: 1fr; gap: 36px; }
  .span-2, .artifact.wide { grid-column: span 1 !important; }
  .artifact { transform: none !important; }
}

@media (max-width: 768px) {
  .container-aligned { width: 92%; }
  .top-nav { padding: 20px 0; }
  .mobile-menu-toggle { display: flex; }
  .top-nav.is-scrolled .mobile-menu-toggle { display: none; }

  .top-back-link {
    font-size: 10px;
    padding: 6px 10px;
    gap: 6px;
  }

  .menu-filters {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
    gap: 8px;
    min-width: 180px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
    z-index: 1001;
  }

  .menu-filters.mobile-open {
    display: flex;
  }

  .classic-hero { margin-bottom: 72px; padding-bottom: 12px; }
  .hero-main { flex-direction: column; align-items: flex-start; gap: 28px; }
  .author-panel { left: 0; right: auto; transform-origin: top left; flex-direction: column; }
  .author-photo { flex: none; width: 140px; }
  .author-text { max-height: none; }
  .classic-hero h1 { font-size: 36px; }
  .hero-subhead { font-size: 15px; }
  .custom-cursor { display: none !important; }
  .artifact.interactive { cursor: pointer !important; }

  .single-post-nav { grid-template-columns: 1fr; gap: 16px; margin-top: 64px; }
  .post-nav-link { min-height: 0; padding: 24px; }
  .single-related { margin-top: 80px; }
  .single-related-header { margin-bottom: 32px; }

  .canvas-pagination { margin-top: 72px; }
  .pagination-pages { display: none; }
  .pagination-count { display: inline; }

  .site-footer { margin-top: 80px; padding-top: 40px; }
  .footer-contact-row { margin-bottom: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .brand-group { gap: 10px; }
  .top-nav.is-scrolled .brand-group { gap: 8px; }
  .top-back-link { padding: 5px 8px; font-size: 10px; }
}

