/*
Site: berschein.com
*/


/* BASELINE RESET */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: 'Courier New', Courier, monospace;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

body {
  background-color: #0b0b0b;
  background-repeat: repeat;
  background-size: cover;
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  line-height: 1.6;
  color: #ccddee;
}

/* LINKS */
a {
  color: #00ffe0;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #ffae42;
}

/* HEADER */
/* --- HUD Panel Background (Matrix + Subtle Noise + Drift) --- */
.site-header {
  background-color: transparent;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 3rem; /* <<< more vertical padding */
  overflow: hidden;
}

/* --- Optional slight shimmer for realism --- */
@keyframes headerShimmer {
  0% { background-position: center center; }
  50% { background-position: center 5px; }
  100% { background-position: center center; }
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 2px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 2px
    ),
    url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=');
  background-color: rgba(17, 17, 17, 0.65); /* <<< Set the darkness and transparency here */
  background-size: 6px 6px, 6px 6px, 200px 200px;
  background-position: center center;
  background-repeat: repeat;
  pointer-events: none;
  z-index: 1;
  animation: headerShimmer 30s linear infinite;
}

.site-header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px) repeat;
  background-size: 120px 120px;
  opacity: 0;
  animation: flickerNoise 60s infinite ease-in-out;
  z-index: 1; /* sits behind logo/nav because they are z-index: 2+ */
}

/* --- Logo and Menu Tighten Up --- */
.site-title {
  display: flex;
  align-items: center;
}

.site-title,
.site-navigation {
  position: relative;
  z-index: 2; /* Make sure the content is ABOVE the background panel */
}

.site-navigation {
  display: flex;
  align-items: center;
}

/* --- Optional: Slow drift of the noise for realism --- */
@keyframes shimmer {
  0% { background-position: center center; }
  50% { background-position: center 5px; }
  100% { background-position: center center; }
}

/* --- Flicker animation (short random glitch) --- */
@keyframes flicker {
  0% { opacity: 1; }
  45% { opacity: 1; }
  46% { opacity: 0.7; }
  47% { opacity: 1; }
  48% { opacity: 0.85; }
  49% { opacity: 1; }
  100% { opacity: 1; }
}

/* --- Apply the flicker periodically --- */
.site-header.flickering {
  animation: shimmer 15s infinite linear, flicker 120s infinite ease-in-out;
}

.site-title {
  display: flex;
  align-items: center;
}

.site-navigation {
  display: flex;
  align-items: center;
}

.site-title a {
  font-family: 'Share Tech Mono', monospace;
  color: #cccccc; /* <-- changed! */
  font-size: 1.5rem; /* optional: made it smaller for better balance */
  text-decoration: none;
  letter-spacing: 0.1em;
}

.site-navigation .nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

