:root {
  --black: #000000;
  --white: #ffffff;
  --say-hi-bg: #93ff87;
  --page-bg: #F6FCFF;
  --gray-light: #f5f5f5;
  --gray-mid: #2f2f2fc4;
  --gray-dark: #000000;
  --anchored-gray: rgba(0,0,0,0.06);
  --font-heading: 'DM Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Centralized font variables for quick experimentation */
  --font-page-title: var(--font-heading);
  --font-grid-title: var(--font-heading);
  --font-regular-text: var(--font-body);
  --spacing-xs: .5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --line-color: rgb(65, 44, 8);
  --project-col: 340px;
}

.say-hi-highlight {
  background-color: var(--say-hi-bg);
  padding: 0.2em 1.05em;
  /* gap: 1rem; */
  border-radius: 2px;
}

a:has(.say-hi-highlight),
.markdown-content a:has(.say-hi-highlight) {
  text-decoration: none !important;
}
a:has(.say-hi-highlight):hover .say-hi-highlight,
.markdown-content a:has(.say-hi-highlight):hover .say-hi-highlight {
  font-style: italic;
}

/* Generic responsive video embed wrapper (used by youtube shortcode) */
.video-embed {
  margin: 1.5rem 0;
}
.video-embed-inner {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}
.video-embed-inner iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

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

