/*
Theme Name: Build Your Own Beast
Theme URI: https://buildyourownbeast.com
Author: Build Your Own Beast
Author URI: https://buildyourownbeast.com
Description: A techy, modern, terminal-inspired WordPress theme for the Build Your Own Beast DIY PC blog. Dark aesthetic with electric accents, sharp typography, and AdSense-ready ad slots.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: buildyourownbeast
Tags: blog, dark-mode, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   CSS RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
img, picture, svg, video { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   DESIGN TOKENS — terminal-inspired, electric accents
   ============================================================ */
:root {
  --bg-deep: #0a0e14;
  --bg-base: #0f141b;
  --bg-raised: #161c25;
  --bg-elevated: #1e2530;
  --border: #232b38;
  --border-bright: #2d3748;

  --text: #e4e8ef;
  --text-muted: #8b95a7;
  --text-dim: #5a6478;

  --accent: #00ff9c;
  --accent-hot: #00d489;
  --accent-glow: rgba(0, 255, 156, 0.15);
  --warn: #ffb547;
  --danger: #ff5570;
  --info: #6ec6ff;

  --font-display: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  --container: 1200px;
  --container-narrow: 760px;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px var(--border), 0 0 24px -8px var(--accent-glow);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  background-image:
    linear-gradient(rgba(0, 255, 156, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 156, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0;
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.125rem); margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); margin-top: 2rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1.25rem; color: var(--text); }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); transition: color 0.15s ease; }
a:hover { color: var(--accent-hot); text-decoration: underline; text-underline-offset: 3px; }
strong, b { font-weight: 700; color: #f5f7fa; }
em, i { font-style: italic; }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elevated);
  color: var(--accent);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
pre {
  font-family: var(--font-mono);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}
pre code { background: none; padding: 0; border: none; color: var(--text); }
blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
  background: linear-gradient(90deg, var(--accent-glow), transparent);
}
ul, ol { margin: 0 0 1.25rem 1.5rem; }
li { margin-bottom: 0.5rem; }
hr { border: none; border-top: 1px dashed var(--border-bright); margin: 2.5rem 0; }

/* LAYOUT */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 1.5rem; }

/* HEADER */
.site-header {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background-color: rgba(10, 14, 20, 0.9);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 2rem;
}
.site-branding { display: flex; align-items: center; gap: 0.75rem; }
.site-logo {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.site-logo::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
.site-logo .bracket { color: var(--text-dim); }
.site-logo .accent-text { color: var(--accent); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.site-tagline { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); display: none; }
@media (min-width: 768px) { .site-tagline { display: inline; } }
.main-nav ul { display: flex; align-items: center; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-body);
}
.main-nav a:hover { color: var(--text); background: var(--bg-raised); text-decoration: none; }
.main-nav a.active, .main-nav .current-menu-item a { color: var(--accent); }
.mobile-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: block;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .main-nav.open ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav.open a { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); }
  .mobile-menu-toggle { display: flex; }
}

/* HERO */
.hero { padding: 5rem 0 4rem; position: relative; overflow: hidden; }
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; max-width: 820px; }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-eyebrow::before { content: '$'; color: var(--text-dim); }
.hero-eyebrow .cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 4px;
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
.hero h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  letter-spacing: -0.035em;
}
.hero h1 .accent-text { color: var(--accent); position: relative; display: inline-block; }
.hero-desc { font-size: 1.125rem; color: var(--text-muted); max-width: 600px; margin-bottom: 2rem; }
.hero-stats {
  display: flex;
  gap: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  flex-wrap: wrap;
}
.hero-stat { display: flex; flex-direction: column; }
.hero-stat-value { font-family: var(--font-display); font-size: 1.75rem; color: var(--accent); font-weight: 700; line-height: 1; }
.hero-stat-label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.5rem; }

/* SECTION HEADERS */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-title::before { content: '//'; color: var(--accent); font-weight: 400; }
.section-link { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); }
.section-link:hover { color: var(--accent); }

