/*-- -------------------------- -->
<---           Hero             -->
<--- -------------------------- -*/
/* Mobile - 360px */
@media only screen and (min-width: 0rem) {
  #hero {
    /* Aligns contents to the left edge */
    text-align: left;
    /* Reduced top padding: comfortable spacing below header nav blocks */
    padding: clamp(7rem, 15vw, 11rem) 1rem 0;
    /* TIGHTENED GAP: Drastically reduced to bring the next section up */
    padding-bottom: clamp(4rem, 10vw, 7rem);
    position: relative;
    z-index: 1;
    overflow: hidden;
  }
  #hero .cs-background {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -2;
  }

  /* Uniform Ambient Backdrop Blur Overlay */
  #hero .cs-background:before {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;

    /* Slightly darkened to pop high-contrast text layers against neon glows */
    background: rgba(11, 13, 17, 0.55);

    /* Unified glassmorphism blur engine */
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  #hero .cs-background img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
  }
  #hero .cs-container {
    width: 100%;
    max-width: 67.5rem;
    margin: auto;
  }
  #hero .cs-title {
    font-size: clamp(2.4375rem, 6.4vw, 3.8125rem);
    font-weight: 700;
    line-height: 1.2em;
    text-align: left;
    max-width: 51.8125rem;
    margin: 0 0 clamp(1rem, 4vw, 1.5rem) 0;
    color: #fff;
    position: relative;
  }
  #hero .cs-title:after {
    /* Divider Line */
    content: "";
    width: clamp(3.75rem, 9.5vw, 6.25rem);
    height: clamp(0.25rem, 0.8vw, 0.5rem);
    margin: clamp(1rem, 4vw, 1.5rem) 0 clamp(1rem, 4vw, 1.5rem) 0;
    background: var(--primary);
    opacity: 1;
    position: relative;
    display: block;
  }
  #hero .cs-text {
    font-size: clamp(1rem, 1.95vw, 1.5625rem);
    line-height: 1.5em;
    text-align: left;
    width: 100%;
    max-width: clamp(29rem, 60vw, 50rem);
    margin: 0;
    /* Normalized resting margin spacing */
    margin-bottom: 1rem;
    color: #fff;
  }
}

/* Desktop - 1300px (To make image background parallax) */
@media only screen and (min-width: 81.25rem) {
  #hero {
    background: url("../assets/img/hero.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
  }

  #hero .cs-background {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
  }
  #hero .cs-background img {
    display: none;
  }
}
/*-- -------------------------- -->
<---          Gallery           -->
<--- -------------------------- -*/

