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

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

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

:root {
  --bg: #0a0a0a;
  --text: #d4d4d4;
  --heading: #ffffff;
  --accent: #119e45;
  --muted: #555555;
  --border: #222222;
  --code-bg: rgba(0, 0, 0, 0.6);
}

html { font-size: 15px; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 20%, rgba(74, 222, 128, 0.06) 0%, transparent 70%),
    radial-gradient(circle, rgba(74, 222, 128, 0.18) 1px, transparent 1px);
  background-size: auto, 22px 22px;
  background-attachment: fixed;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.8;
  padding: 0 1rem;
}

/* Layout */
nav, main, footer {
  max-width: 740px;
  margin: 0 auto;
}

/* Nav */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4rem;
}

nav a { color: var(--heading); text-decoration: none; }
nav a:hover { color: var(--accent); }
.nav-home { font-weight: 500; }
.nav-home::after {
  content: '_';
  animation: blink 1.2s step-end infinite;
  color: var(--accent);
}
.nav-links { display: flex; gap: 1.5rem; }

/* Main */
main { padding-bottom: 5rem; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Typography */
h1 { color: var(--heading); font-size: 1.5rem; font-weight: 500; margin-bottom: 2rem; }
p { margin-bottom: 1.25rem; }
a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.25s ease;
}
a:hover { background-size: 100% 1px; }
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.muted { color: var(--muted); }

/* Home */
.prompt { font-size: 1.1rem; margin-bottom: 1.5rem; }
.prompt-char {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.7);
}
.coords { font-family: inherit; color: #3a7d52; margin-bottom: 1rem; white-space: pre; }
.section-title { color: var(--heading); margin-bottom: 0.5rem; }
.post-item { margin-bottom: 0.5rem; }
.arrow {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}
.links { line-height: 2; }
.link-tag { color: var(--muted); }

/* Blog list */
.list-page h1 { margin-bottom: 1.5rem; }
.list-item { margin-bottom: 0.6rem; display: flex; align-items: baseline; gap: 0.5rem; }
.list-item::before {
  content: '→';
  color: var(--accent);
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
  opacity: 0;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}
.list-item:hover::before { opacity: 1; animation: slide-in 0.2s ease; }
.list-item a { color: var(--text); }
.list-item a:hover { color: var(--accent); }
.list-item a code, .post-item a code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: inherit;
  background: none;
  padding: 0;
}

/* Projects */
.project-block { margin: 1.5rem 0; }
.project-name { color: var(--heading); }
.project-date { font-size: 0.85rem; margin-bottom: 0.5rem; }
.arrow-link { margin-top: 0.5rem; }

/* Blog post */
.post h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
.post h1 code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: var(--accent);
  background: none;
  padding: 0;
}
.post-date { margin-bottom: 3rem; font-size: 0.85rem; }
.post-content {
  font-size: 1.09rem;
  line-height: 2;
}
.post-content h2 {
  font-family: 'JetBrains Mono', monospace;
  color: var(--heading);
  font-size: 1.4rem;
  font-weight: 500;
  margin: 2.5rem 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-left: 2px solid var(--accent);
  padding-left: 0.75rem;
}
.post-content h3 {
  font-family: 'JetBrains Mono', monospace;
  color: var(--heading);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 2rem 0 0.5rem;
}
.post-content p { margin-bottom: 1.5rem; }
.post-content ul, .post-content ol { margin: 0 0 1.5rem 1.5rem; }
.post-content li { margin-bottom: 0.25rem; }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}
.post-content th {
  text-align: left;
  color: var(--heading);
  border-bottom: 1px solid var(--accent);
  padding: 0.5rem 0.75rem;
  font-weight: 500;
}
.post-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.post-content tr:last-child td { border-bottom: none; }
.post-content code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1em;
  color: var(--accent);
}

/* IDE-style code block */
.code-block {
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow: hidden;
  border-radius: 10px;
}
.code-header {
  background: #161616;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green-btn { background: #28c840; }
.code-lang {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}
.code-block pre {
  background: var(--code-bg);
  margin: 0;
  padding: 1rem 1rem 1rem 0.75rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  line-height: 1.7;
}
.code-block pre code { background: none; padding: 0; color: var(--text); }
/* Line numbers */
.code-block .ln {
  color: var(--code-bg);
  margin-right: 1.25rem;
  user-select: none;
  display: inline-block;
  min-width: 1.5rem;
  text-align: right;
}
/* Chroma highlight wrapper — override inline background from monokai theme */
.code-block .highlight { margin: 0; }
.code-block .highlight pre { background: var(--code-bg) !important; }
.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.25rem 0;
  font-style: italic;
}
.back-link {
  margin-top: 4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

/* Mobile */
@media (max-width: 600px) {
  body { padding: 0 1.5rem; }
  nav { padding: 1.5rem 0 1.25rem; margin-bottom: 3rem; }
  .post h1 { font-size: 1.5rem; }
}
