/*
 * THE LEGEND (js/legend.js) · class prefix "lg-"
 *
 * An open 1970s gatefold: PLATE V from a star atlas on the left page
 * (navy chart paper, conic grid, zebra degree border, one star per
 * member joined into a V), the legend in five verses on the right page,
 * and a torn rumor column from the Valley Gazette taped on underneath.
 */

.lg {
  --lg-navy: #13224f;
  --lg-navy-2: #0b1637;
  --lg-print: #f4e8cc; /* the chart's cream "ink" */
  --lg-dim: #b9c4df; /* secondary chart text (8:1 on the navy) */
  --lg-news: #ece4cf;
  position: relative;
}

/* ------------------------------------------------------------ gatefold */
.lg-fold {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--paper);
  border-radius: 4px;
  rotate: -0.35deg;
  box-shadow:
    var(--shadow-soft),
    0 0 0 1px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 250, 235, 0.3);
}
@media (min-width: 900px), (min-width: 700px) and (max-height: 520px) {
  .lg-fold {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
}
.lg-fold--single {
  grid-template-columns: minmax(0, 1fr) !important;
}

/* ------------------------------------------------------- the plate page */
.lg-plate {
  position: relative;
  min-width: 0;
  padding: clamp(8px, 1.3vw, 14px);
}
/* the fold: shade into the spine (right edge side by side, bottom edge stacked) */
.lg-plate::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 22px;
  background: linear-gradient(to top, rgba(60, 30, 15, 0.26), transparent);
  pointer-events: none;
}
.lg-plate__sheet {
  --focus: var(--mustard);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 1.5vw, 1rem);
  height: 100%;
  padding: clamp(10px, 2.1vw, 24px);
  color: var(--lg-print);
  background:
    radial-gradient(ellipse 80% 60% at 50% 42%, #1b2e69, rgba(27, 46, 105, 0) 70%),
    linear-gradient(180deg, var(--lg-navy), var(--lg-navy-2));
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 0 50px rgba(0, 0, 0, 0.35);
  overflow: clip;
}
.lg-plate__strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(244, 232, 204, 0.32);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.lg-plate__no {
  color: var(--mustard);
}
.lg-plate__hint {
  color: var(--lg-dim);
  font-weight: 400;
  letter-spacing: 0.12em;
}

/* ---------------------------------------------------------- the chart */
.lg-chart {
  position: relative;
  width: 100%;
  max-width: 36rem;
  margin: auto;
  container-type: inline-size;
}
/* landscape phones: the whole chart fits on one screen */
@media (orientation: landscape) and (max-height: 520px) {
  .lg-chart {
    max-width: max(17rem, 100vh - 2.5rem);
    max-width: max(17rem, 100svh - 2.5rem);
  }
}
.lg-chart__field {
  position: relative;
  aspect-ratio: 1 / 1;
}
.lg-chart__svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.lg-paper {
  fill: rgba(5, 10, 30, 0.18);
}
.lg-milky {
  fill: rgba(160, 190, 255, 0.055);
}
.lg-milky--core {
  fill: rgba(200, 215, 255, 0.05);
}
.lg-g {
  fill: none;
  stroke: rgba(185, 200, 240, 0.13);
  stroke-width: 1.1;
}
.lg-g--maj {
  stroke: rgba(185, 200, 240, 0.27);
  stroke-width: 1.7;
}
.lg-ecl {
  fill: none;
  stroke: rgba(244, 179, 60, 0.4);
  stroke-width: 2;
  stroke-dasharray: 1 9;
  stroke-linecap: round;
}
.lg-field circle {
  fill: var(--lg-print);
}
.lg-dbl {
  fill: var(--lg-print);
}
.lg-dbl-bar {
  stroke: var(--lg-print);
  stroke-width: 1.8;
}
.lg-cluster {
  fill: none;
  stroke: rgba(244, 232, 204, 0.55);
  stroke-width: 1.8;
  stroke-dasharray: 2 6;
}
.lg-galaxy {
  fill: rgba(244, 232, 204, 0.16);
  stroke: rgba(244, 232, 204, 0.6);
  stroke-width: 1.6;
}
.lg-bound {
  fill: rgba(244, 179, 60, 0.035);
  stroke: rgba(244, 232, 204, 0.42);
  stroke-width: 2;
  stroke-dasharray: 16 7 3 7;
}
.lg-arcname {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 31px;
  letter-spacing: 12px;
  fill: rgba(244, 232, 204, 0.62);
}
.lg-num {
  font-family: var(--font-mono);
  font-size: 22px;
  fill: var(--lg-dim);
  paint-order: stroke;
  stroke: var(--lg-navy);
  stroke-width: 6px;
  stroke-linejoin: round;
}
.lg-frame {
  fill: none;
  stroke: var(--lg-print);
  stroke-width: 2.4;
  opacity: 0.85;
}
.lg-frame--in {
  stroke-width: 1.5;
}
.lg-zebra rect {
  fill: var(--lg-print);
  opacity: 0.82;
}

