:root {
  --project-size: 120px;
  --project-gap: 30px;
}

/* main */
body {
  margin: 0;
  font-family: "Menlo", monospace !important;
  background: #000000;
}

body.toggled {
  background: linear-gradient(120deg, #e87b06 100%);
  transition: background 0.5s;
  background: #ffffff;
}

.main {
  max-width: auto;
  margin: 0px auto;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--project-gap);
  width: 100%;
  margin: 0 auto;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 30px;
  box-sizing: border-box;
}

.project {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  border-radius: 19%;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 1s, box-shadow 0.5s, border-radius 1.5s;
  aspect-ratio: 1/1;
  width: var(--project-size);
  height: var(--project-size);
  min-width: var(--project-size);
  min-height: var(--project-size);
  max-width: var(--project-size);
  max-height: var(--project-size);
  justify-content: center;
  position: relative;
  z-index: 1;
}

body.toggled .project {
  border-radius: 50% !important;
}

.project:hover {
  transform: scale(1.1);
  box-shadow: 0 0 75px rgba(174, 174, 174, 0.956);
}

/* switch toggle */
.switch {
  position: fixed;
  justify-content: center;
  align-items: center;
  width: 52px;
  height: 32px;
  z-index: 10000;
  pointer-events: auto;
}
.center-toggle {
  position: fixed;
  top: auto;
  bottom: 24px;
  left: 24px;
  right: auto;
  z-index: 9999;
  display: flex;
  justify-content: flex-start;
  pointer-events: auto;
  height: 1.5rem;
  align-items: flex-end;
}
.center-toggle .switch,
.center-toggle .switch *,
.center-toggle .switch label {
  pointer-events: auto !important;
}
.center-toggle .switch {
  width: 1.6rem;
  height: 1rem;
  min-width: 0;
  min-height: 0;
  background: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.center-toggle .switch input {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}
.center-toggle .switch label {
  cursor: pointer;
  width: 100%;
  height: 100%;
  display: block;
}
.center-toggle .background {
  z-index: 1;
  position: absolute;
  width: 1.6rem;
  height: 1rem;
  border-radius: 0.6rem;
  border: 0.12rem solid #202020;
  background: linear-gradient(to right, #484848 0%, #202020 100%);
  transition: all 0.3s;
}
.center-toggle .fill {
  display: none;
}

.center-toggle .sun-moon {
  z-index: 2;
  position: absolute;
  left: 0;
  display: inline-block;
  height: 0.6rem;
  width: 0.6rem;
  margin: 0.2rem;
  background: #fffdf2;
  border-radius: 50%;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 0.08rem solid #dee2c6;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}
.center-toggle .switch input:checked ~ .sun-moon {
  left: calc(100% - 0.8rem);
  background: #f5ec59;
  border-color: #e7c65c;
  transform: rotate(-25deg);
  box-shadow: 0 0 4px #f5ec59, 0 0 7px #f5ec59, 0 0 10px #f5ec59;
  border-radius: 50%;
}
.center-toggle .switch input:checked ~ .sun-moon .dots,
.center-toggle .switch input:checked ~ .sun-moon .dots:after,
.center-toggle .switch input:checked ~ .sun-moon .dots:before {
  background: #ffffff;
  border-color: #ffffff;
  border-radius: 50%;
}
.center-toggle .switch input:checked ~ .sun-moon .dots {
  height: 1.5rem;
  width: 1.5rem;
  top: 0px;
  left: -20px;
  transform: rotate(25deg);
}
.center-toggle .switch input:checked ~ .sun-moon .dots:after {
  height: 0.65rem;
  width: 0.65rem;
  top: 2px;
  left: -12px;
}
.center-toggle .switch input:checked ~ .sun-moon .dots:before {
  height: 0.4rem;
  width: 0.4rem;
  top: 6px;
  left: 14px;
}
.center-toggle .switch input:checked ~ .background {
  border: 0.18rem solid #ff9d00;
  background: linear-gradient(to right, #ff9d00 0%, #ffb347 100%);
}

/* Filter bar styles */
.filter-bar {
  position: fixed;
  left: -15px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 10000;
  background: #0000; /* Solid black background */
  padding: 16px 16px 16px 10px; /* Adjust padding as needed */
  border-radius: 16px 24px 24px 0; /* Optional: round only top-right and bottom-right */
}

.filter-btn {
  background: #171717;
  color: #b3b3b3;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1.05rem;
  padding: 7px 18px;
  margin: 2px 0;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  letter-spacing: 0.04em;
  text-align: left;
  outline: none;
}
.filter-btn:hover {
  background: #fff;
  color: #111;
}
.filter-btn:focus {
  background: #ffb347;
  color: #111;
}
/* project numbers when hovered */
.project-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  font-weight: regular;
  color: #7a7a7a;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.25s;
}

.project:hover .project-label {
  opacity: 1;
}

/* Logo styles */
.project-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: auto;
}

/* Mouse lines */
.mouse-line-vertical,
.mouse-line-horizontal {
  position: fixed;
  pointer-events: none;
  z-index: 0; /* Lower z-index to appear behind all content */
  background: #fff;
  transition: none; /* Remove transition for instant response */
}
.mouse-line-vertical {
  width: 1px; /* Thinner line */
  height: 100vh;
  left: 0;
  top: 0;
}
.mouse-line-horizontal {
  height: 1px; /* Thinner line */
  width: 100vw;
  left: 0;
  top: 0;
}
body.toggled .mouse-line-vertical,
body.toggled .mouse-line-horizontal {
  background: #222;
}

/* Trailer and embed display for project pages */
.project-trailer {
  display: block;
  width: 90vw;
  max-width: 900px;
  height: 48vh;
  max-height: 60vh;
  min-height: 600px;
  margin: 40px auto 30px auto;
  background: #000;
  object-fit: contain;
}

@media (max-width: 900px) {
  .project-trailer {
    width: 98vw;
    min-height: 180px;
    height: 32vh;
    max-height: 40vh;
  }
}

/* Media Queries */
@media (max-width: 600px) {
  :root {
    --project-size: 80px;
    --project-gap: 10px;
  }
  .grid {
    display: grid;
    grid-template-columns: repeat(4, var(--project-size));
    gap: var(--project-gap);
    justify-content: center;
  }
  .project-label {
    font-size: 1.1rem;
  }
}
