@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap');

:root {
  --background-color: #EFEFEF; /* Light grey from caiguangxi.com */
  --text-color: #000000; /* Black text from caiguangxi.com */
  --h1-text-color: rgba(0, 0, 0, 0.85); /* Specific H1 color from caiguangxi.com */
  --link-color: #0000EE; /* Blue link color from caiguangxi.com */
  --link-hover-opacity: 0.7;
  
  /* Button styles will need to be re-evaluated based on caiguangxi.com's minimal style */
  /* For now, let's make them simple and clean */
  --button-bg-color: #FFFFFF; /* White background */
  --button-text-color: #000000; /* Black text */
  --button-border-color: #CCCCCC; /* Lighter grey border */
  --button-hover-bg-color: #F5F5F5; /* Slightly darker on hover */
  --button-hover-border-color: #BBBBBB;

  /* Custom cursor color - already set as per user request */
  --custom-cursor-color: rgba(0, 0, 0, 0.6);
}

body {
  font-family: 'Geist', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-size: 16px; /* Base font size for readability */
  line-height: 1.7; /* Increased for better readability */
  cursor: none; 
  transition: background-color 0.3s ease, color 0.3s ease; 
}

.container {
  max-width: 1400px; /* Wider container for homepage */
  margin: 40px auto;
  padding: 0 20px; /* Ensure consistent padding */
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Geist', sans-serif;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  font-weight: 500; /* Consistent weight, can be adjusted per level */
  color: var(--text-color); /* Default to main text color */
  text-shadow: none; /* Ensure no shadows */
}

h1 {
  font-size: 48px; /* As per caiguangxi.com H1 */
  font-weight: 500;
  color: var(--h1-text-color);
  margin-bottom: 0.5em;
}

h2 {
  font-size: 2em; /* Approx 32px */
  border-bottom: none; /* Remove border as requested */
  padding-bottom: 0.3em;
}

p, li {
  font-size: 1em; /* 16px */
  margin-bottom: 1.2em; /* Slightly more spacing */
  color: var(--text-color);
}

ul {
  padding-left: 20px;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: none; /* Remove all transitions */
}

a:hover {
  opacity: 1; /* No opacity change */
  text-decoration: none; /* Remove underline on all hover states */
}

/* Custom Cursor - Updated with fade in/out effect but original style */
.custom-cursor {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #fff;
  position: fixed;
  pointer-events: none;
  left: -100px; /* Position off-screen initially */
  top: -100px; /* Position off-screen initially */
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease-out, opacity 0.3s ease; /* Added opacity transition */
  opacity: 0; /* Start with invisible cursor */
  mix-blend-mode: difference; /* Restore original cursor style */
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 0 0 4px rgba(0, 0, 0, 0.3);
}

/* Footer Button - Updated to match daneden.me style */
.footer-button {
  display: inline-block;
  padding: 12px 24px;
  background-color: #000000; /* Black background */
  color: #FFFFFF; /* White text */
  border: 1px solid #000000; /* Black border */
  border-radius: 6px; /* Slightly rounded corners */
  text-decoration: none;
  font-size: 1em;
  font-weight: 600; /* Bolder */
  text-transform: uppercase; /* Uppercase text */
  letter-spacing: 0.5px; /* Slight letter spacing */
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.footer-button:hover {
  background-color: #333333; /* Darker black on hover */
  border-color: #333333;
  color: #FFFFFF;
  opacity: 1; /* No opacity change */
}

/* Header Enhancements */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 20px; /* Add consistent horizontal padding */
  border-bottom: none; /* Removed border-bottom */
  margin-bottom: 60px; /* Increased space before hero */
  width: calc(100%); /* Account for padding */
  max-width: 1400px; 
  margin-left: auto;
  margin-right: auto;
}

.logo a {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
}

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
}

.site-nav li {
  margin-left: 30px; /* Adjusted spacing */
  margin-bottom: 0;
}

.site-nav a {
  font-size: 1em;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

.site-nav a.active::after, 
.site-nav a:hover::after {
  content: ".";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -8px;
  font-size: 2em;
  line-height: 0.5;
  color: var(--text-color);
}

/* Hero Section (caiguangxi.com inspired) */
.hero-section.container {
  padding: 60px 20px; /* Add horizontal padding to ensure content doesn't touch edges */
  margin-left: auto; /* Center within container */
  margin-right: auto;
  margin-bottom: 80px; /* Increased space before project grid */
}

.hero-text-content p {
  font-family: 'Geist', sans-serif;
  font-size: 3.5em; /* Larger and bolder like caiguangxi */
  line-height: 1.3;
  font-weight: 600; /* Bolder */
  color: var(--text-color);
  margin: 0;
  max-width: 100%; /* Allow full width within container */
  text-align: left; /* Ensure left alignment */
}

/* Project Grid (fionnbreen.com inspired) */
.project-grid-container.container {
  padding: 0 20px; /* Ensure consistent padding */
  padding-bottom: 60px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Fixed 3 columns */
  gap: 30px; /* Slightly reduced gap to allow for larger cards */
  perspective: 1000px; /* Add perspective for 3D effect */
}

.project-card {
  background-color: transparent; /* Changed to transparent */
  overflow: visible;
  text-decoration: none;
  color: var(--text-color);
  display: block;
  border: none;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-bottom: 10px; /* Reduced space between image and text */
}

.project-card:hover {
  transform: rotateX(5deg) rotateY(-5deg); /* Only tilt, no stretching */
  box-shadow: none; /* No shadow */
  border: none; /* No border */
}

.project-card-image-wrapper {
  width: 100%;
  padding-top: 75%; 
  position: relative;
  background-color: transparent; /* Changed to transparent */
  overflow: hidden;
  border: none; /* No border */
}

.project-card-image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: none; /* No transition */
}

