/* ==============================================================================
   NOTHING HEXO THEME - MAIN STYLESHEET
   Consistent with www.hifuu.ink (Nothing Tech aesthetic)
   ============================================================================== */

/* --- TYPOGRAPHY (NOTHING FONT SYSTEM) --- */
@font-face {
  font-family: 'Ndot';
  src: url('/fonts/Ndot57-Regular.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NdotCaps';
  src: url('/fonts/Ndot57Caps-Regular.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NType';
  src: url('/fonts/NType82-Headline.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NTypeRegular';
  src: url('/fonts/NType82-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LetteraMono';
  src: url('/fonts/LetteraMonoLL-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LetteraMonoMedium';
  src: url('/fonts/LetteraMonoLL-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'InterMedium';
  src: url('/fonts/Inter-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --- COLOR TOKENS --- */
:root {
  --bg: #090909;
  --bg-dots: rgba(255, 255, 255, 0.07);
  --surface: #131313;
  --surface-elevated: #1a1a1a;
  --surface-hover: #202020;
  --border: #232323;
  --border-light: #2e2e2e;
  --text-main: #f5f5f7;
  --text-muted: #8e8e93;
  --text-dim: #48484a;
  --red: #d71921;
  --red-glow: rgba(215, 25, 33, 0.35);
  --red-subtle: rgba(215, 25, 33, 0.12);
  --glyph-led: rgba(255, 255, 255, 0.88);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --tape-bg: rgba(255, 255, 255, 0.04);
  --tape-border: rgba(255, 255, 255, 0.1);
  --code-bg: #0e0e0e;
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-dots: rgba(0, 0, 0, 0.05);
  --surface: #ffffff;
  --surface-elevated: #fbfbfb;
  --surface-hover: #f0f0f3;
  --border: #e3e3e8;
  --border-light: #d1d1d6;
  --text-main: #111113;
  --text-muted: #6e6e73;
  --text-dim: #aeaeaf;
  --red: #d71921;
  --red-glow: rgba(215, 25, 33, 0.2);
  --red-subtle: rgba(215, 25, 33, 0.08);
  --glyph-led: rgba(0, 0, 0, 0.7);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --tape-bg: rgba(0, 0, 0, 0.03);
  --tape-border: rgba(0, 0, 0, 0.08);
  --code-bg: #f8f9fa;
}

/* --- RESET & FOUNDATION --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

[id] {
  scroll-margin-top: 96px;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dots) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--red);
  color: #ffffff;
}

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

/* --- UTILITY CLASSES --- */
.mono {
  font-family: 'LetteraMono', monospace;
  letter-spacing: -0.02em;
}

.ndot {
  font-family: 'Ndot', monospace;
  letter-spacing: 0.05em;
}

.ntype {
  font-family: 'NType', sans-serif;
}

.tape-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--tape-bg);
  border: 1px dashed var(--tape-border);
  border-radius: 4px;
  font-family: 'LetteraMono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.red-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background-color: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--red-glow);
}

.pulsing {
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 20px 80px;
}

/* --- NOTHING HEADER & NAVBAR --- */
header.nothing-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  margin-bottom: 28px;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 16px;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-radius 0.25s ease, background-color 0.25s ease;
}

header.nothing-bar.menu-open {
  border-radius: var(--radius-lg);
}

.nothing-bar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.sys-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Ndot', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.sys-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 18px);
  list-style: none;
  flex-shrink: 0;
}

.sys-nav a {
  font-family: 'LetteraMono', monospace;
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: color 0.2s;
}

.sys-nav a:hover,
.sys-nav a.active {
  color: var(--text-main);
}

.sys-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
}

/* Mobile Hamburger Toggle */
.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  transition: all 0.2s ease;
}

.menu-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
}

.menu-icon-line {
  width: 14px;
  height: 1.5px;
  background: var(--text-main);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-btn.active .menu-icon-line:nth-child(1) {
  transform: translateY(3.25px) rotate(45deg);
}

.menu-btn.active .menu-icon-line:nth-child(2) {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* Mobile Navigation Dropdown */
.mobile-menu-drawer {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 10px;
  box-sizing: border-box;
  z-index: 101;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-drawer.open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 6px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: 'LetteraMono', monospace;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  background: var(--surface-elevated);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link:active,
.mobile-nav-link.active {
  color: var(--text-main);
  border-color: var(--border);
  background: var(--surface-hover);
}

.mobile-nav-link .nav-num {
  color: var(--red);
  font-family: 'Ndot', monospace;
  font-size: 11px;
}

/* --- BENTO CARDS --- */
.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bento-card:hover {
  border-color: var(--border-light);
}

.corner-crosshair {
  position: absolute;
  font-family: 'LetteraMono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  user-select: none;
  pointer-events: none;
  line-height: 1;
}
.corner-crosshair.tl { top: 12px; left: 12px; }
.corner-crosshair.tr { top: 12px; right: 12px; }
.corner-crosshair.bl { bottom: 12px; left: 12px; }
.corner-crosshair.br { bottom: 12px; right: 12px; }

.card-meta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.card-tag {
  font-family: 'LetteraMono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-id {
  font-family: 'Ndot', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

/* --- HERO / PROFILE BANNER WIDGETS --- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-body {
  display: flex;
  gap: 20px;
  align-items: center;
}

.avatar-wrapper {
  position: relative;
  width: 86px;
  height: 86px;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-light);
}

.avatar-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'LetteraMono', monospace;
  font-size: 9px;
  color: var(--text-main);
}

.name-title {
  font-family: 'Ndot', monospace;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.handle-spec {
  font-family: 'LetteraMono', monospace;
  font-size: 12px;
  color: var(--red);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.tagline {
  font-size: 13px;
  color: var(--text-muted);
}

/* --- TYPEWRITER SUBTITLE BOX --- */
.typewriter-box {
  margin-top: 18px;
  padding: 10px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'LetteraMono', monospace;
  font-size: 12.5px;
  user-select: none;
  transition: border-color 0.2s;
}

.typewriter-box:hover {
  border-color: var(--border-light);
}

.typewriter-prompt {
  color: var(--red);
  font-weight: 700;
  flex-shrink: 0;
}

.typewriter-text {
  color: var(--text-main);
  letter-spacing: 0.03em;
  font-weight: 500;
}

.typewriter-cursor {
  color: var(--red);
  font-weight: 700;
  animation: blink 1s infinite;
  flex-shrink: 0;
}

.clock-display {
  text-align: center;
  padding: 10px 0;
}

.clock-digits {
  font-family: 'Ndot', monospace;
  font-size: 34px;
  color: var(--text-main);
  letter-spacing: 0.06em;
  line-height: 1;
  margin-bottom: 6px;
}

.clock-colon {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}

.clock-meta {
  font-family: 'LetteraMono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.glyph-light-bar {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.glyph-led-strip {
  display: flex;
  gap: 5px;
  align-items: center;
}

.glyph-led {
  width: 12px;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
}

.glyph-led.active {
  background: var(--glyph-led);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.glyph-led.red {
  background: var(--red);
  box-shadow: 0 0 6px var(--red-glow);
}

/* --- POST LIST / CARDS --- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.post-card {
  padding: 24px;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}

.post-card-title {
  font-family: 'NType', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 10px;
  display: inline-block;
  transition: color 0.2s;
}

.post-card-title:hover {
  color: var(--red);
}

.post-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-family: 'LetteraMono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
}

.post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

/* --- SECTION TITLE HEADINGS --- */
.section-title-wrap {
  margin: 36px 0 20px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-num {
  font-family: 'Ndot', monospace;
  font-size: 18px;
  color: var(--red);
}

.section-heading {
  font-family: 'Ndot', monospace;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-main);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(to right, var(--border) 0, var(--border) 4px, transparent 4px, transparent 8px);
}

/* --- ARTICLE SINGLE VIEW --- */
.article-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  position: relative;
}

.article-container.has-toc {
  grid-template-columns: minmax(0, 1fr) 260px;
}

.article-card {
  padding: 32px 36px;
}

.article-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.article-title {
  font-family: 'NType', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 14px;
}

.article-meta-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-family: 'LetteraMono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* TOC Floating Sidebar */
.toc-sidebar {
  position: sticky;
  top: 96px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-card {
  padding: 20px;
}

.toc-title {
  font-family: 'Ndot', monospace;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toc-content ol,
.toc-content ul {
  list-style: none;
  padding-left: 12px;
  margin: 0;
}

.toc-content > ol,
.toc-content > ul {
  padding-left: 0;
}

.toc-content li {
  margin: 6px 0;
}

.toc-content a {
  font-family: 'LetteraMono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  transition: color 0.2s;
  display: block;
}

.toc-content a:hover,
.toc-content .active > a {
  color: var(--red);
}

/* --- MOBILE INLINE & FLOATING TOC --- */
.mobile-inline-toc {
  display: none;
  margin-bottom: 24px;
}

.mobile-toc-accordion {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}

.mobile-toc-accordion:hover {
  border-color: var(--border-light);
}

.mobile-toc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-family: 'LetteraMono', monospace;
  font-size: 11.5px;
  color: var(--text-main);
  letter-spacing: 0.06em;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.mobile-toc-summary::-webkit-details-marker {
  display: none;
}

.mobile-toc-arrow {
  color: var(--text-muted);
  font-size: 10px;
  transition: transform 0.2s ease;
}

.mobile-toc-accordion[open] .mobile-toc-arrow {
  transform: rotate(180deg);
}

.mobile-toc-accordion-body {
  padding: 4px 16px 14px;
  border-top: 1px dashed var(--border);
  max-height: 350px;
  overflow-y: auto;
}

/* Mobile Floating Action Button (FAB) */
.mobile-toc-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 18px;
  z-index: 90;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.mobile-toc-fab:hover,
.mobile-toc-fab:active {
  background: var(--surface-hover);
  border-color: var(--border-light);
  transform: scale(1.03);
}

.mobile-toc-fab-text {
  font-family: 'LetteraMono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-main);
}

/* Mobile TOC Drawer Overlay */
.mobile-toc-drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.mobile-toc-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-toc-drawer-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 75vh;
  padding: 20px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(30px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.mobile-toc-drawer-overlay.active .mobile-toc-drawer-content {
  transform: translateY(0);
}

.mobile-toc-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.mobile-toc-close:hover {
  background: var(--surface-hover);
  border-color: var(--red);
  color: var(--red);
}

.mobile-toc-scrollable {
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 10px;
  flex: 1;
}

/* --- POST NAV (PREV / NEXT) --- */
.post-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 28px;
  width: 100%;
  box-sizing: border-box;
}

.post-nav-item {
  min-width: 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  box-sizing: border-box;
}

.post-nav-item:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.post-nav-item.next {
  text-align: right;
}

.post-nav-dir {
  font-family: 'LetteraMono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--red);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.post-nav-title {
  font-family: 'NType', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* --- PAGINATION --- */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
}

.pagination-btn,
.pagination-wrap a,
.pagination-wrap span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: 'LetteraMono', monospace;
  font-size: 12px;
  color: var(--text-main);
  transition: all 0.2s;
}

.pagination-wrap a:hover {
  border-color: var(--text-main);
  transform: translateY(-1px);
}

.pagination-wrap .current {
  background: var(--red-subtle);
  border-color: var(--red);
  color: var(--red);
  font-weight: 600;
}

/* --- ARCHIVE / TIMELINE --- */
.timeline-group {
  margin-bottom: 28px;
}

.timeline-year {
  font-family: 'Ndot', monospace;
  font-size: 24px;
  color: var(--text-main);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, transform 0.2s;
}

.timeline-item:hover {
  border-color: var(--border-light);
  transform: translateX(4px);
}

.timeline-date {
  font-family: 'LetteraMono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 90px;
}

.timeline-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
}

/* --- TAGS & CATEGORIES PILLS --- */
.cloud-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px;
}

.cloud-pill {
  padding: 8px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: 'LetteraMono', monospace;
  font-size: 12px;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.cloud-pill:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-subtle);
  transform: translateY(-2px);
}

.cloud-pill-count {
  font-size: 10px;
  padding: 1px 6px;
  background: var(--surface);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

/* --- FOOTER --- */
footer.nothing-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

/* --- FOOTER BARCODE & OPTICAL DECODER --- */
.footer-barcode-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  user-select: none;
}

.footer-barcode-wrap:hover {
  background: var(--surface);
}

.footer-barcode {
  position: relative;
  display: flex;
  gap: 3px;
  align-items: center;
  height: 22px;
  overflow: hidden;
  padding: 0 4px;
}

.barcode-line {
  height: 100%;
  background: var(--text-main);
  opacity: 0.65;
  transition: opacity 0.2s;
}

.footer-barcode-wrap:hover .barcode-line {
  opacity: 1;
}

.barcode-scan-beam {
  position: absolute;
  top: 0;
  left: -20px;
  width: 3px;
  height: 100%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  opacity: 0;
  pointer-events: none;
}

.footer-barcode-wrap:hover .barcode-scan-beam {
  opacity: 1;
  animation: scan-sweep 1.6s infinite ease-in-out;
}

@keyframes scan-sweep {
  0% { left: 0%; }
  50% { left: 100%; }
  100% { left: 0%; }
}

.barcode-hint {
  font-family: 'LetteraMono', monospace;
  font-size: 9.5px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-top: 5px;
  text-transform: uppercase;
  transition: color 0.2s;
}

.footer-barcode-wrap:hover .barcode-hint {
  color: var(--red);
}

/* Modal Overlay */
.barcode-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  padding: 20px;
}

.barcode-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.barcode-modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  padding: 28px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
}

.barcode-modal-overlay.active .barcode-modal-content {
  transform: translateY(0) scale(1);
}

.barcode-modal-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s;
}

