/* ═══════════════════════════════════════════════════════
   pkSmp Partners — style.css
   Theme: Retro-terminal / anarchy dark
   ═══════════════════════════════════════════════════════ */

/* ── Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Share+Tech+Mono&display=swap');

/* ── Design Tokens ──────────────────────────────────────── */
:root {
  --gold:        #e8c96a;
  --gold-dim:    #5a5040;
  --gold-faint:  #3a3020;
  --red:         #ff5555;
  --cyan:        #55ffff;
  --bg-body:     #080808;
  --bg-surface:  #0d0d0d;
  --text-body:   #a89060;
  --text-bright: #c9b88a;

  --font-pixel: 'Press Start 2P', monospace;
  --font-mono:  'Share Tech Mono', monospace;

  --topbar-h: clamp(44px, 6vh, 64px);
  --sidebar-w: clamp(140px, 15vw, 190px);

  --radius-sm: 2px;
  --trans-med: 0.25s ease;
}

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

/* ── Base ───────────────────────────────────────────────── */
body {
  background: var(--bg-body);
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 15px;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* CRT scanlines — subtle */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 4px,
    rgba(0,0,0,0.08) 4px, rgba(0,0,0,0.08) 5px
  );
  pointer-events: none;
  z-index: 9998;
}

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

/* ── Top Bar ─────────────────────────────────────────────── */
.top-bar {
  position: fixed; top: 0; left: 0;
  width: 100%;
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--gold-faint);
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px;
  z-index: 9999;
  box-shadow: 0 4px 30px rgba(0,0,0,.9);
}

.top-bar__logo {
  width: 38px; height: 38px;
  flex-shrink: 0;
}

.top-bar__title {
  font-family: var(--font-pixel);
  font-size: clamp(12px, 2vw, 22px);
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap;
}

.top-bar__tag {
  font-family: var(--font-pixel);
  font-size: clamp(7px, 0.9vw, 13px);
  color: var(--gold-dim);
  margin-left: 6px;
}

.pk-red {
  color: var(--red);
  font-style: italic;
  text-shadow: 0 0 10px rgba(255,85,85,0.35), 2px 2px 0 #3e1414;
}

.smp-blue {
  color: var(--cyan);
  font-style: italic;
  text-shadow: 0 0 10px rgba(85,255,255,0.35), 2px 2px 0 #143e3e;
}

/* ── Top Nav Links ───────────────────────────────────────── */
.top-bar__nav {
  margin-left: auto;
  display: flex; gap: 6px; align-items: center;
}

.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  font-family: var(--font-pixel);
  font-size: clamp(6px, 0.75vw, 10px);
  color: var(--gold-dim);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: color var(--trans-med), border-color var(--trans-med), background var(--trans-med);
  white-space: nowrap;
}

.nav-link img {
  width: 28px; height: 28px;
  filter: brightness(0.8) saturate(0.7);
  transition: filter var(--trans-med);
}

.nav-link:hover,
.nav-link--active {
  color: var(--gold);
  border-color: var(--gold-faint);
  background: rgba(232,201,106,0.06);
}

.nav-link:hover img,
.nav-link--active img {
  filter: brightness(1) saturate(1);
}

/* ── Backdrop Blur (tab switch) ─────────────────────────── */
.switch-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 5000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.switch-backdrop.active { opacity: 1; }

/* ── Layout ──────────────────────────────────────────────── */
#BlogWrapper {
  display: flex;
  height: 100vh;
  width: 100%;
  padding-top: var(--topbar-h);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: 140px;
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--gold-faint);
  display: flex; flex-direction: column;
  overflow: hidden auto;
  flex-shrink: 0;
  position: relative;
  animation: sidebarGlow 5s 2s ease-in-out infinite;
}

@keyframes sidebarGlow {
  0%,100% { border-right-color: var(--gold-faint); }
  50%      { border-right-color: rgba(232,201,106,0.25); }
}

.sidebar__header {
  padding: 16px 12px 14px;
  border-bottom: 1px solid var(--gold-faint);
  flex-shrink: 0;
}

.sidebar__title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 2px;
  line-height: 1.8;
  text-shadow: 0 0 8px rgba(232,201,106,0.3);
}

.sidebar__sub {
  font-size: 11px;
  color: var(--gold-dim);
  margin-top: 4px;
}

/* ── Sidebar Tab Indicator Bar ─────────────────────────── */
.BlogIndicator {
  position: absolute; left: 0; top: 0;
  width: 3px; height: 0;
  background: var(--gold);
  pointer-events: none;
  transition: transform 200ms ease-in-out, height 200ms ease-in-out;
  z-index: 20;
}

