/* ═══════════════════════════════════════════════════════════════════════════
   DVROOM.DEV — INDUSTRIAL TECHNICAL SPECIFICATION AESTHETIC
   Inspired by pharmaceutical packaging, equipment labeling, spec sheets
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Inter:wght@400;500;700;900&display=swap');

:root {
  /* Industrial color palette */
  --bg: #bfc2c4;
  --bg-dark: #a8abae;
  --text: #0a0a0a;
  --text-muted: #3a3a3a;
  --accent: #0a0a0a;
  --border: #0a0a0a;
  --highlight: #8a8d90;
  --wire-color: #3a3a3a;
  --wire-tip-grey: #555;

  /* Typography */
  --font-display: 'Inter', 'Arial Black', sans-serif;
  --font-mono: 'DM Mono', 'Consolas', monospace;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Spacing units */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1c1e;
    --bg-dark: #0f1012;
    --text: #d4d6d8;
    --text-muted: #8a8d90;
    --accent: #d4d6d8;
    --border: #d4d6d8;
    --highlight: #2a2c2e;
    --wire-color: #e8e8e8;
    --wire-tip-grey: #888;
  }
}

:root[data-theme="dark"] {
  --bg: #1a1c1e;
  --bg-dark: #0f1012;
  --text: #d4d6d8;
  --text-muted: #8a8d90;
  --accent: #d4d6d8;
  --border: #d4d6d8;
  --highlight: #2a2c2e;
  --wire-color: #e8e8e8;
  --wire-tip-grey: #888;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BASE RESET & TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTAINER & LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  position: relative;
  overflow: visible;
}

/* Decorative corner markers */
.container::before {
  content: '';
  position: fixed;
  top: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  border-left: 2px solid var(--border);
  border-top: 2px solid var(--border);
  opacity: 0.4;
  pointer-events: none;
}

.container::after {
  content: '';
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-right: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  opacity: 0.4;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--border);
  position: relative;
  overflow: visible;
}


.site-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.8rem;
  text-decoration: none;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  position: relative;
}

/* Retro track decoration element */
.header-decoration {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 var(--space-sm);
  position: relative;
}

.header-decoration svg {
  width: 100%;
  height: 30px;
  overflow: visible;
}

.wire-to-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 150px;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.wire-to-top svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.header-decoration svg path.wire {
  stroke: var(--wire-color) !important;
}

.header-decoration svg .tip-grey {
  fill: var(--wire-tip-grey) !important;
}

.site-title::before {
  content: '[ ';
  font-weight: 400;
  opacity: 0.5;
}

.site-title::after {
  content: ' ]';
  font-weight: 400;
  opacity: 0.5;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.nav a:hover {
  color: var(--text);
  border-color: var(--border);
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: var(--space-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--highlight);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INTRO / HERO SECTION
   ═══════════════════════════════════════════════════════════════════════════ */

.intro {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  padding: var(--space-md);
  border: 1px solid var(--border);
  position: relative;
  background:
    linear-gradient(135deg, transparent 10px, var(--bg) 10px);
}

.intro::before {
  content: 'OPERATOR_IDENT';
  position: absolute;
  top: -0.6em;
  left: var(--space-md);
  background: var(--bg);
  padding: 0 var(--space-sm);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.intro::after {
  content: '////';
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABBED CONTAINER - Folder style
   ═══════════════════════════════════════════════════════════════════════════ */

.tabbed-container {
  position: relative;
}

.filter-tabs {
  display: flex;
  align-items: flex-end;
  margin-bottom: 0;
  padding-left: var(--space-xs);
  position: relative;
}

.tab-content {
  border-top: 2px solid var(--border);
  padding-top: var(--space-lg);
}

.filter-tab {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6rem 1.8rem 0.6rem 1rem;
  background: var(--highlight);
  border: none;
  border-left: 2px solid var(--text-muted);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
  margin-right: -10px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 100%, 0 100%);
}

/* Stack tabs: leftmost on top, rightmost on bottom */
.filter-tab:nth-child(1) { z-index: 5; }
.filter-tab:nth-child(2) { z-index: 4; }
.filter-tab:nth-child(3) { z-index: 3; }
.filter-tab:nth-child(4) { z-index: 2; }

/* Top border - dim for unselected */
.filter-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 12px;
  height: 2px;
  background: var(--text-muted);
}

/* Diagonal edge line - consistent width, matches clip-path angle */
.filter-tab::after {
  content: '';
  position: absolute;
  top: 0;
  left: calc(100% - 14px);
  width: 2px;
  height: 100%;
  background: var(--text-muted);
  transform: skewX(21deg);
  transform-origin: top left;
  pointer-events: none;
}

.filter-tab:hover {
  color: var(--text);
}

.filter-tab.active {
  background: var(--bg);
  color: var(--text);
  z-index: 10 !important;
  padding-bottom: calc(0.6rem + 2px);
  margin-bottom: -2px;
  border-left-color: var(--text);
}

/* Bright top border when selected */
.filter-tab.active::before {
  background: var(--text);
}

/* Bright diagonal line when selected */
.filter-tab.active::after {
  background: var(--text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════════════════════════════════ */

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-header::before {
  content: '';
  flex: 0 0 30px;
  height: 1px;
  background: var(--border);
}

.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   POST LIST
   ═══════════════════════════════════════════════════════════════════════════ */

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.2s ease;
}

.post-list li:hover {
  background: var(--highlight);
}

/* Technical corner markers on post items */
.post-list li::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  border-left: 2px solid var(--border);
  border-top: 2px solid var(--border);
}

.post-list li::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
}

.post-list a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: var(--space-xs);
}

