/* miksanik.net — site stylesheet
 * Design system: light reading column, dark sidebar with violet edge,
 * monospace display (JetBrains Mono), Inter for body, hairline borders,
 * PCB watermark + ASCII corner glyph on content.
 */

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

/* =================================================================
 * TOKENS
 * ================================================================= */
:root {
  /* surfaces (light) */
  --bg-0: #FFFFFF;
  --bg-1: #FFFFFF;
  --bg-2: #F4F6F9;
  --bg-3: #EEF1F5;

  /* foreground */
  --fg-0: #0B0F14;
  --fg-1: #2C3540;
  --fg-2: #5C6773;
  --fg-3: #8A95A3;

  /* lines */
  --line-1: #E2E6EC;
  --line-2: #C9D0D9;
  --line-3: #A6B0BD;

  /* dark surface (sidebar) */
  --dark-0: #07090C;
  --dark-1: #0F151D;
  --dark-fg-0: #E6EDF3;
  --dark-fg-1: #B6C2CF;
  --dark-fg-2: #7B8794;
  --dark-line-1: #1E2A3A;

  /* accents */
  --acc-red:    #DC2638;
  --acc-blue:   #2563EB;
  --acc-violet: #7C3AED;
  --acc-indigo: #4F46E5;
  --acc-green:  #059669;

  --acc-red-bg:    rgba(220, 38, 56, 0.08);
  --acc-blue-bg:   rgba(37, 99, 235, 0.08);
  --acc-violet-bg: rgba(124, 58, 237, 0.10);
  --acc-indigo-bg: rgba(79, 70, 229, 0.08);
  --acc-green-bg:  rgba(5, 150, 105, 0.08);

  --acc-red-bd:    rgba(220, 38, 56, 0.30);
  --acc-blue-bd:   rgba(37, 99, 235, 0.30);
  --acc-violet-bd: rgba(124, 58, 237, 0.35);
  --acc-indigo-bd: rgba(79, 70, 229, 0.30);
  --acc-green-bd:  rgba(5, 150, 105, 0.30);

  /* type */
  --font-display: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --t-xs:  12px;
  --t-sm:  13px;
  --t-base:16px;
  --t-md:  18px;
  --t-lg:  22px;
  --t-xl:  28px;
  --t-2xl: 36px;
  --t-3xl: 48px;
  --t-4xl: 64px;

  /* spacing */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  96px;

  /* radii */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 8px;
  --r-pill: 999px;

  /* shadows */
  --shadow-flat: 0 0 0 1px var(--line-1);
  --shadow-card: 0 0 0 1px var(--line-1), 0 4px 12px rgba(11, 15, 20, 0.06);
  --shadow-pop:  0 0 0 1px var(--line-2), 0 12px 32px rgba(11, 15, 20, 0.12);
  --halo-blue:   0 0 0 1px rgba(37, 99, 235, 0.4),  0 0 16px rgba(37, 99, 235, 0.2);
  --halo-violet: 0 0 0 1px rgba(124, 58, 237, 0.4), 0 0 16px rgba(124, 58, 237, 0.2);

  /* motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 120ms;
  --t-base-dur: 180ms;
  --t-slow: 320ms;

  /* layout */
  --col-read: 68ch;
  --header-h: 56px;
  --sidebar-w: 220px;
}

/* =================================================================
 * RESET + BASE TYPOGRAPHY
 * ================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

h1, .h1 { font-family: var(--font-display); font-weight: 700; font-size: var(--t-3xl); line-height: 1.1; letter-spacing: -0.02em; color: var(--fg-0); }
h2, .h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--t-2xl); line-height: 1.15; letter-spacing: -0.015em; color: var(--fg-0); }
h3, .h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--t-xl); line-height: 1.2; letter-spacing: -0.01em; color: var(--fg-0); }
h4, .h4 { font-family: var(--font-display); font-weight: 600; font-size: var(--t-lg); line-height: 1.25; color: var(--fg-0); }

p { font-family: var(--font-body); font-size: var(--t-base); line-height: 1.65; color: var(--fg-1); text-wrap: pretty; }
small, .caption { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--fg-2); }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.92em; }
pre, .codeblock {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  line-height: 1.55;
  background: var(--bg-3);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  padding: var(--s-4);
  overflow: auto;
  color: var(--fg-0);
}
a {
  color: var(--acc-blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, 0.30);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
a:hover { color: #1E50C8; border-bottom-color: var(--acc-blue); }
hr { border: 0; border-top: 1px solid var(--line-1); margin: var(--s-6) 0; }
::selection { background: var(--acc-violet-bg); color: var(--fg-0); }

/* =================================================================
 * LAYOUT
 * ================================================================= */
