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

html { height: 100%; }

body {
  background: #fff;
  color: #111;
  font-family: 'Space Mono', monospace;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── shared page wrap ── */
.page-wrap {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.back {
  font-size: 0.7rem;
  color: #888;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}
.back:hover { color: #111; }

/* ── blog post ── */
.post-title {
  font-size: clamp(1.4rem, 6vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.post-subtitle {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 2.5rem;
}

.post-body {
  font-size: 0.82rem;
  line-height: 2;
  color: #333;
}
.post-body p { margin-bottom: 1.2rem; }
.post-body h3 {
  font-size: 0.78rem;
  font-weight: 700;
  color: #111;
  letter-spacing: 0.05em;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  border-left: 2px solid #111;
  padding-left: 0.6rem;
}

.code-block {
  background: #f5f5f5;
  border-left: 2px solid #111;
  padding: 0.8rem 1rem;
  font-size: 0.72rem;
  line-height: 1.8;
  margin: 1rem 0;
  overflow-x: auto;
  white-space: pre;
}

/* ── project detail ── */
.project-title {
  font-size: clamp(2rem, 10vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.project-sub {
  font-size: 0.72rem;
  color: #aaa;
  margin-bottom: 1.6rem;
  letter-spacing: 0.05em;
}

.tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.tag {
  font-size: 0.6rem;
  border: 1px solid #bbb;
  color: #555;
  border-radius: 2px;
  padding: 0.18rem 0.5rem;
  letter-spacing: 0.03em;
}

.project-body {
  font-size: 0.82rem;
  line-height: 2;
  color: #333;
  margin-bottom: 2rem;
}
.project-body p { margin-bottom: 1.2rem; }
.project-body h3 {
  font-size: 0.78rem;
  font-weight: 700;
  color: #111;
  letter-spacing: 0.05em;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  border-left: 2px solid #111;
  padding-left: 0.6rem;
}
.project-body a { color: #111; }

.preview-link {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid #111;
  border-radius: 3px;
  padding: 0.5rem 1.2rem;
  text-decoration: none;
  color: #111;
  margin-bottom: 3rem;
  transition: all 0.15s;
}
.preview-link:hover { background: #111; color: #fff; }

/* ── footer ── */
.site-footer {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  border-top: 1px solid #eee;
}
.site-footer .footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: #111;
  gap: 1rem;
}
.site-footer .copyright {
  text-align: center;
  font-size: 0.7rem;
  color: #555;
  font-weight: 700;
  margin-top: 0.8rem;
}

/* blog post footer (simpler) */
footer {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  border-top: 1px solid #eee;
  font-size: 0.7rem;
  color: #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── watermark ── */
.watermark {
  position: fixed;
  bottom: 1.2rem;
  right: 1.5rem;
  font-size: 0.6rem;
  color: #ddd;
  letter-spacing: 0.1em;
  pointer-events: none;
  user-select: none;
}

/* ── nav ── */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 200; pointer-events: none; }
.hamburger {
  pointer-events: all;
  position: absolute;
  top: 1.2rem; right: 1.5rem;
  background: none; border: none; cursor: pointer;
  width: 28px; height: 28px;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  padding: 0; z-index: 300;
}
.hamburger span {
  display: block; width: 100%; height: 1.5px; background: #111;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); background: #fff; }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); background: #fff; }
.nav-overlay {
  pointer-events: none; position: fixed; inset: 0; background: #111;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 3rem 2rem; opacity: 0; transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease; z-index: 250;
}
.nav-overlay.open { opacity: 1; transform: translateY(0); pointer-events: all; }
.nav-overlay a {
  font-size: clamp(1.8rem, 8vw, 2.8rem); font-weight: 700; color: #fff;
  text-decoration: none; line-height: 1.3; letter-spacing: -0.01em;
  transition: color 0.15s ease; display: block; margin-bottom: 0.4rem;
}
.nav-overlay a:hover { color: #aaa; }
.nav-overlay .nav-footer {
  position: absolute; bottom: 2rem; left: 2rem;
  font-size: 0.65rem; color: #444; letter-spacing: 0.1em;
}

/* ── pow images / lightbox ── */
.pow-img {
  width: 100%;
  border: 1px solid #eee;
  border-radius: 4px;
  margin: 1.2rem 0 0.4rem;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}
.pow-img:hover { opacity: 0.85; }
.img-caption {
  font-size: 0.65rem;
  color: #aaa;
  margin-bottom: 1.2rem;
  letter-spacing: 0.04em;
}
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 4px;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: absolute;
  top: 1.2rem; right: 1.5rem;
  color: #fff; font-size: 0.7rem; letter-spacing: 0.1em;
  cursor: pointer; background: none; border: none;
  font-family: 'Space Mono', monospace;
}
.lightbox-caption {
  position: absolute;
  bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  font-size: 0.65rem; color: #888; letter-spacing: 0.05em; white-space: nowrap;
}
.lb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #fff; font-size: 1.4rem;
  cursor: pointer; font-family: 'Space Mono', monospace;
  padding: 0.5rem 1rem; opacity: 0.5; transition: opacity 0.15s ease; user-select: none;
}
.lb-arrow:hover { opacity: 1; }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-arrow.hidden { display: none; }

/* ── story block ── */
.story-block {
  border-left: 2px solid #111;
  padding: 0.8rem 1rem;
  margin: 1.5rem 0;
  background: #fafafa;
}
.story-block p {
  font-size: 0.78rem; line-height: 1.9; color: #333; margin-bottom: 0.4rem;
}
.story-block p:last-child { margin-bottom: 0; }
.story-block .story-label {
  font-size: 0.65rem; color: #aaa; letter-spacing: 0.08em; margin-bottom: 0.6rem; display: block;
}
