/* ---------- Basics ---------- */
:root {
  --bg: #0d0d0f;
  --panel: #16161a;
  --text: #e6e6e6;
  --muted: #8a8a93;
  --accent: #c8452c;   /* change this to whatever fits your style */
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

/* ---------- Layout ---------- */
header, main, footer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem;
}

h1, h2 {
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
}

p {
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Model viewer ---------- */
model-viewer {
  width: 100%;
  height: 450px;
  background: var(--panel);
  border-radius: var(--radius);
  --poster-color: transparent;
}

/* ---------- Gallery grid ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0.75rem;
}

/* ---------- Pixel art ---------- */
.pixel {
  image-rendering: pixelated;   /* keeps sprites crisp when scaled */
  width: 100%;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.15);
}

.sprite {
  --w: 256;        /* frame width in px */
  --h: 256;        /* frame height in px */
  --frames: 24;   /* number of frames in the row */
  --scale: 2;     /* integer scaling keeps pixels crisp */
  --ms: 100;      /* milliseconds per frame */

  width:  calc(var(--w) * var(--scale) * 1px);
  height: calc(var(--h) * var(--scale) * 1px);
  background-image: var(--sheet);
  background-size: calc(var(--w) * var(--frames) * var(--scale) * 1px)
                   calc(var(--h) * var(--scale) * 1px);
  image-rendering: pixelated;   /* delete this line for smooth, high-res renders */
  animation: play calc(var(--frames) * var(--ms) * 1ms)
             steps(var(--frames)) infinite;
}

@keyframes play {
  to { background-position-x: calc(var(--w) * var(--frames) * var(--scale) * -1px); }
}

.conveyor {
    position: relative;
    height: 256px;
    overflow: hidden;
}

@keyframes belt {
  to { background-position-x: -24px; }
}

.centered {
  text-align: center;
}

.row {
  display: flex;
  gap: 1rem;            /* space between them */
  align-items: center;  /* vertical alignment: flex-start, center, flex-end */
}

.column {
  display: flex;
  flex-direction: column;    /* children stack vertically */
  gap: 0.5rem;
}

.player {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel, #4242ff);
  padding: 10px;
  border-radius: 4px;
  box-shadow: inset 0 3px 6px rgba(255, 39, 39, 0.8);
}

#playBtn {
  width: 44px;
  height: 44px;
  background: #000000;
  color: #ff0000;
  border: 2px solid #7a0000;
  border-radius: 2px;
  font-size: 1.1rem;
  cursor: pointer;
}

#playBtn:hover {
  text-shadow: 0 0 8px #ffffff;
}

#wave {
  flex: 1;
  min-width: 0;
  height: 80px;
}

.video {
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 9;      /* keeps the right shape at any width */
  background: #000;
  border-radius: 4px;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.8);
  overflow: hidden;
}

.video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  model-viewer {
    height: 320px;
  }
}