:root {
  --bg-color: #c3ccc9;
  --text-color: #eee;
  --header-footer-bg: #151d28;
  --upscale-factor: 1;

  --base-text-size: clamp(0.8rem, 0.6rem + 2vw, 2rem);
  --base-line-height: clamp(1.6em, 1.4em + .5vw, 1.4em);

  --toggle-width: calc(9px * var(--upscale-factor));  
  --sidebar-peek: calc(var(--toggle-width) + 40px);  

  --ui-font: "LuckyPixelOne", "Courier New", Courier, monospace;
}

@font-face {
  font-family: 'LuckyPixelOne';
  src: url('fonts/lucky-pixel-one/lucky-pixel-one.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:link { color: #4394b0; }

/* === Reset & Base Styles === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--ui-font); 
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

body.menu-open {
  overflow: hidden;
}


/* === Header with Centered Logo === */
header {
  position: sticky;
  top: 0;
  z-index: 1001;
  background-color: var(--header-footer-bg); 
  padding: 1rem 2rem;
  text-align: center;
}

.logo-wrapper {
  display: flex;
  justify-content: center;
}

/* === Pixel Image Scaling === */
.pixel-ui {
  image-rendering: pixelated;
  transform: scale(var(--upscale-factor));
  transform-origin: top left;
  display: block;
}

.pixel-img {
  image-rendering: pixelated;
  display: block;
  width: 100%;
  height: 100%;
}

.pixel-container {
  display: inline-block;
  overflow: hidden;
  height: auto;
}

/* === Top‑Down Dropdown Menu === */
#menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh; 
  transform: scaleY(0);
  transform-origin: top;
  background-color: var(--header-footer-bg);
  z-index: 1000;
}


#menu.open {
  transform: scaleY(1);
}


/* === New Dropdown Toggle === */
.dropdown-toggle-wrapper {
  position: absolute;
  top: 0.75rem;  
  right: 1rem;   
  z-index: 1002;
}

/* reset button look */
#dropdown-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

#dropdown-toggle picture,
#dropdown-toggle img {
  display: block;
}


.menu-content {
  margin-top: calc(1px * var(--upscale-factor) + 60px);
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  max-height: 100vh;
}

/* Keep your text-menu style */
.text-menu {
  font-size: var(--base-text-size);
  line-height: var(--base-line-height);
  font-family: 'LuckyPixelOne', monospace;
  color: #557074;
  padding-bottom: 2rem;
}


/* story title button */
.menu-title{
  display:block;
  color:#557074;
  text-decoration:none;
}
.menu-title:hover{ color:#f1f6f0; }

/* chapter list */
.chapter-list{
  list-style:none;
  padding:0;
  display:block;
}
.chapter-list.collapsed{ display:none; }

.chapter-list a{
  color:#557074;
  text-decoration:none;
  display:block;
  padding-bottom:1rem;
}
.chapter-list a:hover{ color:#f1f6f0; }


.sidebar-group,
.sidebar-subgroup,
.sidebar-placeholders {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

/* === Overlay Behind Sidebar === */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #151d28;
  opacity: 0;
  pointer-events: none;
  z-index: 995;
}

#overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* placeholders look like muted text and don’t react to hover */
.chapter-list .placeholder{
  color:#394a50;
  opacity:0.45;       
  cursor:default;
  padding:0.15rem 0;
  user-select:none;
  padding-bottom:1rem;
}

/* === Hover image swap (ON versions) === */

.hover-swap {
  position: relative;
  display: inline-block;
  width: fit-content;
  height: fit-content;
}

.hover-swap img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

.hover-swap img.default {
  position: relative;
  z-index: 1;
}

.hover-swap img.hover {
  display: none;
  z-index: 2;
}

.hover-swap:hover img.default {
  display: none;
}

.hover-swap:hover img.hover {
  display: block;
}



/* === Main Content (Gallery Area) === */
/* === Layout: Homepage (Gallery Page) === */

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.content-wrapper > * {
  width: 100%;
  max-width: 100%;
}


.gallery-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem 1rem;
}

/* === Layout: Page Template (Narrative Pages) === */
.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem 1rem;
}

/* === Layout: Text Pages (Already Present) === */
.text-page {
  flex: 1;  
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding-top: 50rem;
  box-sizing: border-box;
}

.gallery {
  width: 100%;
  max-width: 100%;
  display: block;
  margin-bottom: 10px;
}


/* Make .main-image follow same layout scaling as .gallery and .text-page > * */

.main-image {
  display: block;
  width: 100%;
  image-rendering: pixelated;
  margin: 0;
  border: none;
  max-width: 100%;
}


.gallery img {
  width: 100%;
  display: block;
  image-rendering: pixelated;
  margin: 0;
  border: none;
}

.gallery-guard { position: relative; }
.gallery-guard::after {
  content: '';
  position: absolute;
  inset: 0;             
}

/* Two-column gallery */

.gallery-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr; 
  gap: 0;                         
  width: 100%;                    
  margin-bottom: 0.6rem;
}

