@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

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

:root {
  --fg: #e8e8e8;
  --bg: #0a0a0a;
  --nav-bg: #0a0a0a;
  --muted: #555;
  --border: #1e1e1e;
  --border-hover: #444;
  --dim: #999;
  --body: #aaa;
}

@media (prefers-color-scheme: light) {
  :root {
    --fg: #111;
    --bg: #fff;
    --nav-bg: #f9f9f9;
    --muted: #999;
    --border: #e5e5e5;
    --border-hover: #999;
    --dim: #555;
    --body: #444;
  }
}

html { font-size: 15px; }

body {
  font-family: 'Space Mono', monospace;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  line-height: 1.7;
}

/* subtle scanline */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.04) 3px,
    rgba(0, 0, 0, 0.04) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

/* ── nav ── */
nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 9999;
}

.nav-name {
  font-family: 'Space Mono', monospace;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: 0.06em;
  margin-right: auto;
  transition: opacity 0.15s;
}

.nav-name::before { content: '✦ '; color: var(--muted); }
.nav-name::after  { content: ' ✦'; color: var(--muted); }
.nav-name:hover { opacity: 0.6; }

.nav-links { display: flex; gap: 1.75rem; }

.nav-links a {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--fg); }
.nav-links a.active { color: var(--fg); }

/* ── main ── */
main {
  max-width: 580px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* ── home ── */
.status {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  animation: pulse 2.5s ease-in-out infinite;
}

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

.intro h1 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.cursor {
  animation: blink 1s step-end infinite;
  color: var(--dim);
}

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

.intro p {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  color: var(--body);
  margin-bottom: 0.75rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

.links a {
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  transition: all 0.15s;
}

.links a:hover {
  color: var(--fg);
  border-color: var(--border-hover);
}

/* ── writing ── */
.page-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.post-list { list-style: none; }

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:first-child { border-top: 1px solid var(--border); }

.post-list li::before {
  content: '✧';
  color: var(--muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.post-list a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.875rem;
  flex: 1;
  transition: color 0.15s;
}

.post-list a:hover { color: var(--dim); }

.post-date {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  flex-shrink: 0;
}

.empty-state {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 1.5rem;
}

/* ── section headings (writing page) ── */
.section-heading {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-link {
  font-size: 0.68rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  font-weight: 400;
  text-transform: none;
  transition: color 0.15s;
}

.section-link:hover { color: var(--fg); }

.sub-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--border-hover);
  display: block;
  padding-top: 1.5rem;
  padding-bottom: 0.25rem;
}

/* ── dev page ── */
.project-list { list-style: none; }

.project-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.project-list li:first-child { border-top: 1px solid var(--border); }

.project-github {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
}

.project-github:hover { color: var(--fg); }

.project-list a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.35rem;
  transition: color 0.15s;
}

.project-list a:hover { color: var(--dim); }

.project-desc {
  font-size: 0.8rem;
  color: var(--body);
}

/* ── guestbook ── */
.guestbook-intro {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  letter-spacing: 0.03em;
}

.guestbook-intro::before { content: '↓ '; }

/* ── reads page ── */
.book-grid {
  columns: 3 110px;
  gap: 1.5rem;
  padding-top: 0.5rem;
}

.book {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  display: block;
}

.book:nth-child(3n+1) { transform: rotate(-1.5deg); }
.book:nth-child(3n+2) { transform: rotate(1deg); margin-top: 1.5rem; }
.book:nth-child(3n)   { transform: rotate(-0.7deg); margin-top: 2.5rem; }

.book img {
  width: 100%;
  display: block;
  filter: grayscale(1);
  transition: filter 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.book img:hover { filter: none; }

.book-title {
  display: block;
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0.45rem;
  letter-spacing: 0.03em;
}

/* make utterances iframe inherit dark bg */
.utterances { max-width: 100% !important; }