body {
  font-family: var(--font-regular-text);
  font-size: 16px;
  line-height: 1.8;
  color: var(--black);
  background: var(--page-bg);
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Prevent accidental horizontal overflow from edge-to-edge elements */
/* Use clip (not hidden) on both html and body so they don't create a scroll container,
   which would silently break position:sticky on any descendant. */
html, body {
  overflow-x: clip;
}

/* Main Layout */
.portfolio-container {
  /* single-column flow; sidebar is fixed and taken out of normal flow */
  display: block;
  gap: var(--spacing-md);
  padding-left: calc(280px + var(--spacing-md)); /* leave room for fixed sidebar */
  padding-right: var(--spacing-md);
  min-height: 100vh;
}

/* Sidebar - Fixed Left */
.sidebar {
  position: fixed;
  left: var(--spacing-md);
  top: 0;
  width: 280px;
  min-width: 280px;
  height: 100vh;
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-top: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
}

/* shorter vertical divider for sidebar (100px gap at top & bottom) */
.sidebar::after {
  content: "";
  position: absolute;
  right: 0;
  top: 60px;
  bottom: 60px;
  width: 2px;
  background: var(--line-color);
  opacity: 1;
}

.sidebar-header {
  /* header cleared per request; hide any leftover title/icon */
  display: none;
}

/* About layout */

.about-layout-new {
  padding-top: 3rem;
  padding-bottom: 0;
  margin-bottom: 0;
  /* break out of container padding so video fills edge-to-edge */
  margin-left: calc(-1 * var(--spacing-lg));
  margin-right: calc(-1 * (var(--spacing-lg) + var(--spacing-md)));
  margin-top: calc(-1 * var(--spacing-lg));
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}
.about-grid-new {
  display: grid;
  grid-template-columns: 380px 1fr 420px; /* wider left column so profession fits on 2 lines */
  gap: 2rem;
  align-items: start; /* align columns to top so intro remains visible */
}
.about-left-col {
  position: relative; /* for absolutely positioned arrow */
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
}
.profession-stack {
  font-family: 'Host Grotesk', var(--font-page-title);
  font-weight: 200;
  font-size: 76px;
  line-height: 0.96;
  letter-spacing: -0.04em;
  color: rgba(0, 0, 0, 0.9);
  margin-top: 60px;
  overflow: visible;
  position: relative;
  z-index: 10;
  margin-bottom: -120px; /* pull text visually over the photo below */
}
.profession-line { display: block; white-space: nowrap; letter-spacing: -0.04em; transition: letter-spacing 0.5s ease, transform 0.5s ease; }
.profession-line:nth-child(2) { padding-left: 1.8em; color: rgba(0,0,0,0.45); }
.profession-line:nth-child(3) { padding-left: 5.4em; color: rgba(0,0,0,0.45); }
.profession-line:nth-child(4) { padding-left: 4.2em; }
.profession-stack:hover .profession-line:nth-child(1) {  letter-spacing: .01em; color: #210c07; }
.profession-stack:hover .profession-line:nth-child(4) { transform: translateX(-1.6rem); letter-spacing: 0.001em; color: #210c07;}
.photo-box {
  width: 290px;
  height: 550px;
  background: var(--gray-light);
  border: none; /* removed gray frame */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -38px; /* slight gap below profession */
  position: relative;
  z-index: 1; /* sit behind the profession-stack text (z-index: 10) */
}
.photo-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.contact-link {
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  color: var(--black);
  text-decoration: none;
  vertical-align: middle;
}
.contact-link:hover {
  text-decoration: none;
  text-shadow: 0.6px 0 0 currentColor;
}
.contact-separator {
  font-size: 18px;
  line-height: 1;
  color: rgba(0,0,0,0.4);
  padding: 0 0.6rem;
  user-select: none;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
}
.photo-box picture {
  width: 100%;
  height: 100%;
  display: block;
}
.photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  --scroll-blur: 0px;
  filter: blur(var(--scroll-blur)); /* fallback when SVG filter is unavailable */
  transition: filter 90ms linear;
  will-change: filter;
}
.about-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.about-intro-right { position: relative; z-index: 3; }
.about-center-col { display: block; }
.photo-row .photo-contacts { margin-left: 18px; }
.top-links { font-size: 14  px; margin-bottom: 0rem; }
.top-links a { color: var(--black); text-decoration: none; margin: 0 0.55rem; }
.intro-text-right { max-width: 320px; text-align: right; color: rgba(0,0,0,0.8); }
.intro-text-right > :first-child { margin-top: 0; }
.about-divider { border: none; border-top: 1px dashed rgba(0,0,0,0.7); margin: 0 0 0rem 1rem; width: 95%; }
.intro-text-right > .about-divider:first-child { margin-top: 0.55rem; }

/* Watch highlights button */
.about-watch-btn {
  position: absolute;
  left: var(--spacing-lg);
  bottom: 40px;
  display: inline-block;
  font-family: 'DM Sans', var(--font-page-title);
  font-weight: 700;
  font-size: 16px;
  color: var(--black);
  text-decoration: none;
  z-index: 2;
}
.about-watch-btn:hover {
  text-decoration: underline;
}

/* Featured video inside about section */
.about-featured-video {
  position: relative;
  margin-left: calc(-1 * var(--spacing-lg));
  margin-right: calc(-1 * (var(--spacing-lg) + var(--spacing-md)));
  margin-top: 40px;
  z-index: 1;
}

/* Background video behind about content */
.about-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.35;
}
.about-bg-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  border: 0;
}

.about-name-anchored {
  font-family: 'Karla', var(--font-page-title);
  font-weight: 700;
  font-size: 38px;
  line-height: 1;
  width: 420px;
  max-width: 100%;
  text-align: left;
  color: rgba(0,0,0,0.9);
  margin-top: 430px;
}

.about-tagline {
  text-align: left;
  align-self: flex-start;
  width: 420px;
  max-width: 100%;
  font-family: var(--font-regular-text);
  font-size: 16px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.699);
  /* margin-top: 0.45rem; */
}

/* removed small author label - author name is now the anchored large text */

/* Author + contact inline row */
.author-contact-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  font-size: 18px;
  line-height: 1.2;
  font-family: var(--font-regular-text);
  font-weight: 400;
  max-width: 100%;
}
.author-contact-row a {
  font-size: 14px !important;
  line-height: 1 !important;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0;
  padding: 0;
  text-decoration: none;
}
.author-contact-row a:hover {
  text-decoration: none;
}
.profession-stack.profession-right {
  text-align: left;
  align-self: flex-start;
  width: 100%;
}

