/* 
 * Bruno's Personal Portfolio & Blog CSS Stylesheet
 * Primary Font: Code New Roman (Self-Hosted Monospace)
 * Style: Cozy monospaced engineering vault. Nostalgic but highly polished and professional.
 */

/* Font face definitions for Code New Roman */
@font-face {
  font-family: 'Code New Roman';
  src: url('../fonts/Code-New-Roman-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Code New Roman';
  src: url('../fonts/Code-New-Roman-Bold.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Code New Roman';
  src: url('../fonts/Code-New-Roman-Italic.otf') format('opentype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

/* Custom HSL Palettes for Premium Slate Dark Theme */
:root {
  --bg-color: #0f172a;
  --panel-bg: #1e293b;
  --text-color: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #475569;
  --border-style: solid;
  --link-color: #38bdf8;
  --link-hover: #fdba74;
  --accent-color: #0ea5e9;
  --accent-light: #334155;
  --card-shadow: 3px 3px 0px #475569;

  --scrollbar-bg: #1e293b;
  --scrollbar-thumb: #475569;
}

/* Global Reset & Base Setup */
* {
  box-sizing: border-box;
}

/* Custom Text Selection Styling */
::selection {
  background-color: var(--accent-color);
  color: var(--bg-color);
}
::-moz-selection {
  background-color: var(--accent-color);
  color: var(--bg-color);
}


body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  background-image: url('../images/pcb-background.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-color);
  font-family: 'Code New Roman', Consolas, Monaco, monospace;
  font-size: 15px;
  line-height: 1.65;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 2px solid var(--scrollbar-bg);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'Code New Roman', monospace;
  margin-top: 0;
  color: var(--text-color);
}

h1 {
  font-size: 1.6rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 6px;
  margin-bottom: 15px;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.25rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

p {
  margin: 0 0 15px 0;
}

/* Limit paragraph reading widths in content areas for comfort */
.main-content p, .post-content p {
  max-width: 85ch;
}

/* Retro Fieldsets (Cozy container blocks with tactile shadow) */
fieldset {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 18px;
  margin-bottom: 25px;
  background-color: var(--panel-bg);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

legend {
  font-weight: bold;
  color: var(--text-color);
  padding: 2px 10px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  font-size: 12px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Centered Container Layout (Fits screen gracefully on wide displays) */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 35px;
}

.site-header {
  margin-bottom: 30px;
}

.header-inner {
  border: 1px solid var(--border-color);
  background-color: var(--panel-bg);
  padding: 25px;
  text-align: center;
  border-radius: 4px;
  box-shadow: var(--card-shadow);
}

.site-title {
  margin: 0;
  font-size: 2.1rem;
  font-weight: bold;
  border: none;
  padding: 0;
}

.site-subtitle {
  margin: 6px auto 0 auto;
  max-width: 85ch;
  font-size: 14px;
  color: var(--text-muted);
}

/* Liquid grid: Sidebar stays fixed, Main Panel stretches to fill remaining screen */
.main-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 25px;
}

@media (max-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .container {
    padding: 15px;
  }
}

/* Sidebar Navigation */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.nav-list li {
  margin-bottom: 6px;
}

.nav-list a {
  display: block;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  font-size: 13px;
  transition: all 0.15s ease-in-out;
}

.nav-list a:hover {
  background-color: var(--accent-light);
  transform: translateX(4px);
  text-decoration: none;
}

.nav-list a.active {
  background-color: var(--accent-light);
  border-left: 4px solid var(--border-color);
  text-decoration: none;
  font-weight: bold;
}



/* Content Area */
.main-content {
  min-width: 0;
}

/* Custom terminal list bullets for dynamic text-vibe */
.post-content ul,
.main-content ul {
  list-style-type: none;
  padding-left: 0;
}

.post-content ul li::before,
.main-content ul li::before {
  content: "■ ";
  color: var(--link-color);
  font-size: 10px;
  margin-right: 8px;
  vertical-align: middle;
}

.post-content ul li,
.main-content ul li {
  margin-bottom: 8px;
  padding-left: 5px;
}

/* Blog listings & archive page */
.post-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.post-item {
  margin-bottom: 20px;
  border-bottom: 1px dotted var(--border-color);
  padding-bottom: 15px;
}
.post-item:last-child {
  border-bottom: none;
}

.post-date {
  font-size: 13px;
  color: var(--text-muted);
  display: inline-block;
  margin-right: 8px;
  font-weight: bold;
}

.post-link {
  font-size: 1.15rem;
}

.post-description {
  margin-top: 5px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Post Detail Content Styling */
.post-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.post-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.post-content {
  font-size: 15px;
}

.post-content code {
  font-family: 'Code New Roman', monospace;
  background-color: var(--panel-bg);
  padding: 2px 5px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 14px;
}

.post-content pre {
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 12px;
  overflow-x: auto;
  border-radius: 4px;
  margin-bottom: 18px;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.1);
  width: 100%;
}

.post-content pre code {
  background-color: transparent;
  padding: 0;
  border: none;
  font-size: 13px;
}

.post-content blockquote {
  border-left: 3px solid var(--border-color);
  margin: 0 0 15px 0;
  padding: 5px 0 5px 15px;
  color: var(--text-muted);
  font-style: italic;
}

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.project-card {
  border: 1px solid var(--border-color);
  background-color: var(--panel-bg);
  padding: 18px;
  border-radius: 4px;
  box-shadow: 2px 2px 0px var(--border-color);
  width: 100%;
}

.project-title {
  font-size: 1.2rem;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
}

.project-specs {
  display: table;
  width: 100%;
  font-size: 12px;
  margin: 12px 0 0 0;
  border-collapse: collapse;
}

.spec-row {
  display: table-row;
  border-bottom: 1px dotted var(--border-color);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  display: table-cell;
  font-weight: bold;
  padding: 5px 8px 5px 0;
  color: var(--text-muted);
  width: 120px;
}

.spec-value {
  display: table-cell;
  padding: 5px 0;
}



/* Footer Section */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0 auto;
  max-width: 85ch;
}

/* Cozy ASCII Cat Box & Interactions */
.cat-box {
  margin-top: 5px;
  text-align: center;
  position: relative; /* for floaty hearts */
}

#ascii-cat {
  font-family: Consolas, Monaco, 'Lucida Console', monospace;
  font-size: 11px;
  line-height: 1.25;
  margin: 0;
  white-space: pre;
  overflow: hidden;
  text-align: left;
  color: var(--link-hover);
  font-weight: bold;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
}

#ascii-cat:active {
  transform: scale(0.96);
}

.cat-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  border-top: 1px dotted var(--border-color);
  padding-top: 6px;
}

.retro-btn {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-family: Consolas, Monaco, 'Lucida Console', monospace;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.retro-btn:hover {
  background-color: var(--accent-light);
  border-color: var(--link-hover);
  color: var(--link-hover);
  transform: translateY(-1px);
}

.retro-btn:active {
  transform: translateY(1px);
}

/* Floaty hearts animation */
.floaty-text {
  position: absolute;
  color: #f43f5e;
  font-size: 14px;
  font-weight: bold;
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-40px) scale(1.4);
    opacity: 0;
  }
}