/* the V itself, and the mask that draws it */
.lg-seg {
  fill: none;
  stroke: var(--lg-print);
  stroke-width: 3.4;
  stroke-opacity: 0.8;
  transition: stroke 0.5s, stroke-width 0.5s, stroke-opacity 0.5s;
}
.lg-seg.is-dashed {
  stroke-dasharray: 12 10;
  stroke-opacity: 0.62;
}
.lg-chart.is-traced .lg-seg {
  stroke: #fff6dc;
  stroke-width: 4.6;
  stroke-opacity: 1;
}
.lg-reveal {
  fill: none;
  stroke: #fff;
  stroke-width: 20;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 0;
}
.lg-chart.is-drawing .lg-reveal {
  stroke-dashoffset: 1;
}
.lg-chart.is-drawing .lg-reveal.is-drawn {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--lg-seg, 0.5s) cubic-bezier(0.45, 0.05, 0.35, 1);
}
.lg-chart.is-instant .lg-reveal.is-drawn {
  transition: none;
}

/* coordinate numbers only where they can be read */
@container (max-width: 459px) {
  .lg-nums {
    display: none;
  }
}

/* ----------------------------------------------------------- the stars */
.lg-stars {
  position: absolute;
  inset: 0;
}
.lg-star {
  --core: calc(var(--s, 1) * 15px);
  --off: calc(var(--core) * 0.55 + 9px);
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
@supports (width: 1cqw) {
  .lg-star {
    --core: calc(var(--s, 1) * clamp(11px, 3.7cqw, 21px));
  }
}
.lg-star:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0;
}
.lg-star__glyph {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transition: opacity 0.35s;
}
.lg-star__glyph > span {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  translate: -50% -50%;
}
.lg-star__glow {
  width: calc(var(--core) * 3.8);
  height: calc(var(--core) * 3.8);
  background: radial-gradient(circle, var(--c) 0, transparent 66%);
  opacity: 0.5;
  animation: lg-twinkle var(--tw, 5s) ease-in-out var(--td, 0s) infinite alternate;
}
.lg-star__core {
  width: var(--core);
  height: var(--core);
  background: radial-gradient(circle, #fffaf0 0 26%, var(--c) 64%);
  box-shadow: 0 0 0 2px rgba(11, 22, 55, 0.9), 0 0 calc(var(--core) * 0.7) var(--c);
  transition: scale 0.3s var(--ease-bounce);
}
/* the four-point glint, the 70s album-cover kind */
.lg-star__core::before,
.lg-star__core::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--core) * 3);
  height: calc(var(--core) * 0.3);
  translate: -50% -50%;
  background: linear-gradient(90deg, transparent, var(--c) 32%, #fffaf0 50%, var(--c) 68%, transparent);
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
}
.lg-star__core::after {
  rotate: 90deg;
}
.lg-star__ring {
  width: calc(var(--core) * 2.1 + 12px);
  height: calc(var(--core) * 2.1 + 12px);
  border: 1.5px solid var(--c);
  opacity: 0;
  scale: 0.7;
  transition: opacity 0.25s, scale 0.35s var(--ease-bounce);
}
.lg-star.is-active .lg-star__ring {
  opacity: 0.95;
  scale: 1;
}
.lg-star__burst {
  width: calc(var(--core) * 2);
  height: calc(var(--core) * 2);
  border: 2px solid var(--c);
  opacity: 0;
}
.lg-star.is-lit .lg-star__burst {
  animation: lg-burst 1s ease-out both;
}

