
/*----------------------------------
  FONTS
----------------------------------*/

@font-face {
  font-family: 'Oaburen';
  src: url('/assets/fonts/Oaburen.woff2') format('woff2'),
       url('/assets/fonts/Oaburen.woff') format('woff'),
       url('/assets/fonts/Oaburen.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Ensures text is rendered using fallback while font loads */
}

body {
  font-family: 'Oaburen', Arial, Helvetica, sans-serif;
  overflow: hidden; /* Prevent scrollbars if layout is full-screen */
}

/*----------------------------------
  BARBA CONTAINER
----------------------------------*/

.barba-container {
  position: relative;
  z-index: 1;
}

[data-barba="container"] {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  will-change: opacity; /* Hint to browser for performance optimisation */
}

/*----------------------------------
  ANIMATIONS
----------------------------------*/

@keyframes shake {
  0%, 100%   { transform: translate(0); }
  25%        { transform: translate(-2px, 2px); }
  50%        { transform: translate(2px, -2px); }
  75%        { transform: translate(-2px, -2px); }
}

.shake {
  animation: shake 0.4s ease;
}


/*----------------------------------
  CRINGE BAR
----------------------------------*/

.CringeBar {
  position: absolute;
  top: 35vh;
  right: 0;
  height: clamp(10vh, 45vh, 45vh);
  display: block;
  z-index:10;
}

.CringeBar-fill {
  height: 100%;
  display: flex;
}

.CringeBar-image img {
  height: 100%;
}

.CringeBar .confidence {
    margin-right: -2.5em;
}

/*----------------------------------
  BACKGROUNDS
----------------------------------*/

.MainBackground {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Static image background */
.MainBackground__image {
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(6px);
  transition: filter 6000s ease-in-out;
}

.entry__sceneContent .MainBackground__image, .entry__sceneOptions .MainBackground__image {
  filter: none; /* Removes blur when appropriate */
}

.is-blurring .MainBackground__image {
  filter: blur(12px); /* Re-applies blur when needed */
}

/* Video background styling */
.MainBackground__video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
}

/*----------------------------------
  HEADER & LOGO
----------------------------------*/

header {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  z-index:11;
}

.CringeQuest__logo {
  position: relative;
  top: 4px;
  left: -3px;
  width: 300px;
  rotate: -6deg;
  z-index: 2;
  z-index:10;
}

.CringeQuest__logo:hover {
  animation: shake 0.4s ease;
}

/*----------------------------------
  MUTE BUTTON STYLES
----------------------------------*/

#mute-toggle {
    position: absolute;
    z-index: 999;
    display: block;
    width: auto;
    bottom: 12%;
    left: 6%;
    rotate:-12deg;
}

.MuteToggle img {
    width: 100%;
    max-width: 1.25em;
}

a:focus, button:focus {
  outline: none;
  box-shadow: none;
}

.MuteToggle:focus {
  outline: none;
  box-shadow: none;
}

.MuteToggle .icon {
    font-size: 6em;
    display: block;
    outline: none;
}

#mute-toggle {
  transition: transform 0.2s ease;
  transform-origin: center;
}

#mute-toggle:hover {
  transform: scale(1.2) rotate(-5deg);
}

/*----------------------------------
  SCENE STYLES
----------------------------------*/

.CringeScene {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.main-story {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 80vw;
    min-height:50vh;
    gap: 2em;
}

/* Main story panel (left side) */
.main-story__panel {
    width: auto;
}
.main-story__panel .scene-image {
    min-width: 10vw;
}

.the___story.has-background {
  background-repeat: no-repeat;
  background-size: contain;
  background-position: left center;
  min-height: 50vh;
  padding: 2rem;
}

.the___story.has-background.imgRight {
  background-position: right center;
}


.main-story__content {
  display: flex;
  flex-direction: column;
  max-height:70vh;
  max-width:70%;
  min-width:50%;
  height: 100%;
  padding: 79px 0; /* room for the tear SVGs */
  overflow: initial; /* keeps tears visually clean */
  filter: brightness(1.06);
}

.main-story__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 2em;
  height:100%;
}