/* MENU NAV LINKS BASE */
.site-navigation .nav-menu li a {
  background-color: #FFD700; /* Safety yellow */
  background-image: linear-gradient(to right, #FFD700 80%, rgba(255, 215, 0, 0)); /* Right fade */
  background-repeat: no-repeat;
  background-size: 400% 100%;
  color: #111; /* Deep black/graphite text */
  font-family: Menlo, Consolas, 'Courier New', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4em 0.8em;
  margin: 0 0.4em;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid #444;
  display: inline-block;
  letter-spacing: 0.05em;
  position: relative;
  top: 1px;
  text-transform: uppercase;
  transition: background-color 0.15s ease, transform 0.15s ease, background-position 0.3s ease;
  animation: flickerText 4s infinite alternate ease-in-out;
  overflow: hidden; /* important for gradient clipping */
}

/* MENU NAV LINKS HOVER */
.site-navigation .nav-menu li a:hover {
  background-color: #FFCC00; /* Slightly brighter */
  background-image: linear-gradient(to right, #FFCC00 80%, rgba(255, 204, 0, 0)); /* Adjust fade on hover */
  background-position: right center;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 1px 3px rgba(255, 215, 0, 0.3);
}

/* FLICKER EFFECT */
@keyframes flickerText {
  0%, 100% {
    opacity: 1;
    filter: brightness(100%);
  }
  45% {
    opacity: 0.96;
    filter: brightness(98%);
  }
  55% {
    opacity: 0.98;
    filter: brightness(102%);
  }
  70% {
    opacity: 0.97;
    filter: brightness(99%);
  }
}

/* MAIN CONTENT */
.site-content {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1rem;
}

/* BLOG CARDS - Matte Glass + Matrix Drift + Softer */
.blog-card {
  position: relative;
  max-width: 900px; /* << stops cards from being too wide */
  margin: 2rem auto; /* << centers and spaces better */
  padding: 2rem 2.5rem; /* << breathing room inside */
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 2px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 2px
    ),
    url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=');
  background-color: rgba(17, 17, 17, 0.35); /* ↓ Softer Matte */
  background-size: 6px 6px, 6px 6px, 200px 200px;
  background-blend-mode: overlay;
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  border-left: 1px solid #555555; /* NOT Safety Yellow */
  border-bottom: 1px solid #555555;
  border-top: none;
  border-right: none;
  border-radius: 0 0 0 0px; /* slight rounding on lower-left corner only */
  margin-bottom: 2rem;
  overflow: hidden;
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  animation: driftMatrix 45s linear infinite;
}

/* Keyframes for subtle background drift */
@keyframes driftMatrix {
  0% {
    background-position: 0 0, 0 0, 0 0;
  }
  100% {
    background-position: 40px 60px, 60px 40px, 0 0;
  }
}

/* BLOG CARD HOVER */
.blog-card:hover {
  background-color: rgba(22, 22, 35, 0.42);
  border-color: rgba(0, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 255, 255, 0.15);
  transform: translateY(-4px); /* <<< subtle lift */
  transition: all 0.4s ease;
}

/* BLOG CARD CONTENT */
.blog-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffe066;
}

.blog-meta {
  font-size: 0.85rem;
  color: #88c0d0;
}

.read-more-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  padding: 0.4em 0.8em;
  background-color: #ff4040; /* Keep strong red */
  color: #111; /* Dark graphite text, matches nav style */
  border: 1px solid #660000; /* Darker red border for subtle 3D */
  border-radius: 2px; /* Tighter corners like nav buttons */
  font-family: Menlo, Consolas, 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: flickerText 4s infinite alternate ease-in-out;
  backdrop-filter: blur(1px);
}

.read-more-btn:hover {
  background-color: #ff5555; /* Slightly brighter red on hover */
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 1px 3px rgba(255, 64, 64, 0.3);
  color: #fff; /* Brighten text slightly */
}

/* HUD PULSE DOT */
.blog-card::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 6px;
  height: 6px;
  background: #00ff99;
  border: 1px solid #003b3b;
  border-radius: 50%;
  box-shadow: 0 0 4px #00ff99;
  animation: pulse 3s infinite ease-in-out;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.blog-card:hover::before {
  background: #ffd700;
  box-shadow: 0 0 6px #ffd700;
  transform: scale(1.2);
}

/* Pulse Animation */
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* STARFIELD CANVAS */
#space {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

#dustfield {
  z-index: -2;
}

#starfield {
  z-index: -1;
}

/* ========================= */
/* FOOTER POLISH */
/* ========================= */

/* Footer container */
.site-footer {
  max-width: 900px; /* Match your blog card area width */
  margin: 6rem auto 2rem auto; /* Push it down nicely */
  padding: 2rem 1rem 0 1rem; /* Give breathing room inside */
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1); /* Softer, contained divider */
}

/* Footer text styling */
.site-footer p {
  margin: 0.5rem 0;
  font-size: 0.8rem;
  color: #888;
}

/* Footer links */
.site-footer a {
  color: #aaa;
  text-decoration: none;
  margin: 0 0.5rem;
  font-size: 0.8rem;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ========================= */

/* RESPONSIVE */
@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    gap: 1rem;
  }
  .site-navigation .nav-menu {
    flex-direction: column;
    align-items: center;
  }
  .blog-card {
    flex-direction: column;
  }
}

