/* ═══════════════════════════════════════════════════════
   TERMINAL AESTHETIC — Minimalist Personal Page
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-secondary: #0f1517;
  --bg-card: #121a1d;
  --border: #1e3038;
  --text: #c8c8c8;
  --text-dim: #5a7a8a;
  --text-bright: #e2f0f4;
  --accent: #22d3ee;
  --accent-dim: #164e63;
  --accent-bright: #67e8f9;
  --red: #f87171;
  --yellow: #fbbf24;
  --blue: #38bdf8;
  --purple: #a78bfa;
  --cursor-blink: 1s;
}

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

::selection {
  background: var(--accent-dim);
  color: var(--accent-bright);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── Scanline overlay ── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ── Layout ── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header / Nav ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  backdrop-filter: blur(10px);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
}

.logo .prompt {
  color: var(--text-dim);
}

.logo .tilde {
  color: var(--accent);
}

.logo .cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent);
  animation: blink var(--cursor-blink) step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

nav {
  display: flex;
  gap: 4px;
}

nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.2s ease;
  position: relative;
}

nav a:hover {
  color: var(--text-bright);
  background: var(--bg-secondary);
}

nav a.active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.06);
}

nav a::before {
  content: './';
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.2s;
}

nav a:hover::before,
nav a.active::before {
  opacity: 1;
}

/* ── Main Content ── */
main {
  padding: 48px 0 80px;
  min-height: calc(100vh - 80px);
}

.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Home Section ── */
.hero {
  padding: 40px 0 60px;
}

.hero-greeting {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 12px;
}

.hero-greeting .comment {
  color: var(--text-dim);
}

.hero h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero h1 .highlight {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 32px;
  max-width: 560px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.meta-item .key {
  color: var(--purple);
}

.meta-item .value {
  color: var(--text);
}

.meta-item .sep {
  color: var(--text-dim);
}

/* ── Terminal Block ── */
.terminal-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 32px 0;
}

.terminal-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.terminal-dots span:nth-child(1) { background: var(--red); }
.terminal-dots span:nth-child(2) { background: var(--yellow); }
.terminal-dots span:nth-child(3) { background: var(--accent); }

.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

.terminal-body {
  padding: 20px;
  font-size: 13px;
  line-height: 1.8;
}

.terminal-line {
  margin-bottom: 4px;
}

.terminal-line .prompt-sign {
  color: var(--accent);
  margin-right: 8px;
}

.terminal-line .cmd {
  color: var(--text-bright);
}

.terminal-line .output {
  color: var(--text-dim);
  padding-left: 20px;
}

.terminal-line .string {
  color: var(--accent);
}

.terminal-line .number {
  color: var(--yellow);
}

.terminal-line .keyword {
  color: var(--purple);
}

.terminal-line .comment-line {
  color: var(--text-dim);
  font-style: italic;
}

/* ── Social Links ── */
.social-links {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.social-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(34, 211, 238, 0.04);
}

.social-link .arrow {
  transition: transform 0.2s;
}

.social-link:hover .arrow {
  transform: translateX(3px);
}

/* ── Section Headers ── */
.section-header {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 .prefix {
  color: var(--accent);
  font-weight: 400;
}

.section-header .desc {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 6px;
}

/* ── Blog Cards ── */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.blog-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.blog-card:last-child {
  border-bottom: none;
}

.blog-card:hover {
  padding-left: 12px;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 12px;
}

.blog-card-date {
  color: var(--text-dim);
}

.blog-card-tag {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.08);
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 11px;
}

.blog-card h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 6px;
  transition: color 0.2s;
}

.blog-card:hover h3 {
  color: var(--accent);
}

.blog-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.blog-card .read-more {
  color: var(--accent);
  font-size: 12px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.blog-card:hover .read-more {
  opacity: 1;
}

/* ── Project Cards ── */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.project-card-header h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-card-header h3 .icon {
  color: var(--accent);
  font-size: 14px;
}

.project-card-time {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 4px;
  border-left: 2px solid var(--border);
}

.time-item {
  color: var(--text-dim);
}

.time-item .time-label {
  color: var(--purple);
  margin-right: 4px;
}

.time-sep {
  color: var(--border);
}

.project-card-status {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 3px;
  font-weight: 500;
}

.status-active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
}

.status-wip {
  color: var(--yellow);
  background: rgba(251, 191, 36, 0.1);
}

.status-archived {
  color: var(--text-dim);
  background: rgba(102, 102, 102, 0.15);
}

.project-card p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.6;
}

.project-card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tech-tag {
  font-size: 11px;
  color: var(--text-dim);
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.project-footer-left {
  display: flex;
  gap: 16px;
}

.project-card-footer a {
  color: var(--text-dim);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.project-card-footer a:hover {
  color: var(--accent);
}

.project-footer-stats {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.stat-item {
  color: var(--text-dim);
  font-size: 12px;
}

/* ── Blog Detail View ── */
.blog-detail {
  display: none;
}

.blog-detail.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.blog-detail-back {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.blog-detail-back:hover {
  color: var(--accent);
}

.blog-detail h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 12px;
}

.blog-detail-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.blog-content {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
}

.blog-content p {
  margin-bottom: 20px;
}

.blog-content code {
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--accent);
}

.blog-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}

.blog-content h2 {
  font-size: 18px;
  color: var(--text-bright);
  margin: 36px 0 16px;
  font-weight: 600;
}

.blog-content h3 {
  font-size: 15px;
  color: var(--text-bright);
  margin: 28px 0 12px;
  font-weight: 500;
}

.blog-content ul, .blog-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.blog-content li {
  margin-bottom: 8px;
  color: var(--text);
}

.blog-content li::marker {
  color: var(--accent);
}

.blog-content blockquote {
  border-left: 3px solid var(--accent-dim);
  padding-left: 16px;
  margin: 24px 0;
  color: var(--text-dim);
  font-style: italic;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--accent);
}

/* ── ASCII Art ── */
.ascii-art {
  color: var(--accent-dim);
  font-size: 10px;
  line-height: 1.2;
  margin: 20px 0;
  user-select: none;
  white-space: pre;
}

/* ── Loading cursor animation ── */
.typing-effect {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent);
  animation: typing 2s steps(40) 1, blinkCaret 0.75s step-end infinite;
  max-width: fit-content;
}

@keyframes typing {
  from { max-width: 0; }
  to { max-width: 100%; }
}

@keyframes blinkCaret {
  50% { border-color: transparent; }
}

/* ── Command Prompt Input (decorative) ── */
.cmd-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 13px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
}

.cmd-prompt .user {
  color: var(--accent);
}

.cmd-prompt .at {
  color: var(--text-dim);
}

.cmd-prompt .host {
  color: var(--purple);
}

.cmd-prompt .colon {
  color: var(--text-dim);
}

.cmd-prompt .path {
  color: var(--blue);
}

.cmd-prompt .dollar {
  color: var(--text-dim);
}

.cmd-prompt .input-area {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-bright);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  caret-color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  header .container {
    flex-direction: column;
    gap: 12px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero-meta {
    flex-direction: column;
    gap: 8px;
  }

  .social-links {
    flex-direction: column;
  }

  .social-link {
    justify-content: center;
  }

  nav {
    gap: 2px;
  }

  nav a {
    padding: 6px 10px;
    font-size: 12px;
  }

  .project-card {
    padding: 18px;
  }

  footer .container {
    flex-direction: column;
    gap: 8px;
  }
}
