/* Base design system for PixelFX */
:root {
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(0, 0, 0, 0.08);
  --card-hover-bg: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-light {
  --card-bg: rgba(0, 0, 0, 0.02);
  --card-hover-bg: rgba(0, 0, 0, 0.04);
}

/* Header image container - Centered and natural size to avoid blur */
.header-image-container {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
  width: 100%;
}

.header-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  /* Ensure it doesn't upscale past its natural width, preventing blur */
  width: auto;
}

/* Applet card layout */
.applet-card {
  margin: 2.5rem 0;
  padding: 1.5rem;
  border-radius: 16px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.applet-card:hover {
  background-color: var(--card-hover-bg);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.applet-card h3 {
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-border);
  color: inherit;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.version {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85em;
  opacity: 0.6;
  font-weight: normal;
}

/* Screenshot containers within card - Stacked vertically */
.screenshot-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.screenshot-wrapper {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  line-height: 0;
  background: #000;
  padding: 1.5rem 0;
  /* Added padding for a bigger background block above/below */
  /* Backdrop for images */
  position: relative;
  width: 100%;
  /* Important for mobile */
}

.screenshot-wrapper img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 240px;
  /* Enforce consistent max height for alignment */
  transition: var(--transition);
  border-radius: 8px;
  /* Slightly smaller radius for old school feel */
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* Multiple screenshots in a single row inside one black box */
.screenshot-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  flex-wrap: wrap;
}

.screenshot-wrapper.screenshot-row img {
  display: inline-block;
  max-width: calc(33.33% - 0.67rem);
  width: auto;
  margin: 0;
  flex: 0 1 auto;
}

/* Grayscale effect - Now triggered on card hover for synchronized transition */
.grayscale-image {
  filter: grayscale(100%);
  opacity: 0.7;
  /* Slightly more faded for minimalistic look */
  transition: var(--transition);
}

.applet-card:hover .grayscale-image {
  filter: grayscale(0%);
  opacity: 1;
}

/* Removed transform scale on hover for a cleaner minimalistic look and to prevent artifact leakage */

/* Crop bottom 6 pixels to remove artifacts */
.crop-bottom {
  clip-path: inset(0 0 6px 0);
}

/* Crop bottom and right 6 pixels to remove artifacts */
.crop-br {
  clip-path: inset(0 6px 6px 0);
}

/* Download section */
.download-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-link {
  font-weight: bold;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.download-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* Utility classes */
.flex-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.flex-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 0;
  background: none;
  /* Removed background boxes */
}

.flex-links a:hover {
  color: #fff;
  text-decoration: underline;
  background: none;
}

/* Mobile Responsiveness for iPhone and similar devices */
@media (max-width: 600px) {
  .applet-card {
    padding: 1rem;
    margin: 1.5rem 0;
  }

  .header-image-container {
    margin: 1rem 0;
  }

  .flex-links {
    gap: 0.5rem;
  }

  .flex-links a {
    font-size: 0.85em;
  }
}