.gallery-two-col a {
  display: block;
  width: 100%;
  position: relative;
}


.gallery-two-col .hover-swap {
  position: relative;
  display: block;
}

.gallery-two-col .hover-swap img {
  display: block;
  width: 100%;      
  height: auto;
}

.gallery-two-col .hover-swap img.hover {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  width: 100%;
  height: auto;
}

.gallery-two-col .hover-swap:hover img.default {
  display: none;
}

.gallery-two-col .hover-swap:hover img.hover {
  display: block;
}

/* === Footer Layout === */

footer {
  background-color: var(--header-footer-bg);
  color: #557074;
  padding: 1rem 2rem;
  font-size: clamp(0.4rem, 0.2rem + 2vw, 1.2rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-left {
  text-align: left;
  flex: 1 1 50%;
}

.footer-right {
  text-align: right;
  flex: 1 1 50%;
}

footer .legal a {
  color: #394a50;
  text-decoration: none;
}

  .footer-right a {
    margin-right: 1rem; 
  }

  .footer-right a:last-child {
    margin-right: 0;
  }

/* === Text Template Styling === */

.text-page {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-x: hidden;
}


.text-block {
  display: flex;
  flex-direction: column;
  padding-left: 10%;
  padding-right: 10%;
  gap: 0.75rem;
  text-align: justify;
}

.text-page #main-image {
  display: block;
  width: 100%;
  image-rendering: pixelated;
  margin: 0;
  border: none;
}


/* Text tiers: same size, only color differs */

.text-copy {
  font-size: var(--base-text-size);
  line-height: var(--base-line-height);
  color: #557074;
}

.text-h1 {
  font-size: var(--base-text-size);
  line-height: var(--base-line-height);
  color: #202e37;
}

.text-h2 {
  font-size: clamp(0.5rem, 0.4rem + 2vw, 1.4rem);
  line-height: var(--base-line-height);
  color: #557074;
}


.center-text {
  text-align: center;
}


.inline-text-links{
  width:100%;
  display:flex;                
  flex-direction:column;
  align-items:center;          
  justify-content:center;      
  text-align:center;           
  gap:1.6rem;
  font-size: var(--base-text-size);
  line-height: var(--base-line-height);
}



.link-primary{
  color:#394a50;
  text-decoration:none;
  transition:color .15s ease;
}
.link-primary:hover{
  color:#f1f6f0;
}


.placeholder{
  color:#839a99;
  pointer-events:none;     
}

.text-legal{  
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  font-kerning: auto;
  font-size: clamp(0.4rem, 0.3rem + 2vw, 1.1rem);
  line-height: clamp(1.6em, 1.4em + .5vw, 1.4em);
  color: #557074;
  margin-bottom: clamp(1.2em, 1em + .5vw, 1em);
}



/* Accordion */
.accordion {
  display: flex;
  padding-left: 10%;
  padding-right: 10%;
  flex-direction: column;
  gap: 1rem;
}

.accordion-item {
  padding-top: 0.5rem;
}

.accordion-toggle {
  font-family: 'LuckyPixelOne';
  font-size: clamp(0.5rem, 0.4rem + 2vw, 1.4rem);
  line-height: var(--base-line-height);
  color: #557074;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.accordion-toggle:hover {
  color: #202e37;
}

.accordion-content {
  display: none;
  padding-top: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  word-break: break-word;
}

.accordion-icon {
  color: #394a50;
  width: 1rem;
  display: inline-block;
  transition: transform 0.2s ease;
}

.accordion-item.open .accordion-toggle .accordion-icon {
  content: "–"; /* replaced via JS */
}

.accordion-item.open .accordion-content {
  display: block;
}

hr {
  border: none;
  height: 25px;
  margin: 1.5rem 0; 
}

/* Fullscreen splash overlay */
#splash-overlay {
  position: fixed;
  inset: 0; /* shorthand for top/left/right/bottom 0 */
  background: #151d28; /* or any color */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000; /* above everything */
  transition: opacity 0.3s ease; /* smooth fade */
}

/* Centered image */
#splash-overlay img {
  image-rendering: pixelated;
  width: auto;
  height: auto;
  max-width: 50%;
  max-height: 50%;
}

/* Hidden state */
#splash-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}  

@media (min-width: 768px) {
  .content-wrapper > * {
    width: 90%;
  }
  .gallery,
  .main-image,
  .text-page {
    width: 90%;
  }

  
}

@media (min-width: 1200px) {
  .content-wrapper > * {
    width: 50%;
    max-width: 1200px;
  }
  .gallery
  .main-image,
  .text-page {
    width: 50%;
  }

}


@media (max-width: 1200px) {
  header {
    padding: 1rem;
  }

  .logo-wrapper {
    justify-content: flex-start;
    align-items: center;
  }

  .header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  footer {
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .footer-left,
  .footer-right {
    flex: unset;
    width: 100%;
    text-align: center;
  }

  .footer-left p {
    margin: 0 auto; 
  }




}

 