@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100;200;300;400;500;700&display=swap');

:root {
  --primary-bg: rgb(252, 252, 252);
  --primary-text: rgb(1, 1, 1);
  --secondary-text: rgb(80, 80, 80);
  --accent-color: rgb(50, 50, 50);
  --border-color: rgb(200, 200, 200);
  --header-font: 'Courier New', Courier, monospace;
  --body-font: 'JetBrains Mono', monospace;
}

body {
  background-color: var(--primary-bg);
  color: var(--primary-text);
  font-family: var(--body-font);
  font-weight: 300;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.container {
  width: 85%;
  max-width: 900px;
  min-width: 300px;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 6rem;
  margin-bottom: 3rem;
  width: 100%;
}

header h1 {
  font-family: var(--header-font);
  font-size: 10rem;
  font-weight: 700;
  margin-bottom: 0;
  margin-top: 0;
  animation: flicker 180s infinite alternate;
}

header h3 {
  font-family: var(--body-font);
  font-weight: 200;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  margin-top: -20px;
  margin-bottom: 10px;
  color: var(--secondary-text);
}

header .logo-separator {
  font-family: var(--body-font);
  font-size: 2rem;
  font-weight: 700;
  margin: 1rem 0 1.5rem 0;
  color: var(--primary-text);
}

header nav {
  width: 100%;
  position: sticky;
  top: 0;
  background-color: var(--primary-bg);
  z-index: 900;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

header nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 0;
  margin: 0;
}

header nav ul li a {
  color: var(--primary-text);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
  transition: color 0.3s ease, border-bottom-color 0.3s ease;
  border-bottom: 2px solid transparent;
}

header nav ul li a:hover,
header nav ul li a.active-nav {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.section {
  display: none;
  margin: 0 auto;
  padding: 3rem 0;
  text-align: left;
  border-top: 1px solid var(--border-color);
}
.section:first-of-type {
    border-top: none;
}

/* Styling for the #home section */
#home {
    /* No specific positioning needed here for the video to be a block element after text */
    /* overflow: hidden; /* Can be kept if desired, but not strictly necessary for this layout */
}

/* Text content in #home - no special z-index needed now */
#home > p {
    /* position: relative; /* Not needed */
    /* z-index: 1; /* Not needed */
    /* Optional text readability enhancements can still be applied if the video content is very busy,
       but they are not for layering purposes anymore. */
}


.section.visible {
  display: block;
  animation: fadeIn 0.5s ease-out;
}

.section h2 {
  font-family: var(--header-font);
  font-size: 2.5rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--accent-color);
}

.section p {
  margin-bottom: 1.5rem;
  color: var(--secondary-text);
  font-size: 0.95rem;
}

.section p a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dotted var(--accent-color);
  transition: color 0.3s ease, border-bottom-style 0.3s ease;
}

.section p a:hover {
  color: var(--primary-text);
  border-bottom-style: solid;
}

/* Video container styling - to appear as a block after text */
#home .video-container {
  position: relative; /* Needed for the overlay positioning */
  /* z-index: -1; /* REMOVED - so overlay can be on top within this container */
  margin-top: 2rem;
  margin-bottom: 1rem;
  overflow: hidden; /* Good to keep, helps with border-radius on children */
  border-radius: 0px; /* Match video's border-radius, or set as desired */
                     /* If you want rounded corners for the video and overlay, set it here */
}

/* Overlay for the video */
#home .video-container::after {
  content: ""; /* Necessary for pseudo-elements */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.01); /* Example: 30% transparent black. Adjust as needed. */
                                       /* e.g., rgba(255, 0, 0, 0.2) for a light red tint */
  z-index: 1; /* Places overlay on top of the video */
  pointer-events: none; /* Makes the overlay non-interactive */
  border-radius: inherit; /* Inherits border-radius from .video-container */
}

#home .video-container video {
  display: block;
  width: 100%;
  height: auto; /* Or 100% if you want to force container height */
  object-fit: cover;
  pointer-events: none;
  border-radius: 0px; /* Can be 'inherit' if parent .video-container has the radius */
  position: relative; /* Optional: to explicitly set stacking context if needed */
  z-index: 0;         /* Optional: video is below the overlay */
}