@media (max-width: 1100px) {
  .about-grid-new { grid-template-columns: 1fr; }
  .about-right-col { align-items: flex-start; }
  .intro-text-right { text-align: left; }
  .about-name-anchored { text-align: left; }
  .author-contact-row { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  /* Reset the negative break-out margins that cause horizontal overflow */
  .about-layout-new {
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }

  /* Stack grid to single column */
  .about-grid-new {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Scale down the big profession headline so it fits */
  .profession-stack {
    font-size: clamp(28px, 8vw, 52px);
    margin-bottom: -50px;
    overflow: visible;
  }

  /* Allow profession lines to wrap and remove large indents */
  .profession-line {
    white-space: normal;
  }
  .profession-line:nth-child(2) { padding-left: 0.6em; }
  .profession-line:nth-child(3) { padding-left: 1.4em; }
  .profession-line:nth-child(4) { padding-left: 1em; }

  /* Photo fills available width */
  .photo-box {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
  }

  /* Center the left column content */
  .about-left-col {
    align-items: flex-start;
  }

  /* Intro text full width */
  .intro-text-right {
    max-width: 100%;
  }

  /* Name / tagline */
  .about-name-anchored {
    font-size: 28px;
  }
}

/* Navigation */
.main-nav {
  padding: 0 var(--spacing-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertically center the nav list */
}

.nav-list {
  list-style: none;
  margin: 0;
}

.nav-item {
  margin-bottom: var(--spacing-sm);
}

.nav-link {
  display: block;
  color: var(--gray-mid);
  text-decoration: none;
  padding: var(--spacing-xs) 0;
  transition: opacity 0.2s;
}
.main-nav:hover .nav-link {
  color: var(--black);
}
.nav-link:hover {
  font-weight: 700;
  opacity: 0.6;
}

.nav-indicator {
  display: inline-block;
  width: 30px;
  font-weight: 500;
}

.nav-indicator--tree {
  font-family: monospace;
  letter-spacing: -1px;
  opacity: 0.5;
}

.subnav {
  list-style: none;
  margin-left: 010px;
  margin-top: var(--spacing-xs);
}

.subnav-link {
  display: block;
  color: var(--gray-mid);
  text-decoration: none;
  padding: 4px 0;
  font-size: 13px;
  transition: opacity 0.2s;
}
.main-nav:hover .subnav-link {
  color: var(--black);
}
.subnav-link:hover {
  font-weight: 700;
  opacity: 0.6;
}

/* Content Area */
.content-area {
  padding: var(--spacing-lg);
  min-height: 100vh;
}

.content-area.project-page {
  padding-top: 0;
}

@media (max-width: 1024px) {
  /* revert to stacked layout on smaller screens */
  .portfolio-container { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
  .sidebar { position: relative; left: auto; width: 100%; min-width: auto; height: auto; }
  .content-area { margin-left: 0; padding: var(--spacing-md); }
}

.content-section {
  display: block;
  scroll-margin-top: 90px; /* offset for sticky sidebar/header when jumping to anchors */
}

/* Styled section header: 200px space, full-width line, large title */
.section-header-styled {
  margin-top: 200px;
  margin-left: calc(-1 * var(--spacing-lg));
  margin-right: calc(-1 * (var(--spacing-lg) + var(--spacing-md)));
  margin-bottom: var(--spacing-lg);
}
.section-header-line {
  width: 100%;
  height: 2px;
  background: var(--line-color);
  opacity: 1;
}
/* Slide-in animation for section titles */
.section-header-title {
  /* font-family: 'DM Sans', var(--font-page-title); */
  font-weight: 700;
  font-size: 38px;
  line-height: 1;
  color: rgba(0,0,0,0.9);
  margin: 0;
  padding: 1rem 0 0 var(--spacing-lg);
  transform: translateX(10px);
  opacity: 0;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 150ms ease;
}

/* Align the Projects section title with the projects grid start */
/* For the Projects section, align the title to the left edge of the description column
   and reduce the large top spacing so it sits closer to the grid. */
#projects .section-header-styled {
  margin-top: 0;
}

#projects .section-header-title {
  padding-left: calc((var(--project-col) - 50px) + var(--spacing-lg));
  text-align: left;
  transform: none; /* remove small slide so it doesn't appear offset */
  opacity: 1;
}

@media (max-width: 1024px) {
  #projects .section-header-title {
    padding-left: var(--spacing-lg);
    text-align: left;
  }
}

#opensource .section-header-title {
  display: none;
}