.main-story__body {
  min-height: 0; /* 🧠 Critical for flex containers to allow scroll */
}
/* Top tear */
.main-story__content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px; /* REQUIRED! Set to the height of your SVG */
  background: url('/assets/static-assets/paper-tear-top.png') no-repeat top center;
  background-size: cover;
  z-index: 3;
  pointer-events: none;
}

/* Bottom tear */
.main-story__content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px; /* REQUIRED! Match SVG height */
  background: url('/assets/static-assets/paper-tear-bottom.png') no-repeat bottom center;
  background-size: cover;
  z-index: 3;
  pointer-events: none;
}

/* Make background cover shorter viewports */
@media (min-width: 1220px) and (max-height: 980px) {
  .main-story__content {
    background-size: cover;
  }
}

.the___story::-webkit-scrollbar {
  width: 8px;
  scrollbar-gutter: stable;

}

.the___story::-webkit-scrollbar-track {
  background: transparent;
}

.the___story::-webkit-scrollbar-thumb {
  background-color: #E401A9;
  border-radius: 4px;
}

.the___story::-webkit-scrollbar-thumb:hover {
  background-color: #E401A9;
}

.the___story {
  scrollbar-width: auto; /* or auto */
  scrollbar-color: #E401A9 transparent;
  margin-right:10px;
}

.the___story::-webkit-scrollbar {
  width: 12px; /* slightly wider scrollbar */
}

.the___story::-webkit-scrollbar-track {
  background: transparent;
  margin-left: 10px; /* 👈 pushes scrollbar inward */
  scrollbar-gutter: stable;
}


/* Titles */
.main-story__title {
    position: absolute;
    background: #fff;
    z-index: 9999;
    top: 3em;
    padding: 9px 17px;
    border: solid;
    border-radius: 10px;
    box-shadow: -5px 5px 0px #000000;
    display:flex;
    flex-direction:row;
    gap:0.75em;
}

.main-story__title:before {
    content: '';
    width: 32px;
    height: 42px;
    background-image: url(/assets/static-assets/location-pin.svg);
    display: block;
    background-position: center center;
    background-repeat: no-repeat;
}

.main-story__title h2 {
  font-size: 2.4em;
  color:#000;
}

.the___story {
    position: relative;
    width: 100%;
    height: 100%;
    color: #000;
    padding: clamp(1vw, 3.5vw, 6vw);
    background: #fff;
    background-image:url('/assets/static-assets/texture.png');
}

h3 {
  font-size: clamp(0.5em, 2em, 2em);
  margin-bottom: 0.5em;
}

.option-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: center;
    gap:1em;
    margin-top:-12em;
}


.main-story__nav.modal-z {
  position: relative;
  z-index: 99999 !important;
}


/*----------------------------
 Modal + Envelope Styling
----------------------------*/

/* Force the browser to load the tear assets early */
.modal__tear-preload {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  background-image: url('/assets/static-assets/paper-tear-top.png'), url('/assets/static-assets/paper-tear-bottom.png');
}

/* --- Z-Index Priority --- */
.main-story__nav {
  position: absolute;
  z-index: 10010;
  bottom: 1em;
}

/* --- Modal Wrap --- */
.custom-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 9;
  pointer-events: none;
}

/* --- Backdrop --- */
.modal__backdrop {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(6px);
  background: rgb(0 0 0 / 0%);
  pointer-events: auto;
  z-index: 1;
}

/* --- Modal Container --- */
.modal__container {
  position: relative;
  z-index: 10020;
  border-radius: 8px;
  padding: 2vw;
  max-width: 50vw;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x:hidden;
  animation: fadeInScale 0.3s ease;
  pointer-events: auto;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  text-rendering: optimizeLegibility;
}

.modal__container div {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  text-rendering: optimizeLegibility;
}

/* --- Close Button --- */
.modal__close-btn {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #666;
  transition: color 0.2s ease;
}

.modal__close-btn:hover,
.custom-modal button:hover {
  color: #000;
}

.modal__cta-close-btn {
  width: auto;
}

/* --- Content Layout --- */
.modal__content-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  overflow: hidden;
  max-height: 70vh;
  filter:brightness(1.06);
}

