@font-face {
  font-family: "Suisse Intl";
  src: url("./fonts/SuisseIntl-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #110d11;
  --fg: #f3ead6;
  --muted: rgba(243, 234, 214, 0.68);
  --panel: rgba(19, 15, 18, 0.82);
  --line: rgba(255, 255, 255, 0.1);
  --accent: #c98c61;
  --debug-x: 50vw;
  --debug-y: 46vh;
  --debug-w: 72vw;
  --debug-h: 34vh;
  --debug-opacity: 0;
  --viewport-shadow-opacity: 0.72;
  --viewport-shadow-noise-opacity: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  font-family: "Suisse Intl", "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
  background: #191519;
  color: var(--fg);
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(222, 130, 99, 0.08), transparent 28%),
    #191519;
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms ease, visibility 320ms ease;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader {
  --loader-width: 60px;
  --loader-eye-size: calc(var(--loader-width) * 4 / 9);
  --loader-pupil-size: calc(var(--loader-eye-size) * 7 / 24);
  --loader-look-offset: calc(var(--loader-eye-size) * 5 / 16);
  --loader-blink-height: calc(var(--loader-eye-size) * 3 / 8);

  position: relative;
  width: var(--loader-width);
  display: flex;
  justify-content: space-between;
}

.loader::after,
.loader::before {
  content: "";
  display: inline-block;
  width: var(--loader-eye-size);
  height: var(--loader-eye-size);
  background-color: #f3ead6;
  background-image: radial-gradient(circle var(--loader-pupil-size), #191519 100%, transparent 0);
  background-repeat: no-repeat;
  border-radius: 50%;
  animation: eyeMove 10s infinite, blink 10s infinite;
}

@keyframes eyeMove {
  0%, 10% { background-position: 0 0; }
  13%, 40% { background-position: calc(var(--loader-look-offset) * -1) 0; }
  43%, 70% { background-position: var(--loader-look-offset) 0; }
  73%, 90% { background-position: 0 var(--loader-look-offset); }
  93%, 100% { background-position: 0 0; }
}

@keyframes blink {
  0%, 10%, 12%, 20%, 22%, 40%, 42%, 60%, 62%, 70%, 72%, 90%, 92%, 98%, 100% { height: var(--loader-eye-size); }
  11%, 21%, 41%, 61%, 71%, 91%, 99% { height: var(--loader-blink-height); }
}

#gl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

#scroll-space {
  width: 1px;
}

.chrome {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.controls {
  position: fixed;
  right: 16px;
  top: 64px;
  width: min(280px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  overflow: hidden;
}

.audio-toggle {
  --audio-wave: #bdf1fd;
  --audio-hover-text: #bdf1fd;

  position: fixed;
  top: 2px;
  right: 2px;
  z-index: 4;
  min-width: 108px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  font-family: "Suisse Intl", Arial, sans-serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: none;
}

.up-actions {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}

.up-button {
  --audio-wave: #bdf1fd;
  --audio-hover-text: #bdf1fd;

  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  font-family: "Suisse Intl", Arial, sans-serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: none;
}

.info-panel {
  position: fixed;
  top: 2px;
  left: 2px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  pointer-events: auto;
}

.info-toggle {
  display: none;
  min-width: 108px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  font-family: "Suisse Intl", Arial, sans-serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
}

.info-toggle:focus-visible {
  outline: none;
}

.info-content {
  width: 350px;
  max-width: calc(100vw - 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.info-content.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.info-content__line {
  display: block;
  width: fit-content;
  margin: 0;
  padding: 2px 6px;
  background: rgba(22, 16, 19, 0.94);
  color: var(--fg);
  font-family: "Suisse Intl", Arial, sans-serif;
  font-size: 12px;
  line-height: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

.info-content__line + .info-content__line {
  margin-top: -2px;
}

.info-content__icon {
  display: block;
  width: 23px;
  height: 23px;
  margin-top: -2px;
  opacity: 0;
  visibility: hidden;
}

.info-content__icon.is-visible {
  opacity: 1;
  visibility: visible;
}

.final-quote {
  position: absolute;
  left: 50%;
  bottom: 50vh;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(90vw, 620px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 180ms ease;
}

.final-quote.is-visible {
  opacity: 1;
}

.final-quote__line {
  display: block;
  width: fit-content;
  margin: 0;
  padding: 2px 6px;
  background: rgba(22, 16, 19, 0.94);
  color: var(--fg);
  font-family: "Suisse Intl", Arial, sans-serif;
  font-size: 12px;
  line-height: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

.final-quote__line + .final-quote__line {
  margin-top: -2px;
}

.audio-toggle:focus-visible,
.up-button:focus-visible {
  outline: none;
}

.audio-toggle__inner,
.info-toggle__inner,
.up-button__inner {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 1px;
}

.audio-toggle__text,
.info-toggle__text,
.up-button__text {
  display: inline-flex;
  align-items: center;
  color: var(--fg);
}

.audio-toggle__letter,
.info-toggle__letter,
.up-button__letter {
  display: inline-block;
  transform-origin: 0% 100%;
  will-change: transform, color;
}

.audio-toggle.is-muted {
  --audio-wave: #de8263;
}

.haptic-switch {
  display: none;
}

.controls summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.controls summary::-webkit-details-marker {
  display: none;
}

.controls__copy {
  margin: 0 14px 10px;
  width: calc(100% - 28px);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  padding: 8px 10px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.controls__grid {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.control {
  display: grid;
  gap: 4px;
}

.control__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}

.control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.control input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.control--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
}

.lens-debug {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--debug-w);
  height: var(--debug-h);
  transform: translate(calc(var(--debug-x) - 50%), calc(var(--debug-y) - 50%));
  opacity: var(--debug-opacity);
  pointer-events: none;
  z-index: 2;
}

.viewport-shadow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  box-shadow: 0 1.278px 79.852px 0 #de8263 inset;
  opacity: var(--viewport-shadow-opacity);
  transition: opacity 120ms linear;
}

.viewport-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: var(--viewport-shadow-noise-opacity);
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 320px 320px;
  mask-image: radial-gradient(circle at center, transparent 34%, black 72%, black 100%);
  -webkit-mask-image: radial-gradient(circle at center, transparent 34%, black 72%, black 100%);
  transition: opacity 120ms linear;
}

.controls.is-hidden-by-default {
  display: none;
}

@media (max-width: 800px) {
  .controls {
    top: auto;
    bottom: 12px;
    right: 12px;
    left: auto;
    width: min(260px, calc(100vw - 24px));
    max-height: 52vh;
    overflow: auto;
  }

  .audio-toggle {
    top: 2px;
    right: 2px;
  }

  .info-panel {
    top: 2px;
    left: 2px;
  }

  .info-content {
    width: 350px;
  }

  .info-content__line {
    width: fit-content;
  }

  .info-content__text {
    font-size: 14px;
  }

}

@media (max-width: 480px), ((hover: none) and (pointer: coarse) and (max-width: 932px) and (max-height: 480px)) {
  .up-button {
    position: relative;
  }

  .haptic-switch {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    clip-path: inset(0 round 0);
    cursor: pointer;
  }

  .info-content {
    width: 250px;
    max-width: 250px;
  }

  .info-content__line {
    width: fit-content;
    max-width: 250px;
  }

  .final-quote {
    width: 270px;
    max-width: 270px;
  }
}
