@font-face {
  font-family: 'jellyScript';
  src: url('fonts/jellyScript.otf') format('opentype');
}

html {
  font-size: clamp(9px, 1.8vh, 26px);
}

body {
  font-family: 'Inconsolata', monospace;
  font-size: 1rem;
  background: #e6e6e6;
  color: #000;
  line-height: 1.8;
  margin: 0;
  padding: 2rem;
  height: 100vh;
  overflow: hidden;
}

.word-sequence-wrapper {
  width: 100%;
  height: 100%;
}

.word-sequence-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25em;
}

.word-english {
  font-family: 'Inconsolata', monospace;
  font-size: 1rem;
}

.word-jelly {
  font-family: 'JellyScript', cursive; /* your custom jellyfish font */
  font-size: 1.2rem;
}
  
#content {
  max-width: 40rem; /* ~720px, better for readability */
  margin: var(--content-margin-top, 10vh) auto var(--content-margin-bottom, 5vh);
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

a {
  color: blue;
  display: inline;
  text-decoration: underline;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

video.autoplay-video {
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
}

.media-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
  justify-content: center;
}

.media-grid video,
.media-grid img {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.video-container {
  display: block;
  max-width: 100%;
  width: 80%;
  margin: 2rem auto;
  overflow: hidden;
  border: none;
  box-shadow: none;
}

@keyframes scrollLeft {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

.subtitle {
  position: absolute;
  white-space: nowrap;
  overflow: visible;
  pointer-events: none;
  font-size: 1rem;
  color: #e6e6e6;
  text-shadow: 1px 1px 3px #000;
  animation-name: scrollLeft;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  will-change: transform;
}

.top-subtitle {
  top: 5px;
  left: 0;
}

.bottom-subtitle {
  bottom: 5px;
  left: 0;
}

.em {
  font-style: italic;
  color: #000;
  background-color: #e6e6e6;
}

.text-block {
  margin: 0.5em 0;
  width: 100%;
}

.content-image {
  position: relative;
  opacity: 0;
  transition: opacity 1.7s ease-in-out;
  will-change: transform;

  /* Ensure horizontal centering */
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.content-image.visible {
  opacity: 1;
}

.preserve-whitespace {
  white-space: pre-wrap;
}

.animated-image {
  max-width: 1000px;
  transform: translate(-50%, -50%);
  position: absolute;
  pointer-events: none;
}

.circular-animated-image {
  position: absolute;
  display: block;
  pointer-events: none;
  transform-origin: center center;
}

#animation-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none; /* so clicks pass through */
  z-index: 1000;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.squiggle-container path {
  fill: none;
  stroke: black;
  stroke-width: 4;
}

#background-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none; /* allow clicks through */
}

#background-layer img {
  position: absolute;
  max-width: 100%;
  will-change: transform;
}

#restartButton {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  font-family: 'Inconsolata', monospace;
  font-size: 1rem;
  padding: 0.5rem 0.8rem;
  background: rgba(230,230,230,0.9);
  border: 1px solid #000;
  border-radius: 0.3rem;
  cursor: pointer;
  z-index: 1000;
  display: none; /* hidden by default */
}

#speed-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 6px;
  height: 120px;
  background: rgba(155, 155, 155, 0.2);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#speed-indicator .speed-bar {
  height: 100%;
  width: 100%;
  background: rgba(155, 155, 155, 0.7);
  transform-origin: bottom center;
}

