:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --gray: #f5f5f5;
  --gray-dark: #666;
  --border: #eaeaea;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

nav {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.site-title {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

.nav-link {
  text-decoration: none;
  color: var(--gray-dark);
}

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s;
}

.project-card .card-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #0a0a0a; /* Fallback */
  display: flex;
  align-items: center;  /* Vertical centering */
  justify-content: center; /* Horizontal centering */
}

.project-card .card-thumbnail::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: inherit; /* Inherits from parent div */
  background-size: cover;
  background-position: center;
  filter: blur(24px) brightness(0.6) saturate(1.5);
  transform: scale(1.2); /* Hides blur edges */
  transition: filter 0.3s ease;
}

/* Slight intensify on hover */
.project-card:hover .card-thumbnail::before {
  filter: blur(20px) brightness(0.5) saturate(1.8);
}

.project-card:hover {
  transform: translateY(-4px);
}

/* Actual thumbnail image */
.card-thumbnail img {
  position: relative;
  z-index: 3;
  display: block;
  margin-left: auto;  /* Explicit */
  margin-right: auto; /* Explicit */
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Landscape - full width */
.project-card.landscape .card-thumbnail img {
  width: 100%;
  height: auto;
  max-height: none; /* Override the max-height */
}

/* Portrait & Vertical - full height */
.project-card.portrait .card-thumbnail img,
.project-card.vertical .card-thumbnail img {
  width: auto;
  height: 100%;
  max-width: none; /* Override the max-width */
}

.project-card .card-thumbnail::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 70%,
    rgba(0,0,0,0.1) 100%
  );
  z-index: 2;
  pointer-events: none;
}

.card-content {
  padding: 1rem 0;
}

.card-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.client {
  color: var(--gray-dark);
  font-size: 0.9rem;
}

.card-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-dark);
}