.modal__content-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 4rem;
  background: #fff;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  background-image:url('/assets/static-assets/texture.png');
}

/* --- Content Text --- */
.modal__body {
  font-size: 1rem;
  color: #444;
  line-height: 1.5;
  flex: 1;
  max-width: 600px;
}

.modal__body h2 {
  font-size: 3em;
}

.modal__body p {
  font-size: 2em;
}

.modal__content-block h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #222;
}

/* --- Image Placement --- */
.modal__image {
  flex: 0 0 50%;
}

.modal__image--imgLeft {
  order: -1;
}

.modal__image--imgRight {
  order: 1;
}

/* --- Paper Tear --- */
.modal__tear {
  width: 100%;
  line-height: 0;
  z-index: 2;
}

.modal__tear img {
  width: 100%;
  height: auto;
}

.modal__tear--top {
  margin-bottom: -1px;
}

.modal__tear--bottom {
  margin-top: -1px;
}

/* --- CTA Button --- */

.modal__cta-wrap > a, .modal__cta-wrap > button {
    width: 240px;
    text-align:center;
}
.modal__cta-wrap > a span, .modal__cta-wrap > button span {
    width: 100%;
    text-align: center;
    font-size: 1.4em;
}


.modal__cta-wrap {
  color: #000;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap:0.25em;
}

.modal__cta-close-btn {
    rotate: 3deg;
}

.modal__cta-btn span {
    rotate: -3deg;
    display: block;
}

.modal__cta-close-btn span {
  rotate: 2deg;
  display:block;
}

/* --- Envelope Button --- */
.envelope {
  transition: transform 0.2s ease;
}
.envelope > .modal-trigger {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  height: 180px;
  padding: 2rem;
  background: url('/assets/static-assets/envelope-closed.svg') center center / contain no-repeat;
  border: none;
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
  color: #000;
  cursor: pointer;
  outline: none;
  box-shadow: none;
}
.envelope:not(.modal--active):hover {
  transform: scale(1.05);
}
.envelope.modal--active > .modal-trigger {
  background-image: url('/assets/static-assets/envelope-open.svg');
}

/* --- h4 Label Inside Trigger --- */
.modal-trigger h4 {
  position: relative;
  bottom: 0;
  display: flex;
  background: #fff;
  padding: 13px 20px;
  border-radius: 250px;
  border: solid;
}

/* --- Text Overlay (Fallback) --- */
.envelope > .modal-trigger::after {
  content: attr(data-title);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* --- Animation --- */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}







/* Other Buttons */

.torn-btn {
    width: 380px;
    height: 100px;
    background-image: url(/assets/static-assets/torn-button.png);
      padding-left: 38px;
}

.torn-btn-2 {
    width: 380px;
    height: 100px;
    background-image: url(/assets/static-assets/torn-button-2.png);
}

.torn-btn, .torn-btn-2 {
    cursor:pointer !important;
    will-change: auto; /* or remove if unnecessary */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    rotate:-3deg;
    transition: transform 0.3s ease; /* enable smooth rotation transition */
}
.torn-btn:hover {
  transform: rotate(3deg); /* adjust to how far you want it to rotate */
}

.torn-btn span {
      cursor:pointer !important;
      will-change: auto; /* or remove if unnecessary */
  text-decoration: none;
  color: #000;
  font-family: inherit;
  font-size: 2rem;
  font-weight: bold;
  line-height: 1;
}

/* Scene Results */
.scene_result_btn a {
  color:#000;
  font-size:2em;
}

.scene_result_btn {
  position: absolute;
  bottom: 5vh;
  align-items: center;
  justify-content: center;
  z-index: 10030; /* Must be above .CringeBar and modal backdrop */
}

/* Fun Fact */
.main-story.sceneFact .the___story, .main-story.sceneResult .the___story {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 7.5%;
}

.the___story > div {
    display: flex;
    flex-direction: column;
    justify-content:flex-start;
}

.the___story p {
    font-size: 1.4em;
}

.sceneFact {
    max-width: 50vw;
}

