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

:root {
  --bg: #0a0e14;
  --bg-light: #111922;
  --fg: #c5c8c6;
  --accent: #00d4ff;
  --accent-dim: #00d4ff33;
  --green: #00ff41;
  --yellow: #ffb000;
  --red: #ff3333;
  --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Source Code Pro', 'Consolas', monospace;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a:hover {
  opacity: 0.8;
}

/* ========== CRT Scanline Effect ========== */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ========== Layout ========== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
  position: relative;
}

/* ========== Terminal Header ========== */
.terminal-header {
  margin-bottom: 32px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-light);
  border-radius: 8px 8px 0 0;
  border: 1px solid #1e2a3a;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }

.terminal-title {
  margin-left: 12px;
  color: #5c6773;
  font-size: 0.85rem;
}

/* ========== Terminal Body ========== */
.terminal-body {
  padding: 24px;
  background: var(--bg-light);
  border: 1px solid #1e2a3a;
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-bottom: 32px;
}

/* ========== Sections ========== */
.section {
  margin-bottom: 28px;
}

.section:last-of-type {
  margin-bottom: 0;
}

/* ========== Prompt ========== */
.prompt {
  margin-bottom: 6px;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
}

.user {
  color: var(--green);
  font-weight: bold;
}

.host {
  color: var(--accent);
}

.cmd {
  color: var(--fg);
}

/* ========== Output ========== */
.output {
  padding-left: 24px;
  margin-bottom: 4px;
  color: #a0a8b4;
  font-size: 0.9rem;
}

.output p {
  margin-bottom: 4px;
}

/* ========== Skills ========== */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.skill-tag {
  padding: 3px 10px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-dim);
}

/* ========== Posts ========== */
.posts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.post-item {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid #1a2332;
  transition: padding-left 0.2s, color 0.2s;
}

.post-item:hover {
  padding-left: 8px;
  color: #fff;
  opacity: 1;
}

.post-date {
  color: #5c6773;
  font-size: 0.8rem;
  flex-shrink: 0;
  min-width: 90px;
}

.post-title {
  color: var(--fg);
}

.post-item:hover .post-title {
  color: var(--accent);
}

/* ========== Contact ========== */
.contact {
  padding-top: 4px;
}

.contact .label {
  color: #5c6773;
  margin-right: 8px;
}

/* ========== Cursor ========== */
.active-line {
  margin-top: 28px;
  margin-bottom: 0;
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 18px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

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

/* ========== Footer ========== */
.terminal-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #3d4450;
}

.footer-line {
  margin-bottom: 12px;
  color: #2a3240;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.footer-info .highlight {
  color: var(--accent);
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
  .container {
    padding: 20px 12px;
  }

  .terminal-body {
    padding: 16px;
  }

  .output {
    padding-left: 12px;
  }

  .post-item {
    flex-direction: column;
    gap: 2px;
  }

  .prompt {
    font-size: 0.82rem;
  }

  .skills {
    gap: 6px;
  }
}