.layout { display: flex; min-height: 100vh; }

/* =================================================================
 * SIDEBAR (DARK)
 * ================================================================= */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--dark-0);
  border-right: 1px solid var(--dark-line-1);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  position: relative;
  color: var(--dark-fg-0);
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent 5%, rgba(124,58,237,0.7) 35%, rgba(124,58,237,0.7) 65%, transparent 95%);
  pointer-events: none;
}
.sidebar-header { padding: 0 16px 14px; border-bottom: 1px solid var(--dark-line-1); }
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dark-fg-0);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 0;
}
.logo:hover { color: var(--dark-fg-0); border-bottom: 0; }
.logo .logo-mark { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; border-radius: var(--r-1); }
.logo .logo-text { line-height: 1; }
.logo .tld { color: var(--acc-violet); }

.sidebar-body { flex: 1; display: flex; flex-direction: column; padding-top: 6px; min-height: 0; overflow-y: auto; }

.sidebar nav ul { list-style: none; padding: 0; }
.sidebar nav .nav-row { display: flex; align-items: stretch; }
.sidebar nav .nav-row a {
  display: block;
  flex: 1;
  padding: 6px 16px;
  color: var(--dark-fg-1);
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 0;
  border-left: 2px solid transparent;
  transition: color 120ms var(--ease), background 120ms var(--ease), border-color 120ms var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar nav .nav-row a:hover { color: var(--dark-fg-0); background: var(--dark-1); }
.sidebar nav .nav-row.active a,
.sidebar nav .nav-row a.active {
  color: var(--acc-violet);
  border-left-color: var(--acc-violet);
  background: var(--dark-1);
}
.sidebar nav .nav-caret {
  width: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--dark-fg-2); font-size: 10px; cursor: pointer; user-select: none;
  transition: transform 120ms var(--ease), color 120ms var(--ease);
}
.sidebar nav .nav-caret::before { content: "\25B8"; }
.sidebar nav .nav-caret:hover { color: var(--dark-fg-0); }

/* checkbox-driven collapsible nested nav */
.sidebar nav .nav-toggle { display: none; }
.sidebar nav .has-children > ul { display: none; padding-left: 14px; }
.sidebar nav .nav-toggle:checked ~ ul { display: block; }
.sidebar nav .nav-toggle:checked ~ .nav-row .nav-caret { transform: rotate(90deg); color: var(--acc-violet); }

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--dark-line-1);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dark-fg-2);
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-bottom a { color: var(--dark-fg-1); border-bottom: 0; text-decoration: none; }
.sidebar-bottom a:hover { color: var(--acc-violet); }

/* =================================================================
 * CONTENT (LIGHT) — PCB watermark + ASCII corner overlay
 * ================================================================= */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  color: var(--fg-0);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.content::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 70% 55% at 0% 0%, rgba(124, 58, 237, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(79, 70, 229, 0.16), transparent 70%),
    radial-gradient(ellipse 55% 50% at 95% 45%, rgba(37, 99, 235, 0.13), transparent 65%),
    radial-gradient(ellipse 40% 35% at 5% 75%, rgba(245, 158, 11, 0.11), transparent 60%),
    radial-gradient(ellipse 30% 25% at 80% 5%, rgba(5, 150, 105, 0.09), transparent 65%),
    radial-gradient(circle at 16px 16px, rgba(124, 58, 237, 0.18) 1.2px, transparent 1.6px),
    linear-gradient(to right,  rgba(11, 15, 20, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11, 15, 20, 0.05) 1px, transparent 1px),
    repeating-linear-gradient(135deg, transparent 0 26px, rgba(99, 102, 241, 0.06) 26px 27px);
  background-size: auto, auto, auto, auto, auto, 32px 32px, 32px 32px, 32px 32px, auto;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat, repeat, repeat;
  z-index: 0;
}
.content::after {
  content: "[ /home/martin ]\A xmiksay · git:main\A 0x4F · v0.4.2\A — — — — — — — —";
  white-space: pre;
  position: absolute;
  top: 14px; right: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: 0.06em;
  color: rgba(11, 15, 20, 0.22);
  pointer-events: none;
  text-align: right;
  z-index: 0;
}
.content > * { position: relative; z-index: 1; }

