:root {
  --bg: #f4f1eb;
  --bg-elevated: #ebe7df;
  --text: #2d2a24;
  --text-muted: #8a8578;
  --accent: #c45a3b;
  --accent-hover: #d4704f;
  --border: #d4d0c8;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(244, 241, 235, 0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

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

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text);
}

/* Sections */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section:first-of-type {
  padding-top: 6rem;
}

.section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 2rem;
  color: var(--accent);
}

/* Posts */
.post {
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
  cursor: pointer;
}

.post-header:hover .post-title {
  color: var(--accent);
}

.post-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  font-weight: 400;
  transition: color 0.2s;
}

.post-thumb {
  width: 80px;
  height: 45px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: var(--bg-elevated);
}

.post-thumb video,
.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-thumb .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  color: white;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.post-content {
  display: none;
  padding: 0 0 1.5rem;
}

.post.expanded .post-content {
  display: block;
}

.post-text a {
  color: var(--accent);
  text-decoration: underline;
  transition: color 0.2s;
}

.post-text a:hover {
  color: var(--accent-hover);
}

.post-text {
  color: var(--text-muted);
  margin-bottom: 1rem;
  max-width: 65ch;
}

/* Inline media (single image/video in content flow) */
.media-inline {
  position: relative;
  max-width: 500px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  margin: 1rem 0;
  background: var(--bg-elevated);
}

.media-inline video,
.media-inline img {
  width: 100%;
  display: block;
}

.media-inline .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Embedded videos (Vimeo, YouTube) */
.media-embed {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16/9;
  margin: 1rem 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
}

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

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.media-item {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-elevated);
  transition: transform 0.2s, box-shadow 0.2s;
}

.media-item:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.media-item video,
.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  color: white;
  opacity: 0.9;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: opacity 0.2s;
}

.media-item:hover .play-icon {
  opacity: 1;
}

.post.expanded .media-item .play-icon,
.post.expanded .media-inline .play-icon {
  display: none;
}

/* About */
.about-content {
  max-width: 600px;
}

.about-content p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

/* Tools */
.tools-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-link {
  display: inline-block;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  transition: border-color 0.2s, transform 0.2s;
  max-width: fit-content;
}

.tool-link:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 200;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content video,
.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 4px;
}

#lightbox-video,
#lightbox-img {
  display: none;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .nav {
    padding: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .nav-link {
    font-size: 0.85rem;
  }
  
  .section {
    padding: 2rem 1rem;
  }
  
  .section:first-of-type {
    padding-top: 5rem;
  }
  
  .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
  
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .post-thumb {
    width: 60px;
    height: 34px;
  }
  
  .lightbox {
    padding: 1rem;
  }
  
  .lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 0.75rem;
  }
  
  .nav-logo {
    font-size: 1.1rem;
  }
  
  .post-title {
    font-size: 1.1rem;
  }
  
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
