body {
    background: #201F1F;
    overflow-x: hidden;
}

/***** GENERAL CONTENT *****/
.content {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    flex-direction: column;
}

.showing { visibility: visible; display: block; opacity: 1;}

.hidden { visibility: hidden; display: none; opacity: 0;}

.infoContent {
    position: fixed;
    top: 5%; right: 7%;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    max-width: 400px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.842);
}

.infoContent p {
    color: #4e4e4e;
    font-size: 16px;
    display: none;
    line-height: 20px;
}

.infoContent p.active {
    display: block;
}

footer {
    text-align: center;
    padding: 0px 0px 30px;
}

footer a {
    z-index: 1000;
    position: relative;
    color: rgba(255, 255, 255, 0.842);

}


/***** TYPOGRAPHY STYLING *****/
h1 {
    font-family: "Roboto", sans-serif;
    font-weight: 900;
    font-size: 4.5em;
    color:rgb(255, 255, 255);
}

h1.title2, h1.title3, h1.title4 { font-size: 8em; }

text { font-family: "Roboto", sans-serif; }

p, footer { 
    font-family: "Space Mono", monospace;
    color:rgb(255, 255, 255);
    font-size: 21px;
}

/***** PORTAL CONTENT *****/
.portal {
    width: 100%;
    height: fit-content;
    display: flex;
    justify-content: center;
    cursor: pointer
}

.portal img {
    position: absolute;
    width: 80vw;
    max-width: 400px;
    width: 450px;
    height: auto;
    bottom: 0%;
}

.portal .back {
    animation: rotatePortal 4s linear infinite;
    z-index: 0;
}

@keyframes rotatePortal {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.portal .front { z-index: 1; }

/***** OPENING SCREEN *****/
.content header { position: relative; }

#opening .content header::before {
    content: "";
    position: absolute;
    top: -134px;
    left: -190px;
    width: 930px;
    height: 473px;
    background-image: url(images/openingHeaderBG.png);
    background-repeat: no-repeat;
    background-position: center;
    z-index: -2;
}

h1.title { z-index: 1; margin: .67em 0 0 0; }

#headerSVG { position: absolute; top: 0; left: -79px; }

#headerSVG text {
    fill: rgb(255, 255, 255);
    letter-spacing: -2px;
    font-size: 2em;
    font-weight: 600;
}

.headerBg img {
    position: absolute;
    top: -334px;
    right: -53px;
    z-index: -1;
    transform-origin: bottom;
}

.headerBg svg {
    position: absolute;
    top: -384px;
    right: 49px;
    z-index: -2;
}

#visualContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
}

#visualContainer svg { position: absolute; }

#visualContainer svg:nth-child(1) { top: 6%; left: -1%; }

#visualContainer svg:nth-child(2) { top: 14%; left: 8%; }

#visualContainer svg:nth-child(3) { bottom: 5%; left: 80%; }

#visualContainer svg:nth-child(4) { bottom: -12%; left: 77%; }

.visuals {
    stroke: rgb(255, 255, 255);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.enterText {
    position: absolute;
    display: inline-block;
    bottom: 0px;
    color: #6E6E6E;
}

.enterText::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #6E6E6E;
    animation: UpDownMove 1s linear infinite;
}

@keyframes UpDownMove {
    0%, 100% { transform: translateY(-50%) translateX(-50%); }
    50% { transform: translateY(0%) translateX(-50%); }
}

