* {
  box-sizing: border-box;
}

body {
  background: #FAF9F6;
  color: #202020;
  font-family: 'Oxygen', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

h1,h2,h3 {
  font-family: 'Oxygen', sans-serif;
  font-weight: 700;
}

a {
  color: inherit;
  transition: color 0.2s ease;
}

.home-intro {
  text-align: center;
  padding: 6em 1em 2em;
}

.home-intro h1 {
  font-size: 4rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.home-intro p {
  font-size: 1.75rem;
  color: #606060;
  margin: 0;
  font-weight: 300;
}

.home-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.home-link {
  background: #6B8E5F;
  border: 4px solid #6B8E5F;
  border-radius: 8px;
  padding: 3rem 2rem;
  text-decoration: none;
  color: #fff;
  transition: all 0.3s ease;
  display: block;
  text-align: center;
  box-shadow: 0 4px 12px rgba(184, 196, 170, 0.2);
}

.home-link:hover {
  border-color: #5a7a4f;
  background: #5a7a4f;
  color: #fff;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(107, 142, 95, 0.4);
}

.home-link h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.site-header {
  padding: 3.5rem 0 2rem 0;
}

.site-header .header-content {
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #d0d0d0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.site-header .header-title h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  position: relative;
}

/* Larger section title in header */
body:not(.home) .site-header .header-title h1 {
  font-size: 2.5rem;
}

body:not(.home) .site-header {
  padding: 3.5rem 0 1rem 0;
}

.site-header .header-title h1 a {
  text-decoration: none;
  color: #202020;
}

.site-header .header-title h1 a:hover {
  color: #6B8E5F;
}

/* Section name animation */
.site-name {
  display: inline-block;
}

.section-name {
  display: inline-block;
  color: #202020;
  font-weight: 700;
  animation: slideInSection 0.5s ease;
}

@keyframes slideInSection {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.site-header .header-nav {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
}

.site-header .header-nav a {
  text-decoration: none;
  color: #606060;
  font-size: 1.5rem;
}

.site-header .header-nav a:hover {
  color: #6B8E5F;
}

/* List/Projects Grid */
.list-page {
  padding: 2rem 0 4rem;
}

.list-title {
  display: none;
}

.list-intro {
  color: #606060;
  font-size: 1.2rem;
  margin: 0 0 3.5rem;
  font-style: italic;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2.5rem;
}

/* Posts List (vertical layout) */
body:has([data-section="posts"]) .list-grid {
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 800px;
}

body:has([data-section="posts"]) .list-item {
  border-radius: 8px;
  border-width: 2px;
}

body:has([data-section="posts"]) .list-item-link {
  flex-direction: row;
  align-items: center;
}

body:has([data-section="posts"]) .list-item-img {
  width: 150px;
  min-width: 150px;
  aspect-ratio: 1;
  flex-shrink: 0;
}

body:has([data-section="posts"]) .list-item-text {
  padding: 1.25rem;
}

body:has([data-section="posts"]) .list-item-title {
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
}

body:has([data-section="posts"]) .list-item-desc {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

body:has([data-section="posts"]) .list-item-date {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

body:has([data-section="posts"]) .list-item:hover {
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  body:has([data-section="posts"]) .list-item-link {
    flex-direction: column;
  }

  body:has([data-section="posts"]) .list-item-img {
    width: 100%;
  }
}

.list-item {
  background: #fff;
  border: 3px solid #d0d0d0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  position: relative;
}

.list-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  box-shadow: 0 12px 40px rgba(107, 142, 95, 0.3);
}

.list-item:hover {
  border-color: #6B8E5F;
  transform: translateY(-8px) rotate(-1deg);
}

.list-item:hover::after {
  opacity: 1;
}

.list-item:nth-child(even):hover {
  transform: translateY(-8px) rotate(1deg);
}

.list-item-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.list-item-img {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(135deg, #B8C4AA 0%, #8FA882 100%);
  position: relative;
}


.list-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: contrast(1.05) saturate(1.1);
}

.list-item:hover .list-item-img img {
  transform: scale(1.08);
}

/* Hover GIF effect */
.list-item-img img[data-hover-src] {
  cursor: pointer;
}

.list-item-text {
  padding: 1.75rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.list-item-title {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

.list-item:hover .list-item-title {
  color: #6B8E5F;
}

.list-item-desc {
  color: #606060;
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  flex-grow: 1;
}

.list-item-date {
  color: #909090;
  font-size: 0.85rem;
  margin-top: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Single Page / About Page */
.single-page {
  max-width: 720px;
  padding: 2rem 0 4rem;
}

.page-title {
  display: none;
}

.page-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #202020;
}

.page-content p {
  margin: 0 0 1.5rem;
}

.page-content h2 {
  font-size: 1.75rem;
  margin: 3rem 0 1rem;
  font-weight: 700;
}

.page-content h3 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
  font-weight: 700;
}

.page-content ul, .page-content ol {
  margin: 0 0 1.5rem;
  padding-left: 2rem;
}

.page-content li {
  margin: 0.5rem 0;
}

.page-content a {
  color: #6B8E5F;
  text-decoration: none;
  border-bottom: 2px solid #6B8E5F;
  transition: all 0.2s ease;
}

.page-content a:hover {
  color: #202020;
  border-bottom-color: #202020;
}

.page-content hr {
  border: none;
  border-top: 2px solid #d0d0d0;
  margin: 2.5rem 0;
}

.page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.page-content img:hover {
  transform: scale(1.02);
}

/* Photo Grid for Gallery Sections */
.page-content h3 {
  margin-top: 3rem;
  margin-bottom: 1rem;
}

/* Masonry-style grid layout */
.page-content h3 ~ p {
  display: inline-block;
  margin: 0.5rem;
  vertical-align: top;
}

.page-content h3 ~ p img {
  height: 300px;
  width: auto;
  max-width: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 8px;
}

/* Hide captions (em text) under gallery images */
.page-content h3 ~ p em {
  display: none;
}

@media (max-width: 768px) {
  .page-content h3 ~ p img {
    height: 250px;
  }
}

@media (max-width: 480px) {
  .page-content h3 ~ p {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
  }

  .page-content h3 ~ p img {
    width: 100%;
    height: auto;
    max-height: 400px;
  }
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  color: white;
  font-size: 3rem;
  font-weight: 300;
  cursor: pointer;
  transition: transform 0.2s ease;
  line-height: 1;
}

.lightbox-close:hover {
  transform: scale(1.1);
}

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

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* PDF Embed */
.pdf-embed-container {
  margin: 2rem 0;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.pdf-embed {
  width: 100%;
  height: 800px;
  border: none;
  display: block;
}

@media (max-width: 768px) {
  .pdf-embed {
    height: 600px;
  }
}

/* Profile photo to the left of intro text */
.intro-with-photo {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.profile-photo {
  width: 150px;
  height: 150px;
  min-width: 150px;
  border-radius: 50%;
  border: 4px solid #B8C4AA;
  object-fit: cover;
  flex-shrink: 0;
}

.intro-text {
  flex: 1;
}

.intro-text p {
  margin: 0 0 1rem;
  line-height: 1.8;
}

.intro-text p:last-child {
  margin-bottom: 0;
}

.contact-links {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #606060;
}

.contact-links a {
  color: #6B8E5F;
  text-decoration: none;
  border-bottom: 2px solid #6B8E5F;
  transition: all 0.2s ease;
}

.contact-links a:hover {
  color: #202020;
  border-bottom-color: #202020;
}

/* Links Container */
.links-container {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

/* Resume Button */
.resume-link {
  flex-shrink: 0;
}

.resume-button {
  display: inline-block;
  background: #6B8E5F;
  color: #fff !important;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: none !important;
}

.resume-button:hover {
  background: #5a7a4f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 142, 95, 0.3);
  color: #fff !important;
  border: none !important;
}

/* Skills section grid */
.page-content .skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 1.5rem 0;
}

.page-content .skills-grid > div {
  margin: 0;
}

.page-content .skills-grid strong {
  display: block;
  margin-bottom: 0.5rem;
}

.page-content .skills-grid ul {
  margin: 0;
  padding-left: 1.5rem;
}

.page-content .skills-grid li {
  margin: 0.3rem 0;
}

@media (max-width: 600px) {
  .intro-with-photo {
    flex-direction: column;
    align-items: center;
  }
}

.site-footer {
  text-align: center;
  padding: 2em 0;
  background: #fff;
  margin-top: 4em;
}