/* Josh: a variable star. Dashed, faint, flickers, under review. */
.lg-star.is-pending .lg-star__glow {
  opacity: 0.22;
  animation-name: lg-twinkle-faint;
}
.lg-star.is-pending .lg-star__core {
  width: calc(var(--core) * 1.55);
  height: calc(var(--core) * 1.55);
  background: radial-gradient(circle, #fffaf0 0 12%, var(--c) 24%, transparent 30%);
  border: 2px dashed var(--c);
  box-shadow: none;
  animation: lg-flicker 6.5s steps(1, end) infinite;
}
.lg-star.is-pending .lg-star__core::before,
.lg-star.is-pending .lg-star__core::after {
  display: none;
}

@media (hover: hover) {
  .lg-star:hover .lg-star__core {
    scale: 1.18;
  }
  .lg-star:hover .lg-star__name {
    color: #fff;
  }
}

/* while tracing (by hand), the stars wait their turn */
.lg-chart.is-drawing:not(.is-auto) .lg-star.is-pre .lg-star__glyph {
  opacity: 0.32;
}

/* labels: Bayer letter + name, then the epithet. Always on. */
.lg-star__label {
  position: absolute;
  top: 50%;
  display: grid;
  gap: 0.08em;
  width: max-content;
  white-space: nowrap;
  text-align: left;
  line-height: 1.14;
  translate: 0 -50%;
  color: var(--lg-print);
  text-shadow: 0 0 3px var(--lg-navy), 0 0 8px var(--lg-navy), 0 0 14px var(--lg-navy);
}
.lg-star--r .lg-star__label {
  left: calc(50% + var(--off));
}
.lg-star--l .lg-star__label {
  right: calc(50% + var(--off));
  text-align: right;
  justify-items: end;
}
/* the first star's label rides a line higher, clear of its neighbor across the V */
.lg-star--r.lg-star--hi .lg-star__label {
  translate: 0 -76%;
}
.lg-star--l.lg-star--lo .lg-star__label {
  translate: 0 -34%;
}
.lg-star--br .lg-star__label {
  left: calc(50% + var(--off) * 0.8);
  top: calc(50% + 2px);
  translate: none;
}
.lg-star__title {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.lg-star__bayer {
  margin-right: 0.28em;
  font-style: italic;
  font-weight: 600;
  color: var(--c);
}
.lg-star__name {
  transition: color 0.2s;
}
.lg-star__epithet {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  color: var(--lg-dim);
}
@supports (width: 1cqw) {
  .lg-star__title {
    font-size: clamp(12.5px, 3.25cqw, 17px);
  }
  .lg-star__epithet {
    font-size: clamp(12px, 2.75cqw, 14.5px);
  }
}
@container (max-width: 320px) {
  .lg-star {
    --off: calc(var(--core) * 0.45 + 5px);
  }
}
.lg-star.is-active .lg-star__name {
  text-decoration: underline 2px;
  text-decoration-color: var(--c);
  text-underline-offset: 0.2em;
}

/* --------------------------------------------- the star's catalogue card */
.lg-card {
  display: grid;
  margin: 0.15rem 3px 3px;
  padding: 0.7rem 0.9rem 0.75rem;
  background: rgba(8, 15, 40, 0.72);
  border: 1px solid rgba(244, 232, 204, 0.55);
  box-shadow: 0 0 0 3px rgba(8, 15, 40, 0.72), 0 0 0 4px rgba(244, 232, 204, 0.28);
}
.lg-entry {
  grid-area: 1 / 1;
  display: grid;
  align-content: start;
  gap: 0.12rem;
  min-width: 0;
  visibility: hidden;
}
.lg-entry.is-on {
  visibility: visible;
}
.lg-entry__desig {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lg-dim);
}
.lg-entry__bayer {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--c);
}
.lg-entry__name {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1.05;
  color: var(--c);
}
.lg-entry__epithet {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--lg-print);
}
.lg-entry__mag {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--lg-print);
}
.lg-entry__mag-k {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mustard);
}

/* atlas legend for magnitudes, tucked in the corner of a roomy chart */
.lg-key {
  position: absolute;
  right: 7.6%;
  bottom: 7%;
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lg-dim);
  background: rgba(8, 15, 40, 0.6);
  border: 1px solid rgba(244, 232, 204, 0.3);
  pointer-events: none;
}
.lg-key i {
  display: block;
  width: calc(var(--s, 1) * 11px);
  height: calc(var(--s, 1) * 11px);
  border-radius: 50%;
  background: var(--lg-print);
}
.lg-key i.is-var {
  width: 11px;
  height: 11px;
  background: none;
  border: 1.5px dashed var(--lg-print);
}

