/* Card library, card pages, legal pages and 404 (almanac theme). */

.lib,
.card-page,
.legal,
.nf {
  padding-block: clamp(2.5rem, 2rem + 3vw, 5rem) clamp(4rem, 3rem + 4vw, 7rem);
}

/* Library */
.lib-head {
  max-width: 46rem;
  margin-bottom: 3rem;
}
.lib-head h1,
.card-copy h1,
.legal h1,
.nf h1 {
  font-size: clamp(2.6rem, 1.6rem + 4vw, 4.75rem);
  line-height: 1;
}
.lib-head p:not(.eyebrow) {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  color: var(--ink-2);
}
.lib-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}
.lib-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}
.lib-nav a:hover {
  background: var(--ink);
  color: var(--bg);
}
.lib-group {
  padding-top: 3rem;
  margin-top: 3rem;
  border-top: 2px solid var(--ink);
}
.lib-group-head {
  display: grid;
  gap: 0.5rem 3rem;
  margin-bottom: 2rem;
}
@media (min-width: 52em) {
  .lib-group-head {
    grid-template-columns: auto 1fr;
    align-items: baseline;
  }
}
.lib-group-head p {
  color: var(--ink-2);
  max-width: 34rem;
}
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(8.5rem, 42%), 1fr));
  gap: 2rem 1.25rem;
}
.lib-grid a {
  display: grid;
  gap: 0.25rem;
  text-decoration: none;
}
.lib-grid .tcard {
  margin-bottom: 0.6rem;
  transition: translate 0.3s var(--ease-out), rotate 0.3s var(--ease-out);
}
.lib-grid a:hover .tcard,
.lib-grid a:focus-visible .tcard {
  translate: 0 -0.35rem;
  rotate: -1.5deg;
}
.lib-grid a:active .tcard {
  scale: 0.97;
}
.lib-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.15;
}
.lib-kw {
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.lib-cta {
  display: grid;
  justify-items: start;
  gap: 1rem;
  margin-top: 5rem;
  padding: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  background: var(--mustard);
}
.lib-cta h2 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
}

/* Card page */
.card-grid {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 56em) {
  .card-grid {
    grid-template-columns: 22rem minmax(0, 1fr);
    gap: 5rem;
    align-items: start;
  }
  .card-figure {
    position: sticky;
    top: 2rem;
  }
}
.card-figure {
  width: min(22rem, 72vw);
  margin-inline: auto;
  rotate: -1.5deg;
}
.card-copy .eyebrow a {
  text-decoration: none;
}
.card-kw {
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.card-meaning {
  margin-top: 1.5rem;
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem);
  line-height: 1.55;
  max-width: 38rem;
}
.card-boxes {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}
@media (min-width: 40em) {
  .card-boxes {
    grid-template-columns: 1fr 1fr;
  }
}
.card-boxes > div {
  padding: 1.25rem 1.4rem;
  background: var(--bg-2);
  border-top: 2px solid var(--ink);
}
.card-boxes h2 {
  font-family: var(--font-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red-deep);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.card-boxes p::first-letter {
  text-transform: uppercase;
}
.card-boxes p {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.3;
}
.card-cta {
  display: grid;
  justify-items: start;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
}
.card-pn {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: end;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.card-pn a {
  display: grid;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.2;
}
.card-pn a span {
  font-family: var(--font-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.card-pn [rel="next"] {
  text-align: right;
}
.card-pn .card-all {
  font-family: var(--font-text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* Legal */
.legal-in {
  --max: 46rem;
}
.legal-note {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--mustard-soft);
  font-size: 0.9375rem;
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-block: 2rem 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.legal-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink-2);
}
.legal-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.35em;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}
.prose {
  font-size: 1.0625rem;
  line-height: 1.7;
}
.prose > * + * {
  margin-top: 1rem;
}
.prose h2 {
  margin-top: 2.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.15;
}
.prose h3 {
  margin-top: 1.75rem;
  font-size: 1.125rem;
}
.prose ul,
.prose ol {
  padding-left: 1.4rem;
}
.prose li + li {
  margin-top: 0.4rem;
}
.prose a {
  color: var(--red-deep);
  text-underline-offset: 0.2em;
}
.prose > p:first-child {
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* 404 */
.nf-in > * {
  max-width: 40rem;
}
.nf p:not(.eyebrow) {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  color: var(--ink-2);
}
.nf-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}

/* Gen Z versions (/pull/cards/, /pull/terms/ ...): same structure, riso surfaces. */
.t-z .eyebrow {
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-stretch: 120%;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--blue);
}
.t-z .eyebrow a {
  text-decoration: none;
}
.t-z :is(.lib-head, .card-copy, .legal, .nf) h1 {
  font-size: clamp(2.4rem, 1.2rem + 4.4vw, 4.75rem);
  line-height: 0.95;
}
.t-z .lib-nav a {
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  font-family: var(--font-display);
  font-stretch: 115%;
  font-weight: 750;
}
.t-z .lib-nav a:hover {
  background: var(--yellow);
  color: var(--ink);
}
.t-z .lib-group {
  border-top: 2.5px solid var(--ink);
}
.t-z .lib-grid .tcard {
  outline: 2px solid var(--ink);
  --card-shadow: 4px 4px 0 var(--ink);
}
.t-z .lib-name {
  font-stretch: 115%;
  font-weight: 800;
  font-size: 1.0625rem;
}
.t-z .lib-cta {
  background: var(--pink);
  border: 2.5px solid var(--ink);
  border-radius: 1.5rem;
  box-shadow: 8px 8px 0 var(--ink);
}
.t-z .lib-cta .zbtn {
  background: var(--yellow);
}
.t-z .card-figure .tcard {
  border: 3px solid var(--white);
  outline: 2.5px solid var(--ink);
  box-shadow: 8px 9px 0 var(--ink);
}
.t-z .card-kw {
  text-transform: none;
  letter-spacing: 0;
}
.t-z .card-line {
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  max-width: 34rem;
  background: var(--pink);
  border: 2.5px solid var(--ink);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 750;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem);
  line-height: 1.2;
  rotate: -1deg;
}
.t-z .card-boxes > div {
  background: var(--yellow);
  border: 2.5px solid var(--ink);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}
.t-z .card-boxes h2 {
  font-family: var(--font-display);
  font-stretch: 118%;
  font-weight: 750;
  font-size: 0.875rem;
  letter-spacing: 0;
  text-transform: lowercase;
  color: var(--blue);
}
.t-z .card-boxes p {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 1.125rem;
}
.t-z .card-cta,
.t-z .card-pn {
  border-top: 2px dashed oklch(21% 0.035 285 / 0.3);
}
.t-z .card-pn a {
  font-stretch: 112%;
  font-weight: 750;
}
.t-z .card-pn a span {
  color: var(--blue);
  text-transform: lowercase;
}
.t-z .legal-note {
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 0.85rem;
}
.t-z .legal-nav {
  border-bottom: 2px dashed oklch(21% 0.035 285 / 0.3);
}
.t-z .legal-nav a[aria-current="page"] {
  text-decoration-color: var(--pink);
  text-decoration-thickness: 3px;
}
.t-z .prose h2 {
  font-stretch: 115%;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.t-z .prose a {
  color: var(--blue-deep);
}
