/* ===================================================
   rmstar.sh — Terminal Hacker Theme
   =================================================== */

/* --- Google Fonts import for VT323 terminal font --- */
@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --bg:          #0a0a0a;
  --bg-panel:    #111111;
  --bg-hover:    #1a1a1a;
  --green:       #00ff41;
  --green-dim:   #00cc33;
  --green-dark:  #007a1f;
  --amber:       #ffaa00;
  --cyan:        #00ffcc;
  --red:         #ff3333;
  --white:       #e0e0e0;
  --grey:        #555555;
  --border:      #1f3320;
  --font-mono:   'Share Tech Mono', 'Courier New', Courier, monospace;
  --font-title:  'VT323', 'Courier New', Courier, monospace;
  --radius:      4px;
  --max-width:   900px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  /* subtle scanline overlay */
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--green-dark); border-radius: 3px; }

/* --- Links --- */
a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

a:hover, a:focus {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  outline: none;
}

/* --- Skip link for accessibility --- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--green);
  color: var(--bg);
  padding: 8px 16px;
  z-index: 100;
  font-weight: bold;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { top: 0; }

/* ===================================================
   HEADER / NAV
   =================================================== */
.site-header {
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--green-dark);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.07);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  border-bottom: none;
}

.site-logo img,
.site-logo svg {
  height: 44px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green-dim);
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  border-bottom: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-link::before {
  content: './';
  color: var(--green-dark);
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
  color: var(--green);
  border-color: var(--green-dark);
  background: var(--bg-hover);
}

/* Hamburger for mobile */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--green-dark);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: var(--radius);
}

.nav-toggle:hover {
  border-color: var(--green);
  background: var(--bg-hover);
}

/* ===================================================
   MAIN LAYOUT
   =================================================== */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ===================================================
   PROMPT / HERO BANNER
   =================================================== */
.prompt-banner {
  border: 1px solid var(--green-dark);
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
  position: relative;
  overflow: hidden;
}

.prompt-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
}

.prompt-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.prompt-sign {
  color: var(--green-dark);
  font-size: 1.1rem;
  user-select: none;
}

.prompt-cmd {
  color: var(--green);
  font-size: 1.1rem;
}

.prompt-title {
  font-family: var(--font-title);
  font-size: 2.8rem;
  color: var(--green);
  line-height: 1.1;
  margin: 0.5rem 0 0.75rem;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

.prompt-desc {
  color: var(--green-dim);
  font-size: 0.9rem;
  max-width: 60ch;
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 1em;
  background: var(--green);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ===================================================
   SECTION HEADINGS
   =================================================== */
.section-heading {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-heading::before { content: '# '; color: var(--amber); }
.section-heading::after  {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===================================================
   POST CARDS (index listing)
   =================================================== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-dark);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  align-items: start;
}

.post-card:hover {
  border-left-color: var(--green);
  box-shadow: -2px 0 12px rgba(0, 255, 65, 0.12);
}

.post-card-title {
  grid-column: 1;
  font-family: var(--font-title);
  font-size: 1.5rem;
  line-height: 1.2;
}

.post-card-title a {
  color: var(--green);
  border-bottom: none;
}

.post-card-title a:hover {
  color: var(--cyan);
}

.post-card-date {
  grid-column: 2;
  grid-row: 1;
  font-size: 0.78rem;
  color: var(--grey);
  white-space: nowrap;
  padding-top: 0.3rem;
}

.post-card-date::before { content: '@ '; color: var(--green-dark); }

.post-card-excerpt {
  grid-column: 1 / -1;
  color: var(--white);
  font-size: 0.88rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

.post-card-tags {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.tag {
  font-size: 0.72rem;
  color: var(--green-dark);
  border: 1px solid var(--green-dark);
  border-radius: 2px;
  padding: 1px 6px;
}

.tag::before { content: '#'; }

/* ===================================================
   ARTICLE / POST PAGE
   =================================================== */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--grey);
  margin-bottom: 0.75rem;
}

.article-meta .meta-date::before { content: '> date: '; color: var(--green-dark); }
.article-meta .meta-author::before { content: '> author: '; color: var(--green-dark); }
.article-meta .meta-read::before { content: '> read-time: '; color: var(--green-dark); }

.article-title {
  font-family: var(--font-title);
  font-size: 3rem;
  color: var(--green);
  line-height: 1.1;
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.article-subtitle {
  color: var(--green-dim);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* Article body */
.article-body {
  color: var(--white);
  font-size: 0.93rem;
  max-width: 68ch;
}

.article-body h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--green);
  margin: 2rem 0 0.75rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--green-dark);
}

.article-body h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--cyan);
  margin: 1.5rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-body p { margin-bottom: 1rem; }

.article-body a {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-body li { margin-bottom: 0.25rem; }

.article-body li::marker { color: var(--green-dark); }

.article-body blockquote {
  border-left: 3px solid var(--amber);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: var(--bg-panel);
  color: var(--amber);
  font-style: italic;
}

.article-body code {
  font-family: var(--font-mono);
  background: #0f1f10;
  color: var(--green);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 0.88em;
  border: 1px solid var(--border);
}

.article-body pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-dark);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  position: relative;
}

.article-body pre::before {
  content: attr(data-lang);
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 0.7rem;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--green);
}

/* ===================================================
   BACK LINK / BREADCRUMB
   =================================================== */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--grey);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--green-dim); }
.breadcrumb .sep { margin: 0 0.4rem; color: var(--green-dark); }

/* ===================================================
   ABOUT PAGE
   =================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.info-block {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.info-block h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.info-block h3::before { content: '> '; color: var(--amber); }

.info-block p {
  color: var(--white);
  font-size: 0.88rem;
  opacity: 0.75;
}

.skill-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.skill-list li {
  font-size: 0.85rem;
  color: var(--green-dim);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-list li::before {
  content: '[x]';
  color: var(--green);
  font-size: 0.75rem;
}

/* ASCII art decoration */
.ascii-art {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--green-dark);
  white-space: pre;
  overflow-x: auto;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ===================================================
   FOOTER
   =================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--grey);
}

.site-footer a { color: var(--green-dark); }
.site-footer a:hover { color: var(--green); }

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-prompt::before { content: '$ '; color: var(--green-dark); }

/* ===================================================
   PAGINATION
   =================================================== */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2.5rem;
}

.page-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--green-dim);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius);
  background: var(--bg-panel);
  cursor: pointer;
  text-decoration: none;
  border-bottom: none;
  transition: all 0.15s;
}

.page-btn:hover,
.page-btn.current {
  color: var(--green);
  border-color: var(--green-dark);
  background: var(--bg-hover);
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 680px) {
  :root { font-size: 14px; }

  .header-inner { padding: 0 1rem; }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--green-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 1rem;
    gap: 0.25rem;
  }

  .site-nav.open { display: flex; }

  .nav-toggle { display: block; }

  .site-main { padding: 1.25rem 1rem 3rem; }

  .prompt-title { font-size: 2rem; }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-card-date {
    grid-column: 1;
    grid-row: auto;
  }

  .article-title { font-size: 2.2rem; }

  .about-grid { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
  * { transition-duration: 0s !important; animation-duration: 0s !important; }
}