@container (min-width: 460px) {
  .lg-card {
    padding: 0.75rem 1rem 0.8rem;
  }
  .lg-entry {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 1.1rem;
  }
  .lg-entry__desig {
    grid-column: 1 / -1;
  }
  .lg-entry__name,
  .lg-entry__epithet {
    grid-column: 1;
  }
  .lg-entry__mag {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: stretch;
    display: grid;
    align-content: center;
    margin: 0.2rem 0 0;
    padding-left: 1rem;
    border-left: 1px solid rgba(244, 232, 204, 0.3);
  }
  .lg-entry__mag-k {
    display: block;
  }
  .lg-key {
    display: flex;
  }
}

/* ---------------------------------------------------- title + trace */
.lg-plate__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.9rem 1.25rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(244, 232, 204, 0.32);
}
.lg-plate__titles {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 15rem;
}
.lg-plate__name {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0.005em;
  color: var(--lg-print);
  text-shadow: var(--stripes);
  padding-bottom: 0.12em;
}
.lg-plate__gloss {
  max-width: 28rem;
  font-size: var(--fs-sm);
  font-style: italic;
  line-height: 1.45;
  color: var(--lg-dim);
}
.lg-trace {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.5rem 1.1rem 0.5rem 0.85rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--ink);
  background: var(--mustard);
  border: 0;
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--rust);
  transition: translate 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.lg-trace__icon {
  display: inline-block;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--rust-ink);
}
.lg-trace.is-busy {
  cursor: progress;
}
.lg-trace.is-busy .lg-trace__icon {
  animation: lg-spin 1.3s linear infinite;
}
@media (hover: hover) {
  .lg-trace:not(.is-busy):hover {
    translate: -2px -2px;
    box-shadow: 5px 5px 0 var(--rust);
  }
}
.lg-trace:active {
  translate: 1px 1px;
  box-shadow: 1px 1px 0 var(--rust);
}

