@font-face {
  font-family: 'Rubik Spray Paint';
  src: url('fonts/RubikSprayPaint-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rosario';
  src: url('fonts/Rosario-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rosario';
  src: url('fonts/Rosario-LightItalic.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Rosario';
  src: url('fonts/Rosario-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rosario';
  src: url('fonts/Rosario-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Rosario';
  src: url('fonts/Rosario-SemiBoldItalic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Rosario';
  src: url('fonts/Rosario-Italic.woff2') format('woff2');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Rosario';
  src: url('fonts/Rosario-Bold.woff2') format('woff2');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rosario';
  src: url('fonts/Rosario-BoldItalic.woff2') format('woff2');
  font-weight: bold;
  font-style: italic;
  font-display: swap;
}

@view-transition {
  navigation: auto;
}


:root {
  --cols: 4;
  --rows: 4;
  --cube-size: min(calc(90vw / var(--cols)), calc(90vh / var(--rows)));
  --half-size: calc(var(--cube-size) / 2);
  --rim-thickness: calc(var(--cube-size) * 0.06);
  --track-size: calc(var(--cube-size) - var(--rim-thickness));

  --shelf-base: #bbb4ae;
  --shelf-back: #9e9b94;
  --shelf-floor: #5f5c57;
  --shelf-wall-left: #d9d6c6;
  --shelf-wall-right: #d2ccc0;
  --rim-color: #fffdf5;
  --shelf-base: #292726;
  --shelf-back: #1b1b1b;
  --shelf-floor: #090908;
  --shelf-wall-left: #4d4c47;
  --shelf-wall-right: #3a3937;
  --rim-color: #757471;
  --border-color: rgba(0, 0, 0, 0);
  --proj-image: url('images/blue.png');

  --base-font: 'Rosario', sans-serif;
  --title-font: 'Rubik Spray Paint', sans-serif;

  --blue: #0375d8;
  --pink: #e7378c;
  --gold: #f18b39;
  --red: #eb3c2b;
  --yellow: #fef73c;
}


html {
  scrollbar-gutter: stable;
}

body,
html {
  margin: 0;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  background-color: #c9c8c8;
  perspective: calc(var(--cube-size) * 12);
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  /* Allow body to grow with content */
  min-height: 100%;
  font-family: var(--base-font);
}

h1 {
  font-family: var(--title-font);
}

p {
  font-size: 1.1em;
  line-height: 1.5;
}
a {
  color: var(--blue);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navigation Bar */
nav {
  position: absolute;
  left: 0;
  z-index: 100;
  box-sizing: border-box;
}

nav ul {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0;
}

nav ul li::marker {
  content: none;
}

nav a,
.close-btn {
  text-transform: uppercase;
  font-weight: bold;
  text-decoration: none;
  letter-spacing: 0.04em;
  padding: 1em;
}

nav ul li a {
  color: var(--blue);

}

nav ul li:nth-of-type(1) a {
  color: var(--red);
}

/* Modal */

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  /*transform: translateZ(var(--cube-size) + 20px);*/
  /* Above the canvas */
  display: flex;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  /* Space for mobile */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Smooth scrolling on iOS */
}

#overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.no-scroll {
  overflow: hidden;
  /* Stops background scrolling */
  height: 100vh;
  /* Keeps the viewport locked */
}

.modal {
  background: black;
  color: white;
  width: 100%;
  position: relative;
  max-height: 99vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2em;
  overflow-y: auto;
  overscroll-behavior: contain;
}


@media (min-width: 600px) {
  .modal {
    /*grid-template-columns: 1fr 2fr;*/
  }

  .modal img {
    max-width: 50%;
  }

  .modal .fixed-column {
    position: sticky;
    top: 0;
    align-self: start;
  }
}

#modal-body {
  display: flex;
  flex-direction: column;
  gap: 4em;
}

#modal-title {
  font-family: var(--base-font);
  margin: 0;
  padding-left: 1rem;
}

.modal-top {
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.5em 2em 1em 0.5em;
  gap: 1em;
  background-color: black;
}

#proj-artist {
  font-size: 1.2rem;
  color: #c1c1c1;
  margin: 0;
  padding-left: 1rem;
  /*margin-bottom: 0.5em;*/
}

#proj-info {
  font-size: 1rem;
  font-weight: 300;
  color: #c1c1c1;
  max-width: 60ch;
  min-width: 16ch;
  margin: 0;
  padding-left: 1rem;
  margin-bottom: 0.2em;
}

.modal-desc {
  align-self: flex-end;
  background-color: var(--gold);
  margin-top: 5em;
  padding: 2em 2.4em 2.4em 2.4em;
  color: black;
  z-index: 5;
}

#modal-body p {
  max-width: 70ch;
}