main { padding: 32px 40px; flex: 1; max-width: 880px; width: 100%; }
footer {
  padding: 16px 40px;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 11px;
  border-top: 1px solid var(--line-1);
}
footer a { color: var(--fg-2); border-bottom: 1px solid var(--line-1); }
footer a:hover { color: var(--acc-violet); border-bottom-color: var(--acc-violet); }

/* =================================================================
 * ARTICLE LIST (used by some menus / tag pages)
 * ================================================================= */
.article-list article { padding: 16px 0; border-bottom: 1px solid var(--line-1); }
.article-list article:hover h2 a { color: var(--acc-violet); }
.article-list h2 { font-family: var(--font-display); font-size: 18px; margin-bottom: 4px; font-weight: 600; letter-spacing: -0.005em; }
.article-list h2 a { color: var(--fg-0); border-bottom: 0; text-decoration: none; transition: color 120ms var(--ease); }
.article-list p { color: var(--fg-1); margin-top: 4px; font-size: 14px; }

.meta {
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* =================================================================
 * ARTICLE DETAIL
 * ================================================================= */
.article-detail h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--fg-0);
  position: relative;
  padding-left: 14px;
}
.article-detail h1::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 14px;
  width: 3px;
  background: var(--acc-violet);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}
.article-body { margin-top: 24px; max-width: var(--col-read); }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--acc-violet); text-decoration: underline; }
.breadcrumbs .crumb-sep { color: var(--fg-2); margin: 0 0.3rem; font-weight: 400; }
.article-body h1 { padding-left: 0; }
.article-body h1::before { display: none; }
.article-body h2 { margin: 24px 0 8px; font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--fg-0); }
.article-body h3 { margin: 16px 0 6px; font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--fg-0); }
.article-body p { margin: 8px 0; color: var(--fg-1); }
.article-body ul, .article-body ol { margin: 8px 0 8px 24px; color: var(--fg-1); }
.article-body pre {
  background: var(--bg-3);
  padding: 16px;
  border-radius: var(--r-2);
  border: 1px solid var(--line-1);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-0);
  margin: 12px 0;
}
.article-body code {
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: var(--r-1);
  border: 1px solid var(--line-1);
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--acc-violet);
}
.article-body pre code { background: none; padding: 0; border: 0; color: var(--fg-0); }
.article-body table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14px; }
.article-body th, .article-body td { border: 1px solid var(--line-1); padding: 6px 12px; text-align: left; }
.article-body th { background: var(--bg-2); color: var(--fg-0); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.article-body blockquote { border-left: 2px solid var(--acc-violet); padding-left: 16px; color: var(--fg-2); margin: 12px 0; font-style: italic; }

/* =================================================================
 * TAGS
 * ================================================================= */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; align-items: center; }
.tag {
  display: inline-block;
  padding: 3px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-1);
  text-decoration: none;
}
.tag:hover, .tag.active {
  background: var(--acc-violet-bg);
  border-color: var(--acc-violet-bd);
  color: var(--acc-violet);
  border-bottom-color: var(--acc-violet-bd);
}

/* =================================================================
 * TRANSCLUDE (::page directive)
 * ================================================================= */
.transclude {
  position: relative;
  border: 1px solid var(--line-1);
  border-left: 2px solid var(--acc-violet);
  background: linear-gradient(90deg, rgba(124,58,237,0.04), transparent 60%);
  margin: 12px 0;
  border-radius: 0 var(--r-2) var(--r-2) 0;
}
.transclude .tx-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  border-bottom: 1px solid var(--line-1);
  cursor: pointer;
  user-select: none;
}
.transclude .tx-head .caret { color: var(--acc-violet); width: 10px; text-align: center; }
.transclude .tx-head .path { color: var(--acc-violet); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transclude .tx-head .toggle { color: var(--fg-3); font-size: 11px; }
.transclude .tx-body { padding: 10px 14px; }
.transclude.collapsed .tx-body { display: none; }
.transclude.collapsed .tx-head { border-bottom: 0; }
.transclude .summary { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); padding: 0 14px 8px; }

/* =================================================================
 * IMAGES
 * ================================================================= */