/* Style the SVG logo */
/* Style the container div, NOT the SVG directly */
.svg-logo {
  max-width: 240px;
  height: auto;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

/* Then style the inner SVG */
.svg-logo svg {
  width: 100%;
  height: auto;
  display: block;
  transform: none; /* REMOVE scaling here */
  fill: #ccc; /* Default color */
  color: #ccc;
}

/* Optional: smooth flicker on hover */
.svg-logo-link {
  display: inline-block;
  text-decoration: none;
  transition: filter 0.3s ease-in-out;
}

.svg-logo-link:hover .svg-logo svg {
  filter: brightness(1.3) contrast(1.4);
}

@keyframes flickerNoise {
  0%, 98%, 100% {
    opacity: 0;
  }
  49% {
    opacity: 0.02;
    transform: translate(0px, 0px);
  }
  50% {
    opacity: 0.06;
    transform: translate(1px, -1px);
  }
  51% {
    opacity: 0.04;
    transform: translate(-1px, 1px);
  }
}

/* BLOG CARD FLEX LAYOUT FOR HOE + ARCHIVE */
.blog-card-content {
  display: flex;
  flex-direction: row; /* Important: now a row layout */
  flex-wrap: wrap;
  gap: 2rem; /* More breathing space between image and text */
  align-items: flex-start;
  padding: 2rem; /* <-- MORE breathing room inside the card */
}

.blog-thumbnail {
  flex: 0 0 200px; /* Fixed width */
  height: auto;
  overflow: hidden;
  border-radius: 6px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-thumbnail img {
  width: 100%;
  height: auto;
  object-fit: cover; /* Add this for better scaling control */
  display: block;
  border-radius: 6px;
}

.blog-text-content {
  flex: 1; /* Takes remaining space */
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* <-- Important */
  padding: 1rem 0; /* vertical breathing */
  position: relative;
  min-height: 220px; /* optional, makes the card height more consistent */
}

.blog-meta {
  font-size: 0.85rem;
  color: #88c0d0;
  margin-bottom: 0.5rem;
}

.blog-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffe066;
  margin-bottom: 1rem;
}

.blog-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 4 /* Limit to 4 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1rem;
  color: #ccc;
  line-height: 1.6;
  flex-grow: 1; /* push Read More down naturally */
}

/* Terminal-style frame for reading pages */
.terminal-frame {
  max-width: 740px;
  margin: 4rem auto;
  padding: 2rem;
  background: #000000dd;
  border: 1px solid #00ff88;
  border-radius: 4px;
  box-shadow: 0 0 20px #00ff8840;
  font-size: 1rem;
  line-height: 1.65;
}

/* Optional: terminal-style headings */
.terminal-frame h1,
.terminal-frame h2,
.terminal-frame h3 {
  color: #00ffaa;
  border-bottom: 1px dashed #00ffaa55;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* Terminal link style */
.terminal-frame a {
  color: #00ffee;
  text-decoration: underline;
}
.terminal-frame a:hover {
  color: #ffae42;
}
/* ==================================== */
/* RESPONSIVE + MOBILE POLISH (CLEAN) */
/* ==================================== */

@media (max-width: 768px) {

  /* Protect header padding */
  .site-header {
    padding: 1rem 1.5rem;
  }

  /* Keep ticker from overflowing on small screens */
  .ticker-wrapper {
    width: 90%;
  }

  /* Center and contain footer */
  .site-footer {
    width: 90%;
    margin: 4rem auto 2rem auto;
    padding: 1rem;
  }

  /* Shrink the SVG logo */
  .svg-logo {
    max-width: 200px;
  }

  /* Starfield background scales safely */
  body {
    background-size: contain;
  }

  /* Site Navigation - Stack buttons */
  .site-navigation .nav-menu {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
  }

  /* Blog Card Content */
  .blog-card-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }

  /* Blog Thumbnail */
  .blog-thumbnail {
    flex: 0 0 auto;
    width: 80%;
    max-width: 300px;
    margin-bottom: 1rem;
  }

  .blog-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 6px;
  }

  /* Blog Text */
  .blog-text-content {
    flex: 1;
    width: 90%;
    padding: 0;
  }

  .blog-meta,
  .blog-title,
  .blog-excerpt {
    text-align: center;
  }

  .blog-meta {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }

  .blog-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
  }

  .blog-excerpt {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  /* Read More Button */
  .read-more-btn {
    position: static;
    margin-top: 1rem;
    align-self: center;
    transform: none;
    box-shadow: none;
    padding: 0.5em 1em;
    font-size: 0.85rem;
  }

  .read-more-btn:hover {
    transform: scale(1.05);
  }

  /* Blog Card Layout */
  .blog-card {
    padding: 1rem;
    margin-bottom: 2rem;
  }

} /* END RESPONSIVE + MOBILE POLISH */