/* Mobile Base Structural Rules - 360px up */
@media only screen and (min-width: 0rem) {
  #gallery {
    text-align: center; /* Enforces uniform alignment on inline elements */
    padding: var(--sectionPadding);
    background-color: #0b0d11; /* Matches the deep, expensive slate-black backdrop */
  }
  #gallery .cs-container {
    width: 100%;
    max-width: 34.375rem;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center; /* Keeps columns dead center along the mobile layout axis */
    gap: clamp(2rem, 4vw, 3rem);
    position: relative;
  }
  #gallery .cs-content {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Horizontally anchors headers in the screen center */
    gap: 1.5rem;
  }
  #gallery .cs-topper {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary); /* Pulls signature branding color accent */
    margin-bottom: 0.25rem;
    display: block;
  }
  #gallery .cs-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    color: #f5f7fa;
    margin: 0;
  }
  #gallery .cs-button-group {
    width: 100%;
    display: flex;
    justify-content: center; /* Spreads navigation tags evenly out from center */
    align-items: center;
    flex-wrap: wrap;
    row-gap: 0.5rem;
    column-gap: 1.5rem;
  }
  #gallery .cs-button {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5em;
    padding: 0.5rem 0;
    color: #7b8496; /* Clean muted gray for resting states */
    background-color: transparent;
    border: none;
    position: relative;
    cursor: pointer;
    transition: color 0.3s;
  }
  #gallery .cs-button:hover,
  #gallery .cs-button.cs-active {
    color: #f5f7fa;
  }

  /* Minimal hover/active track underline indicator */
  #gallery .cs-button:after {
    content: "";
    width: 0%;
    height: 2px;
    background: var(--secondary);
    position: absolute;
    bottom: 0;
    left: 0;
    transition: width 0.3s;
  }
  #gallery .cs-button:hover:after,
  #gallery .cs-button.cs-active:after {
    width: 100%;
  }

  /* Grid Layout Setup for Product Displays */
  #gallery .cs-gallery {
    width: 100%;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr; /* Stacks single layout card on phones */
    gap: 2rem;
    opacity: 1;
    visibility: visible;
    transition:
      opacity 0.3s,
      visibility 0.3s;
  }
  #gallery .cs-gallery.cs-hidden {
    display: none; /* Dropped entirely to prevent broken ghost-space errors */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  /* EsjemLabs Core Card Framework */
  #gallery .cs-card {
    background-color: #141820; /* Elevated UI box background layer */
    border: 1px solid #222936;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: left; /* Forces specific textual information to stay crisp, left-aligned */
    transition:
      transform 0.3s,
      border-color 0.3s;
  }
  #gallery .cs-card:hover {
    transform: translateY(-4px);
    border-color: #384358;
  }

  /* Enforced 16:9 Aspect Box for Media Previews */
  .cs-gallery .cs-media-wrapper {
    width: 100%;
    height: auto; /* Lets height adapt naturally to the banner image */
    overflow: hidden;
  }

  .cs-gallery .cs-media-wrapper img {
    width: 100%;
    height: auto;
    display: block;
  }

  #gallery .cs-media-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Text & Description Wrapping Blocks */
  #gallery .cs-info-wrapper {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }
  #gallery .cs-game-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    display: block;
  }
  #gallery .cs-item-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f5f7fa;
    margin: 0 0 0.5rem 0;
  }
  #gallery .cs-item-desc {
    font-size: 0.9rem;
    line-height: 1.5em;
    color: #7b8496;
    margin: 0 0 1.5rem 0;
    flex-grow: 1; /* Pushes button layer cleanly down to uniform footer alignments */
  }

  /* The "View on Etsy" Primary Action CTA Link */
  #gallery .cs-etsy-btn {
    display: block;
    text-align: center;
    background-color: #222936;
    color: #f5f7fa;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition:
      background-color 0.2s,
      color 0.2s;
  }
  #gallery .cs-etsy-btn:hover {
    background-color: var(--secondary);
    color: #fff;
  }
}

/* Tablet Viewports - 768px and up */
@media only screen and (min-width: 48rem) {
  #gallery .cs-container {
    max-width: 80rem;
  }
  #gallery .cs-content {
    flex-direction: column; /* Locks headings vertically layered */
    justify-content: center;
    align-items: center; /* Retains rigid center alignment on medium view screens */
  }
  #gallery .cs-gallery {
    grid-template-columns: repeat(
      2,
      1fr
    ); /* Expands out cleanly to double dual rows */
    gap: 2rem;
  }
}

/* Widescreen Desktop Displays - 1200px and up */
@media only screen and (min-width: 75rem) {
  #gallery .cs-gallery {
    grid-template-columns: repeat(
      3,
      1fr
    ); /* Forms the premium look 3-column setup */
  }
}

/*-- -------------------------- -->
<---            Custom          -->
<--- -------------------------- -*/