.modal-bio {
  z-index: 5;
  margin-top: 3em;
  background-color: var(--yellow);
  padding: 2em 2.4em 2.4em 2.4em;
  max-width: 70ch;
  color: black;
}

.modal-bio h3 {
  margin-top: 0;
}

.instagram-media {
  background: white;
  border: 1px solid black;
  max-width: 100%;
  width: 100%;
  box-shadow: none;
  display: block;
  min-width: 326px;
  padding: 0px;
  margin: 0 auto;
}

.gif-bg-grid {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: 1920px;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.gif-tile {
  background-size: cover;
  background-position: center;
}

.mem-imgs {
  gap: 2rem;
  display: flex;
  flex-direction: column;
  margin: 5%;
  max-width: 100vw;
  box-sizing: border-box;
}

.modal img.mem-img {
  max-width: 80%;
}

.modal img.mem-img:nth-of-type(2) {
  align-self: flex-end;
}

@media (min-width: 600px) {
  .instagram-media {
    width: 40%;
  }

  .modal img.mem-img {
    max-width: 35rem;
  }

  .mem-imgs {
    gap: 0;
  }

  .modal img.mem-img:nth-of-type(2) {
    max-width: 45rem;
  }

  .modal img.mem-img:nth-of-type(3) {
    max-width: 45rem;
  }
}



#socials {
  z-index: 5;
  display: flex;
  gap: 2em;
}

.social {
  background-color: var(--blue);
  color: white;
  padding: 1em;
  max-width: 20ch;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.social.website:before {
  content: "🌐";
  font-size: 2em;
  margin-right: 0.5em;
}

.social.ig:before {
  content: "📷";
  font-size: 2em;
  margin-right: 0.5em;
}

.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue);
  font-size: 1rem;
  padding: 0;
  display: flex;
  align-items: center;
}

.close-btn:before {
  content: '⇜';
  font-weight: bold;
  font-size: 2em;
  margin-right: 0.5em;
  color: var(--blue);
}

/* The Overlay Canvas */
#erase-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: crosshair;
  touch-action: none;
  transform: translateZ(var(--cube-size) + 20px);
}

.scene {
  width: calc(var(--track-size) * var(--cols));
  height: calc(var(--track-size) * var(--rows));
  transform-style: preserve-3d;
  transform: translateZ(calc((var(--cube-size) * -1) - 20px));
  transition: transform 0.1s ease-out;
  z-index: -10;
  position: relative;
  margin-bottom: 100px;
}

.shelf {
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--track-size));
  grid-template-rows: repeat(var(--rows), var(--track-size));
  transform-style: preserve-3d;
  margin-top: 3em;
  transform: rotateX(-8deg);
}

@media (max-width: 600px) {
  .shelf {
    margin-top: 0;
  }
}

.cubby {
  position: relative;
  width: var(--cube-size);
  height: var(--cube-size);
  transform-style: preserve-3d;
  background: rgba(0, 0, 0, 0.01);
  pointer-events: auto !important;
}

/* Ensure users can see which cubby they've tabbed to */
.cubby:focus-visible {
  outline: 4px solid #55aaff;
  outline-offset: 10px;
  transform: translateZ(20px);
  /* Bring it forward slightly when focused */
}

.cubby,
a.cubby {
  all: unset;
  /* Clear the slate */
  display: block;
  position: relative;
  width: var(--track-size);
  /* Use track-size for the grid footprint */
  height: var(--track-size);
  transform-style: preserve-3d;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.3s ease;
  margin: 0;
  padding: 0;
}

/* Ensure the focus ring doesn't look broken in 3D space */
a.cubby:focus-visible {
  outline: 3px solid #55aaff;
  outline-offset: 5px;
}

.face {
  position: absolute;
  width: var(--cube-size);
  height: var(--cube-size);
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  /* Center the face in case of track-size mismatch */
  top: 50%;
  left: 50%;
  transform-origin: center;
}


.back {
  transform: translate(-50%, -50%) translateZ(calc(var(--half-size) * -1));
  background-color: var(--shelf-back);
}

.top {
  transform: translate(-50%, -50%) rotateX(90deg) translateZ(var(--half-size));
  background-color: var(--shelf-base);
}

.bottom {
  transform: translate(-50%, -50%) rotateX(-90deg) translateZ(var(--half-size));
  background-color: var(--shelf-floor);
}