.post-list a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.date::before {
  content: '>';
  opacity: 0.5;
}

.summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--border);
  opacity: 0.8;
}

/* Item number indicator */
.post-list li {
  counter-increment: post-counter;
}

.post-item-number {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.post-item-number::before {
  content: 'ENTRY_' counter(post-counter, decimal-leading-zero);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pagination a {
  color: var(--text);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.pagination a:hover {
  background: var(--text);
  color: var(--bg);
}

.pagination a:first-child::before {
  content: '<<<';
  font-size: 0.7em;
}

.pagination a:last-child::after {
  content: '>>>';
  font-size: 0.7em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SINGLE POST / ARTICLE
   ═══════════════════════════════════════════════════════════════════════════ */

.post {
  position: relative;
}

.post h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  line-height: 1.1;
  margin: 0 0 var(--space-md);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: var(--space-lg);
}

.post h1::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text);
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  padding: var(--space-sm) var(--space-md);
  background: var(--highlight);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
}

.meta::before {
  content: 'PUBLISHED';
}

/* ═══════════════════════════════════════════════════════════════════════════
   ARTICLE CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */

.post h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: var(--space-xl) 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.post h2::before {
  content: '[';
  opacity: 0.4;
  margin-right: var(--space-xs);
}

.post h2::after {
  content: ']';
  opacity: 0.4;
  margin-left: var(--space-xs);
}

.post h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: var(--space-lg) 0 var(--space-md);
  color: var(--text-muted);
}

.post h3::before {
  content: '/// ';
  opacity: 0.5;
}

.post p {
  margin: 0 0 var(--space-md);
}

.post strong {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.post em {
  font-style: italic;
}

/* Links */
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all 0.15s ease;
}

a:hover {
  text-decoration-thickness: 2px;
  background: var(--highlight);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CODE BLOCKS
   ═══════════════════════════════════════════════════════════════════════════ */

pre,
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

code {
  background: var(--highlight);
  padding: 0.15em 0.4em;
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-dark);
  border: 2px solid var(--border);
  padding: var(--space-md);
  overflow-x: auto;
  position: relative;
  margin: var(--space-lg) 0;
}

pre::before {
  content: 'CODE_BLOCK';
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  padding: var(--space-xs) var(--space-sm);
  background: var(--border);
  color: var(--bg);
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BLOCKQUOTES
   ═══════════════════════════════════════════════════════════════════════════ */

blockquote {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text);
  background: var(--highlight);
  font-style: italic;
  position: relative;
}

blockquote::before {
  content: 'NOTE';
  position: absolute;
  top: -0.6em;
  left: var(--space-md);
  background: var(--bg);
  padding: 0 var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-style: normal;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LISTS
   ═══════════════════════════════════════════════════════════════════════════ */

.post ul,
.post ol {
  margin: var(--space-md) 0;
  padding-left: var(--space-lg);
}

.post li {
  margin-bottom: var(--space-sm);
  position: relative;
}

.post ul li::marker {
  content: '>';
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.post ol {
  counter-reset: list-counter;
  list-style: none;
}

.post ol li {
  counter-increment: list-counter;
}

.post ol li::before {
  content: counter(list-counter, decimal-leading-zero) '.';
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--text-muted);
  position: absolute;
  left: -2.5em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   IMAGES
   ═══════════════════════════════════════════════════════════════════════════ */

.post img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--border);
  margin: var(--space-lg) 0;
  display: block;
}

.post p > img {
  margin: var(--space-lg) auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HORIZONTAL RULE
   ═══════════════════════════════════════════════════════════════════════════ */

hr {
  border: none;
  margin: var(--space-xl) 0;
  position: relative;
  height: 20px;
}

hr::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--border) 0,
    var(--border) 10px,
    transparent 10px,
    transparent 20px
  );
}

hr::after {
  content: '///';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.site-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.site-footer::before {
  content: 'END_TRANSMISSION';
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DECORATIVE HATCHING PATTERN (for special elements)
   ═══════════════════════════════════════════════════════════════════════════ */

.hatched {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 2px,
    var(--border) 2px,
    var(--border) 4px
  );
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAGS
   ═══════════════════════════════════════════════════════════════════════════ */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.tags a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.tags a:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.tags a::before {
  content: '#';
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .container {
    padding: var(--space-lg) var(--space-md);
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .site-header::after {
    display: none;
  }

  .nav {
    flex-wrap: wrap;
  }

  .post h1 {
    font-size: 1.5rem;
  }

  .post-list li {
    padding: var(--space-md);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
  .theme-toggle,
  .container::before,
  .container::after {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