.type-tag {
  background: var(--gray);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Filter Nav */
.filter-nav {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0 1rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: var(--gray);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.filter-btn.active {
  background: var(--text);
  color: white;
}

/* Case Study Layout */
.case-study {
  max-width: 1000px;
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--gray-dark);
  text-decoration: none;
}

.project-header {
  margin: 2rem 0;
}

.project-meta {
  display: flex;
  gap: 2rem;
  margin: 1rem 0;
  color: var(--gray-dark);
}

.project-tags {
  display: flex;
  gap: 0.5rem;
}

.tag {
  background: var(--gray);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.project-description {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Video Container - SINGLE SOURCE OF TRUTH */
.video-container {
  margin: 2rem auto;
  border-radius: 8px;
  background: none;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Orientation labels */
.video-container::after {
  content: "";
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.video-container:hover::after {
  opacity: 1;
}

.video-container.landscape::after {
  content: "16:9";
}

.video-container.portrait::after {
  content: "4:5";
}

.video-container.vertical::after {
  content: "9:16";
}

.video-container iframe {
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 8px;
}

.video-container.landscape iframe {
  aspect-ratio: 16/9;
  max-width: 1000px;
  width: 100%;
}

.video-container.portrait iframe {
  aspect-ratio: 4/5;
  max-width: 500px;
  width: 100%;
}

.video-container.vertical iframe {
  aspect-ratio: 9/16;
  max-width: 360px;
  width: 100%;
}

/* Mobile */
@media (max-width: 600px) {
  body { padding: 1rem; }
  .project-grid { grid-template-columns: 1fr; }
  .project-meta { flex-direction: column; gap: 0.5rem; }
  
  .video-container.landscape,
  .video-container.portrait,
  .video-container.vertical {
    max-width: 100%;
  }
  .project-card .card-thumbnail::before {
    filter: blur(16px) brightness(0.6);
  }
}

/* ===== HOME PAGE ===== */
.hero {
  text-align: center;
  margin: 4rem 0 3rem;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.25rem;
  color: var(--gray-dark);
}

/* "Right now" section */
.now {
  margin: 4rem 0;
}

.now h2, .worlds h2, .elsewhere h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-dark);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.now-list {
  list-style: none;
  padding: 0;
}

.now-list li {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.2rem;
  line-height: 1.6;
}

.now-list li:last-child {
  border-bottom: none;
}

.now-list .project {
  font-weight: 600;
  color: var(--text);
}

.now-list a {
  color: var(--gray-dark);
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: 0.5rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.now-list a:hover {
  border-bottom-color: var(--gray-dark);
}

/* Worlds grid */
.world-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.world-card {
  display: block;
  padding: 2rem 1.5rem;
  background: var(--gray);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, background 0.2s;
}

.world-card:hover {
  transform: translateY(-4px);
  background: #eaeaea; /* Slightly darker than gray */
}

.world-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.world-card p {
  color: var(--gray-dark);
  font-size: 0.9rem;
  margin: 0;
}

.world-card.coming-soon {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

/* Social links */
.social-links {
  display: flex;
  gap: 2rem;
  margin: 1.5rem 0;
}

.social-links a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
  transition: border-color 0.2s;
}

.social-links a:hover {
  border-bottom-color: var(--text);
}

/* ===== JOURNAL ===== */
.journal-header {
  text-align: center;
  margin: 3rem 0;
}

.journal-header h1 {
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.journal-header p {
  color: var(--gray-dark);
  font-size: 1.1rem;
}

.journal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 800px;
  margin: 0 auto;
}

.journal-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.journal-card:last-child {
  border-bottom: none;
}

.journal-cover {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray);
}

.journal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.journal-content h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.3rem;
  font-weight: 500;
}

.journal-content h2 a {
  color: var(--text);
  text-decoration: none;
}

.journal-content h2 a:hover {
  text-decoration: underline;
}

.journal-content time {
  color: var(--gray-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.journal-excerpt {
  margin: 0.75rem 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.9;
}

/* Journal entry page */
.journal-entry {
  max-width: 700px;
  margin: 0 auto;
}

.journal-entry header {
  margin: 2rem 0 3rem;
  text-align: center;
}

.journal-entry h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.journal-entry time {
  color: var(--gray-dark);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.entry-content {
  font-size: 1.1rem;
  line-height: 1.8;
}

.entry-content h2 {
  font-size: 1.8rem;
  margin: 2rem 0 1rem;
}

.entry-content h3 {
  font-size: 1.4rem;
  margin: 1.5rem 0 1rem;
}

.entry-content p {
  margin-bottom: 1.5rem;
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.entry-content blockquote {
  border-left: 4px solid var(--border);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--gray-dark);
  font-style: italic;
}

.entry-content code {
  background: var(--gray);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.entry-content pre {
  background: var(--gray);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

.entry-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.entry-navigation a {
  color: var(--text);
  text-decoration: none;
  max-width: 45%;
}

.entry-navigation a:hover {
  text-decoration: underline;
}

.entry-navigation .next {
  text-align: right;
}

/* Journal tags */
.journal-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.entry-tags {
  margin: 1rem 0;
}

.no-entries {
  text-align: center;
  color: var(--gray-dark);
  padding: 3rem;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .journal-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .journal-cover {
    width: 100%;
    height: 200px;
  }
  
  .entry-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .entry-navigation a {
    max-width: 100%;
    text-align: left;
  }
  
  .entry-navigation .next {
    text-align: left;
  }
}

/* ===== MAIN PAGE LAYOUT ===== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero {
  text-align: center;
  margin: 4rem 0 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.tagline {
  font-size: clamp(1.1rem, 4vw, 1.3rem);
  color: var(--gray-dark);
}

/* Worlds grid - balanced 3 columns on desktop */
.world-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.world-card {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  background: var(--gray);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, background 0.2s;
  text-align: center;
}

.world-card:hover {
  transform: translateY(-4px);
  background: #eaeaea;
}

.world-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.world-card p {
  color: var(--gray-dark);
  font-size: 0.9rem;
  margin: 0;
}

/* Journal preview section */
.latest-journal {
  margin: 5rem 0;
}

.latest-journal h2 {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 2rem;
  text-align: center;
}

.journal-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.preview-card {
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}

.preview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.preview-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gray);
}

.preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.preview-card:hover .preview-image img {
  transform: scale(1.05);
}

.preview-content {
  padding: 1.5rem;
}

.preview-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  line-height: 1.4;
}

.preview-content h3 a {
  color: var(--text);
  text-decoration: none;
}

.preview-content h3 a:hover {
  text-decoration: underline;
}

.preview-content time {
  color: var(--gray-dark);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.75rem;
}

.preview-content p {
  color: var(--gray-dark);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.read-more {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.read-more:hover {
  border-bottom-color: var(--text);
}

.view-all-link {
  text-align: center;
  margin-top: 2rem;
}

.view-all-link a {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--text);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s;
}

.view-all-link a:hover {
  background: #333;
}

.no-entries {
  text-align: center;
  color: var(--gray-dark);
  padding: 3rem;
  grid-column: 1 / -1;
}

/* Elsewhere section */
.elsewhere {
  margin: 4rem 0;
  text-align: center;
}

.elsewhere h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 2rem;
  color: var(--gray-dark);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--text);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background 0.2s;
}

.social-links a:hover {
  background: var(--gray);
}

/* Mobile adjustments */
@media (max-width: 600px) {
  main {
    padding: 0 1rem;
  }
  
  .hero {
    margin: 2rem 0;
  }
  
  .journal-previews {
    grid-template-columns: 1fr;
  }
  
  .social-links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .social-links a {
    width: 100%;
    text-align: center;
  }
}