.service {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--border-color);
}

.service:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.service h3 {
  font-family: var(--body-font);
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--primary-text);
}

#portfolio, #news { /* Apply to both portfolio and news sections on index.html */
  text-align: center;
}

.portfolio-grid, .news-grid { /* Apply to both grids on index.html */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.portfolio-item { /* This class is used for both portfolio and news cards */
  background-color: var(--primary-bg);
  border: 1px solid var(--border-color);
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 0px; /* Added rounded corners */
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08); /* Slightly adjusted shadow */
}

.portfolio-item a.portfolio-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.portfolio-item img.portfolio-thumbnail,
.portfolio-item .placeholder-thumbnail { /* Style for actual image and placeholder */
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border-color);
  background-color: #f0f0f0; /* Background for placeholder */
  text-align: center; /* Center text in placeholder */
  line-height: 200px; /* Vertically center text in placeholder */
  color: var(--secondary-text); /* Text color for placeholder */
  font-size: 0.9rem;
  /* Removed border-radius from here to apply to .portfolio-item for overall rounding */
}


.portfolio-item-content {
  padding: 1rem 1.5rem 0.5rem 1.5rem;
}

.portfolio-item-lower-content {
  padding: 0.5rem 1.5rem 1.5rem 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-item h4 {
  font-family: var(--body-font);
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--primary-text);
}

.portfolio-item p {
  font-size: 0.85rem;
  color: var(--secondary-text);
  margin-bottom: 1rem;
  flex-grow: 1;
}
.portfolio-item p.news-date-summary { /* Specific for news card date */
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}


/* Global Tag Styling */
.tag {
  display: inline-block;
  background-color: rgb(230, 230, 230);
  color: var(--secondary-text);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 0px; /* Slightly more rounded */
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

/* Tag Container on index.html cards (portfolio & news) */
.portfolio-item .portfolio-tags {
  margin-bottom: 1rem;
  margin-top: 0.5rem; /* Add some top margin if needed */
}


.portfolio-item .portfolio-external-link,
.portfolio-item .news-read-more-link { /* Style for "View Project" and "Read More" */
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-color);
  transition: color 0.3s ease, border-bottom-color 0.3s ease;
  margin-top: auto;
}

.portfolio-item .portfolio-external-link:hover,
.portfolio-item .news-read-more-link:hover {
  color: var(--primary-text);
  border-bottom-color: var(--primary-text);
}

#contact p {
    text-align: center;
}

footer {
  text-align: center;
  padding: 3rem 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--secondary-text);
  font-size: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

/* --- Project Detail Page (project-detail.html) --- */
.project-detail-nav { /* Already in project-detail.html <style>, but can be here for consistency */
    width: 100%;
    padding: 1rem 0;
    text-align: center;
    background-color: var(--primary-bg);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}
.project-detail-nav a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    margin: 0 1rem;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}
.project-detail-nav a:hover {
    color: var(--primary-text);
    border-bottom-color: var(--primary-text);
}

.project-detail-container {
    width: 85%;
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
    background-color: var(--primary-bg);
}

.project-detail-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.project-detail-header h1 {
    font-family: var(--header-font);
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.project-detail-content .content-block-text p {
    color: var(--secondary-text);
    font-size: 0.95rem;
    line-height: 1.7;
}

.project-detail-content img.image-float-left {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
    max-width: 50%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 0px;
}

.project-detail-content img.image-float-right {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
    max-width: 50%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 0px;
}

.project-detail-content img.image-center-block {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    max-width: 80%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 0px;
}

.project-detail-content figure.content-block-figure {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 0px;
    background-color: #f9f9f9;
    overflow: hidden;
}

.project-detail-content figure.image-float-left {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
    max-width: 50%;
}

.project-detail-content figure.image-float-right {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
    max-width: 50%;
}

.project-detail-content figure.image-center-block {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 80%;
}

.project-detail-content figure.content-block-figure img {
    display: block;
    width: 100%;
    height: auto;
}

.project-detail-content figure.content-block-figure figcaption {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--secondary-text);
    text-align: center;
    background-color: #f0f0f0;
}