/* POST GRID */
.posts-section { padding: 3rem 0 5rem; }
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}
.post-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--border-bright); box-shadow: var(--shadow-glow); }
.post-card-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-deep));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}
.post-card-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 156, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 156, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
}
.post-card-thumb-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1rem;
  letter-spacing: 0.1em;
}
.post-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.post-card-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.post-card-category { color: var(--accent); display: inline-flex; align-items: center; gap: 0.375rem; }
.post-card-category::before { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.post-card h3 { font-size: 1.1875rem; line-height: 1.3; margin: 0; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); text-decoration: none; }
.post-card-excerpt { color: var(--text-muted); font-size: 0.9375rem; line-height: 1.55; margin: 0; }
.post-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.post-card-readmore { color: var(--accent); font-weight: 500; }

/* SINGLE POST/PAGE */
.single-post-wrap, .single-page-wrap { padding: 3rem 0 5rem; }
.post-header { margin-bottom: 3rem; max-width: var(--container-narrow); margin-left: auto; margin-right: auto; }
.post-breadcrumbs { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); margin-bottom: 1.5rem; }
.post-breadcrumbs a { color: var(--text-muted); }
.post-breadcrumbs a:hover { color: var(--accent); }
.post-breadcrumbs .sep { color: var(--text-dim); margin: 0 0.5rem; }
.post-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}
.post-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 1.25rem; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.post-meta-item { display: flex; align-items: center; gap: 0.375rem; }
.post-meta-item strong { color: var(--text); font-weight: 500; }
.post-content {
  max-width: var(--container-narrow);
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.75;
}
.post-content p { margin-bottom: 1.5rem; color: var(--text); }
.post-content h2 {
  font-size: 1.625rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  position: relative;
  padding-left: 1.25rem;
}
.post-content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.post-content h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.post-content ul, .post-content ol { margin: 0 0 1.5rem 1.5rem; }
.post-content li { margin-bottom: 0.625rem; line-height: 1.7; }
.post-content img { border-radius: var(--radius); margin: 1.5rem 0; border: 1px solid var(--border); }
.post-content .callout {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.post-content .callout strong { color: var(--accent); display: block; margin-bottom: 0.25rem; }

/* AD SLOTS */
.ad-slot { margin: 2.5rem auto; max-width: var(--container-narrow); padding: 0 1.5rem; }
.ad-slot-inner {
  background: var(--bg-raised);
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  display: block;
}

/* SIDEBAR */
.has-sidebar { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 992px) { .has-sidebar { grid-template-columns: 1fr 300px; } }
.sidebar { display: flex; flex-direction: column; gap: 2rem; }
.widget {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.widget-title {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.widget-title::before { content: '>'; color: var(--accent); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px dashed var(--border); }
.widget li:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.widget a { color: var(--text-muted); font-size: 0.9rem; display: block; transition: color 0.15s ease; }
.widget a:hover { color: var(--accent); text-decoration: none; }

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.875rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.pagination .page-numbers:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.pagination .page-numbers.current { background: var(--accent); color: var(--bg-deep); border-color: var(--accent); font-weight: 700; }

/* FOOTER */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }
.footer-brand .site-logo { margin-bottom: 1rem; font-size: 1.25rem; }
.footer-desc { color: var(--text-muted); font-size: 0.9rem; max-width: 360px; }
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.625rem; }
.footer-col a { color: var(--text-muted); font-size: 0.875rem; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--accent); text-decoration: none; }

/* COMMENTS */
.comments-area {
  max-width: var(--container-narrow);
  margin: 4rem auto 0;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}
.comments-title {
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}
.comment-list { list-style: none; padding: 0; }
.comment-body {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.comment-author { font-weight: 600; }
.comment-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.5rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.comment-form .submit,
button[type="submit"], input[type="submit"] {
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.comment-form .submit:hover,
button[type="submit"]:hover, input[type="submit"]:hover {
  background: var(--accent-hot);
  transform: translateY(-1px);
}

/* ARCHIVE HEADER */
.archive-header {
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}
.archive-eyebrow { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 0.75rem; }
.archive-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; }
.archive-desc { color: var(--text-muted); margin-top: 0.75rem; max-width: 600px; }

/* SEARCH FORM */
.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] {
  flex: 1;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
.search-form input[type="search"]:focus { outline: none; border-color: var(--accent); }

/* UTILITY */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1.5rem auto; }
.wp-caption-text { font-size: 0.8125rem; color: var(--text-dim); font-style: italic; text-align: center; margin-top: 0.5rem; }