.barcode-modal-close:hover {
  background: var(--surface-hover);
  border-color: var(--red);
  color: var(--red);
}

.barcode-decoder-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 18px;
}

@media (max-width: 560px) {
  .barcode-decoder-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

.barcode-qr-box {
  background: #ffffff;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.barcode-qr-box img {
  width: 130px;
  height: 130px;
  display: block;
}

.barcode-qr-label {
  font-family: 'LetteraMono', monospace;
  font-size: 9px;
  color: #666;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.barcode-decoded-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-main);
  background: var(--surface-elevated);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  position: relative;
}

.footer-text {
  font-family: 'LetteraMono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .article-container.has-toc { grid-template-columns: 1fr; }
  .toc-sidebar { display: none; }
  .mobile-inline-toc { display: block; }
  .mobile-toc-fab { display: inline-flex; }
  .mobile-toc-drawer-overlay { display: flex; }
}

@media (max-width: 880px) {
  header.nothing-bar {
    padding: 10px 18px;
  }
  .sys-nav { display: none; }
  .menu-btn { display: flex; }
  .mobile-menu-drawer { display: block; }
}

@media (max-width: 640px) {
  html { scroll-padding-top: 76px; }
  [id] { scroll-margin-top: 76px; }
  .container { padding: 20px 14px 60px; }
  header.nothing-bar {
    padding: 10px 14px;
  }
  .article-card { padding: 20px 18px; }
  .article-title { font-size: 22px; }
  .post-card-title { font-size: 17px; }
  .post-nav { grid-template-columns: 1fr; }
  .clock-digits { font-size: 28px; }
}