@media (max-width: 1024px) {
  #opensource .section-header-title {
    display: block;
  }
}

.section-header-title.in-view {
  transform: translateX(0);
  opacity: 1;
  transition-delay: 320ms;
}

.section-content {
  max-width: 800px;
}

/* Markdown Content Styling */
.markdown-content {
  max-width: 800px;
}

.markdown-content h1 {
  font-size: 32px;
  font-weight: 600;
  font-family: var(--font-heading);
  margin-bottom: var(--spacing-md);
}

.markdown-content h2 {
  font-size: 24px;
  font-weight: 600;
  font-family: var(--font-heading);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.markdown-content h3 {
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.markdown-content h3::before {
  content: '⸻ ';
  /* content: '**  '; */
  font-weight: 200;
}
/* .markdown-content h3::after {
  content: '';
  font-weight: 200;
} */

.markdown-content p {
  margin-bottom: var(--spacing-md);
  line-height: 1.7;
}

.markdown-content a {
  color: var(--black);
  text-decoration: underline;
}

.markdown-content a:hover {
  text-decoration: none;
}

.markdown-content ul,
.markdown-content ol {
  margin-bottom: var(--spacing-md);
  margin-left: var(--spacing-md);
}

.markdown-content li {
  margin-bottom: var(--spacing-xs);
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  vertical-align: middle;
  margin: 0.5rem;
  cursor: zoom-in;
  transition: opacity 150ms ease;
}

.markdown-content img:hover {
  opacity: 0.85;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 0.5rem; 
}

.project-item {
  display: block;
  position: relative;
  padding-bottom: 0;
  overflow: hidden;
  border: 0.5px solid var(--line-color);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: center center;
}

/* Hover / focus animation for project cards — image zoom only, no card movement */

/* all grid items keep their borders consistently */

.project-image {
  aspect-ratio: 4/3;
  background: var(--page-bg);
  overflow: hidden;
  width: 100%;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Make grid images B/W by default and reveal color on hover/focus for interactivity */
.project-item .project-image img {
  filter: grayscale(10%) contrast(85%);
  transition: filter 260ms ease, transform 260ms cubic-bezier(0.2,0.8,0.2,1);
}

@media (hover: hover) and (pointer: fine) {
  /* title shifts slightly to the right on hover; image moves up */
  .project-title .project-title-text {
    display: inline-block;
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .project-item:not(.feature):hover .project-title .project-title-text,
  .project-item:not(.feature):focus-within .project-title .project-title-text {
    transform: translateX(4px);
  }

  .project-item:hover .project-image img,
  .project-item:focus-within .project-image img {
    filter: none;
    transform: translateY(-6px);
  }
}

/* Ensure keyboard users get a visible color change when focusing the card */
.project-item:not(.feature):focus-within .project-image img {
  filter: none;
}

.project-title {
  font-size: 18px;
  font-weight: 400;
  font-family: 'Karla', var(--font-page-title);
  margin-bottom: var(--spacing-xs);
}

.project-title-arrow {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 1.76em;
  line-height: 1;
  vertical-align: middle;
  transform-origin: center;
  animation: project-arrow-pingpong 820ms ease-in-out infinite alternate;
}

@keyframes project-arrow-pingpong {
  0% {
    transform: scale(0.88);
  }
  100% {
    transform: scale(1.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-title-arrow {
    animation: none;
  }
}

/* Project index — overlaid on image, top-right corner */
.project-index {
  position: absolute;
  top: 0;
  right: 0;
  font-family: 'DM Sans', var(--font-page-title);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  color: #fff;
  background: #000;
  padding: 0.3rem 0.55rem;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 2;
}

a.project-item,
a.project-item:hover,
a.project-item:focus-visible,
a.project-item:active {
  color: inherit;
  text-decoration: none;
}

/* Project info overlay on image */
.project-item:not(.feature) .project-info {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.15rem 0.5rem 0.75rem;
  background: none;
  color: var(--black);
  text-align: left;
}

.project-item:not(.feature) .project-info .card-view-details {
  order: -1;
  margin-top: 0;
  margin-bottom: 0.2rem;
}

.project-meta {
  margin-bottom: 0;
}

.subtitle {
  font-style: italic;
  margin-bottom: var(--spacing-xs);
  color: rgba(0,0,0,0.5);
}

.venue {
  margin-bottom: 0.25rem;
  font-size: 13px;
  color: rgba(0,0,0,0.6);
}

.dates {
  font-weight: 600;
  margin-bottom: 0;
  font-size: 13px;
  color: rgba(0,0,0,0.7);
}

.project-item:not(.feature) .project-description {
  display: none;
}

.card-view-details {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.2rem 1rem;
  background: #ffffff00;
  color: #287eff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  /* text-transform: uppercase; */
  letter-spacing: 0.06em;
  text-align: center;
  border-radius: 0;
  cursor: pointer;
  user-select: none;
}

a.project-item:hover .card-view-details,
a.project-item:focus-visible .card-view-details {
  background: #b1c7ff41;
}

/* Project Detail Page */
.project-detail-content {
  max-width: 100%;
}

/* Project detail layout: banner full-width, body centered below */
.project-detail-layout {
  display: block;
}

/* Full-width banner spanning edge-to-edge */
.project-image-large {
  width: calc(100% + var(--spacing-lg) + var(--spacing-lg) + var(--spacing-md));
  margin-left: calc(-1 * var(--spacing-lg));
  margin-right: calc(-1 * (var(--spacing-lg) + var(--spacing-md)));
  aspect-ratio: 16 / 5;
  overflow: hidden;
  background: var(--gray-light);
  margin-bottom: var(--spacing-lg);
}

.project-image-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Centered two-column body: constrained width + auto margins center it between sidebar edge and viewport */
.project-detail-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-areas: "meta main";
  gap: 0 var(--spacing-lg);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.project-meta-column { grid-area: meta; padding-top: 0; }
.project-main { grid-area: main; align-self: start; }

/* Bullet lists in project content → tree-panel style */
.project-main ul {
  list-style: none;
  margin: 0.75rem 0 1.25rem 0;
  padding: 0;
}

.project-main ul li {
  position: relative;
  padding-left: 2.2em;
  margin-bottom: 0.25rem;
  line-height: 1.7;
}

.project-main ul li::before {
  content: '├─';
  position: absolute;
  left: 0;
  font-family: monospace;
  letter-spacing: -1px;
  color: var(--gray-dark);
  opacity: 0.5;
}

.project-main ul li:last-child::before {
  content: '└─';
}

.project-meta-card {
  border: none;
  padding: 0;
  width: 100%;
  position: sticky;
  top: var(--spacing-md);
}

.project-back-btn {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 13px;
  font-family: 'Karla', var(--font-page-title);
  font-weight: 600;
  color: rgba(0,0,0,0.5);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

.project-back-btn:hover {
  color: rgba(0,0,0,0.9);
}

.project-meta-card .project-detail-title {
  font-size: 28px;
  margin: 0 0 0.75rem 0;
  font-family: 'Karla', var(--font-page-title);
  font-weight: 400;
  line-height: 1.15;
}

.project-detail-description {
  font-size: 14px;
  color: rgba(0,0,0,0.7);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.project-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.project-detail-tags .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line-color);
  color: var(--black);
  background: transparent;
}

.project-detail-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-size: 13px;
}

.project-detail-meta-row .meta-label {
  font-weight: 600;
  color: rgba(0,0,0,0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.project-detail-meta-row .meta-value {
  text-align: right;
  color: var(--black);
}

.project-detail-links {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-detail-link {
  display: block;
  width: 100%;
  padding: 0.55rem 1rem;
  /* background: #1a5bff; */
  color: #287eff;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  border-radius: 0;
  border: 2px;
  border-color: #287eff;
  transition: background 0.15s;
}

.project-detail-link:hover {
  background: #94b2fd;
  color: #ffffff;
}

/* Project main content images */
.project-main img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
}

.project-main img.float-left {
  float: left;
  max-width: 42%;
  width: auto;
  margin: 0 1.25rem 1rem 0;
}

.project-main img.float-right {
  float: right;
  max-width: 42%;
  width: auto;
  margin: 0 0 1rem 1.25rem;
}

@media (max-width: 1024px) {
  .project-detail-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "meta"
      "main";
  }
  .project-meta-column {
    position: static;
    margin-bottom: var(--spacing-md);
  }
  .project-meta-card {
    position: static;
  }
  /* .project-image-large {
    aspect-ratio: 16 / 1;
  } */
}

@media (max-width: 768px) {
  .project-main img.float-left,
  .project-main img.float-right {
    float: none;
    margin: 0.75rem auto;
    max-width: 100%;
  }
}

/* Alternative project card style */
.project-item.alt-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  /* padding: var(--spacing-md); */
  /* border: 1px solid var(--black); */
  /* border-radius: 1px; */
  /* box-shadow: 0 6px 18px rgba(0,0,0,0.04); */
  background: transparent;
}

.project-item.alt-card .project-image {
  width: 100%;
  aspect-ratio: 5/6;
  margin: 0 auto;
}

.project-item.alt-card .project-info {
  text-align: left;
  max-width: 70ch;
}

.project-item.alt-card .project-title {
  margin-top: var(--spacing-sm);
}

@media (min-width: 1200px) {
  .project-item.alt-card {
    align-items: stretch;
  }
}

/* Featured project card: span full width and use stacked layout */
.project-item.feature {
  grid-template-columns: 1fr;
  padding: 0;
  width: calc(100% + var(--spacing-lg) + var(--spacing-lg) + var(--spacing-md));
  max-width: none;
  margin-left: calc(-1 * var(--spacing-lg));
  margin-right: calc(-1 * (var(--spacing-lg) + var(--spacing-md)));
  margin-bottom: 1.5rem;
}

/* Limit the overall projects grid width and center it so cards don't stretch too wide */
.projects-grid {
  width: calc(100% + var(--spacing-lg) + var(--spacing-lg) + var(--spacing-md));
  max-width: none;
  margin-left: calc(-1 * var(--spacing-lg));
  margin-right: calc(-1 * (var(--spacing-lg) + var(--spacing-md)));
  margin-bottom: 2rem;
  box-sizing: border-box;
  padding: 0;
}

/* Projects overview: left intro column + right projects grid (3 columns) */
.projects-overview {
  /* make columns: intro column, narrow rotated-title column, and main grid */
  --project-col: 340px; /* adjust this value to taste */
  display: grid;
  grid-template-columns: calc(var(--project-col) - 50px) 48px 1fr; /* middle column reserved for rotated title */
  gap: var(--spacing-lg);
  align-items: start;
  width: 100%;
  margin-left: -34px;
  margin-right: 0;
  box-sizing: border-box;
  padding: 0;
}

.projects-intro {
  padding: var(--spacing-md);
  align-self: start;
}

.projects-intro {
  text-align: right;
}

.projects-intro p {
  margin: 0;
}

/* Nudge the intro up slightly so it visually aligns with the top of the grid cards */
.projects-intro {
  position: relative;
  top: -35px; /* small upward shift */
}

@media (max-width: 1024px) {
  .projects-overview {
    display: flex;
    flex-direction: column;
    margin-left: 0;
  }

  .projects-intro {
    order: 1;
  }

  .projects-grid.projects-listing {
    order: 2;
    grid-column: auto;
  }

  .more-projects-wrap {
    order: 3;
    grid-column: auto;
    left: 0;
  }

  .projects-intro {
    top: 0; /* reset on narrower screens to avoid overlap */
    text-align: left;
    padding-bottom: var(--spacing-sm);
  }
}

.projects-grid.projects-listing {
  display: grid;
  grid-column: 3; /* place in third column of projects-overview */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  position: relative;
  left: -50px;
}

.more-projects-wrap {
  grid-column: 3;
  position: relative;
  left: -50px;
  text-align: center;
  margin-top: 0.75rem;
}

.more-projects-btn {
  display: inline-block;
  font-family: 'DM Sans', var(--font-page-title);
  font-weight: 700;
  font-size: 32px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--black);
  text-decoration: none;
}

.more-projects-btn:hover {
  text-decoration: underline;
}

.projects-rotated {
  grid-column: 2; /* middle narrow column */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  grid-row: 1; /* ensure it sits on the same row as the grid */
  padding-top: 65px;
  position: relative;
  left: -55px;
}

.projects-rotated span {
  display: inline-block;
  transform: rotate(-90deg);
  transform-origin: center;
  font-family: 'DM Sans', var(--font-page-title);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}
/* remove ::before slashes to avoid double artefacts; slashes can be added elsewhere if needed */

@media (max-width: 1280px) {
  .projects-grid.projects-listing {
    grid-template-columns: 1fr;
    left: 0;
  }

  .more-projects-wrap {
    grid-column: 1 / -1;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 1024px) {
  .projects-rotated { display: none; }
}

.project-item.feature .project-image {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16/6;
  margin-bottom: 0; /* remove bottom gap under image */
}

/* Responsive YouTube embed for featured hero */
.yt-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
}
.yt-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Float helpers for portrait images inside markdown content */
.markdown-content img.float-left {
  float: left;
  max-width: 42%; /* portrait column width */
  width: auto;
  margin: 0 1.25rem 1rem 0;
  display: block;
}

.markdown-content img.float-right {
  float: right;
  max-width: 42%;
  width: auto;
  margin: 0 0 1rem 1.25rem;
  display: block;
}

/* Small screens: clear floats and stack images */
@media (max-width: 768px) {
  .markdown-content img.float-left,
  .markdown-content img.float-right {
    float: none;
    margin: 0.75rem auto;
    max-width: 100%;
  }
}

/* Inline images row: place two images side-by-side */
.inline-images {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: center;
  margin: var(--spacing-sm) 0;
}

.inline-images img {
  width: 50%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .inline-images {
    flex-direction: column;
  }
  .inline-images img { 
    width: 100%; 
  }
}

/* Ensure Eleventy's image shortcode output (<picture> / <figure>)
   behaves like the simple <img> used by .inline-images */
.inline-images picture,
.inline-images figure {
  width: 50%;
  display: block;
  margin: 0;
}

.inline-images picture img,
.inline-images figure img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .inline-images picture,
  .inline-images figure {
    width: 100%;
  }
}
 
/* show project info below the featured image */
.project-item.feature .project-info .project-title {
  display: block;
}

/* featured overlay now displays as normal block below image (no gradient) */
.project-item.feature .feature-overlay {
  background: none;
  padding: 0;
  border-radius: 0;
  display: block;
}

/* Featured video overlay button */
.featured-video-wrap {
  position: relative;
}
.featured-video-wrap .yt-embed {
  pointer-events: none;
}
.featured-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--white);
  background: rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.featured-video-wrap:hover .featured-video-overlay {
  opacity: 1;
}
.featured-play-btn {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.featured-play-text {
  font-family: 'DM Sans', var(--font-page-title);
  font-weight: 700;
  font-size: 18px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.project-item.feature .overlay-meta {
  margin: 0.5rem 0 0;
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
}

.overlay-cta {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.45rem 0.9rem;
  background: var(--white);
  color: var(--black);
  text-decoration: none;
  font-weight: 700;
  border-radius: 4px;
}

.overlay-cta:hover {
  opacity: 0.95;
}

@media (max-width: 640px) {
  .project-item.feature .overlay-title { font-size: 1.25rem; }
  .project-item.feature .feature-overlay { left: 1rem; right: 1rem; bottom: 1rem; }
}

.project-item.feature .project-info {
  display: block; /* show project info below image */
  padding: var(--spacing-md);
}

/* Make featured card CTA prominent (black background, white text) */
.project-item.feature .overlay-cta {
  background: var(--black);
  color: var(--white);
  border: none;
}

.project-item.feature .overlay-cta:hover {
  opacity: 0.95;
}

@media (min-width: 1200px) {
  .projects-grid .project-item.feature {
    grid-column: 1 / -1;
  }
}

/* OpenSource grid — reuse projects-grid styling, clickable cards */
.projects-grid.opensource-grid {
  /* make each opensource column wider by 100px compared to --project-col */
  grid-column: 3;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  width: 100%;
  max-width: 100%;
  position: relative;
  left: 0;
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 1024px) {
  .projects-grid.opensource-grid {
    grid-column: auto;
    left: 0;
  }
}

.opensource-overview {
  --project-col: 300px;
  display: grid;
  grid-template-columns: calc(var(--project-col) - 50px) 48px 1fr;
  gap: var(--spacing-lg);
  align-items: start;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.opensource-intro {
  grid-column: 1;
  text-align: left;
}

.opensource-overview .projects-rotated {
  grid-column: 2;
  margin-left: 120px;
  margin-top: 45px;
}

@media (max-width: 1024px) {
  .opensource-overview {
    display: block;
  }
}

/* Clickable card links for opensource items */
a.project-item.opensource-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.project-item.project-card-link {
  cursor: pointer;
}

a.project-item .annotation {
  font-style: normal;
  color: #666;
  margin: -0.05rem 0 -0.25rem;
  font-size: 0.95rem;
}


/* Responsive */
@media (max-width: 1024px) {
  .portfolio-container {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--black);
  }

  .content-area {
    margin-left: 0;
    padding: var(--spacing-md);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid.projects-listing {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    left: 0;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .projects-grid.opensource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    left: 0;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .project-image {
    width: 100%;
  }
}

@media (min-width: 901px) and (max-width: 1024px) {
  .projects-grid,
  .projects-grid.projects-listing,
  .projects-grid.opensource-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1025px) {
  .projects-grid:not(.projects-listing):not(.opensource-grid) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sidebar-header {
    padding: var(--spacing-sm);
  }

  .main-nav {
    padding: var(--spacing-sm);
  }

  .content-area {
    padding: var(--spacing-sm);
  }

  .projects-grid,
  .projects-grid.projects-listing,
  .projects-grid.opensource-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid.projects-listing {
    left: 0;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .projects-grid.opensource-grid {
    left: 0;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .more-projects-wrap {
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    text-align: center;
  }

  .about-layout-new {
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }

  .about-featured-video {
    margin-left: 0;
    margin-right: 0;
  }

  .about-right-col {
    align-items: flex-start;
  }

  .about-intro-right,
  .intro-text-right {
    width: 100%;
    max-width: 100%;
    text-align: left;
    
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .about-name-anchored,
  .about-tagline {
    width: 100%;
    max-width: 100%;
    text-align: left;
    align-self: flex-start;
    margin-left: 0;
  }

  .about-name-anchored {
    margin-top: var(--spacing-sm);
  }

  .author-contact-row {
    gap:0.25rem;
    line-height: 1.35;
  }

  .author-contact-row a {
    font-size: 13px !important;
  }

  .contact-separator {
    padding: 0 0.35rem;
  }
}

/* ── Lightbox ── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.82);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: lightbox-fade-in 180ms ease;
}

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

@keyframes lightbox-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-img {
  max-width: min(90vw, 1200px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  animation: lightbox-zoom-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes lightbox-zoom-in {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 120ms;
  z-index: 10000;
}

.lightbox-close:hover {
  opacity: 1;
}