/* Font Face */
@font-face {
  font-family: 'UN';
  src: url('../fonts/UN-Reg.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/* Reset and Base Styles */
* {
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
}

body {
  font-family: 'UN', sans-serif;
  font-size: 12px;
  line-height: 110%;
  color: #3F2818;
  background: #FFFDF9;
  padding-top: 20px; /* Space for fixed header */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}


/* Fixed Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  padding: 12px 0;
}

.nav {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 0;
}

.nav-link {
  color: #3F2818;
  text-decoration: none;
}

.nav-link.active {
  text-decoration: underline;
}

.nav-separator {
  margin-right: 0.3em;
}

.nav-bio {
  position: absolute;
  top: 12px;
  left: 18px;
  max-width: 30%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.nav-bio p {
  margin: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Main Content */
.main-content {
  margin: 0 auto;
  margin-top: 30px;
  padding: 0 18px;
}

.home-content {
  display: block;
}

/* Post Styles */
.skillset-group {
  margin-bottom: 3rem;
  clear: both;
  display: block;
  width: 100%;
}

.skillset-group h1,
.skillset-group h2 {
  margin-bottom: 2rem;
  font-weight: 600;
  display: block;
  width: 100%;
}

.projects-container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
}


/* Work Template Styles */
.work {
  margin: 10px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.work-content {
  margin-bottom: 4rem;
}

.work h1 {
  margin-bottom: 3rem;
  font-weight: 600;
}

.work h2 {
  margin: 10px;
  padding: 10px;
  display: block;
  width: 100%;
}

.block {
  margin: 10px;
  padding: 10px;
}

.block-text {
  line-height: 1.8;
}

.block-heading h2 {
  font-weight: 600;
  margin-bottom: 1rem;
}

.project-post {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  flex-grow: 0;
  box-sizing: border-box;
}

/* Random offsets for editorial feel - using prime intervals for more organic patterns */

/* Vertical offsets - layered for complexity */
.project-post:nth-child(2n) {
  margin-top: 25px;
}

.project-post:nth-child(3n+1) {
  margin-top: 55px;
}

.project-post:nth-child(5n+2) {
  margin-top: 90px;
}

.project-post:nth-child(7n+3) {
  margin-top: 35px;
}

.project-post:nth-child(11n+4) {
  margin-top: 70px;
}

.project-post:nth-child(13n+7) {
  margin-top: 110px;
}

.project-post:nth-child(17n+5) {
  margin-top: 45px;
}

/* Horizontal nudges - subtle asymmetry */
.project-post:nth-child(4n) {
  margin-left: 3%;
}

.project-post:nth-child(6n+1) {
  margin-right: 2%;
}

.project-post:nth-child(9n+2) {
  margin-left: 1.5%;
}

.project-post:nth-child(11n+6) {
  margin-right: 4%;
}

.project-post:nth-child(13n+3) {
  margin-left: 2.5%;
}

/* Subtle bottom spacing variation */
.project-post:nth-child(8n+1) {
  margin-bottom: 20px;
}

.project-post:nth-child(10n+4) {
  margin-bottom: 35px;
}

/* Vertical alignment variation within rows */
.project-post:nth-child(5n+3) {
  align-self: center;
}

.project-post:nth-child(7n+2) {
  align-self: flex-end;
}

.project-post:nth-child(11n+8) {
  align-self: center;
}

.project-post:nth-child(13n+1) {
  align-self: flex-end;
}

.work-image {
  margin: 0;
  padding: 0;
  display: block;
  position: relative;
  overflow: hidden;
  cursor: se-resize;
}

.work-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Lazy load fade-in animation */
.lazy-image {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-image.loaded {
  opacity: 1;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 253, 249, 0.9);
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* Only show hover overlay on devices that support hover (not touch) */
@media (hover: hover) {
  .work-image:hover .image-overlay {
    opacity: 1;
  }
}

.caption-wrapper {
  width: 100%;
  display: flex;
  align-items: flex-start;
  padding: 0 18px;
}

.caption-left {
  color: #3F2818;
}

.caption-right {
  position: absolute;
  left: 65%;
  color: #3F2818;
}

/* Narrow posts - adjust caption position */
.project-post--narrow .caption-right {
  left: 50%;
}

.caption-1,
.caption-2,
.caption-3 {
  display: block;
}

/* Fixed Contact - Bottom Right */
.fixed-contact {
  position: fixed;
  bottom: 12px;
  right: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.contact-link {
  color: #3F2818;
  text-decoration: none;
}

.contact-link:hover {
  text-decoration: underline;
}

/* Fixed Logo */
.fixed-logo {
  position: fixed;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 1000;
  pointer-events: none;
}

.site-logo {
  width: 53px;
  height: auto;
  pointer-events: auto;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 253, 249, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: nw-resize;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-image {
  max-width: 75%;
  max-height: 75%;
  object-fit: contain;
}

.lightbox-caption {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  color: #3F2818;
}

.lightbox-caption-1,
.lightbox-caption-2,
.lightbox-caption-3 {
  display: block;
}

.lightbox-caption-1:empty,
.lightbox-caption-2:empty,
.lightbox-caption-3:empty {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding-top: 10px;
  }

  .site-header {
    position: relative;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-bio {
    position: static;
    max-width: 100%;
  }
  
  .nav {
    justify-content: flex-start;
  }
  
  .nav-links {
    flex-wrap: wrap;
  }
  
  .main-content {
    margin-top: 2rem;
    padding: 0 18px;
  }
  
  .home-content {
    gap: 2rem;
  }
  
  .skillset-group {
    margin-bottom: 1.5rem;
  }
  
  .projects-container {
    gap: 18px;
    justify-content: center;
  }
  
  .project-post {
    width: calc(50% - 9px) !important;
    padding: 0;
    margin: 0 !important;
    align-self: flex-start !important;
  }
  
  /* Subtle stagger for editorial feel - vertical */
  .project-post:nth-child(2n) {
    margin-top: 20px !important;
  }
  
  .project-post:nth-child(3n+1) {
    margin-top: 12px !important;
  }
  
  .project-post:nth-child(5n+2) {
    margin-top: 30px !important;
  }
  
  .project-post:nth-child(7n+3) {
    margin-top: 8px !important;
  }
  
  /* Width and padding variation */
  .project-post:nth-child(4n+1) {
    width: calc(42% - 9px) !important;
    padding-left: 8% !important;
  }
  
  .project-post:nth-child(4n+2) {
    width: calc(55% - 9px) !important;
    padding: 2.5% !important;
  }
  
  .project-post:nth-child(4n+3) {
    width: calc(54% - 9px) !important;
    padding: 2% !important;
  }
  
  .project-post:nth-child(4n) {
    width: calc(40% - 9px) !important;
    padding-right: 9% !important;
  }
  
  .project-post:nth-child(6n+1) {
    padding-top: 20px !important;
  }
  
  .project-post:nth-child(8n+3) {
    padding-left: 6% !important;
  }
  
  .project-post:nth-child(5n) {
    padding-right: 7% !important;
  }
  
  .project-post:nth-child(7n+2) {
    padding-left: 5% !important;
  }
  
  .project-post:nth-child(9n+4) {
    padding: 2% !important;
  }
  
  .project-post:nth-child(11n+5) {
    width: calc(48% - 9px) !important;
    padding-left: 4% !important;
  }
  
  .work {
    margin: 0;
    padding: 0;
  }
  
  .block {
    margin: 0;
    padding: 0;
    margin-bottom: 1rem;
  }
  
  .fixed-contact {
    position: static;
    align-items: flex-start;
    padding: 2rem 18px;
  }
  
  /* Hide hover overlay on mobile - just tap to enlarge */
  .image-overlay {
    display: none !important;
  }
  
  /* Fix caption overlap on mobile */
  .caption-wrapper {
    flex-direction: column;
    padding: 0 8px;
  }
  
  .caption-right {
    position: static;
    margin-top: 4px;
  }
  
  /* Lightbox caption - move to bottom on mobile */
  .lightbox-caption {
    left: 18px !important;
    right: 18px !important;
    top: auto !important;
    bottom: 18px !important;
    transform: none !important;
  }
}