.project-detail-content::after { /* Clearfix */
    content: "";
    display: table;
    clear: both;
}

/* Tag container on project-detail.html */
.project-detail-meta .project-tags-container {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem; /* Space before project link if any */
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    clear: both; /* Ensure it's below floated content */
}
.project-detail-meta .project-tags-container h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-text);
    font-family: var(--body-font); /* Ensure consistent font */
    font-weight: 500;
}

.project-detail-meta .project-link-container {
    margin-top: 1.5rem; /* Space after tags if they exist */
    margin-bottom: 2rem;
    clear: both;
}
.project-detail-meta .project-link-container a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: var(--primary-bg);
    text-decoration: none;
    border-radius: 0px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}
.project-detail-meta .project-link-container a:hover {
    background-color: var(--primary-text);
}

.back-to-portfolio-container, .back-to-news-container { /* Shared style */
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.back-to-portfolio-container a, .back-to-news-container a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dotted var(--accent-color);
    transition: color 0.3s ease, border-bottom-style 0.3s ease;
}
.back-to-portfolio-container a:hover, .back-to-news-container a:hover {
    color: var(--primary-text);
    border-bottom-style: solid;
}


/* --- News Detail Page (news-detail.html) --- */
/* site-header-generic and detail-page-nav are often in <style> of news-detail.html but can be here */
.news-detail-container {
    width: 85%;
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
}
.news-detail-header h1 {
    font-family: var(--header-font);
    font-size: 2.8rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}
.news-detail-meta-info {
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}
.news-detail-meta-info .author {
    margin-left: 1em;
}
.news-detail-content .content-block-text p { /* Copied from project-detail for consistency */
     color: var(--secondary-text);
     font-size: 1rem;
     line-height: 1.8;
}
.news-detail-content .link-button-container {
    margin: 1.5rem 0;
    text-align: center;
}
.news-detail-content .link-button-container a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: var(--primary-bg);
    text-decoration: none;
    border-radius: 0px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}
 .news-detail-content .link-button-container a:hover {
    background-color: var(--primary-text);
}

/* Tag container on news-detail.html */
.news-detail-container .news-detail-tags-container { /* More specific selector */
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    clear: both; /* Ensure it's below floated content */
}
 .news-detail-container .news-detail-tags-container h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-text);
    font-family: var(--body-font); /* Ensure consistent font */
    font-weight: 500;
}


/* Animations (Shared) */
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.6; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Media Queries (Shared and Extended) */
@media (max-width: 991px) {
  header h1 { font-size: 8rem; }
  .container, .project-detail-container, .news-detail-container { width: 90%; }
  .project-detail-header h1, .news-detail-header h1 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
  header { margin-top: 4rem; }
  header h1 { font-size: 6rem; }
  header h3 { font-size: 1rem; margin-top: -15px; }
  header .logo-separator { font-size: 1.5rem; }
  header nav ul { flex-direction: column; gap: 0.5rem; align-items: center; }
  header nav ul li a { display: block; padding: 0.8rem 1rem; text-align: center; }
  .section { padding: 2rem 0; }
  .section h2 { font-size: 2rem; }

  .project-detail-header h1, .news-detail-header h1 { font-size: 2.2rem; }
  .project-detail-content img.image-float-left,
  .project-detail-content img.image-float-right,
  .project-detail-content figure.image-float-left,
  .project-detail-content figure.image-float-right,
  .news-detail-content img.image-float-left, /* Apply to news detail as well */
  .news-detail-content img.image-float-right,
  .news-detail-content figure.image-float-left,
  .news-detail-content figure.image-float-right {
      float: none; display: block; margin-left: auto; margin-right: auto;
      margin-bottom: 1.5rem; max-width: 90%; width: auto !important;
  }
  .project-detail-content img.image-center-block,
  .project-detail-content figure.image-center-block,
  .news-detail-content img.image-center-block, /* Apply to news detail */
  .news-detail-content figure.image-center-block {
      max-width: 90%;
  }
}