.article-image { margin: 20px 0; }
.article-image a { border: 0; display: block; }
.article-image img {
  max-width: 100%;
  border-radius: var(--r-2);
  border: 1px solid var(--line-1);
  display: block;
}
.article-image figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  margin-top: 6px;
}

/* =================================================================
 * GALLERY
 * ================================================================= */
.gallery { margin: 20px 0; }
.gallery h3 { margin-bottom: 8px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.gallery-item {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border: 0; text-decoration: none;
}
.gallery-item:hover { border: 0; }
.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-1);
  border: 1px solid var(--line-1);
  transition: border-color 120ms var(--ease);
}
.gallery-item:hover img { border-color: var(--acc-violet-bd); }
.gallery-item span { font-family: var(--font-mono); font-size: 11px; color: var(--fg-2); margin-top: 4px; }

/* =================================================================
 * CHESS BOARDS
 * ================================================================= */
.pgn-viewer, .fen-viewer {
  --board-size: min(400px, 70vw);
  margin: 20px 0;
  max-width: var(--board-size);
}
.pgn-viewer.size-sm, .fen-viewer.size-sm { --board-size: min(260px, 60vw); }
.pgn-viewer.size-lg, .fen-viewer.size-lg { --board-size: min(560px, 85vw); }
.fen-viewer { width: var(--board-size); height: var(--board-size); }
.pgn-viewer .board, .fen-viewer .board {
  width: var(--board-size);
  height: var(--board-size);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 1px rgba(124,58,237,0.25), 0 8px 24px rgba(11,15,20,0.10);
  background: var(--dark-0);
}
.controls {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 8px;
}
.controls button {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  color: var(--fg-1);
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: var(--r-1);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 120ms var(--ease), color 120ms var(--ease), background 120ms var(--ease);
}
.controls button:hover { border-color: var(--line-2); color: var(--fg-0); background: var(--bg-2); }
.move-info {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--acc-violet);
  min-width: 90px;
  text-align: center;
}

/* =================================================================
 * FILE DOWNLOAD
 * ================================================================= */
.file-download {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-1);
  text-decoration: none;
  border-bottom: 1px solid var(--line-1);
}
.file-download:hover {
  border-color: var(--acc-blue-bd);
  background: var(--acc-blue-bg);
  color: var(--acc-blue);
  border-bottom-color: var(--acc-blue-bd);
}
.file-download::before { content: "▸ "; color: var(--acc-violet); }

/* =================================================================
 * EDIT LINK (logged-in admins)
 * ================================================================= */
.edit-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-3);
  border-bottom: 0;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.edit-link:hover { color: var(--acc-blue); border-color: var(--acc-blue-bd); border-bottom: 1px solid var(--acc-blue-bd); }
.edit-bar { text-align: right; margin-bottom: 8px; }

/* =================================================================
 * PAGE SEARCH
 * ================================================================= */
.page-search h1 { margin-bottom: 12px; }
.search-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch;
  margin: 16px 0 24px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
}
.search-form input[type="search"],
.search-form input[type="text"] {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 8px 12px;
  background: var(--bg-1);
  color: var(--fg-0);
  border: 1px solid var(--line-1);
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
}
.search-form input[type="search"] { flex-grow: 2; }
.search-form input:focus {
  outline: none;
  border-color: var(--acc-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.search-form input::placeholder { color: var(--fg-3); }
.search-form button {
  padding: 8px 16px;
  background: var(--acc-blue);
  color: #fff;
  border: 1px solid var(--acc-blue);
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms var(--ease);
}
.search-form button:hover { background: #1E50C8; border-color: #1E50C8; }

.page-list { list-style: none; margin: 16px 0; padding: 0; }
.page-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-1);
}
.page-list li a {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--acc-violet);
  border-bottom: 0;
}
.page-list li a:hover { color: var(--acc-blue); }
.page-list .summary { display: block; color: var(--fg-1); font-size: 14px; margin-top: 2px; font-family: var(--font-body); }
.page-list .meta { display: block; margin-top: 4px; }

.pagination { display: flex; gap: 6px; align-items: center; margin: 24px 0; flex-wrap: wrap; }
.pagination a, .pagination .meta {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid var(--line-1);
}
.pagination a { color: var(--acc-blue); background: var(--bg-1); }
.pagination a:hover { background: var(--acc-blue-bg); border-color: var(--acc-blue-bd); border-bottom-color: var(--acc-blue-bd); }
.pagination .meta { color: var(--fg-2); text-transform: none; letter-spacing: 0; }

