/* ===== colour scheme: retinted to the glitchagon palette =====
   (--bg / --primary / --secondary keep their old names so nothing else breaks) */
:root {
  --bg: #F5F1E9;
  --primary: #E85D1A;
  --secondary: #1A1814;

  /* site tokens, copied from the main stylesheet */
  --off-white: #F5F1E9;
  --charcoal: #1A1814;
  --bright-orange: #E85D1A;
  --variant-1: #ffc640;
  --variant-2: #d5d9d2;
  --variant-3: #b0b3ad;
  --soft-gray: #888888;

  /* height of the nav area; the popup starts below this line */
  --nav-h: 5.5rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Funnel Display", sans-serif;
  color: var(--charcoal);
  background: var(--bg);
  overflow-x: hidden;
}

body::-webkit-scrollbar {
  display: none;
}

.canvas-container {
  margin: 0 auto;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 101;
}

canvas {
  width: 300px;
  height: 100px;
  cursor: pointer;
}

.left-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 35%;
  height: 100vh;
  position: fixed;
  overflow-y: hidden;
  flex-direction: column;
}

.right-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  width: 65%;
  margin-left: 35%;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== site nav (copied from the main stylesheet) ===== */

nav {
  position: absolute;
  top: 0;
  width: 100%;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav p,
nav p a {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  font-weight: 500;
}

.navbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 24px;
  background-color: transparent;
  border-radius: 50px;
  transition: all 0.3s ease;
  z-index: 1000;
}

.navbar.scrolled,
.navbar.menu-open {
  background-color: #ffffff;
  box-shadow: 0px 4px 0px #000000;
  border: 2px solid #000000;
}

.nav-links {
  display: flex;
  white-space: nowrap;
}

.nav-links a {
  text-decoration: none;
  color: #707070;
  margin: 0 16px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  font-family: "Funnel Display", sans-serif;
}

.nav-links a:hover {
  color: #000000;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--charcoal);
  cursor: pointer;
}

.nav-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 200ms ease;
}

.navbar.menu-open .nav-toggle svg {
  transform: rotate(180deg);
}

.nav-dropdown {
  display: none;
}

/* ===== buttons (Back / Close / View Site) — same look as the site's chips ===== */

.btn,
#close-btn,
#item-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--charcoal);
  background: var(--off-white);
  border: 2px solid var(--charcoal);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease,
    background-color 150ms ease;
}

.btn:hover,
#close-btn:hover,
#item-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--charcoal);
}

.btn:active,
#close-btn:active,
#item-link:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

#item-link {
  background: var(--variant-1);
}

/* ===== overlay ===== */

.overlay {
  position: fixed;
  bottom: -1600px;
  right: 0;
  width: 65%;
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
  padding: 2em;
  background: var(--off-white);
  color: var(--charcoal);
  border: 2px solid var(--charcoal);
  box-shadow: -6px 6px 0 var(--charcoal);
  overflow-x: hidden;
  overflow-y: scroll;
  z-index: 2;
  will-change: bottom;
  transform: translateZ(0) rotate(20deg);
  transform-origin: bottom center;
}

.overlay::-webkit-scrollbar {
  display: none;
}

.img-container {
  width: 100%;
  padding-bottom: 2em;
}

img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 2em 0;
}

.col:nth-child(1) {
  flex: 3;
}

.col:nth-child(2) {
  flex: 2;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.item-details {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 1em 0 4em 0;
}

.item-details p:nth-child(1) {
  flex: 3;
}

.item-details p:nth-child(2) {
  flex: 2;
}

#item-text {
  font-size: 18px;
  line-height: 1.5;
  padding: 0 10px;
  font-weight: 300;
}

#item-text {
  line-height: 1.8;
  font-size: 1.1rem;
  color: var(--charcoal);
}

#item-text p {
  margin-bottom: 1.5rem;
  display: block;
}

#item-text ul,
#item-text ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

#item-text li {
  margin-bottom: 0.5rem;
}

.footer {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 2em;
  display: none;
}

/* top padding clears the site nav */
.container {
  padding-top: 6rem;
}

/* .roll {
  text-decoration: none;
  font-size: 40px;
  line-height: 60px;
  color: var(--secondary);
  height: 60px;
  overflow: hidden;
  margin: 20px 0;
} */

.roll {
  text-decoration: none;
  color: var(--secondary);
  overflow: hidden;
  font-size: 20px;
  line-height: 40px;
  height: 40px;
  margin: 5px 0;
}

/* .roll.play {
  pointer-events: none;
} */

.roll:hover .letter,
.roll.play .letter {
  transform: translateY(-100%);
}


.roll .letter {
  display: inline-block;
  transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
  /* each letter gets --i (its position) from the script, so the stagger
     works for any word length: 0s, 0.03s, 0.06s, ... */
  transition-delay: calc(var(--i, 0) * 0.03s);
  will-change: transform;
}

/* ===== tablet + mobile ===== */

@media (max-width: 1080px) {

  /* the title block becomes a normal header above the list
     (it used to be hidden, with the old top bar standing in for it) */
  .left-container {
    position: static;
    width: 100%;
    height: auto;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0 1.25rem 1.5rem;
    overflow: visible;
  }

  .right-container {
    width: 100%;
    margin-left: 0;
    padding: 0 1.25rem 3rem;
  }

  .footer {
    display: block;
  }

  .items {
    width: 100%;
    bottom: 8em;
  }

  .overlay {
    width: 100%;
    box-shadow: none;
  }

  .roll {
    font-size: 20px;
    line-height: 40px;
    height: 40px;
    margin: 8px 0;
  }
}

/* ===== mobile nav — icon button + dropdown replaces the inline links ===== */

@media (max-width: 700px) {
  nav {
    padding: 1.25rem 1.25rem;
  }

  nav p,
  nav p a {
    font-size: 0.85rem;
  }

  .navbar {
    top: 14px;
    padding: 12px;
    border-radius: 50%;
  }

  .navbar.scrolled,
  .navbar.menu-open {
    border-radius: 50%;
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-dropdown {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    display: flex;
    flex-direction: column;
    min-width: 150px;
    background-color: #ffffff;
    border: 2px solid #000000;
    border-radius: 16px;
    box-shadow: 0px 4px 0px #000000;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
    z-index: 1001;
  }

  .nav-dropdown.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  .nav-dropdown a {
    text-decoration: none;
    color: #707070;
    font-family: "Funnel Display", sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .nav-dropdown a:hover,
  .nav-dropdown a:active {
    background-color: var(--off-white);
    color: #000000;
  }

  /* popup sits under the nav button; tighter padding, stack the details */
  :root {
    --nav-h: 5rem;
  }

  .overlay {
    padding: 1.5rem 1.25rem 2rem;
  }

  .overlay-header {
    padding: 1.25em 0;
  }

  .item-details {
    flex-direction: column;
    gap: 1.25rem;
    padding: 0.5em 0 2em 0;
  }

  .container {
    padding-top: 5.5rem;
  }
}