@media (max-width: 480px) {
  header h1 { font-size: 4.5rem; }
  header h3 { font-size: 0.9rem; margin-top: -10px; }
  header .logo-separator { font-size: 1.2rem; }

  .container, .project-detail-container, .news-detail-container { width: 95%; padding: 0 0.5rem; }
  .project-detail-container, .news-detail-container { padding: 1rem; margin: 1rem auto; }

  .section h2 { font-size: 1.75rem; }
  .portfolio-grid, .news-grid { grid-template-columns: 1fr; }

  .project-detail-header h1, .news-detail-header h1 { font-size: 1.8rem; }

  header nav ul li a { font-size: 0.85rem; padding: 0.6rem 0.5rem; }
  /* detail-page-nav a styles are in <style> of detail pages, can be moved here if desired */
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    z-index: 1000; /* Ensure it's on top */
    padding-top: 60px; /* Space from top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.9); /* Black background with opacity */
    display: none; /* Hidden by default */
}

.lightbox-content {
    margin: auto;
    display: block;
    width: auto; /* Adjust width automatically */
    max-width: 85%; /* Max width of the image */
    max-height: 80vh; /* Max height of the image, leaving space for controls/caption */
    border-radius: 0px;
}

#lightboxCaption {
    text-align: center;
    color: #ccc;
    padding: 10px 20px;
    height: 50px; 
    font-family: var(--body-font);
    font-size: 0.9rem;
    margin-top: 5px;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
}

.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -30px; /* Adjust to vertically center with image */
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0,0,0,0.3); /* Slight background for better visibility */
}
.lightbox-next {
    right: 15px; /* Position from right edge */
    border-radius: 3px 0 0 3px;
}
.lightbox-prev {
    left: 15px; /* Position from left edge */
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0,0,0,0.7);
}

/* Gallery image styling on the page */
.gallery-image {
    cursor: pointer;
    transition: opacity 0.3s ease;
    max-width: 100%; 
    height: auto;
    border-radius: 0px;
    border: 1px solid var(--border-color); /* Optional: border around thumbnails */
}

.gallery-image:hover {
    opacity: 0.7;
}

/* Container for gallery images on the page */
.project-detail-content .content-block-gallery,
.news-detail-content .content-block-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Smaller thumbnails */
    gap: 10px; /* Spacing between thumbnails */
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 10px; /* Padding around the gallery block */
    background-color: rgba(0,0,0,0.02); /* Subtle background for the gallery block */
    border-radius: 0px;
}

.project-detail-content .content-block-gallery figure,
.news-detail-content .content-block-gallery figure {
    margin: 0;
    display: flex; 
    flex-direction: column;
    background-color: var(--primary-bg); /* Background for each item */
    border: 1px solid var(--border-color);
    border-radius: 0px;
    overflow: hidden; /* Ensure image corners are rounded if image itself isn't */
}

.project-detail-content .content-block-gallery figure img, /* The actual image */
.news-detail-content .content-block-gallery figure img {
    width: 100%;
    height: 100px; /* Fixed height for thumbnails */
    object-fit: cover; /* Cover to fill, might crop */
}


.project-detail-content .content-block-gallery figcaption,
.news-detail-content .content-block-gallery figcaption {
    font-size: 0.75rem; /* Smaller caption for thumbnails */
    text-align: center;
    padding: 6px;
    color: var(--secondary-text);
    background-color: #f7f7f7; 
    border-top: 1px solid var(--border-color);
    white-space: nowrap; /* Prevent caption from wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis if text is too long */
    min-height: 28px; /* Ensure consistent height even with short/no caption */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure single images that might become part of a lightbox also have a pointer */
/* This is more of a note: if you make individual non-gallery images lightbox triggers, add a class like .lightbox-trigger */
.lightbox-trigger {
    cursor: pointer;
    transition: opacity 0.3s ease;
}
.lightbox-trigger:hover {
    opacity: 0.7;
}
