:root {
  --bg: #0a0a0a;
  --fg: #c8c8c8;
  --dim: #666;
  --accent: #fff;
  --link: #c8c8c8;
  --hover: #fff;
  --border: #333;
  --max-w: 680px;
}

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

html {
  font-size: 15px;
}

body {
  font-family: "Berkeley Mono", "SF Mono", "IBM Plex Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  padding: 3rem 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

/* ── header ── */

header {
  margin-bottom: 3rem;
}

.ascii-name {
  white-space: pre;
  font-size: 0.65rem;
  line-height: 1.15;
  color: var(--accent);
  margin-bottom: 1rem;
  overflow-x: auto;
}

.tagline {
  color: var(--dim);
  font-size: 0.85rem;
}

/* ── navigation ── */

nav {
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

nav a {
  color: var(--dim);
  text-decoration: none;
  margin-right: 1.5rem;
  font-size: 0.85rem;
}

nav a:hover,
nav a.active {
  color: var(--accent);
}

/* ── sections ── */

section {
  margin-bottom: 3rem;
}

h2 {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.2rem;
}

h2::before {
  content: "# ";
}

p {
  margin-bottom: 1rem;
}

/* ── links ── */

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

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

/* ── lists ── */

ul {
  list-style: none;
}

ul li {
  margin-bottom: 0.6rem;
  padding-left: 1.2rem;
  position: relative;
}

ul li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--dim);
}

/* ── ascii animation ── */

#ascii-nn {
  margin-bottom: 1rem;
  opacity: 0;
  animation: fade-in 0.6s ease 2.2s forwards;
}

/* ── project items ── */

.item {
  margin-bottom: 1.5rem;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.item-title {
  color: var(--accent);
  font-weight: 600;
}

.item-meta {
  color: var(--dim);
  font-size: 0.8rem;
}

.item-desc {
  color: var(--fg);
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

.item-tags {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--dim);
}

/* ── article items ── */

.article-date {
  color: var(--dim);
  font-size: 0.8rem;
  min-width: 7rem;
}

/* ── footer ── */

footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  color: var(--dim);
  font-size: 0.8rem;
}

footer a {
  color: var(--dim);
  border-bottom-color: transparent;
  margin-right: 1.5rem;
}

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

/* ── article page ── */

.article-content {
  line-height: 1.75;
}

.article-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

.article-content p {
  margin-bottom: 1.2rem;
}

.article-content code {
  background: #1a1a1a;
  padding: 0.15em 0.4em;
  border-radius: 2px;
  font-size: 0.9em;
}

.article-content pre {
  background: #111;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
}

.article-content pre code {
  background: none;
  padding: 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.article-content ul {
  margin-bottom: 1.2rem;
}

.article-content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  color: var(--dim);
  margin-bottom: 1.2rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--dim);
  font-size: 0.85rem;
}

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

/* ── animations ── */

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

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

@keyframes scanline {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ascii-name .line {
  display: block;
  opacity: 0;
  animation: scanline 0.15s ease forwards;
}

.tagline {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--dim);
  width: 0;
  animation:
    typing 1.5s steps(40) 1.2s forwards,
    blink 0.7s step-end infinite;
}

@keyframes typing {
  to { width: 100%; }
}

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

section, nav, footer {
  opacity: 0;
  animation: fade-in 0.4s ease forwards;
}

nav       { animation-delay: 2.0s; }
section:nth-of-type(1) { animation-delay: 2.2s; }
section:nth-of-type(2) { animation-delay: 2.4s; }
section:nth-of-type(3) { animation-delay: 2.6s; }
section:nth-of-type(4) { animation-delay: 2.8s; }
footer    { animation-delay: 3.0s; }

/* ── responsive ── */

@media (max-width: 500px) {
  html {
    font-size: 14px;
  }

  body {
    padding: 2rem 1rem;
  }

  .ascii-name {
    font-size: 0.45rem;
  }

  nav a {
    margin-right: 1rem;
  }
}
