.folio {
  max-width: 70rem;
  margin: clamp(3rem, 7vw, 5rem) auto 0;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--gold);
  background: var(--surface);
  box-shadow:
    inset 0 0 0 5px var(--surface),
    inset 0 0 0 6px color-mix(in srgb, var(--gold) 55%, transparent),
    var(--shadow-sm);
  text-align: left;
}

.folio-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.75rem);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--gold-text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.folio-body {
  display: grid;
  gap: 1.25rem;
}

.verse {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  line-height: 1.7;
  text-wrap: pretty;
}

.verse::first-letter {
  float: left;
  padding: 0.07em 0.02em 0 0;
  color: var(--gold-text);
  font-size: 3.5em;
  font-weight: 500;
  line-height: 0.8;
}

.word {
  margin: 0;
  padding: 0 0.08em;
  border: 0;
  border-radius: 4px;
  background: none;
  color: inherit;
  font: inherit;
  line-height: 1.35;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.word sup {
  margin-left: 0.12em;
  color: var(--gold-text);
  font-family: var(--sans);
  font-size: 0.5em;
  font-weight: 600;
  line-height: 0;
}

.word:hover,
.word.is-active {
  background: var(--gold-soft);
}

.word:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.note {
  position: relative;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.note-kind {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.45rem;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.note-num {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-text);
  letter-spacing: 0;
}

.note.is-open .note-num {
  background: var(--gold);
  color: #1b2232;
}

.note-body p {
  margin: 0 0 0.4rem;
}

.note-body .note-src {
  margin: 0;
  color: var(--gold-text);
  font-size: 0.85rem;
  font-weight: 600;
}

.gk {
  color: var(--ink);
  font-family: var(--greek);
  font-size: 1.1em;
}

.folio-hint {
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.folio:not(.is-interactive) .folio-hint {
  display: none;
}

.folio-sources {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.folio-sources a {
  color: inherit;
}

@media (min-width: 960px) {
  .folio-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1fr);
    align-items: start;
    gap: 2rem 3rem;
  }

  .verse {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin: 0;
  }

  .note {
    padding-top: 0;
    border-top: 0;
  }

  #note-1 {
    grid-area: 1 / 1;
  }

  #note-2 {
    grid-area: 2 / 1;
  }

  #note-3 {
    grid-area: 1 / 3;
  }

  #note-4 {
    grid-area: 2 / 3;
  }

  #note-5 {
    grid-area: 3 / 3;
  }

  .note-left {
    text-align: right;
  }

  .note-left .note-kind {
    flex-direction: row-reverse;
  }

  .note::after {
    content: "";
    position: absolute;
    top: 0.8rem;
    width: 2.25rem;
    border-top: 1px solid var(--gold);
  }

  .note-left::after {
    right: -2.6rem;
  }

  .note-right::after {
    left: -2.6rem;
  }
}
