:root {
  --bg: #0a0a0a;
  --fg: #e6e6e6;
  --muted: #6b6b6b;
  --accent: #c8c8c8;
  --line: #1c1c1c;
  --sel: #2a2a2a;
  --green: #b5b5b5;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 4vh 16px;
}

::selection { background: var(--sel); color: #fff; }

/* scanline overlay */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.025) 0px,
    rgba(255,255,255,0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* terminal window */
.terminal {
  width: 100%;
  max-width: 820px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c0c0c;
  box-shadow: 0 0 0 1px #000, 0 20px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #111;
}

.dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #333;
  border: 1px solid #000;
}
.dot:nth-child(1) { background: #444; }
.titlebar .title {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* nav */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #0a0a0a;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  transition: .15s;
}
.nav a::before { content: "/"; color: #3a3a3a; margin-right: 2px; }
.nav a:hover, .nav a:focus { color: var(--fg); border-color: var(--line); background: #141414; }

/* screen */
.screen { padding: 22px 22px 30px; }

.block { margin-bottom: 38px; }
.block:last-child { margin-bottom: 0; }

.prompt { color: var(--muted); user-select: none; }

.hero .line { font-size: 15px; margin: 0 0 6px; }
.ascii {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 6px 0 0;
  white-space: pre;
  overflow-x: auto;
}

.cursor {
  display: inline-block;
  animation: blink 1s steps(2) infinite;
  color: var(--fg);
}
@keyframes blink { 50% { opacity: 0; } }

h2.cmd {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--fg);
}

.out { padding-left: 2px; }
.out p { margin: 0 0 12px; color: #cfcfcf; }
.out strong { color: #fff; }

/* key/value */
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; gap: 14px; padding: 3px 0; }
.kv .k { color: var(--muted); min-width: 70px; }
.kv .k::after { content: ":"; }
.kv .v { color: var(--fg); }
.online { color: #7ec77e; }

/* projects */
.projects { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .projects { grid-template-columns: 1fr 1fr; } }

.card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  background: #0b0b0b;
  transition: .18s;
}
.card:hover {
  border-color: #333;
  background: #101010;
  transform: translateY(-2px);
}
.card-h { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.card .folder { color: var(--muted); font-size: 12px; }
.card .name { color: #fff; font-weight: 500; }
.card .desc { color: #b8b8b8; font-size: 13px; margin: 0 0 10px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags span { color: var(--muted); font-size: 12px; }

/* blog list */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.posts li:last-child { border-bottom: none; }
.posts a {
  display: flex; justify-content: space-between; gap: 14px;
  color: var(--fg); text-decoration: none; padding: 6px 0;
}
.posts a:hover { color: #fff; }
.posts a:hover .ptitle { text-decoration: underline; }
.posts .ptitle::before { content: "→ "; color: var(--muted); }
.posts .pdate { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* links */
.links { display: flex; gap: 18px; flex-wrap: wrap; }
.links a { color: var(--fg); text-decoration: none; }
.links a:hover { color: #fff; text-shadow: 0 0 8px rgba(255,255,255,.4); }

.foot { margin-top: 30px; }
.muted { color: var(--muted); font-size: 12px; }

/* article page */
.article { max-width: 760px; }
.article .meta { color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.article h1 { font-size: 22px; color: #fff; margin: 0 0 6px; }
.article h2 { font-size: 17px; color: #fff; margin: 28px 0 10px; }
.article p { color: #cfcfcf; margin: 0 0 14px; }
.article a { color: #fff; }
.article code {
  background: #161616; padding: 2px 6px; border-radius: 4px;
  font-size: 13px; color: #e0e0e0;
}
.article pre {
  background: #0f0f0f; border: 1px solid var(--line);
  padding: 14px 16px; border-radius: 5px; overflow-x: auto;
}
.article pre code { background: none; padding: 0; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.back:hover { color: #fff; }

/* template variants */
body[data-template="minimal"] {
  --bg: #f7f7f4;
  --fg: #151515;
  --muted: #686868;
  --accent: #111;
  --line: #deded8;
  --sel: #e9e9df;
  background: var(--bg);
}
body[data-template="minimal"] .scanlines { display: none; }
body[data-template="minimal"] .terminal {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  max-width: 920px;
}
body[data-template="minimal"] .titlebar,
body[data-template="minimal"] .nav {
  background: transparent;
  border-color: var(--line);
}
body[data-template="minimal"] .card,
body[data-template="minimal"] .article pre {
  background: #fff;
  border-color: var(--line);
}
body[data-template="minimal"] .out p,
body[data-template="minimal"] .card .desc,
body[data-template="minimal"] .article p { color: #333; }
body[data-template="minimal"] .card .name,
body[data-template="minimal"] .article h1,
body[data-template="minimal"] .article h2 { color: #111; }

body[data-template="cyber"] {
  --bg: #05070a;
  --fg: #eaf7ff;
  --muted: #7b8da1;
  --accent: #00e0ff;
  --line: #143344;
  --sel: #092b39;
  background:
    linear-gradient(135deg, rgba(0, 224, 255, .08), transparent 34%),
    linear-gradient(315deg, rgba(255, 42, 109, .1), transparent 38%),
    var(--bg);
}
body[data-template="cyber"] .terminal {
  background: rgba(5, 10, 16, .86);
  border-color: #1d5b72;
  box-shadow: 0 0 0 1px #041820, 0 22px 70px rgba(0, 224, 255, .12);
}
body[data-template="cyber"] .titlebar,
body[data-template="cyber"] .nav { background: rgba(0, 18, 28, .8); }
body[data-template="cyber"] .prompt,
body[data-template="cyber"] .nav a:hover,
body[data-template="cyber"] .links a { color: var(--accent); }
body[data-template="cyber"] .card {
  background: rgba(1, 16, 24, .85);
  border-color: #16485c;
}
body[data-template="cyber"] .card:hover { border-color: #00e0ff; }
body[data-template="cyber"] .online { color: #00ff9c; }

.article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f0f0f;
}