/* -------------------------------------------------------- the verses */
.lg-page {
  --focus: var(--ink);
  position: relative;
  min-width: 0;
  padding: clamp(1.6rem, 3.6vw, 3rem) clamp(1.15rem, 3vw, 2.5rem) clamp(2.2rem, 4vw, 3.2rem);
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 100%, rgba(236, 122, 44, 0.14), transparent 40%),
    linear-gradient(180deg, transparent 70%, rgba(78, 38, 23, 0.06));
  border-radius: 0 4px 4px 0;
}
/* the spine, from this side */
.lg-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 26px;
  background: linear-gradient(to bottom, rgba(60, 30, 15, 0.2), rgba(255, 250, 235, 0.12) 3px, transparent);
  pointer-events: none;
}
/* a 70s rainbow in the corner */
.lg-page__band {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(4.5rem, 9vw, 6.5rem);
  aspect-ratio: 1;
  background: radial-gradient(
    circle at 100% 0,
    transparent 0 34%,
    var(--brown) 34% 47%,
    var(--rust) 47% 60%,
    var(--orange) 60% 73%,
    var(--mustard) 73% 86%,
    transparent 86%
  );
  border-top-right-radius: 4px;
  pointer-events: none;
}
.lg-told {
  width: fit-content;
  max-width: calc(100% - 4.5rem);
  margin: 0 0 clamp(1rem, 2.2vw, 1.4rem);
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  line-height: 1;
  color: var(--rust-ink);
  rotate: -2deg;
}
.lg-told::after {
  /* a pen swash under the line */
  content: "";
  display: block;
  height: 8px;
  margin-top: 0.1em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5 C 40 1, 80 7, 120 4 S 180 2, 198 5' fill='none' stroke='%239a3219' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E")
    0 0 / 100% 100% no-repeat;
}
.lg-verses {
  max-width: 40rem;
  display: grid;
  gap: clamp(0.85rem, 1.7vw, 1.2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.lg-verse {
  display: grid;
  grid-template-columns: 2.3rem minmax(0, 1fr);
  column-gap: 0.7rem;
  align-items: baseline;
}
.lg-verse__num {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-align: right;
  color: var(--rust-ink);
}
.lg-verse__text {
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  line-height: 1.6;
}
.lg-verse--first .lg-verse__text::first-letter {
  float: left;
  margin: 0.06em 0.1em 0 -0.03em;
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 900;
  font-size: 4.35em;
  line-height: 0.8;
  color: var(--rust);
  text-shadow: 0.04em 0.04em 0 var(--mustard), 0.08em 0.08em 0 var(--brown);
}
.lg-verse--last {
  margin-top: 0.2rem;
}
.lg-verse--last .lg-verse__text {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 800;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.22;
  letter-spacing: -0.005em;
}
.lg-verse--last .lg-verse__num {
  font-size: 1.15rem;
}
.lg-hl {
  color: inherit;
  padding: 0 0.06em;
  background: linear-gradient(transparent 56%, rgba(244, 179, 60, 0.9) 56% 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* the line after verse V: the next gig (or the tapes) */
.lg-page__next {
  margin-top: clamp(1.15rem, 2.4vw, 1.6rem);
  padding-left: 3rem;
}
.lg-cta {
  display: inline-grid;
  gap: 0.15rem;
  max-width: 100%;
  padding: 0.65rem 1.1rem 0.75rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--mustard);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ink);
  rotate: -1deg;
  transition: translate 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.lg-cta__kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust-ink);
}
.lg-cta__when,
.lg-cta__what {
  display: block;
}
.lg-cta__dot {
  display: none;
}
.lg-cta__main {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 800;
  font-size: clamp(1.05rem, 1.7vw, 1.22rem);
  line-height: 1.25;
}
.lg-cta__arrow {
  display: inline-block;
  transition: translate 0.2s var(--ease-out);
}
@media (hover: hover) {
  .lg-cta:hover {
    translate: -2px -2px;
    box-shadow: 6px 6px 0 var(--rust);
  }
  .lg-cta:hover .lg-cta__arrow {
    translate: 4px 0;
  }
}
.lg-cta:active {
  translate: 1px 1px;
  box-shadow: 2px 2px 0 var(--ink);
}

/* side by side: the spine runs down the middle */
@media (min-width: 900px), (min-width: 700px) and (max-height: 520px) {
  .lg-plate::after {
    inset: 0 0 0 auto;
    width: 26px;
    height: auto;
    background: linear-gradient(to left, rgba(60, 30, 15, 0.3), transparent);
  }
  .lg-page::before {
    inset: 0 auto 0 0;
    width: 30px;
    height: auto;
    background: linear-gradient(to right, rgba(60, 30, 15, 0.22), rgba(255, 250, 235, 0.14) 3px, transparent);
  }
  .lg-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
@media (min-width: 700px) and (max-height: 520px) {
  .lg-page {
    padding-inline: 1.25rem;
  }
}

/* ------------------------------------------------- the Valley Gazette */
.lg-gz-wrap {
  position: relative;
  z-index: 1;
  width: min(94%, 64rem);
  margin: -0.85rem 1.5% 0 auto;
  rotate: 0.7deg;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.42));
}
.lg-gz {
  --focus: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 14.5rem) minmax(0, 1fr);
  gap: 0 1.7rem;
  padding: 1.7rem 1.9rem 1.8rem;
  color: var(--ink);
  background:
    radial-gradient(rgba(30, 20, 36, 0.06) 0.7px, transparent 1.2px) 0 0 / 4px 4px,
    linear-gradient(170deg, rgba(255, 252, 240, 0.5), transparent 45%, rgba(170, 140, 80, 0.12)),
    var(--lg-news);
}
.lg-gz__mast {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding-right: 1.5rem;
  border-right: 3px double var(--ink);
}
.lg-gz__paper {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 0, "WONK" 0;
  font-weight: 900;
  font-size: clamp(1.5rem, 2.3vw, 1.95rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
}
.lg-gz__dept {
  padding-block: 0.4rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-block: 2px solid var(--ink);
}
.lg-gz__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.lg-gz__stamp {
  --tilt: -8deg;
  justify-self: start;
  margin-top: 0.7rem;
  font-size: 0.95rem;
}
.lg-gz__tales {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 3 12rem;
  column-gap: 2.2rem;
  column-rule: 1px solid rgba(30, 20, 36, 0.32);
}
.lg-tale {
  break-inside: avoid;
  padding-bottom: 1rem;
}
.lg-tale__text {
  font-size: 1rem;
  line-height: 1.5;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.lg-tale__lead {
  position: relative;
  display: inline-block;
  margin-right: 0.15em;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 0, "WONK" 0;
  font-weight: 900;
  font-size: 0.86em;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
/* somebody circled it in red pen */
.lg-tale__lead::after {
  content: "";
  position: absolute;
  inset: -0.3em -0.5em -0.25em;
  border: 2px solid var(--rust);
  border-radius: 50%;
  rotate: -4deg;
  opacity: 0;
  scale: 0.8;
  transition: opacity 0.2s, scale 0.3s var(--ease-bounce);
  pointer-events: none;
}
@media (hover: hover) {
  .lg-tale:hover .lg-tale__lead::after {
    opacity: 0.9;
    scale: 1;
  }
}
.lg-gz__tape {
  position: absolute;
  z-index: 2;
  top: -0.75rem;
  width: 6.5rem;
  height: 1.55rem;
  background: rgba(246, 230, 196, 0.8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  clip-path: polygon(0 8%, 4% 0, 9% 10%, 14% 2%, 86% 0, 91% 9%, 96% 1%, 100% 10%, 100% 92%, 95% 100%, 90% 90%, 85% 100%, 12% 100%, 7% 91%, 3% 100%, 0 92%);
  pointer-events: none;
}
.lg-gz__tape--l {
  left: 2.25rem;
  rotate: -7deg;
}
.lg-gz__tape--r {
  right: 2.75rem;
  rotate: 5deg;
}

@media (max-width: 760px) {
  .lg-gz-wrap {
    width: 100%;
    margin: -0.5rem 0 0;
    rotate: 0.45deg;
  }
  .lg-gz {
    grid-template-columns: minmax(0, 1fr);
    padding: 1.6rem 1.15rem 1.5rem;
  }
  .lg-gz__mast {
    padding: 0 0 0.9rem;
    margin-bottom: 0.9rem;
    border-right: 0;
    border-bottom: 3px double var(--ink);
  }
  .lg-gz__stamp {
    position: absolute;
    right: 0.2rem;
    top: 0.1rem;
    margin: 0;
    font-size: 0.8rem;
    --tilt: 9deg;
  }
  .lg-gz__paper {
    padding-right: 6.5rem;
  }
  .lg-gz__tales {
    columns: auto;
  }
  .lg-tale + .lg-tale {
    padding-top: 0.85rem;
    border-top: 1px dotted rgba(30, 20, 36, 0.45);
  }
  .lg-tale {
    padding-bottom: 0.85rem;
  }
  .lg-gz__tape {
    width: 5rem;
  }
}

/* --------------------------------------------------------- phones */
@media (max-width: 560px) {
  .lg-fold {
    rotate: -0.2deg;
  }
  .lg-page__next {
    padding-left: 0;
  }
  .lg-verse {
    grid-template-columns: 1.9rem minmax(0, 1fr);
    column-gap: 0.55rem;
  }
  .lg-plate__strip {
    letter-spacing: 0.14em;
  }
  .lg-trace {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
@media (max-width: 400px) {
  .lg-trace {
    gap: 0.4rem;
    padding-inline: 0.7rem;
    letter-spacing: 0.05em;
  }
}
@media (max-width: 480px) {
  .lg-gz__stamp {
    position: static;
    justify-self: end;
    margin-top: 0.35rem;
    --tilt: -6deg;
  }
  .lg-gz__paper {
    padding-right: 0;
  }
}

/* --------------------------------------------- motion + off-screen */
@keyframes lg-twinkle {
  from {
    opacity: 0.34;
    scale: 0.84;
  }
  to {
    opacity: 0.62;
    scale: 1.1;
  }
}
@keyframes lg-twinkle-faint {
  from {
    opacity: 0.12;
    scale: 0.8;
  }
  to {
    opacity: 0.3;
    scale: 1.05;
  }
}
@keyframes lg-flicker {
  0% { opacity: 1; }
  7% { opacity: 0.42; }
  9% { opacity: 1; }
  37% { opacity: 0.7; }
  40% { opacity: 1; }
  62% { opacity: 0.35; }
  63% { opacity: 0.9; }
  65% { opacity: 0.5; }
  67% { opacity: 1; }
}
@keyframes lg-burst {
  from {
    opacity: 0.95;
    scale: 0.5;
  }
  to {
    opacity: 0;
    scale: 3.4;
  }
}
@keyframes lg-spin {
  to {
    rotate: 360deg;
  }
}
.lg-chart.lg-off .lg-star__glow,
.lg-chart.lg-off .lg-star__core {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .lg-star__glow,
  .lg-star.is-pending .lg-star__core,
  .lg-star.is-lit .lg-star__burst,
  .lg-trace.is-busy .lg-trace__icon {
    animation: none;
  }
  .lg-star__glow {
    opacity: 0.5;
  }
  .lg-star.is-pending .lg-star__glow {
    opacity: 0.22;
  }
}
