:root {
  --bg: #0d1117;
  --panel: #111827;
  --panel-strong: #161f2e;
  --ink: #e5e7eb;
  --muted: #9aa4b2;
  --border: rgba(148, 163, 184, 0.2);
  --accent: #d7a6ff;
  --accent-soft: rgba(216, 140, 255, 0.16);
  --link: #f0b8ff;
  --link-visited: #cdb7ff;
  --link-hover: #ffe1ff;
  --shadow: rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}

a {
  color: var(--link);
  text-decoration-color: rgba(240, 184, 255, 0.7);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:visited {
  color: var(--link-visited);
  text-decoration-color: rgba(205, 183, 255, 0.7);
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
  text-decoration-color: rgba(255, 225, 255, 0.95);
}

img,
video {
  max-width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f172a;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.78);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
}

.site-nav {
  display: flex;
  gap: 1.2rem;
}

.site-nav a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}

.main-content {
  padding: 2rem 0 1rem;
}

.sidebar {
  padding-bottom: 3rem;
}

.panel,
.post-card,
.post-article,
.project-page {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 30px var(--shadow);
}

.panel {
  padding: 1rem 1.25rem;
}

.post-card,
.project-page,
.post-article {
  padding: 1.5rem;
}

.post-list,
.project-post-list,
.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list {
  display: grid;
  gap: 1.2rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.post-card h2,
.post-article h1,
.project-page h1 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.post-card h2 a,
.post-article h1 a,
.project-page h1 a {
  color: var(--ink);
  text-decoration: none;
}

.read-more {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
}

.project-tag,
.project-link {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(147, 197, 253, 0.35);
  padding: 0.25rem 0.7rem;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.project-link {
  margin-bottom: 0.75rem;
}

.article-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.article-body {
  max-width: 760px;
  margin: 0 auto;
}

.article-body img,
.article-body video {
  display: block;
  width: auto;
  max-width: min(100%, 640px);
  max-height: 52vh;
  height: auto;
  margin: 1.5rem auto;
  float: none;
  clear: both;
  border-radius: 14px;
  border: 1px solid var(--border);
  object-fit: contain;
}

.article-body video {
  width: auto;
  max-width: min(100%, 560px);
  max-height: 48vh;
}

.article-body img.lightbox-trigger {
  cursor: zoom-in;
}

.article-body p,
.article-body li {
  font-size: 1.05rem;
}

.article-body h2,
.article-body h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding-left: 1rem;
  color: var(--muted);
}

.article-body code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.15em 0.35em;
  border: 1px solid rgba(215, 166, 255, 0.35);
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.article-body pre {
  background: #241a33;
  color: #edf2ff;
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.article-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: inherit;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  font-weight: 800;
}

.intro h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.06em;
}

.intro {
  margin-bottom: 1.5rem;
}

.project-list {
  display: grid;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
}

.project-list a,
.project-post-list a,
.project-list-grid a {
  color: var(--link);
  text-decoration: none;
}

.project-list a:hover,
.project-post-list a:hover,
.project-list-grid a:hover {
  text-decoration: underline;
}

.project-list-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}

.project-post-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.7rem;
  margin-bottom: 0.7rem;
}

body.lightbox-open {
  overflow: hidden;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.9);
  z-index: 1000;
  padding: 1.5rem;
}

.media-lightbox.is-open {
  display: flex;
}

.media-lightbox img {
  max-width: min(1200px, 92vw);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.media-lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
}

.site-footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .nav-wrap {
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    height: auto;
    padding: 0.6rem 0;
  }

  .site-nav {
    justify-content: center;
    flex-wrap: wrap;
  }

  .project-post-list li {
    flex-direction: column;
  }
}
