@layer normalize, base, demo;

@layer demo {
  :root {
    color-scheme: dark only;
    --accent: hsl(0 0% 85%);
    --border-color: hsl(0 0% 70%);
    --radius: calc(var(--rad, 12) * 1px); /* Controlled by script.js */
    --border-width: 1; /* Controlled by script.js */
  }

  body {
    overflow-x: hidden; /* Allow vertical scroll if content exceeds viewport */
    overflow-y: auto;
    display: grid;
    place-items: center;
    min-height: 100%;
    font-family: monospace;
    padding: 20px 0; /* Add some padding to body for spacing */
  }

  body::before {
    --size: 45px;
    --line: color-mix(in lch, canvasText, transparent 70%);
    content: '';
    height: 100%;
    width: 100vw;
    position: fixed;
    background: linear-gradient(
          90deg,
          var(--line) 1px,
          transparent 1px var(--size)
        )
        50% 50% / var(--size) var(--size),
      linear-gradient(var(--line) 1px, transparent 1px var(--size)) 50% 50% /
        var(--size) var(--size);
    -webkit-mask: linear-gradient(-20deg, transparent 50%, white);
            mask: linear-gradient(-20deg, transparent 50%, white);
    top: 0;
    left: 0; /* Ensure it covers full screen */
    transform-style: flat;
    pointer-events: none;
    z-index: -1;
  }

  .wrapper {
    position: absolute;
    height: 80%;
    bottom: 10%;
    display: flex;
    width: 90%;
    flex-direction: row;
    align-items: flex-end;
  }

  .card {
    width: 100%; /* Takes full width of parent */
    height: fit-content; /* Adjusts height to content */
    min-height: 300px; /* Minimum height to avoid collapsing when empty */
    padding: 20px;
    text-align: center; /* Center text if card is empty or has simple text */
    display: flex; /* Use flexbox to arrange columns */
    flex-wrap: wrap; /* Allow columns to wrap on smaller screens if necessary */
    gap: var(--spacing-medium, 20px); /* Space between columns, using a variable or fixed value */
    align-items: flex-start; /* Align items at the top of columns */
  }

  .card-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-small, 10px); /* Space between elements within a column */
  }

  .card-column-left {
    flex: 2 1 60%; /* Example: allow shrinking, growing, base width 60% */
    min-width: 250px; /* Minimum width before wrapping or squishing too much */
  }

  .card-column-right {
    flex: 1 1 35%; /* Example: allow shrinking, growing, base width 35% */
    min-width: 200px; /* Minimum width */
  }

  .card-column .label,
  .card-column .card-text {
    margin: 0; /* Remove default margins if any */
    /* Add other specific styling for text/labels within columns if needed */
  }

  .titles {
    width: 100%; /* Takes full width of parent */
    max-width: 300px; /* Max width for titles section */
    height: fit-content;
    padding: 20px;
    text-align: left; /* Align titles to the left */
    margin-right: 20px; /* Space between titles and card */
   }

   .label {
    font-size: 20px;
    margin-bottom: 10px; /* Space between labels */
    transition: text-shadow 0.2s ease-in-out; /* Optional: smooth transition for the shadow */
   }

   .label:hover {
    /* text-shadow: 0 -1px 20px #ffffff, -1px 0 20px #ffffff, 0 1px 20px #ffffff, 1px 0 20px #ffffff; */ /* Shadow moved to .label-active */
    cursor: pointer;
   }

  .label-active {
    text-shadow: 0 -1px 20px #ffffff, -1px 0 20px #ffffff, 0 1px 20px #ffffff, 1px 0 20px #ffffff;
  }

  .card .label { /* Style for the /DÆMI: label inside the card */
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    margin-top: 10px;
    margin-left: 3%;
    color: var(--accent, #ccc);
    /* Ensure the /DÆMI: label inside the card doesn't get the active glow */
    text-shadow: none !important; 
    text-align: left;
  }

  .card .label:hover {
    text-shadow: none !important; /* Ensure no glow effect on hover for the /DÆMI: label */
    cursor: default; /* Default cursor for the /DÆMI: label */
  }

  .card-text {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1;
    text-align: left;
    padding: 0 10px;
    max-width: 95%;
    color: var(--accent, #ccc);
  }

  .card-image {
    max-width: 80%; /* Relative to its parent column */
    max-height: 750px; /* MODIFIED: Was 250px, now 3x larger */
    object-fit: contain;
    height: auto;
    border-radius: var(--radius, 8px);
    margin-top: 10px;
    border: var(--border-width, 1px) solid var(--border-color, #555);
  }

  @media (max-width: 768px) {
    .card {
      flex-direction: column; /* Stack columns vertically on smaller screens */
      align-items: center; /* Center content when stacked */
    }

    .card-column-left,
    .card-column-right {
      flex-basis: 100%; /* Each column takes full width when stacked */
      width: 90%; /* Use a bit less than full width for some padding effect */
      max-width: 500px; /* Max width for stacked columns */
      align-items: center; /* Center content within columns */
      text-align: center; /* Center text within columns */
    }

    .card-column-left .label,
    .card-column-left .card-text {
        text-align: center; /* Center text when stacked */
    }

    .card-column-right .card-image { /* Image in the right column when stacked */
      max-width: 80%; /* Adjust image size for stacked view, or 100% of its column */
      margin-bottom: 20px; /* Add some space below image when stacked */
    }
  }
} /* Closes @layer demo */