@font-face {
  font-family: "Terminal Grotesque";
  src: url("assets/fonts/terminal-grotesque.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --yod-yellow: #ffd60d;
  --black: #000000;
  --page-bg: #444444;
  --nav-h-desktop: 2.875rem;
  --nav-h-mobile: 4rem;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--page-bg);
  -webkit-user-select: none;
  user-select: none;
  font-size: 16px;
}

body.overlay-open {
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: manipulation;
}

canvas:active {
  cursor: grabbing;
}

/* --------------------------
   NAV
--------------------------- */

.yod-nav {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  height: var(--nav-h-desktop);
  background: var(--yod-yellow);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  box-sizing: border-box;
  z-index: 30;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-left {
  min-width: 0;
  flex: 0 1 auto;
  gap: 0.55rem;
}

.brand-trigger,
.about-close,
.sound-toggle {
  touch-action: manipulation;
}

.brand-trigger {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 0.55rem;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--black);
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
}

.brand-sub {
  padding-top: 0.05rem;
  display: inline-block;
  align-self: center;
  font-family: "degular-mono", monospace;
  font-size: 0.55rem;
  line-height: 1.05;
  text-align: left;
  white-space: nowrap;
}

.brand-main {
  position: relative;
  display: inline-block;
  font-family: "Terminal Grotesque", sans-serif;
  font-size: 1.2rem;
  line-height: 1;
}

.brand-sub-break {
  display: inline;
}

.brand-underline {
  position: absolute;
  left: 0;
  bottom: -0.3125rem;
  width: 100%;
  height: 0.125rem;
  background: var(--black);
  transform: scaleX(1);
  transform-origin: left center;
  transition:
    height 180ms ease,
    bottom 180ms ease,
    opacity 180ms ease;
  pointer-events: none;
  opacity: 1;
}

.brand-trigger:hover .brand-main .brand-underline,
.brand-trigger:focus-visible .brand-main .brand-underline {
  height: 0.16rem;
  bottom: -0.34rem;
  opacity: 0.92;
}

.brand-trigger:focus-visible {
  outline: none;
}

.sound-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  flex: 0 0 auto;
}

.sound-toggle-icon {
  width: 1.45rem;
  height: 1.45rem;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.sound-icon-off {
  display: none;
}

.sound-toggle.is-muted .sound-icon-on {
  display: none;
}

.sound-toggle.is-muted .sound-icon-off {
  display: block;
}

.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Terminal Grotesque", sans-serif;
  font-size: 1.2rem;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.nav-right {
  font-family: "degular-mono", monospace;
  font-size: 0.875rem;
  line-height: 1;
  white-space: nowrap;
  font-weight: 600;
}

/* --------------------------
   OVERLAY
--------------------------- */

.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.about-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.about-backdrop {
  position: absolute;
  inset: 0;
  background-image: url("assets/images/about-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.5);
  transform: scale(1.03);
  opacity: 0;
  transition: transform 420ms ease, opacity 260ms ease;
}

.about-overlay.is-open .about-backdrop {
  transform: scale(1);
  opacity: 1;
}

.about-panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 4rem 1.5rem 2rem;
}

.about-close {
  position: absolute;
  top: 4rem;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  z-index: 2;
  transform: translateX(-50%) scale(0.96);
  transition: opacity 220ms ease, transform 280ms ease;
}

.about-close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.1rem;
  height: 0.14rem;
  background: var(--yod-yellow);
  border-radius: 999px;
  transform-origin: center;
}

.about-close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.about-close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.about-overlay.is-open .about-close {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.about-close:hover {
  transform: translateX(-50%) scale(1.06);
}

.about-content {
  position: relative;
  z-index: 2;
  width: min(100%, 30rem);
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  text-align: center;
  color: var(--yod-yellow);
  padding: 0 1rem;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(0.625rem) scale(0.985);
  transition: opacity 240ms ease, transform 320ms ease;
}

.about-overlay.is-open .about-content {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.about-title {
  margin: 0 0 1.5rem;
  font-family: "Terminal Grotesque", sans-serif;
  font-size: clamp(2.2rem, 4vw, 2.75rem);
  line-height: 0.95;
  font-weight: 300;
}

.about-body {
  font-family: "dejanire-text", serif;
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.28;
}

.about-body p {
  margin: 0 0 1.625rem;
}

.about-body em {
  font-style: italic;
}

.about-body a {
  color: var(--yod-yellow);
  text-decoration: underline;
  text-underline-offset: 0.08em;
  z-index: 200;
}

.about-body a:hover {
  opacity: 0.9;
}

/* --------------------------
   MOBILE
--------------------------- */

@media (max-width: 700px) {
  html {
    font-size: 15px;
  }

  .yod-nav {
    height: var(--nav-h-mobile);
    padding: 0 0.9rem;
  }

  .nav-left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.5rem;
  }

  .brand-trigger {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    column-gap: 0.42rem;
  }

  .brand-sub {
    display: inline-block;
    align-self: center;
    min-width: 2rem;
    width: auto;
    font-size: 0.5rem;
    line-height: 1.04;
    white-space: normal;
  }

  .brand-main {
    font-size: 1.72rem;
    line-height: 0.88;
  }

  .brand-sub-break {
    display: block;
  }

  .brand-underline {
    bottom: -0.38rem;
    height: 0.13rem;
  }

  .brand-trigger:hover .brand-main .brand-underline,
  .brand-trigger:focus-visible .brand-main .brand-underline {
    bottom: -0.4rem;
    height: 0.17rem;
  }

  .sound-toggle {
    display: inline-flex;
    width: 2.3rem;
    height: 2.3rem;
  }

  .sound-toggle-icon {
    width: 1.25rem;
    height: 1.25rem;
  }

  .nav-center {
    display: none;
  }

  .nav-right {
    flex: 0 0 auto;
    font-size: 0.82rem;
    line-height: 1;
    text-align: right;
  }

  .about-panel {
    padding: 4.5rem 1rem 2rem;
  }

  .about-close {
    top: 1.75rem;
    width: 2.25rem;
    height: 2.25rem;
  }

  .about-close span {
    width: 1.9rem;
  }

  .about-content {
    width: 100%;
    max-width: 22rem;
    max-height: calc(100vh - 7rem);
    padding: 0 0.75rem;
  }

  .about-title {
    font-size: clamp(2.4rem, 9vw, 3rem);
    margin-bottom: 1.2rem;
  }

  .about-body {
    font-size: 0.95rem;
    line-height: 1.2;
  }

  .about-body p {
    margin-bottom: 1.35rem;
  }
}