.left {
  transform: translate(-50%, -50%) rotateY(-90deg) translateZ(var(--half-size));
  background-color: var(--shelf-wall-left);
}

.right {
  transform: translate(-50%, -50%) rotateY(90deg) translateZ(var(--half-size));
  background-color: var(--shelf-wall-right);
}

.front {
  transform: translate(-50%, -50%) translateZ(var(--half-size));
  background: none;
  border: var(--rim-thickness) solid var(--rim-color);
  pointer-events: none;
}

@media (max-width: 600px) {
  :root {
    --cols: 3;
    --rows: 6;
  }

  .shelf .cubby:last-child {
    grid-column: 1 / -1;
    width: calc(100% + var(--rim-thickness));
    height: var(--cube-size);
    right: calc(var(--rim-thickness) / 2);
  }

  .shelf .cubby:last-child .top,
  .shelf .cubby:last-child .bottom {
    height: var(--cube-size) !important;
    width: 100%;
  }

  .shelf .cubby:last-child .left,
  .shelf .cubby:last-child .right {
    width: var(--cube-size) !important;
    height: 100%;
  }

  .shelf .cubby:last-child .right {
    right: 0;
    left: auto;
    transform-origin: right;
    transform: rotateY(90deg) translate(50%, -50%);
  }

  .shelf .cubby:last-child .left {
    left: 0;
    right: auto;
    transform-origin: left;
    transform: rotateY(-90deg) translate(-50%, -50%);
  }

  .shelf .cubby:last-child .front,
  .shelf .cubby:last-child .back {
    width: 100%;
    height: 100%;
  }
}

.content {
  position: absolute;
  width: 60%;
  height: 60%;
  top: 10%;
  left: 10%;
  transform: translateZ(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgb(0, 0, 0);
  background-image: var(--proj-image);
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  font-size: calc(var(--cube-size) * 0.084);
  text-transform: uppercase;
  padding: 1em;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: brightness(0.5);
}

.cubby .content {
  webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
  webkit-transform-style: flat !important;
  transform-style: flat !important;
  transform: translateZ(1px);
}

.cubby.hovered .content {
  transform: translateZ(20px);
  filter: none;

}

/* Magic 8 Ball Container */
/* --- MAGIC 8-BALL OVERLAY & INTERACTION STYLES --- */
#eight-ball-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 8, 8, 0.97);
  background-image: url("images/p.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 2000;
  transform: translateZ(var(--cube-size) + 20px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.hidden {
  display: none !important;
}

.eight-ball-container {
  text-align: center;
  color: #ffffff;
}

.eight-ball-container h2 {
  font-family: 'Rubik Spray Paint', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 8px;
}

/* The 3D Rendered Sphere Body */
.oracle-sphere {
  width: 24em;
  height: 24em;
  background: radial-gradient(ellipse at 22% 22%, #a99eb8b1 0%, #9ea2b8bd 2.6%, transparent 3%), radial-gradient(circle at 30% 30%, #3a334e 0%, #080808 30%, #000000 100%);
  /*background: black;*/
  border-radius: 50%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), inset -10px -10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  cursor: pointer;
  user-select: none;
  z-index: 10;
  position: relative;
}

.oracle-window {
  width: 12em;
  height: 12em;
  background: radial-gradient(circle at center, #001133 0%, #000511 100%);
  border: 8px solid #141414;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.9);
}

/* The Floating Glowing Prediction Text Element */
.oracle-text {
  width: 5em;
  height: 7em;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1.4;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Outer Triangle (Border Color) */
.oracle-text::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-left: 6em solid transparent;
  border-right: 6em solid transparent;
  border-top: 10em solid var(--blue);
  filter: blur(1px);
  top: 0;
  z-index: -1;
}

@media (min-width: 600px) {
  .oracle-sphere {
    width: 30em;
    height: 30em;
  }

  .oracle-window {
    width: 14em;
    height: 14em;
    background: radial-gradient(circle at center, #001133 0%, #000511 100%);
    border: 8px solid #141414;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.9);
  }

  /* The Floating Glowing Prediction Text Element */
  .oracle-text {
    width: 6em;
    height: 7.5em;
    font-size: 0.75rem;
  }

  /* Outer Triangle (Border Color) */
  .oracle-text::before {
    border-left: 6em solid transparent;
    border-right: 6em solid transparent;
    border-top: 11em solid var(--blue);
  }
}

/* Exit Button Component */
#eight-ball-close {
  position: absolute;
  top: 1em;
  left: 1em;
  color: white;
  z-index: 10;
}

#eight-ball-close:before {
  color: white;
}

#eight-ball-close:hover {
  opacity: 1;
}

/* Physical Shaking Animation Loop */


.magic-8-ball {
  width: calc(var(--cube-size) / 2);
  height: calc(var(--cube-size) / 2);
  /*background: radial-gradient(circle at 30% 30%, #444, #000);*/
  /*border-radius: 50%;*/
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
}

/* Force the model viewer container to occupy full volumetric space */
#shelf-eight-ball {
  width: 100%;
  height: 100%;
  display: block;
}

#eight-ball-heading {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 3em;
}