/* No transform on hover */
.project-card:hover .project-card-image-wrapper img {
  transform: none;
}

.project-card-info {
  padding: 10px 0; /* Reduced vertical padding */
  background-color: transparent; /* Changed to transparent */
  text-align: left; /* Ensure left alignment */
}

.project-card-info h3 {
  font-family: 'Geist', sans-serif;
  font-size: 1.2em;
  margin-top: 10px; /* Reduced space after image by half */
  margin-bottom: 6px !important; /* Force 6px spacing - approximately 1/3 of original */
  font-weight: 500;
  color: var(--text-color); 
  transition: none; /* No transition */
}

/* No color change on hover */
.project-card:hover .project-card-info h3 {
  color: var(--text-color);
}

.project-card-info p {
  font-family: 'Geist', sans-serif;
  font-size: 1em;
  line-height: 1.5;
  color: var(--text-color);
  opacity: 0.7;
  margin-bottom: 0;
  transition: none; /* No transition */
}

/* Ensure no opacity change on hover */
.project-card:hover .project-card-info p {
  opacity: 0.7; /* Keep exactly the same opacity */
}

.project-card.placeholder {
  background-color: #E0E0E0;
}

.project-card.placeholder .project-card-image-wrapper {
  background-color: #C8C8C8;
}

/* Footer adjustments */
.site-footer {
  text-align: center; /* Center all footer content */
  margin-top: 80px; /* More space before footer */
  padding: 30px 0;
  border-top: none; /* Remove border as requested */
}

.copyright-text {
  font-size: 1em;
  color: var(--text-color);
  opacity: 0.7;
  margin-top: 15px;
}

/* Responsive adjustments for homepage */
@media (max-width: 1536px) {
    .site-header {
        padding: 20px 20px; /* Ensure horizontal padding for tablet */
        margin-bottom: 40px;
        width: calc(100% - 40px); /* Adjust width to account for padding */
    }
    .container {
        padding: 0 20px; /* Ensure consistent padding */
    }
    .project-article-container .container {
        padding: 0 20px; /* Consistent padding */
    }
    .project-banner-image-container {
        padding: 0 20px; /* Ensure images don't touch edges */
    }
    .project-content-container {
        padding: 0 20px; /* Ensure content doesn't touch edges */
    }
}

@media (max-width: 768px) {
  .site-header {
    padding: 20px 20px; /* Consistent padding for tablet */
    margin-bottom: 40px;
    width: calc(100% - 40px); /* Account for padding */
  }
  .container {
    padding: 0 20px; /* Ensure consistent padding */
  }
  .hero-section.container {
    padding: 40px 20px; /* Ensure horizontal padding on tablet */
    margin-bottom: 60px;
  }
  .hero-text-content p {
    font-size: 2.8em; /* Adjust hero text for tablets */
  }
  .project-grid-container.container {
    padding: 0 20px; /* Adjusted padding for tablet */
    padding-bottom: 40px;
  }
  .project-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px; /* Adjusted gap for tablet */
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px; /* Adjust base for mobile */
  }
  .container {
    padding: 0 20px; /* Ensure consistent padding */
  }
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 20px; /* Consistent horizontal padding for mobile */
    margin-bottom: 30px;
    width: calc(100% - 40px); /* Account for padding */
  }
  .site-nav {
    margin-top: 15px;
    padding-left: 0; /* Ensure no extra padding */
    width: 100%; /* Full width */
  }
  .site-nav ul {
    width: 100%; /* Full width */
  }
  .site-nav li {
    margin-left: 0;
    margin-right: 20px;
  }
  .hero-section.container {
    padding: 30px 20px; /* Ensure horizontal padding on mobile */
    margin-bottom: 40px;
  }
  .hero-text-content p {
    font-size: 2.2em; /* Adjust hero text for mobile */
    max-width: none; /* Allow full width within padding */
    padding: 0; /* Ensure no extra padding */
  }
  .project-grid-container.container {
    padding: 0 20px; /* Ensure padding on mobile */
    padding-bottom: 30px;
  }
  .project-grid {
    gap: 20px; /* Further reduce gap for mobile */
  }
}
