:root {
  --bg: #111111;
  --fg: #e6e6e6;
  --muted: #999999;
  --link: #8fbcff;
  --border: #333333;
  --max-width: 900px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-size: 1rem;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

a {
  color: var(--link);
}

a:visited {
  color: var(--link);
}

h1, h2, h3 {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

section {
  margin-bottom: 2.5rem;
}

section:last-child {
  margin-bottom: 0;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.site-title {
  font-weight: bold;
  text-decoration: none;
  font-size: 1.25rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-list a {
  text-decoration: none;
}

.nav-list a.active,
.nav-list a:hover {
  text-decoration: underline;
}

.entry-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

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

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

.date {
  color: var(--muted);
  font-size: 0.85rem;
}

.summary {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

section > h2 + .summary {
  margin-bottom: 0.75rem;
}

.subheading {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

.content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  overflow-x: auto;
  display: block;
}

.content th, .content td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.content blockquote {
  border-left: 3px solid var(--border);
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  color: var(--muted);
}

.content figure {
  margin: 1.5rem 0;
  text-align: center;
}

.content figure img,
.content figure video {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

.content figure img.zoomable {
  cursor: zoom-in;
}

.content figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 1000;
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--border);
}

.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
}

.flow-box {
  border: 1.5px solid var(--fg);
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  text-align: center;
  background: #1a1a1a;
  min-width: 220px;
}

.flow-arrow {
  width: 1.5px;
  height: 2rem;
  background: var(--fg);
  position: relative;
}

.flow-arrow::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--fg);
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.poster-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
}

.poster-card a {
  display: block;
  text-decoration: none;
  color: var(--fg);
}

.poster-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #1a1a1a;
}

.poster-card a:hover .poster-thumb {
  border-color: var(--fg);
}

.poster-title {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.9rem;
  text-align: center;
}

.poster-subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.album-thumb {
  aspect-ratio: 1 / 1;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
}

pre, code {
  background: #1a1a1a;
  color: var(--fg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

pre {
  padding: 1rem;
  overflow-x: auto;
}

img, iframe {
  max-width: 100%;
}

@media (min-width: 1600px) {
  :root {
    --max-width: 1200px;
  }
  body {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