.infoButton {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    width: 60px; 
    padding: 0;
    z-index: 1000; 
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.infoButton.infoActive {
    opacity: 1;
}

.infoButton img {
    width: 100%;
    height: auto;
    display: block;
}

.infoButton:hover {
    opacity: 1;
}

/***** SCENES: General Styling *****/
.blink {
    position: fixed;
    width: 100%;
    height: 50%;
    background: black;
    z-index: 1000;
    pointer-events: none;
    transition: transform 0.4s ease-in-out;
}

.blink-top {
    top: 0;
    left: 0;
    transform: translateY(-100%);
}

.blink-bottom {
    bottom: 0;
    left: 0;
    transform: translateY(100%);
}

.blink-top.blink-in {
    transform: translateY(0);
}

.blink-bottom.blink-in {
    transform: translateY(0);
}


.scenes {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-direction: column;
}

.scenes header {
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.scenes::before { content: ''; display: block; height: 30vh; }

.scenes .enterText { position: relative; text-align: center; margin: 0; }

.scenes .enterText::before {
    transform: translateX(-50%) rotate(180deg);
    animation: UpDownMoveScroll 1s linear infinite;
}

.scenes div.portal { height: 50%; }

.yearDisp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.yearDisp p {
    background-color: #000000b0;
    font-size: 2em;
    padding: 4px 49px;
    color: white;
    letter-spacing: 14px;
}

.prePuzzleContent, .postPuzzleContent {
    padding: 1% 10%;
    display: flex;
    flex-direction: column;
    gap: 28px;
    z-index: 5;
    width: 60vw;
    line-height: 55px ;
    padding: 0 1% 10%;
}

.puzzleContainer {
    width: 95vw;
    margin: 5px auto;
    padding: 5px;
    position: relative;
    align-items: center;
    z-index: 5;
    display: flex;
    flex-direction: column;
}

.puzzleLayout {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}

.pieceContainer {
    width: 300px;
    height: 460px;
    position: relative;
    overflow: visible;
}

.boardContainer {
    width: 90vw;
    aspect-ratio: 1 / 1;
    display: grid;
    max-width: 600px;
    gap: 2px;
    padding: 5px;
    box-sizing: border-box;
}

.piece, .droppableSpace {
    width: 100%;
    font-size: 30px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    cursor: move;
}

.droppableSpace { background-color: #a5a5a57c; border-radius: 10px;}

.ui-state-highlight { background-color: #c5e9e4; }

.piece { 
    width: 100%; 
    position: absolute; 
    overflow: visible; 
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.piece-wrapper, .piece-wrapper img { width: 100%;}

.puzzleButton button {
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 20px auto;
    display: block;
}

.puzzleButton button:hover { transform: translateY(-2px); }

.overlayBackdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.overlayContent {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    padding: 2rem 2.5rem;
    border-radius: 12px;
    max-width: 400px;
    z-index: 10;
    background: white;
}

.overlayContent p { margin: 0.5rem 1rem; color: #dbdbdb; }

.arrow-button {
    margin-top: 1rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    animation: bounce 2s infinite;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.closeOverlay {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    border-radius: 5px;
    font-size: 1.8rem;
    font-weight: bold;
    color: #d6d2d2;
    cursor: pointer;
}

.closeOverlay:hover { color: #000; }

.hoverInfo {
    position: relative;
    cursor: pointer;
    display: inline-block;
    color: #d64242;
}

.hoverInfo.alwaysShow .hoverInfoText{
    visibility: visible;
    opacity: 1;
}

.hoverInfo:hover {
    scale: 1.05;
}

.hoverInfoText {
    visibility: hidden;
    width: 500px;
    background-color: #fff;
    color: #333;
    text-align: left;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
    position: absolute;
    z-index: 100;
    bottom: 120%;
    left: 50%;
    opacity: 0;
    transition: opacity 0.5s;
    transform: translateX(-50%);
    animation: floatHover 3s ease-in-out infinite;
    text-align: center;
    font-family: "Roboto", sans-serif;
    font-weight: 500;
    font-size: 15px;
    line-height: 32px;
}


@keyframes floatHover {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}
 
.hoverInfoText::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

/***** SCENES 1 *****/
#scene1 .boardContainer {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

@keyframes UpDownMoveScroll {
    0%, 100% { transform: translateY(-50%) translateX(-50%) rotate(180deg); }
    50% { transform: translateY(0%) translateX(-50%) rotate(180deg); }
}

.overlayScene1 {
    background: linear-gradient(to bottom, #2b2b2b, #1c1c1c);
    border: 4px double #fdf6e3;
    box-shadow: 
        0 0 0 2px #000 inset,
        0 0 12px rgba(0, 0, 0, 0.5),
        8px 8px 0 #000;
    width: 80%;
    z-index: 1000;
}

#finishPuzzle1 {
    font-size: 1.5rem;
    background: linear-gradient(to bottom, #333333, #1c1c1c);
    border: 2px double #949494;
    cursor: pointer;
}

.deco-button:hover {
    transform: translate(-1px, -1px);
    box-shadow: inset 0 0 0 2px #000, 6px 6px 0 #000;
}

/***** SCENES 2 *****/
#scene2 .scenes { background: #ececf5; }

#scene2 .yearDisp p { background: ghostwhite; }

#scene2 h1, #scene2 p { color: #201F1F; }

#scene2 .prePuzzleContent p, #scene2 .postPuzzleContent p, #scene2 .overlayContent p { 
    font-family: "Inter", sans-serif; 
    line-height: 48px;
    color: #6d6d6d;
}

#scene2 .prePuzzleContent .prePuzzleText, #scene2 .postPuzzleContent .postPuzzleText, #scene2 .overlayContent {
    background: white;
    border-radius: 10px;
    padding: 10px 4%;
    margin: 10px 10%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#scene2 .infoButton {
    background: #3f3f3f8f;
    border-radius: 10px;
}

#scene2 .overlayContent {
    margin: 0;
}

#scene2 .overlayContent p {
    padding: 10px 0;
    font-size: 16px;
}

#scene2 #puzzleInfo2 .overlayContent {
    top: 3%; left: 2%;
    transform: translate(0);
}

#scene2 #puzzleInfo3 .overlayContent {
    top: 27%; left: 2%;
    transform: translate(0);
}

#scene2 .droppableSpace.ui-state-highlight {
  background-color: #c5e9e4;
  box-shadow: inset 0 0 0 3px #4ea3a0;
  transition: background-color 0.2s ease;
}

#scene2 .boardContainer {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    background: none;
    width: 26vw;
    max-width: 320px;
    justify-items: center;
    gap: 2px;
    justify-content: center;
    padding-top: 39px;
}

#scene2 .puzzleContainer {
    background-image: url("images/presentPhone.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    height: 637px;
}

#scene2 .puzzleLayout { padding-top: 80px; gap: 80px; align-items: flex-start; }

#scene2 .droppableSpace {
    width: 100px;
    height: 100px;
    background: #c9c9c967;
    border-radius: 10px;
    border: none;
}