/* Homepage */
.homepage {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
}
.hp-content {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    top: 2vh;
    z-index: 2;
}
.static-content {
  display:flex;
  align-items:center;
  justify-content:center;
}
.static-content h1 {
  font-size:3.25em;
  width:60%;
  text-align:center;
  text-shadow:1px 2px 8px #000;
}

.hp-logo {
  width: 40vw;
  transform: scale(0);
  opacity: 0;
  animation: zoomIn 0.5s ease-in-out 0.3s forwards;
}

@keyframes zoomIn {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.character-strip {
    display: flex;
    flex-direction: row;
    max-width: 100vw;
    align-items: flex-end;
    position: absolute;
    bottom: 0;
    gap: 2vw;
}
.character-strip img {
    width: 12vw;
    height: 100%;
}
.entry-btn .torn-btn {
    width: 310px;
    height: 80px;
    margin-top: 5px;
    rotate: -6deg;
}
.entry-btn .torn-btn span {
    font-size: 2rem;
    padding-left: 0.65em;
}



/* Scene Select Page */
.CringeScene.sceneSelect {
  width:80%;
  margin:0 auto;
}
.sceneSelect .scene-select__grid {
    flex-direction: row;
    display: flex;
    width: 100%;
    position: relative;
    align-items: center;
}
.scene-select__left {
    width: 30%;
}
.scene-select__right {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    justify-items: center;
    width: 100%;
}

.scene-select__content {
  font-size:clamp(1em, 2em, 3em);
  color:#000;
}

.scene-select__universal-link a {
    background: #ffffff;
    padding: 15px 15px;
    border-radius: 6px;
    rotate: -3deg;
    display: block;
    width: fit-content;
    font-size: 1.2em;
    color: #f35798;
    box-shadow: 5px 6px 12px #00000021;
}

.scene-select__nav-block:nth-child(n + 5) {
  grid-column: span 1;
}

.scene-select__nav-block:nth-child(5) {
  grid-column-start: 2;
}

.scene-select__nav-block:nth-child(6) {
  grid-column-start: 3;
}

.scene-select__nav-block:nth-child(7) {
  grid-column-start: 4;
}

/* Style Buttons */

.scene-select__nav-block {
  background-image: url(/assets/static-assets/scene-select/ss-frame.svg);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  aspect-ratio: 1 / 1.2;
  min-height: 300px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 3rem;
  box-sizing: border-box;
}

.scene-btn-graphics {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.scene-btn-graphics li {
  width: 100%;
  max-width: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
  position:relative;
  top:-10%;
}

.scene-btn-graphics img {
  width: 100%;
  height: auto;
  display: block;
}

ul.scene-btn-content {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 100%;
    width:100%;
}

ul.scene-btn-content li {
    color: #000;
    font-size: 1.5em;
    text-align:center;
}
ul.scene-btn-content li.title {
  font-size:3em;
}

.scene-select__nav-block {
    position: relative; /* important so children can be absolutely positioned */
}

.locked-btn,
.completed {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 0em 3em 2em;
    box-sizing: border-box;
    z-index: 10;
    pointer-events: auto;
    transition: transform 0.2s ease;
    transform-origin: center;
}

.locked-btn img,.sticky a h2
.completed img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.locked-btn:hover {
    animation: shakeYRotate 0.4s ease;
}

a.scene-select__link:hover {
  animation: shakeZoomRotate 0.4s ease;
}


@keyframes shakeYRotate {
  0%   { transform: translateY(0) rotate(0deg); }
  25%  { transform: translateY(-2px) rotate(2deg); }
  50%  { transform: translateY(2px) rotate(-2deg); }
  75%  { transform: translateY(-2px) rotate(1deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@keyframes shakeZoomRotate {
  0%   { transform: scale(1) translateY(0) rotate(0deg); }
  25%  { transform: scale(1.05) translateY(-2px) rotate(2deg); }
  50%  { transform: scale(1.05) translateY(2px) rotate(-2deg); }
  75%  { transform: scale(1.05) translateY(-2px) rotate(1deg); }
  100% { transform: scale(1) translateY(0) rotate(0deg); }
}