:root {
  --background: #111;
  --surface: #181818;
  --surface-hover: #202020;
  --border: #3b3b3b;
  --border-hover: #777;
  --text: #ccc;
  --muted: #888;
  --accent: #00dd00;
  --accent-mid: #b8dd00;
  --accent-red: #dd4a00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  /* padding: 2rem 1rem; */
  background: var(--background);
  color: var(--text);
  font-family: monospace;
  line-height: 1.5;
}

footer{
  padding:2rem;
}

code {
  background: var(--surface);
  color: var(--accent);
  font: 14px monospace;
}

pre {
  background: var(--surface);
  color: var(--accent);
  font: 14px monospace;
  overflow: scroll;
  padding: 5px;
}

textarea {
  background: var(--surface);
  color: var(--accent);
  font: 14px monospace;
  width: 400px;
  height: 250px;
}

.shader-editors textarea {
  width: 100%;
  max-width: 100%;
}

.shader-editors {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sourcecode {
  display: flex;
  gap: 1rem;
}

.sourcecode a {
  gap: 0.25rem;
  display: flex;
  align-items: center;
  text-decoration: none;
}

canvas {
  border: 2px solid var(--accent);
  width: 100%;
}

main {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 0 2rem;
}

h2 {
  margin-bottom: 0.25rem;
  color: #eee;
}

h1 small {
  color: var(--muted);
  font-size: 0.7em;
  font-weight: normal;
}

h3 {
  margin-top: 2rem;
  color: #eee;
}

a {
  color: var(--accent);
}

a:hover {
  color: #66ff66;
}

.intro {
  max-width: 700px;
  color: var(--muted);
}

.project-list {
  display: grid;
  gap: 1rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.project-card {
  display: flex;
  align-items: center;
  min-height: 150px;
  overflow: visible;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 8px rgb(0 0 0 / 15%);

  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%);
  transform: translateY(-3px);
  outline: none;
}

.project-card:hover .project-thumbnail,
.project-card:focus-visible .project-thumbnail {
  margin-right: 0rem;
  flex-basis: 260px;
  width: 260px;
  height: 260px;
  border-color: var(--border-hover);
}

.project-info {
  flex: 1;
  padding: 1.25rem;
}

.project-number {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.project-title {
  margin: 0 0 0.75rem;
  color: #eee;
  font-size: 1.15rem;
}

.project-description {
  margin: 0;
  color: var(--muted);
}

.project-thumbnail {
  position: relative;
  flex: 0 0 180px;
  width: 180px;
  height: 110px;
  margin-right: 1rem;
  overflow: hidden;
  background: #0b0b0b;
  border: 1px solid var(--border);
  border-radius: 5px;

  transition:
    width 300ms ease,
    height 300ms ease,
    flex-basis 300ms ease,
    border-color 180ms ease,
    margin-right 180ms ease;
}

.project-thumbnail img,
.project-thumbnail video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition:
    opacity 180ms ease,
    transform 300ms ease;
}

.project-card:hover .project-thumbnail img,
.project-card:hover .project-thumbnail video {
  opacity: 1;
  transform: scale(1.04);
}

.play-label {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.25rem 0.45rem;
  color: #ddd;
  background: rgb(0 0 0 / 70%);
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 0.7rem;
  pointer-events: none;
}

@media (max-width: 650px) {
  .project-card {
    display: block;
  }

  .project-thumbnail,
  .project-card:hover .project-thumbnail,
  .project-card:focus-visible .project-thumbnail {
    width: 100%;
    height: min(75vw, 300px);
    margin: 0;
    border-top: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 0 7px 7px;
  }
}

/* demo controls css, origin in hw4 */
#demo {
  padding: 10px;
  background: var(--surface);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: left;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
}

.controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.controls input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.controls input[type="range"] {
  width: 10rem;
  accent-color: var(--accent);
}

.controls select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
  color: var(--accent);
}

.controls input:focus,
.controls select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#controls-BVH {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

#controls-BVH input[type="range"] {
  width: 6rem;
}

.canvas-wrapper {
  position: relative;
}

#loader-wrapper {
  position: absolute;
  width: 100%;
  height: 100%;
  display: none;
}

#loader-wrapper.show {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
}

.spinner {
  border: 16px solid var(--surface);
  border-top: 16px solid var(--accent);
  border-radius: 50%;
  padding: 10%;
  animation: spin 2s linear infinite;
}

.spinner-text{
  position: absolute;
  z-index: 100;
  width:15vw;
  overflow: hidden;
  font-size: 2.2vw;
  text-align: center;
  text-overflow: ellipsis;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
