/* css/styles.css */
@import url('https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P&display=swap');

:root {
  --bg-stars: #000;
  --window-bg: #e8e4db;
  /* Pale beige */
  --window-border: #000;
  /* Sharp 1px black */
  --title-bar: #b2b1ce;
  /* Muted lavender gray */
  --text-main: #000;
  --text-secondary: #555;
  --link-color: #000080;
  /* Navy blue */
  --accent-color: #ff33cc;
  --accent-pink: #ff33cc;
  --accent-yellow: #ffff00;
  --accent-green: #33ff33;
  --surface-border: #ccc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'VT323', monospace;
  background-color: var(--bg-stars);
  color: var(--text-main);
  line-height: 1.4;
  overflow-x: hidden;
  font-size: 1.4rem;
  /* Simple crisp star pattern using SVG */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="%23000"/><rect x="10" y="20" width="2" height="2" fill="%23fff"/><rect x="40" y="70" width="2" height="2" fill="%23fff"/><rect x="80" y="30" width="2" height="2" fill="%23fff"/><rect x="25" y="85" width="2" height="2" fill="%23fff"/><rect x="70" y="90" width="2" height="2" fill="%23fff"/></svg>');
  background-size: 150px 150px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Press Start 2P', cursive;
  line-height: 1.4;
  text-transform: uppercase;
}

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

/* Base Window Container */
.os-window {
  max-width: 900px;
  margin: 4rem auto;
  background: var(--window-bg);
  border: 1px solid var(--window-border);
  display: flex;
  flex-direction: column;
  position: relative;
  /* A sharp flat shadow */
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.5);
  width: 95%;
  /* ensure margin on small screens */
}

/* Title Bar */
.os-title-bar {
  background: var(--title-bar);
  border-bottom: 1px solid var(--window-border);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.os-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.os-buttons {
  display: flex;
  gap: 2px;
}

.os-buttons span {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--window-border);
}

.os-buttons span:nth-child(1) {
  background: var(--accent-pink);
}

.os-buttons span:nth-child(2) {
  background: var(--accent-yellow);
}

.os-buttons span:nth-child(3) {
  background: var(--accent-green);
}

.os-title {
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #000;
  display: flex;
  align-items: center;
}

.os-title::before {
  content: '📁';
  margin-right: 5px;
}

/* Right side window controls (Minimize, Maximize, Close) */
.os-controls {
  display: flex;
  gap: 2px;
}

.os-controls span {
  width: 16px;
  height: 14px;
  border: 1px solid var(--window-border);
  background: #c0c0c0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  font-family: sans-serif;
  cursor: pointer;
  box-shadow: inset -1px -1px 0 #888, inset 1px 1px 0 #fff;
}

/* OS Body (Sidebar + Content) */
.os-body {
  display: flex;
  min-height: 60vh;
  min-width: 0;
  max-width: 100%;
}

/* Sidebar */
.os-sidebar {
  width: 220px;
  border-right: 1px solid var(--window-border);
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.os-profile {
  margin-bottom: 30px;
}

.os-profile img {
  width: 100px;
  height: 100px;
  border: 1px solid var(--window-border);
  background: #9cb3c8;
  object-fit: cover;
  padding: 4px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.nav-links a {
  font-family: 'VT323', monospace;
  font-size: 1.8rem;
  color: var(--link-color);
  border-bottom: 2px solid var(--link-color);
  padding-bottom: 2px;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(0, 0, 128, 0.1);
}

.rainbow-bar {
  width: 100%;
  height: 12px;
  border: 1px solid var(--window-border);
  background: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
  margin-top: 20px;
}

/* Main Content Area */
.os-content {
  flex: 1;
  padding: 40px;
  min-width: 0;
  /* Fixes flexbox overflow */
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Dripping Rainbow Text Simulation */
.gradient-text,
.post-title,
h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(1.2rem, 5vw, 2.5rem);
  background: linear-gradient(180deg, #ff0000, #ffff00, #00ff00, #0000ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--window-border);
  position: relative;
  display: inline-block;
  margin-bottom: 40px;
  line-height: 1.4;
  word-break: break-word;
  /* Ensure huge words break */
}

/* Glitch/Drip pseudo elements */
.gradient-text::after,
.post-title::after,
h1::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 5%;
  width: 6px;
  height: 20px;
  background: #ff00ff;
  border: 1px solid var(--window-border);
  border-top: none;
  border-radius: 0 0 5px 5px;
  box-shadow: 40px -8px 0 0 #00ff00, 90px -4px 0 0 #0000ff;
}

/* Cards (Under Construction box style) */
.grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.card {
  display: block;
  background: #333;
  border: 1px solid var(--window-border);
  padding: 4px;
  text-decoration: none;
  /* Shadow matching the image's dark aura */
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.6);
  transition: transform 0.1s;
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.6);
}