#scene2 .pieceContainer { border-radius: 20px; }

#scene2 .piece-wrapper, #scene2 .piece-wrapper img { 
    width: 170px; 
    transition: transform 0.5s ease; 
}

#scene2 .boardContainer .piece-wrapper,
#scene2 .boardContainer .piece-wrapper img {
    width: 100px;
}

#scene2 #svgContainer {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 3;  
    pointer-events: none; 
}

#scene2 #svgContainer div { position: relative; }
#scene2 #svgContainer svg{ position: absolute; }

#scene2 #svgBG1 { right: 0vw; top: 54vh; }
#scene2 #svgBG2 { right: -67vw; }
#scene2 #svgPattern1 { right: -17vw; top: 66vh; }
#scene2 #svgPattern2 { right: -86vw; }
#scene2 #svgYellow { right: -18vw; top: -7vh; }
#scene2 #svgYellow #svgYellowOutline{ left: -21px; top: 8px; }
#scene2 #svgRed { top: 70vh; left: -5vw; }
#scene2 #svgBlue { right: -91vw; top: 65vh;}
#scene2 #svgBlue #svgBlueOutline{ left: -21px; top: 8px; }

#scene2 #finishPuzzle2 {
    font-family: 'Inter', sans-serif;
    background-color: #285EFE;
    padding: 12px 50px;
    border-radius: 100px;
    margin-top: 0;
    position: relative;
    z-index: 2;
}

#scene2 #finishPuzzle2:hover { background-color: #4870e9; } 

/***** SCENES 3 *****/
#scene3 .puzzleLayout {
    background: url("images/futurePuzzleBG.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    height: 770px;
    gap: 2px;
}

#scene3 #prePuzzleFuture div, #scene3 #postPuzzleFuture div {
    background: url("images/futureTextBG.png");
    background-size: auto 100% ;
    background-repeat: no-repeat;
    background-position: center;
}

#scene3 #prePuzzleFuture p, #scene3 #postPuzzleFuture div p {
    font-family: "Oxanium", sans-serif;
    padding: 10%;
}

.overlayScene3 p {
    font-family: "Oxanium", sans-serif;
    line-height: 32px;
}

.overlayScene3 {
    background: rgba(0, 10, 15, 0.85); /* dark sci-fi tint */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

#scene3 .closeOverlay:hover { color:#00ffff; }

#scene3 .boardContainer {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    background: none;
    padding: 70px;
}

#scene3 .pieceContainer {
    background: none;
    border: none;
}

#scene3 .piece-wrapper, #scene3 .piece-wrapper img { width: 100px; }

#scene3 #wrapper3D { position: fixed; inset: 0; }

#scene3 #canvas3D { top: 0; left: 0; width: 100vw; height: 100vh; }

@keyframes screenTurnOn {
  0% {
    opacity: 0;
    transform: perspective(800px) rotateX(-90deg) scale(0.7);
    filter: brightness(0.4) blur(4px);
  }
  60% {
    opacity: 1;
    transform: perspective(800px) rotateX(10deg) scale(1.05);
    filter: brightness(1.2) blur(0);
  }
  100% {
    opacity: 1;
    transform: perspective(800px) rotateX(0deg) scale(1);
    filter: brightness(1) blur(0);
  }
}

[data-aos="screen-on"] {
  opacity: 0;
  transform: perspective(800px) rotateX(-90deg) scale(0.7);
  transform-origin: center center;
  transition: none;
}

[data-aos="screen-on"].aos-animate {
  animation: screenTurnOn 1s ease-out forwards;
}

.scene3Button {
    font-family: "Oxanium", sans-serif;
    color: #fafafa;
    background: #0e0e0e;
    border: 2px solid #00ffff;
    padding: 0.75rem 2.5rem;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 0 10px #00ffff,
        0 0 20px rgba(0, 255, 255, 0.4),
        inset 0 0 8px rgba(0, 255, 255, 0.2);
}

.scene3Button:hover {
  background: #00ffff;
  color: #0e0e0e;
  box-shadow:
    0 0 12px #00ffff,
    0 0 30px #00ffff,
    inset 0 0 10px #0e0e0e;
}

.flip-container {
    perspective: 1000px;
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
}

.flip-container img {
    width: 100%;
    height: auto;
    backface-visibility: hidden;
    transition: transform 0.6s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.flip-container .front {
    z-index: 2;
    transform: rotateY(0deg);
}

.flip-container .back {
    transform: rotateY(180deg);
}

.flip-container:hover .front {
    transform: rotateY(180deg);
}

.flip-container:hover .back {
    transform: rotateY(360deg);
}