/* ── Sidebar Tab ─────────────────────────────────────────── */
.BlogTab {
  display: block; width: 100%;
  background: transparent;
  border: none; border-bottom: 1px solid #1e1a10;
  cursor: pointer; text-align: left;
  padding: 12px 10px 12px 14px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gold-dim);
  line-height: 2; letter-spacing: 0.5px;
  position: relative;
  transition: color 0.15s, background 0.15s, padding-left 0.3s;
  background-size: cover; background-position: center;
  /* ── FIX: lighter overlay so the tab background image is actually visible ── */
}

.BlogTab::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: transparent;
  transition: background 0.15s;
}

.BlogTab[selected],
.BlogTab:hover {
  color: var(--gold);
  background: rgba(232,201,106,0.05);
  padding-left: 18px;
}

.BlogTab[selected]::before,
.BlogTab:hover::before {
  background: var(--gold);
}

/* ── Blog Panel ──────────────────────────────────────────── */
.BlogPanel {
  flex: 1;
  height: 100%;
  overflow: hidden auto;
  display: flex; flex-direction: column;
  background: var(--bg-body);
  animation: panelReveal 0.3s ease forwards;
  /* Allow panel content to scroll on all screen sizes */
  -webkit-overflow-scrolling: touch;
}

.BlogPanel[hidden] { display: none; }

@keyframes panelReveal {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Scrollbar */
.BlogPanel::-webkit-scrollbar { width: 5px; }
.BlogPanel::-webkit-scrollbar-track { background: var(--bg-body); }
.BlogPanel::-webkit-scrollbar-thumb { background: #2a2010; border-radius: 2px; }
.BlogPanel::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Header Banner ───────────────────────────────────────── */
.BlogHeader {
  width: 100%;
  /* Taller on desktop, shorter on mobile so content isn't wasted */
  height: clamp(120px, 20vw, 260px);
  position: relative;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: 18px 22px;
  overflow: hidden; flex-shrink: 0;
}

/*
  ── FIX: Header background image
  Was brightness(0.15) — nearly black.
  Now brightness(0.35) so the image is recognisable as a banner.
  Removed blur so it looks sharp.
*/
.BlogHBG {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(0.35) saturate(0.6);
  z-index: 0;
  transition: filter 0.75s ease;
}

/*
  ── FIX: Gradient overlay
  Was rgba(8,8,8,0.98) at the bottom — completely blacked out the image.
  Now 0.82 so some image colour bleeds through at the bottom.
*/
.BlogHeader::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,8,8,0.82) 0%, rgba(8,8,8,0.3) 50%, transparent 100%);
  z-index: 1;
}

/*
  ── FIX: Header scanlines
  Was 0.1 opacity — noticeable over the header.
  Now 0.04 — barely there, just enough for texture.
*/
.BlogHeader::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px);
  z-index: 2;
  pointer-events: none;
}

/* Gold scan sweep */
.scan-sweep {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden;
}
.scan-sweep::after {
  content: '';
  position: absolute; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(232,201,106,0.35), transparent);
  animation: scanDown 6s 1s ease-in-out infinite;
}
@keyframes scanDown {
  0%   { top: -2px; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 0.4; }
  100% { top: 100%; opacity: 0; }
}

.header-content { position: relative; z-index: 4; }

/* Header title */
.BlogHeader h1 {
  font-family: var(--font-pixel);
  font-size: clamp(11px, 2.2vw, 22px);
  color: var(--gold);
  line-height: 1.6;
  text-shadow: 0 0 20px rgba(232,201,106,0.4), 2px 2px 0 #252525;
  margin-bottom: 10px;
  letter-spacing: 1px;
  animation: headerSlideUp 0.5s 0.1s both ease-out, glitch 8s 3s infinite;
}

.header-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: clamp(11px, 1.5vw, 13px);
  animation: headerSlideUp 0.5s 0.22s both ease-out;
}