.card-inner {
  background: linear-gradient(180deg, #444, #111);
  border: 1px solid #777;
  padding: 25px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  /* subtle tv scanline overlay */
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 4px;
}

.card-title {
  color: #fff;
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  text-shadow: 2px 0 var(--accent-pink), -2px 0 #0ff;
  /* Glitch split */
  margin-bottom: 15px;
}

.card-desc {
  color: #ddd;
  font-size: 1.2rem;
  font-family: 'VT323', monospace;
  margin-bottom: 20px;
}

.card-tag {
  color: #000;
  background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #0000ff);
  padding: 4px 10px;
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
  margin-bottom: 20px;
  border: 1px solid var(--window-border);
  display: inline-block;
  box-shadow: 2px 2px 0 #000;
}

.card-meta {
  color: #888;
  font-size: 1rem;
}

/* Posts / Articles styling */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
}

.post-content p {
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}

.post-content h2,
.post-content h3 {
  font-family: 'Press Start 2P', cursive;
  color: #000;
  font-size: 1.2rem;
  margin: 3rem 0 1.5rem 0;
  text-transform: uppercase;
}

.post-content ul,
.post-content ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}

.post-content pre {
  background: #fff;
  color: #000;
  border: 1px solid var(--window-border);
  padding: 15px;
  font-family: monospace;
  font-size: 1.2rem;
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 1.5rem;
  box-shadow: 4px 4px 0 #000;
}

.post-content code {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
}

.post-content blockquote {
  border-left: 4px solid var(--accent-pink);
  padding-left: 1rem;
  font-style: italic;
  background: rgba(255, 51, 204, 0.1);
}

.post-content img {
  max-width: 100%;
  border: 1px solid var(--window-border);
  box-shadow: 4px 4px 0 #000;
  margin: 1.5rem 0;
}

footer {
  text-align: center;
  margin-top: 2rem;
  padding-bottom: 2rem;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  color: #fff;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .os-body {
    flex-direction: column;
  }

  .os-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--window-border);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    flex-wrap: wrap;
  }

  .os-profile {
    margin-bottom: 0;
  }

  .os-profile img {
    width: 60px;
    height: 60px;
  }

  .rainbow-bar {
    display: none;
  }

  .os-content {
    padding: 20px;
  }

  /* About Layout Fix Mobile */
  .about-layout {
    display: block;
  }

  .about-image {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 30px;
  }
}

/* About Page Layout */
.about-layout {
  display: block;
}

.about-layout::after {
  content: "";
  display: table;
  clear: both;
}

.about-image {
  float: left;
  width: 300px;
  max-width: 100%;
  margin-right: 30px;
  margin-bottom: 20px;
  border: 1px solid var(--window-border);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  padding: 4px;
  background: #fff;
}

.about-content p {
  margin-bottom: 2rem;
  font-size: 1.4rem;
  line-height: 1.6;
}

.stack-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.retro-tag {
  background: #c0c0c0;
  color: #000;
  padding: 6px 10px;
  border: 1px solid var(--window-border);
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

/* Sidebar Date Index */
.date-index {
  margin-top: 2rem;
  width: 100%;
}

.date-index h3 {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  margin-bottom: 15px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.date-index ul {
  list-style-type: none;
}

.date-index li {
  margin-bottom: 10px;
}

.date-index a {
  font-family: 'VT323', monospace;
  font-size: 1.4rem;
  color: var(--link-color);
  text-decoration: none;
  display: inline-block;
  border-bottom: 1px solid transparent;
}

.date-index a:hover {
  background: var(--accent-pink);
  color: #000;
}

@media (max-width: 768px) {
  .date-index {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--window-border);
  }

  .date-index ul {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
  }
}