/* ============================================================
   STYLE.CSS — 31a50n3 project site
   Fonts: JetBrains Mono (loaded in each HTML file)
   ============================================================ */

:root {
  --bg:         #0b0b0b;
  --surface:    #111111;
  --surface-2:  #161616;
  --border:     #1e1e1e;
  --border-2:   #2a2a2a;
  --text:       #c8c8c8;
  --text-dim:   #918989;
  --text-mid:   #8a8989;
  --accent:     #e63030;
  --accent-dim: #3d0d0d;
  --green:      #3fb950;
  --blue:       #79c0ff;
  --yellow:     #e3b341;
  --purple:     #d2a8ff;
  --font:       'JetBrains Mono', 'Fira Code', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ── Nav ────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 44px;
  background: rgba(11,11,11,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-author { color: var(--text-mid); font-size: 12px; }
.nav-author span { color: var(--blue); }
.nav-author em { color: var(--yellow); font-style: normal; }

.nav-links { display: flex; align-items: center; gap: 28px; }

.nav-links a {
  font-size: 12px;
  color: var(--text-mid);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }

.nav-cta {
  color: var(--accent) !important;
  border: 1px solid var(--accent-dim);
  padding: 4px 14px;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s !important;
}
.nav-cta:hover { background: var(--accent-dim) !important; color: var(--accent) !important; }

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

.page-wrap {
  padding-top: 44px; /* nav height */
}

/* ── Section header (filesystem style) ──────────────── */
.section-header {
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-header .count {
  color: var(--text-dim);
}

/* ── Status badge ────────────────────────────────────── */
.status-line {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.status-line .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 8px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Hero section ────────────────────────────────────── */
.hero {
  padding: 100px 0 80px;
  max-width: 720px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #e8e8e8;
  margin-bottom: 24px;
}

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

.hero p {
  font-size: 13px;
  color: var(--text-mid);
  max-width: 500px;
  line-height: 1.8;
  margin-bottom: 32px;
}

/* ── Code block (hero decoration) ───────────────────── */
.hero-code {
  position: absolute;
  right: 40px;
  top: 140px;
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: none; /* shown at wider breakpoints */
}
@media (min-width: 1000px) { .hero-code { display: block; } }

.code-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.code-titlebar .dots { display: flex; gap: 6px; }
.code-titlebar .dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border-2);
}
.code-titlebar .filename {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}

.code-body {
  padding: 16px;
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
}

/* ── Stats bar ───────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 72px;
}
.stat-item .num {
  font-size: 26px;
  font-weight: 700;
  color: #e8e8e8;
  letter-spacing: -0.02em;
}
.stat-item .label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ── Project cards ───────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 80px;
}

.project-card {
  background: var(--bg);
  padding: 24px;
  transition: background 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.project-card:hover { background: var(--surface); }

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-dim);
}
.card-meta .filename { color: var(--green); }

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e0;
  line-height: 1.3;
}

.card-desc {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.7;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tag {
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid var(--border-2);
  color: var(--text-dim);
  border-radius: 2px;
}
.tag.hl { border-color: #1e3a5f; color: var(--blue); }
.tag.red { border-color: #3d1515; color: #e66; }
.tag.green { border-color: #1a3d1a; color: var(--green); }

/* ── Project detail page ─────────────────────────────── */
.project-header {
  padding: 80px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}

.breadcrumb {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 24px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.breadcrumb a:hover { color: var(--text-mid); }
.breadcrumb span { color: var(--text-dim); }

.project-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #e8e8e8;
  line-height: 1.15;
  margin-bottom: 16px;
}
.project-title .accent { color: var(--accent); }

.project-subtitle {
  font-size: 13px;
  color: var(--text-mid);
  max-width: 580px;
  line-height: 1.8;
  margin-bottom: 28px;
}

.project-meta-row {
  display: flex;
  gap: 32px;
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.project-meta-row span em { color: var(--text-mid); font-style: normal; }

/* ── Article body ────────────────────────────────────── */
.project-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 60px;
  margin-bottom: 80px;
}
@media (max-width: 800px) { .project-layout { grid-template-columns: 1fr; } }

.project-body { min-width: 0; }

/* Section heading styled as code comment */
.project-body h2 {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.project-body h2::before { content: '// '; color: var(--text-dim); }
.project-body h2 strong { color: var(--text-mid); font-weight: 600; }

.project-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  margin: 32px 0 12px;
}

.project-body p {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.85;
  margin-bottom: 18px;
}

.project-body ul, .project-body ol {
  padding-left: 20px;
  margin-bottom: 18px;
}
.project-body li {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.85;
  margin-bottom: 6px;
}
.project-body li::marker { color: var(--accent); }

/* Inline code */
.project-body code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 12px;
  color: var(--blue);
  font-family: var(--font);
}

/* Code blocks */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 24px 0;
}
.code-block .cb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.code-block .cb-header .lang {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.code-block .cb-header .fname {
  font-size: 10px;
  color: var(--green);
}
.code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.7;
  font-family: var(--font);
  tab-size: 2;
}
.code-block pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* Syntax colour helpers (manual) */
.kw   { color: var(--purple); }
.fn   { color: var(--blue); }
.str  { color: var(--yellow); }
.cmt  { color: var(--text-dim); font-style: italic; }
.num  { color: #ff9d52; }
.op   { color: var(--text-mid); }
.type { color: var(--green); }

/* Images in project body */
.img-block {
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.img-block img { width: 100%; }
.img-caption {
  padding: 10px 14px;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* Callout / info box */
.callout {
  border-left: 2px solid var(--accent);
  background: var(--accent-dim);
  padding: 14px 18px;
  margin: 24px 0;
  border-radius: 0 4px 4px 0;
  font-size: 12px;
  color: #c88;
  line-height: 1.7;
}
.callout.info {
  border-color: var(--blue);
  background: #0e1a2e;
  color: #8ab4d4;
}
.callout.success {
  border-color: var(--green);
  background: #0d2010;
  color: #7cc47c;
}

/* ── Sidebar (project TOC) ───────────────────────────── */
.project-sidebar {
  position: sticky;
  top: 64px;
  height: fit-content;
}
.sidebar-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.toc-list { list-style: none; padding: 0; }
.toc-list li {
  border-left: 1px solid var(--border);
  padding: 5px 0 5px 14px;
  font-size: 11px;
  color: var(--text-dim);
  transition: color 0.15s, border-color 0.15s;
}
.toc-list li:hover, .toc-list li.active {
  color: var(--text-mid);
  border-color: var(--accent);
}
.toc-list li a { display: block; }

/* ── About page ──────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 80px;
  padding: 80px 0;
}
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } }

.about-bio h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  color: #e8e8e8;
  line-height: 1.2;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.about-bio h1 .accent { color: var(--accent); }

.about-bio p {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.85;
  margin-bottom: 18px;
  max-width: 520px;
}

/* JSON-style bio card */
.bio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.8;
  align-self: start;
  position: sticky;
  top: 64px;
}
.bio-card .bc-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 10px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bio-card .bc-header .dots { display: flex; gap: 5px; }
.bio-card .bc-header .dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--border-2);
}
.bio-card pre {
  padding: 18px;
  font-family: var(--font);
  font-size: 12px;
  white-space: pre;
  overflow-x: auto;
}

/* Interests list */
.interests {
  margin: 32px 0;
}
.interests .int-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.interests ul { list-style: none; padding: 0; }
.interests li {
  font-size: 12px;
  color: var(--text-mid);
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
}
.interests li::before { content: '→'; color: var(--accent); }

/* ── Footer ──────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
}
footer a:hover { color: var(--text-mid); }
footer .footer-links { display: flex; gap: 24px; }

/* ── Utilities ───────────────────────────────────────── */
.mt-0  { margin-top: 0; }
.mb-40 { margin-bottom: 40px; }
.relative { position: relative; }

/* Scroll fade-in */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fadeUp 0.5s ease both;
}
.fade-up-2 { animation-delay: 0.1s; }
.fade-up-3 { animation-delay: 0.2s; }
.fade-up-4 { animation-delay: 0.3s; }
