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

:root {
  --bg: #f5f5f5;
  --fg: #111;
  --dim: #aaa;
  --accent: #555;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'IBM Plex Mono', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 80px 0 40px;
}

/* Vertical centering via auto margins — doesn't break scrolling */
.container {
  margin-top: auto;
  margin-bottom: auto;
}

.page {
  margin-top: auto;
  margin-bottom: auto;
  max-width: 520px;
  text-align: left;
  animation: fadeIn 1.8s ease-out;
  padding-bottom: 80px;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.012) 2px,
    rgba(0, 0, 0, 0.012) 4px
  );
  pointer-events: none;
  z-index: 100;
}

/* Layout */
.container {
  text-align: center;
  animation: fadeIn 1.8s ease-out;
}

/* Header */
.title {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 8px;
  text-transform: lowercase;
  margin-bottom: 4px;
  color: var(--fg);
}

.dot {
  color: var(--dim);
}

.tld {
  color: var(--accent);
}

.tagline {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 5px;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 48px;
}

/* Distribution / histogram */
.dist-section {
  position: relative;
  width: 560px;
  margin: 0 auto;
}

.hist {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  height: 110px;
  width: 560px;
  margin: 0 auto;
  user-select: none;
  cursor: default;
}

.hist-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 6px;
  height: 100%;
  gap: 1px;
}

.cell {
  width: 6px;
  height: 6px;
  border: 1px solid var(--fg);
  background: var(--bg);
  flex-shrink: 0;
}

.axis-line {
  width: 560px;
  height: 1px;
  background: var(--fg);
  margin: 4px auto 0;
  opacity: 0.25;
}

/* Navigation */
.nav {
  display: flex;
  justify-content: space-between;
  width: 480px;
  margin: 8px auto 0;
  position: relative;
  z-index: 2;
}

.nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: lowercase;
  padding: 8px 12px;
  position: relative;
  z-index: 2;
}

.nav a:hover {
  color: var(--bg);
  background: var(--fg);
  outline: 1px solid var(--fg);
}

/* Animations */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  margin-top: 64px;
  padding-top: 16px;
  border-top: 1px solid var(--dim);
  opacity: 0.3;
  text-align: center;
  width: 480px;
  font-size: 8px;
  font-weight: 300;
  letter-spacing: 3px;
  color: var(--dim);
  text-transform: lowercase;
}

/* ── Subpage layout ──────────────────────────────────────── */

.page-header {
  text-align: center;
  margin-bottom: 48px;
}

.page-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 8px;
}

.page-nav a {
  color: var(--dim);
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: lowercase;
  padding: 4px 0;
}

.page-nav a:hover {
  color: var(--bg);
  background: var(--fg);
  outline: 1px solid var(--fg);
  padding: 4px 6px;
  margin: -4px -6px;
}

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

.section-label {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--dim);
  opacity: 0.4;
}

.page p {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--fg);
  margin-bottom: 16px;
}

/* CV / Work */
.cv-entry {
  margin-bottom: 28px;
}

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.cv-role {
  font-size: 12px;
  font-weight: 400;
  color: var(--fg);
}

.cv-date {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 2px;
  color: var(--dim);
  flex-shrink: 0;
  margin-left: 16px;
}

.cv-org {
  font-size: 10px;
  font-weight: 300;
  color: var(--accent);
  margin-bottom: 6px;
}

.cv-desc {
  font-size: 11px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--fg);
  opacity: 0.7;
}

.cv-section {
  margin-bottom: 36px;
}

.cv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.cv-tag {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: lowercase;
  color: var(--accent);
  border: 1px solid var(--dim);
  padding: 3px 8px;
  opacity: 0.6;
}

/* Log / Blog */
.log-entry {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--dim);
  opacity: 0.9;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-date {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 3px;
  color: var(--dim);
  margin-bottom: 6px;
}

.log-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 8px;
}

.log-title a {
  color: var(--fg);
  text-decoration: none;
}

.log-title a:hover {
  color: var(--bg);
  background: var(--fg);
  outline: 1px solid var(--fg);
  padding: 2px 4px;
  margin: -2px -4px;
}

.log-excerpt {
  font-size: 11px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--accent);
}

.log-tags {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.log-tag {
  font-size: 8px;
  letter-spacing: 2px;
  text-transform: lowercase;
  color: var(--dim);
}

.log-tag::before {
  content: '#';
}

/* Blog post body */
.post-body {
  margin-top: 24px;
}

.post-body h2 {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--fg);
  margin: 28px 0 12px;
}

.post-body p {
  font-size: 11px;
  line-height: 1.8;
  margin-bottom: 14px;
}

.post-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 5px;
  border: 1px solid var(--dim);
  opacity: 0.7;
}

.post-body pre {
  font-size: 10px;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--dim);
  padding: 12px 16px;
  margin: 16px 0;
  overflow-x: auto;
  opacity: 0.7;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  opacity: 1;
}

.post-back {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--dim);
  text-decoration: none;
  margin-bottom: 24px;
}

.post-back:hover {
  color: var(--fg);
}

/* Contact */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--dim);
  opacity: 0.5;
}

.contact-link:hover {
  opacity: 1;
  color: var(--fg);
}

.contact-label {
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dim);
  width: 80px;
  flex-shrink: 0;
}

.contact-value {
  color: var(--fg);
}

/* ── Lightbox ────────────────────────────────────────────── */
.post-body img {
  cursor: zoom-in;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 245, 245, 0.92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  border: 1px solid var(--fg);
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.1);
}

.lightbox-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  letter-spacing: 3px;
  color: var(--dim);
  text-transform: lowercase;
  z-index: 201;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox-overlay.active + .lightbox-hint {
  opacity: 1;
  visibility: visible;
}

/* Responsive */
@media (max-width: 600px) {
  .title {
    font-size: 12px;
    letter-spacing: 6px;
  }

  .dist-section,
  .hist,
  .axis-line {
    width: 360px;
  }

  .nav {
    width: 300px;
  }

  .nav a {
    font-size: 9px;
    letter-spacing: 2px;
    padding: 6px 6px;
  }

  .page {
    max-width: 320px;
    padding: 0 16px;
  }

  .page-nav {
    gap: 16px;
  }

  .page-nav a {
    font-size: 9px;
    letter-spacing: 2px;
  }

  .cv-entry-header {
    flex-direction: column;
  }

  .cv-date {
    margin-left: 0;
  }
}