/* =================================================================
 * LOGIN
 * ================================================================= */
.login-box {
  max-width: 360px;
  margin: 10vh auto;
  padding: 32px;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-card);
}
.login-box h1 { text-align: center; margin-bottom: 24px; font-size: 24px; }
.login-box label { display: block; margin-top: 12px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-2); }
.login-box input { width: 100%; padding: 8px 12px; margin-top: 4px; border: 1px solid var(--line-1); border-radius: var(--r-1); font-family: var(--font-mono); font-size: 13px; background: var(--bg-1); color: var(--fg-0); }
.login-box input:focus { outline: none; border-color: var(--acc-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.login-box button {
  width: 100%; margin-top: 20px; padding: 10px;
  background: var(--acc-blue); color: #fff;
  border: 1px solid var(--acc-blue); border-radius: var(--r-1);
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  cursor: pointer; text-transform: uppercase; letter-spacing: 0.08em;
}
.login-box button:hover { background: #1E50C8; border-color: #1E50C8; }
.login-error { color: var(--acc-red); text-align: center; margin-bottom: 8px; font-family: var(--font-mono); font-size: 12px; }

/* =================================================================
 * LIGHTBOX
 * ================================================================= */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 12, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.lightbox-overlay.active { display: flex; }
.lightbox-overlay .lb-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.lightbox-overlay .lb-img {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-2);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.4), 0 8px 30px rgba(0, 0, 0, 0.6);
  background: var(--dark-0);
}
.lightbox-overlay .lb-bottom {
  margin-top: 8px;
  color: var(--dark-fg-1);
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  width: 100%;
  min-height: 1.2em;
}
.lightbox-overlay .lb-caption { flex: 1; text-align: left; }
.lightbox-overlay .lb-counter { color: var(--dark-fg-2); }
.lightbox-overlay .lb-close,
.lightbox-overlay .lb-prev,
.lightbox-overlay .lb-next {
  position: absolute;
  background: rgba(15, 21, 29, 0.6);
  color: var(--dark-fg-0);
  border: 1px solid var(--dark-line-1);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: var(--r-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
  z-index: 1;
}
.lightbox-overlay .lb-close:hover,
.lightbox-overlay .lb-prev:hover,
.lightbox-overlay .lb-next:hover { background: rgba(124, 58, 237, 0.25); border-color: var(--acc-violet); }
.lightbox-overlay .lb-close { top: 16px; right: 16px; }
.lightbox-overlay .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-overlay .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* =================================================================
 * STATUS PILL (utility, used by content authors)
 * ================================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--r-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pill.live { background: var(--acc-red-bg); border: 1px solid var(--acc-red-bd); color: var(--acc-red); }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--acc-red); animation: pulse 1.4s infinite; }
.pill.ok { background: var(--acc-green-bg); border: 1px solid var(--acc-green-bd); color: var(--acc-green); }
.pill.draft { background: var(--bg-2); border: 1px solid var(--line-1); color: var(--fg-2); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* =================================================================
 * SCANLINE — page-mount accent
 * ================================================================= */
.scanline {
  position: fixed;
  left: var(--sidebar-w); right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acc-violet), transparent);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}
.scanline.active { animation: scan 700ms var(--ease) forwards; }
@keyframes scan {
  0%   { transform: translateY(0);     opacity: 0.9; }
  80%  { opacity: 0.4; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* =================================================================
 * MOBILE HEADER + HAMBURGER
 * ================================================================= */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: var(--dark-0);
  border-bottom: 1px solid var(--dark-line-1);
  z-index: 100;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}
.mobile-header .header-logo {
  color: var(--dark-fg-0);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border-bottom: 0;
}
.mobile-header .header-logo .tld { color: var(--acc-violet); }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--dark-fg-1);
  border-radius: 1px;
}

/* =================================================================
 * RESPONSIVE
 * ================================================================= */
@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .hamburger { display: flex; }
  .layout { padding-top: 48px; }
  .sidebar {
    position: fixed;
    top: 48px; left: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 250ms var(--ease);
    z-index: 99;
    overflow-y: auto;
    border-right: 1px solid var(--dark-line-1);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-header { display: none; }
  .content { width: 100%; }
  main { padding: 24px 20px; }
  footer { padding: 16px 20px; }
  .scanline { left: 0; }
  .article-detail h1 { font-size: 28px; }
}