.bottom-text {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Video */

.vid-container iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  /* Sets the proportional width-to-height ratio */
}

.vid-container.vid-4-5 iframe {
  aspect-ratio: 5 / 4;
}

@media (min-width: 700px) {
  .vid-container {
    width: 60%;
    margin: 0 auto;
  }
}

.vid-container {
  /*view-transition-name: proj-expand;*/
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 2em;
  opacity: 1;
  transition: 0.3s;
  z-index: 5;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.link-container {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: 0.8;
  transition: opacity 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-transform: uppercase;
  color: black;
  letter-spacing: 0.04em;
}


.highlight {
  background: var(--yellow);
  padding: 0.5em 1em;
  font-size: 1.5em;
  font-weight: bold;
}

.link-note {
  background: var(--yellow);
  padding: 0.5em 1em;
  margin-top: 1em;
}

a.work-link {
  text-decoration: none;
}

.link-container:hover {
  opacity: 1;
}

@media (min-width: 600px) {
  .link-container {
    width: 70%;
  }
}

/* Curatorial */

#curatorial-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  background: #fff;
  color: black;
  z-index: 1000;
  transform: translateZ(var(--cube-size) + 20px);
  /* Above the canvas */
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  /* Space for mobile */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Smooth scrolling on iOS */
}

#curatorial-panel.open {
  opacity: 1;
  pointer-events: auto;
}

#curatorial-panel.open .curatorial-peek-handle {
  width: 0;
  border-left: none;
  overflow: hidden;
}

.curatorial-content {
  flex: 1;
  padding: 80px 10%;
  overflow-y: auto;
  position: relative;
  box-sizing: border-box;
}

.curatorial-content h2 {
  font-family: 'Rubik Spray Paint', sans-serif;
  font-size: 2.5rem;
  margin-top: 0;
  margin-bottom: 30px;
}

#curatorial-close-btn {
  margin-bottom: 1em;
  z-index: 9999;
}


@media (max-width: 768px) {
  #curatorial-panel {
    top: auto;
    bottom: 4em;
    left: 0;
    width: 100vw;
    height: 100vh;
    flex-direction: column;
    transform: translateY(100%);
  }

  #curatorial-panel.open {
    transform: translateY(0) !important;
  }

}

#overlay,
#curatorial-panel,
#eight-ball-overlay {
  contain: layout;
}

@media (prefers-reduced-motion: no-preference) {
  #overlay {
    transition: opacity 0.3s ease;
  }

  .spray {
    filter: url(#spray-life);
  }

  /* Page transition for project */
  .proj-expand {
    view-transition-name: proj-expand;
  }

  ::view-transition-old(proj-expand),
  ::view-transition-new(proj-expand),
  ::view-transition-old(oracle-expand),
  ::view-transition-new(oracle-expand) {
    object-fit: cover;
    animation-duration: 500ms;
  }


  .oracle-sphere {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1);
  }

  .oracle-sphere:hover {
    transform: scale(1.1);
  }

  .oracle-sphere.shaking {
    animation: shakeBall 0.4s ease-in-out infinite alternate;
  }

  @keyframes shakeBall {
    0% {
      transform: translate(4px, 4px) rotate(3deg);
    }

    25% {
      transform: translate(-4px, -2px) rotate(-4deg);
    }

    50% {
      transform: translate(3px, -3px) rotate(5deg);
    }

    75% {
      transform: translate(-3px, 3px) rotate(-2deg);
    }

    100% {
      transform: translate(2px, -1px) rotate(3deg);
    }
  }

  .magic-8-ball {
    transition: transform 0.2s ease;
    animation: float 3s ease-in-out infinite;
  }

  @keyframes float {

    0%,
    100% {
      transform: translateY(0px);
    }

    50% {
      transform: translateY(-10px);
    }
  }

  .tile-1 {
    background-image: url('images/ithought.gif');
  }

  .tile-2 {
    background-image: url('images/ithought2.gif');
  }

  .tile-3 {
    background-image: url('images/ithought3.gif');
  }
}