body { font-family: sans-serif; margin: 0; padding: 1rem; }
nav a { text-decoration: none; color: #333; }
ul { list-style: none; padding: 0; }
li a { color: #007acc; }
li a:hover { text-decoration: underline; }
/* Frame around the canvas */
.canvas-frame {
    margin: 1.5rem auto;            /* center horizontally + some vertical spacing */
    padding: 0.5rem;                /* inner padding */
    background: white;              /* canvas background */
    border: 1px solid hsl(0, 0%, 80%); /* light gray border */
    border-radius: 0.5rem;          /* gentle rounding */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* subtle shadow */
    position: relative;

  width: 100%;
  padding-top: 100%; /* square */
  }
  

  .canvas-frame canvas {
    /* force layout size to always fill parent,
       regardless of attribute values */
    width: 100% !important;
    height: 100% !important;
    object-fit: fill;
  }

  /* ===== Top header ===== */
.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
  }
  .back-button {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }
  .item-title {
    margin: 0;
    font-size: 1.5rem;
    text-align: center;
    flex: 1;
  }
  .variant-selector {
    padding: 0.3rem;
    font-size: 0.9rem;
  }
  
  /* ===== Accordions ===== */
  .accordion-container details {
    margin-bottom: 1rem;
    border: 1px solid hsl(0,0%,80%);
    border-radius: 4px;
    overflow: hidden;
  }
  .accordion-container summary {
    padding: 0.6rem 1rem;
    background: hsl(0,0%,95%);
    cursor: pointer;
    font-weight: 600;
  }
  .accordion-container details[open] summary {
    background: hsl(0,0%,90%);
  }
  
  /* ===== Visualizer section ===== */
  .visualizer-section {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 1rem;
    padding: 1rem;
  }
  .shader-panel,
  .control-panel {
    background: #fafafa;
    padding: 0.5rem;
    border: 1px solid hsl(0,0%,85%);
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
  }
  .canvas-frame {
    grid-column: 1 / -1; /* full width */
    margin-top: 1rem;
  }
  
  /* ===== 3D Renders carousel ===== */
  #render-carousel {
    padding: 1rem;
  }
  #render-carousel img {
    width: 100%;
    height: auto;
    display: block;
  }
  
  /* Initialize Splide’s arrows and pagination styling via its CSS */
  
  /* ===== Metadata ===== */
  .metadata-section {
    padding: 1rem;
  }
  .metadata-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
  }
  .metadata-section th,
  .metadata-section td {
    border: 1px solid hsl(0,0%,85%);
    padding: 0.5rem;
    text-align: left;
  }

  /* ensure body can stack the pseudo */
body {
    position: relative;
    margin: 0;
    padding: 0;
    background: none; /* clear any old background */
    min-height: 100vh; /* ensure it fills the viewport */
    z-index: 0;
  }
  
  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("/static/images/bg_2.png");
    background-repeat: repeat;
    opacity: 0.5;               /* tweak for visibility */
    transform: rotate(0deg);
    background-size: 320px 320px;
    transform-origin: center center;
    z-index: -1;                /* behind everything */
  }