/* Mobile Base Layout Rules - 310px up */
@media only screen and (min-width: 0rem) {
  #custom {
    padding: var(--sectionPadding);
    background-color: #0b0d11; /* Seamless matching backdrop */
  }
  #custom .cs-container {
    width: 100%;
    max-width: 34.375rem;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2.5rem;
  }
  #custom .cs-content {
    width: 100%;
    text-align: left; /* Strict left alignment text setting */
  }
  #custom .cs-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #f5f7fa;
    margin: 0;
    white-space: nowrap; /* Forces text onto a single continuous line */
  }

  /* Card Grid System Container */
  #custom .cs-card-group {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  /* The EsjemLabs Dashboard Style Card Frame */
  #custom .cs-item {
    list-style: none;
    width: 100%;
    background-color: #141820; /* Darker elevated box offset */
    border: 1px solid #222936;
    border-radius: 12px;
    padding: 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    transition:
      border-color 0.3s,
      transform 0.3s;
  }
  #custom .cs-item:hover {
    transform: translateY(-4px);
    border-color: #384358;
  }

  /* Card Context Typography Wrapping */
  #custom .cs-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  #custom .cs-card-h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f5f7fa;
    margin: 0;
  }
  #custom .cs-card-p {
    font-size: 0.95rem;
    line-height: 1.5em;
    color: #7b8496;
    margin: 0;
  }

  /* Flat Rectangular Action Button */
  #custom .cs-action-btn {
    display: inline-block;
    text-align: center;
    background-color: #222936;
    color: #f5f7fa;
    text-decoration: none;
    padding: 0.85rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    width: 100%; /* Spans full card on small mobile configurations */
    box-sizing: border-box;
    transition:
      background-color 0.2s,
      color 0.2s;
  }
  #custom .cs-item:hover .cs-action-btn {
    background-color: var(
      --secondary
    ); /* Swaps to main brand orange on card hover */
    color: #fff;
  }
}

/* Tablet Viewports - 768px and up */
@media only screen and (min-width: 48rem) {
  #custom .cs-container {
    max-width: 80rem;
  }
  #custom .cs-card-group {
    flex-direction: row; /* Snaps cards side-by-side matching the mockup layout */
  }
  #custom .cs-item {
    flex: 1; /* Distributes horizontal widths symmetrically */
  }
  #custom .cs-action-btn {
    width: auto; /* Drops down to tight intrinsic link sizing at desktop widths */
  }
}

/* Card coming soon dimming */
.cs-card-coming-soon {
  position: relative;
}

.cs-card-coming-soon .cs-media-wrapper {
  position: relative;
  overflow: hidden;
}

/* Semi-transparent dark overlay over the video */
.cs-card-coming-soon .cs-media-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 13, 17, 0.4);
  pointer-events: none;
}

/* "Coming Soon" badge ribbon style */
.cs-badge-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background-color: var(--primary); /* Signature Esjem Orange */
  color: #ffffff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Disabled button state */
.cs-btn-disabled {
  display: inline-block;
  width: 100%;
  text-align: center;
  background-color: var(--border-subtle) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  opacity: 0.7;
  pointer-events: none;
  text-decoration: none;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-weight: 700;
}

/* Card Container Constraints for Ribbons */
.cs-coming-soon-card {
  position: relative;
  overflow: hidden; /* Clips the banner so it doesn't bleed outside the rounded card corners */
}

/* Shift the wrapper to the top right */
.cs-ribbon-wrapper {
  width: 140px;
  height: 140px;
  overflow: hidden;
  position: absolute;
  top: -10px;
  right: -10px; /* Changed from left: -10px */
  left: auto;
  z-index: 10;
  pointer-events: none;
}

/* Mirror the rotation to angle top-right to bottom-left */
.cs-ribbon {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 1px;
  line-height: 26px;
  transform: rotate(45deg); /* Changed from -45deg to 45deg */
  width: 170px;
  display: block;
  background: var(--primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 30px;
  right: -40px; /* Changed from left: -40px */
  left: auto;
}

/* Optional Card Subtlety Adjustments for "Coming Soon" State */
.cs-coming-soon-card .cs-card-info {
  opacity: 0.75; /* Slightly dims text to signify non-active status */
}

/* Disabled Action Button Styling */
.cs-coming-soon-card .cs-btn-disabled {
  background-color: var(--border-subtle) !important;
  color: var(--text-muted) !important;
  border-color: var(--border-subtle) !important;
  cursor: not-allowed !important;
  opacity: 0.6;
  pointer-events: none;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  width: 100%;
}
