/* ============================================================
   bsdBased.Net — Main Stylesheet
   Aesthetic: Terminal minimalism — dark, monospaced, precise
   ============================================================ */

/* --- Custom Properties ------------------------------------ */
:root {
  --bg:           #0d0f0e;
  --bg-elevated:  #131613;
  --bg-card:      #161a16;
  --border:       #253025;
  --border-bright:#2e3e2e;

  --fg:           #c8d5c0;
  --fg-muted:     #637060;
  --fg-dim:       #3a4238;

  --green:        #5dba6e;
  --green-bright: #7dd98c;
  --green-dim:    #2a5c32;
  --amber:        #d4943a;
  --amber-dim:    #7a4f18;
  --red:          #c05050;

  --font-mono:    'IBM Plex Mono', 'Inconsolata', 'Courier New', monospace;
  --font-serif:   'Libre Baskerville', Georgia, serif;

  --radius:       2px;
  --gap:          1.5rem;
  --max-w:        960px;
  --header-h:     56px;

  --transition:   150ms ease;
}

/* --- Reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-bright); text-decoration: underline; }
img { max-width: 100%; display: block; }

/* --- Scanlines overlay ------------------------------------ */
.scanlines {
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.07) 3px,
    rgba(0,0,0,0.07) 4px
  );
}

/* --- Header ----------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(13,15,14,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-bracket { color: var(--green-dim); }
.logo-name    { color: var(--green-bright); }
.logo-tld     { color: var(--fg-muted); }
.logo-cursor  {
  color: var(--green);
  animation: blink 1.1s step-end infinite;
  margin-left: 1px;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin-left: auto;
}
.nav-main a {
  color: var(--fg-muted);
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.nav-main a:hover {
  color: var(--fg);
  border-color: var(--border-bright);
  text-decoration: none;
}
.nav-cta {
  color: var(--green) !important;
  border-color: var(--green-dim) !important;
}
.nav-cta:hover {
  background: var(--green-dim);
  color: var(--green-bright) !important;
}
.nav-toggle { display: none; }

/* --- Main ------------------------------------------------- */
.site-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem var(--gap);
  min-height: calc(100vh - var(--header-h) - 80px);
}

/* --- Hero ------------------------------------------------- */
.hero {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 3rem 2.5rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), var(--amber), transparent);
}
.hero-eyebrow {
  font-size: 0.72rem;
  color: var(--green);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  font-weight: 600;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 1.2rem;
  letter-spacing: -0.03em;
}
.hero h1 em {
  font-style: normal;
  color: var(--green-bright);
}
.hero-sub {
  color: var(--fg-muted);
  max-width: 540px;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid;
  text-decoration: none;
}
.btn-primary {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green-bright);
}
.btn-primary:hover {
  background: var(--green);
  color: var(--bg);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border-bright);
  color: var(--fg-muted);
}
.btn-ghost:hover {
  border-color: var(--fg-muted);
  color: var(--fg);
  text-decoration: none;
}

/* Terminal motif on hero */
.hero-terminal {
  position: absolute;
  right: 2rem; bottom: 1.5rem;
  font-size: 0.7rem;
  color: var(--fg-dim);
  pointer-events: none;
  display: none;
}
@media (min-width: 640px) { .hero-terminal { display: block; } }

/* --- Section headings ------------------------------------- */
.section-label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- Post cards ------------------------------------------- */
.posts-grid { display: flex; flex-direction: column; gap: 0; }

.post-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  transition: background var(--transition);
}
.post-card:first-child { border-top: 1px solid var(--border); }
.post-card:hover { background: var(--bg-elevated); padding-left: 0.5rem; margin-left: -0.5rem; padding-right: 0.5rem; }

.post-meta {
  font-size: 0.7rem;
  color: var(--fg-dim);
  line-height: 1.4;
  padding-top: 0.15rem;
}
.post-meta-date { display: block; }
.post-meta-cat  { color: var(--amber-dim); }

.post-body h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.post-body h2 a { color: var(--fg); }
.post-body h2 a:hover { color: var(--green-bright); text-decoration: none; }
.post-excerpt { font-size: 0.82rem; color: var(--fg-muted); }

/* --- Breadcrumb ------------------------------------------- */
.breadcrumb {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--fg-muted); }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb-sep { color: var(--fg-dim); }
.breadcrumb-current { color: var(--fg); }

/* --- Article / content ------------------------------------ */
.article-header { margin-bottom: 2.5rem; }
.article-header h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 0.8rem;
}
.article-byline {
  font-size: 0.75rem;
  color: var(--fg-muted);
}
.article-byline span { color: var(--green); }

.article-body {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.85;
  color: #b0bca8;
  max-width: 680px;
}
.article-body p  { margin-bottom: 1.2em; }
.article-body h2 { font-family: var(--font-mono); font-size: 1rem; font-weight: 600; color: var(--fg); margin: 2rem 0 0.8rem; }
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: var(--radius);
  color: var(--amber);
}
.article-body pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-dim);
  padding: 1.2rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.82rem;
}
.article-body pre code { background: none; border: none; padding: 0; color: var(--fg-muted); }
.article-body a { color: var(--green); }

/* --- Category listing ------------------------------------- */
.cat-header { margin-bottom: 2.5rem; }
.cat-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.cat-header h1::before {
  content: '# ';
  color: var(--green-dim);
}

/* --- Error page ------------------------------------------- */
.error-page { text-align: center; padding: 5rem 0; }
.error-code {
  font-size: 5rem;
  font-weight: 700;
  color: var(--fg-dim);
  line-height: 1;
  margin-bottom: 1rem;
}
.error-msg { color: var(--fg-muted); margin-bottom: 2rem; }

/* --- Footer ----------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.2rem var(--gap);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.75rem;
}
.footer-prompt { color: var(--green-dim); }
.footer-cmd    { color: var(--fg-muted); }
.footer-mid    { display: flex; gap: 1.2rem; }
.footer-mid a  { color: var(--fg-dim); }
.footer-mid a:hover { color: var(--fg-muted); text-decoration: none; }
.footer-right  { color: var(--fg-dim); }

/* --- Utility ---------------------------------------------- */
.mt-0 { margin-top: 0; }
.mb-2 { margin-bottom: 2rem; }

/* --- Responsive ------------------------------------------- */
@media (max-width: 600px) {
  .nav-main { display: none; flex-direction: column; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--bg-elevated); border-bottom: 1px solid var(--border); padding: 1rem; gap: 0.4rem; }
  .nav-main.open { display: flex; }
  .nav-toggle { display: block; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--fg); font-size: 1.2rem; padding: 0.2rem 0.6rem; cursor: pointer; }
  .site-header { position: relative; }
  .post-card { grid-template-columns: 1fr; gap: 0.2rem; }
  .post-meta { display: flex; gap: 0.8rem; }
  .hero { padding: 2rem 1.5rem; }
}