@keyframes headerSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Chromatic glitch — occasional */
@keyframes glitch {
  0%,95%,100% { text-shadow: 0 0 20px rgba(232,201,106,0.4), 2px 2px 0 #252525; transform: none; }
  96%          { text-shadow: -3px 0 var(--red), 3px 0 var(--cyan); transform: translateX(2px); }
  97%          { text-shadow: 3px 0 var(--red), -3px 0 var(--cyan); transform: translateX(-2px); }
  98%          { text-shadow: 0 0 20px rgba(232,201,106,0.4), 2px 2px 0 #252525; transform: none; }
}

.meta-author { color: var(--text-bright); }
.meta-date   { color: var(--gold-dim); }
.meta-bullet { color: var(--gold); }

/* ── Blog Content Area ───────────────────────────────────── */
.blog-content {
  padding: 24px 22px;
  display: flex; flex-direction: column;
  width: 100%;
  max-width: 900px;
}

/* ── Cards ───────────────────────────────────────────────── */
.blog-card {
  background: var(--bg-surface);
  border: 1px solid var(--gold-faint);
  box-shadow:
    0 0 0 1px #1a1610,
    inset 0 0 40px rgba(0,0,0,0.5),
    0 8px 40px rgba(0,0,0,0.8);
  width: 100%; padding: 22px 20px;
  position: relative; margin-bottom: 20px;
  opacity: 0;
  animation: cardFadeIn 0.4s ease forwards;
}
.blog-card:nth-child(2) { animation-delay: 0.08s; }
.blog-card:nth-child(3) { animation-delay: 0.18s; }
.blog-card:nth-child(4) { animation-delay: 0.28s; }
.blog-card:nth-child(5) { animation-delay: 0.38s; }

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Corner brackets */
.blog-card::before,
.blog-card::after {
  content: ''; position: absolute;
  width: 12px; height: 12px;
  border-color: var(--gold); border-style: solid;
}
.blog-card::before { top:-1px; left:-1px; border-width: 2px 0 0 2px; }
.blog-card::after  { bottom:-1px; right:-1px; border-width: 0 2px 2px 0; }

.card-label {
  font-family: var(--font-pixel);
  font-size: 8px; color: var(--gold-dim);
  letter-spacing: 2px; margin-bottom: 16px;
}

/* ── Headings ────────────────────────────────────────────── */
.blog-content h2 {
  font-family: var(--font-pixel);
  font-size: clamp(9px, 1.1vw, 11px);
  color: var(--gold);
  margin: 20px 0 10px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(232,201,106,0.25);
}
.blog-card h2:first-of-type { margin-top: 0; }

/* ── Body Text ───────────────────────────────────────────── */
.blog-content p {
  font-size: clamp(13px, 1.5vw, 16px);
  color: var(--text-body);
  line-height: 1.75;
  margin-bottom: 12px;
}

/* ── Lists ───────────────────────────────────────────────── */
.blog-content ul {
  list-style: none;
  padding: 0; margin-bottom: 14px;
}

.blog-content li {
  font-size: clamp(13px, 1.5vw, 16px);
  color: var(--text-body);
  line-height: 1.8;
  padding-left: 22px;
  position: relative;
  margin-bottom: 4px;
}

.blog-content li::before {
  content: '▸';
  position: absolute; left: 0;
  color: var(--gold);
}

/* ── Strong ──────────────────────────────────────────────── */
strong { color: var(--gold); }

/* ── Command Box ─────────────────────────────────────────── */
.cmd-box {
  background: #000;
  border: 1px solid var(--gold-faint);
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  font-size: clamp(12px, 1.4vw, 15px);
  font-family: var(--font-mono);
  color: var(--gold);
  word-break: break-all;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.cmd-box::before { content: '> '; color: var(--gold-dim); }

/* ── Email Link ──────────────────────────────────────────── */
.email-link {
  color: var(--gold); text-decoration: none;
  border-bottom: 1px dotted var(--gold);
  font-size: clamp(12px, 1.4vw, 15px);
  display: inline-block;
  transition: color var(--trans-med), transform var(--trans-med);
  transform-origin: center left;
}
.email-link:hover {
  color: #fff;
  transform: scale(1.03);
}

/* ── Hint / Small Text ───────────────────────────────────── */
.hint-text {
  font-size: clamp(11px, 1.1vw, 13px);
  color: var(--gold-dim);
  margin-top: -6px;
  margin-bottom: 12px;
}

/* ── Callout Block ───────────────────────────────────────── */
.callout {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
  opacity: 0;
  animation: cardFadeIn 0.4s 0.05s ease forwards;
}

.callout--gold {
  background: rgba(232,201,106,0.04);
  border-left: 3px solid var(--gold);
}

.callout__icon { color: var(--gold); font-size: 14px; flex-shrink: 0; margin-top: 2px; }

.callout span:last-child {
  font-family: var(--font-pixel);
  font-size: clamp(7px, 0.9vw, 9px);
  color: var(--gold);
  line-height: 2;
  text-shadow: 0 0 8px rgba(232,201,106,0.2);
}

/* ── Outro Text ──────────────────────────────────────────── */
.outro {
  font-size: clamp(13px, 1.5vw, 16px);
  color: var(--text-body);
  margin-bottom: 8px;
}
.outro--warn {
  color: var(--gold);
  font-size: clamp(12px, 1.4vw, 15px);
}

/* ── Blog Images ─────────────────────────────────────────── */
/*
  Very light treatment — images should be clearly visible.
  Hover restores full brightness/colour.
*/
.blog-img {
  width: 100%; display: block;
  margin: 16px 0;
  border: 1px solid var(--gold-faint);
  filter: brightness(0.92) saturate(0.9);
  transition: filter 0.4s ease, transform 0.3s ease;
  border-radius: var(--radius-sm);
}

.blog-img:hover {
  filter: brightness(1) saturate(1);
  transform: scale(1.003);
}

/* ── Divider ─────────────────────────────────────────────── */
hr.divider {
  border: none;
  border-top: 1px solid #1e1a10;
  margin: 16px 0;
}

/* ── Panel Footer ────────────────────────────────────────── */
.panel-footer {
  font-size: 12px; color: #2e2818;
  text-align: center;
  padding: 24px 16px 32px;
  border-top: 1px solid #1e1a10;
  margin-top: auto;
  letter-spacing: 1px;
}

/* ── Flying Circles (load animation) ────────────────────── */
.flying-circle {
  position: fixed; bottom: -30px;
  width: 8px; height: 12px;
  background: #4d3902;
  border-radius: 50%;
  pointer-events: none; opacity: 0;
  box-shadow: 0 0 10px #3d2505;
  animation: fireworksUp 1.1s ease-in forwards;
  z-index: -1;
}

@keyframes fireworksUp {
  0%   { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
  100% { opacity: 0; transform: translateY(-600px) translateX(var(--offset,0px)) scale(0.4); }
}

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

/* ── Tablet (≤ 900px) ────────────────────────────────────── */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 120px;
  }

  .top-bar__tag { display: none; }  /* hide "// PARTNERS \\" tag */

  .blog-content { padding: 18px 16px; }

  .blog-card { padding: 18px 16px; }

  .BlogHeader {
    height: clamp(110px, 25vw, 200px);
    padding: 14px 16px;
  }
}

/* ── Mobile (≤ 600px) ────────────────────────────────────── */
@media (max-width: 600px) {
  :root {
    --topbar-h: 52px;
    --sidebar-w: 90px;
  }

  /* Sidebar collapses to icon-only strip */
  .sidebar {
    min-width: 90px;
    width: 90px;
  }

  .sidebar__sub   { display: none; }
  .sidebar__title { font-size: 8px; letter-spacing: 1px; }

  .BlogTab {
    font-size: 6px;
    padding: 10px 6px 10px 10px;
    line-height: 1.9;
  }
  .BlogTab[selected], .BlogTab:hover {
    padding-left: 12px;
  }

  /* Nav: hide text labels, show icons only */
  .top-bar__nav .nav-link span { display: none; }
  .nav-link { padding: 4px 6px; }
  .nav-link img { width: 24px; height: 24px; }

  /* Header: shorter, bigger title relative to space */
  .BlogHeader {
    height: clamp(100px, 38vw, 160px);
    padding: 12px 14px;
  }

  .BlogHeader h1 {
    font-size: clamp(10px, 3.5vw, 15px);
    margin-bottom: 6px;
  }

  .header-meta { gap: 6px; flex-wrap: wrap; }

  /* Content */
  .blog-content { padding: 14px 12px; }

  .blog-card { padding: 14px 12px; margin-bottom: 14px; }

  .card-label { font-size: 7px; margin-bottom: 12px; }

  .blog-content h2 { font-size: 9px; margin: 14px 0 8px; }

  .blog-content p,
  .blog-content li { font-size: 13px; line-height: 1.7; }

  .cmd-box { font-size: 12px; padding: 10px 12px; }

  .callout { padding: 12px 14px; gap: 10px; }
  .callout span:last-child { font-size: 7px; }
}

/* ── Very small phones (≤ 380px) ────────────────────────── */
@media (max-width: 380px) {
  :root { --sidebar-w: 76px; }

  .sidebar { min-width: 76px; width: 76px; }

  .sidebar__title { font-size: 7px; }

  .BlogTab { font-size: 5px; padding: 8px 4px 8px 8px; }

  .top-bar__title { font-size: 12px; }

  .BlogHeader h1 { font-size: 9px; }

  .blog-content { padding: 10px; }
  .blog-card { padding: 12px 10px; }
}
