img.header-image {
  display: block;
  margin: 0 auto 1.5em auto;
  max-width: 25%;
  height: auto;
}

.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #444;
  color: #fff;
  font-family: 'EB Garamond', serif;
  font-size: 0.95em;
  padding: 0.6em 0.8em;
  border-radius: 4px;
  white-space: pre-wrap;
  width: max-content;
  max-width: 320px;
  z-index: 1000;
  transition: opacity 0.5s ease-in-out;
  pointer-events: none;
  text-align: left;
  font-style: normal;
}

.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

body {
  font-family: 'EB Garamond', serif;
  background-color: #FCFAFD;
  color: #111;
  line-height: 1.7;
  max-width: 720px;
  margin: 60px auto;
  padding: 0 20px;
  font-size: 1.2em;
  overflow-x: hidden;
  position: relative;
}

h1 {
  text-align: center;
  font-size: 2em;
  letter-spacing: 0.05em;
  line-height: 1em;
  margin-bottom: 0.75em;
}

h2 {
  text-align: center;
  font-size: 1.7em;
  letter-spacing: 0.05em;
  line-height: 1.1em;
  margin-top: 0;
  margin-bottom: 0.75em;
}


.project-intro {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  text-align: center;
  font-size: 1.05em;
  color: #444;
  margin: 0 0 2.5em 0;
  line-height: 1.8;
}

#poem-section p,
#interview-section > p {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
}

.section-break {
  text-align: center;
  margin: 4em 0;
  color: #bbb;
  font-size: 1.4em;
}

/* Interview chapter headings */
.section-title {
  font-size: 1.3em;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.03em;
  margin-top: 4em;
  margin-bottom: 1.5em;
  padding-top: 2em;
  border-top: 1px solid #ddd;
}

/* Formal introduction block at the start of the interview */
.introduction {
  font-style: italic;
  margin: 1em 0;
  text-align: center;
  padding: 1em 2em;
  border-top: 2px dotted darkred;
  border-bottom: 2px dotted darkred;
}

/* Narrative transitions between interview sections */
.interlude {
  font-style: italic;
  text-align: center;
  margin: 3em 0;
  padding: 0 2em;
  color: #777;
  font-size: 0.95em;
}

.interviewer,
.ai-poet {
  margin: 2em 0;
  position: relative;
}

.interviewer::before {
  content: "INTERVIEWER";
  display: block;
  text-align: center;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.05em;
  margin-bottom: 0.6em;
}

.ai-poet::before {
  content: "AI POET";
  display: block;
  text-align: center;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.05em;
  margin-bottom: 0.6em;
}

.highlight {
  background-color: #fff3cd;
  transition: background-color 0.3s ease;
}

#playButton {
  display: block;
  margin: 0 auto 2em auto;
  padding: 0.5em 1.5em;
  font-family: 'EB Garamond', serif;
  font-size: 1.1em;
  background-color: #fff;
  border: 2px solid #111;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#playButton:hover {
  background-color: #111;
  color: #fff;
}

#poemcontrols {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5em 0;
  flex-wrap: wrap;
}

.poem-modes {
  display: flex;
  gap: 0.5rem;
}

#poemcontrols button {
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  background: transparent;
  color: #111;
  border: 1px solid #111;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
  border-radius: 0;
  box-shadow: none;
}

#poemcontrols button:hover {
  background-color: #111;
  color: #fff;
}

.poem-download {
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  color: #999;
  border: 1px solid #ccc;
  padding: 0.6rem 1.25rem;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
}

.poem-download:hover {
  color: #111;
  border-color: #111;
}

#controls {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1000;
  padding: 0.5em 0;
  border-bottom: 1px solid #ccc;
  gap: 0.5em;
  margin-bottom: 2em;
}

#controls button, #controls select {
  margin: 0.25em;
  padding: 0.4em 0.8em;
  font-size: 1em;
  font-family: 'EB Garamond', serif;
  background-color: #fff;
  border: 1px solid #111;
  border-radius: 4px;
  cursor: pointer;
  min-width: 80px;
  box-sizing: border-box;
}

#controls button:hover, #controls select:hover {
  background-color: #111;
  color: #fff;
}

.speed-button {
  margin: 0 0.25em;
  padding: 0.4em 0.8em;
  font-size: 1em;
  font-family: 'EB Garamond', serif;
  background-color: #fff;
  border: 1px solid #111;
  border-radius: 4px;
  cursor: pointer;
}

.speed-button:hover {
  background-color: #111;
  color: #fff;
}

.speed-button.active {
  background-color: #888 !important;
  color: #fff;
}

footer {
  font-family: 'EB Garamond', serif;
  text-align: center;
  font-size: 0.85rem;
  color: #999;
  padding: 4rem 2rem;
  margin-top: 4rem;
}

#poem-container {
  display: block;
  white-space: pre-wrap;
  color: #111;
  font-family: monospace;
  font-size: 1rem;
  width: 80%;
  padding: 2% 5%;
  margin: 0 auto 2rem auto;
  min-height: 2rem;
  background-color: #fff;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.poem-line {
  line-height: 1.5;
}

.glitch-char {
  color: darkred;
}

.system-line {
  color: #d55;
  text-align: right;
  width: 100%;
}

#poem-container::after {
  content: ">";
  animation: blink 1s step-start infinite;
  color: #a11;
  font-family: monospace;
}

@keyframes blink {
  50% { opacity: 0.1; }
}

.annotation {
  width: 150px;
  font-family: 'Caveat', cursive;
  font-size: 0.8em;
  color: #a44;
  padding: 0.5em;
  margin: 0;
  z-index: 10;
}

.annotation[data-tilt="-2"] { transform: rotate(-3deg); }
.annotation[data-tilt="-1"] { transform: rotate(-2deg); }
.annotation[data-tilt="0"]  { transform: rotate(1deg); }
.annotation[data-tilt="1"]  { transform: rotate(2deg); }
.annotation[data-tilt="2"]  { transform: rotate(3deg); }

@media (max-width: 1024px) {
  .annotation {
    display: none;
  }
}
