/* ==========================================================================
   ARCHIVE — Closing Statement & Footer
   The final section. A closing statement that also serves as the site footer.
   It sits on a warm paper wash to separate it from the section above. Its
   navigation reuses existing in-page anchors (#disciplines, #stories,
   #generations), so no new routes are added.
   ========================================================================== */

.closing {
  position: relative;
  background-color: var(--color-bg-subtle);
  color: var(--color-text-main);
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-3xl) var(--space-xl);
}

.closing__inner {
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Top identity row — wordmark left, edition marker right
   -------------------------------------------------------------------------- */
.closing__identity {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-subtle);
}

/* Matches the navbar wordmark treatment (Garet light, tight tracking). */
.closing__wordmark {
  font-family: var(--font-wordmark);
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--color-text-main);
}

.closing__edition {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

/* --------------------------------------------------------------------------
   Main closing message
   -------------------------------------------------------------------------- */
.closing__message {
  padding: var(--space-3xl) 0;
}

.closing__headline {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5.2vw, 4.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--color-text-main);
  margin-bottom: var(--space-lg);
}

.closing__lede {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  max-width: 54ch;
  margin-bottom: var(--space-xl);
}

/* --------------------------------------------------------------------------
   Footer bar
   -------------------------------------------------------------------------- */
.closing__footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-md);
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-lg);
}

.closing__copyright,
.closing__note,
.closing__totop {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

.closing__copyright {
  justify-self: start;
}

.closing__note {
  justify-self: center;
  text-align: center;
}

.closing__totop {
  justify-self: end;
  color: var(--color-text-main);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.closing__totop:hover {
  color: var(--color-highlight);
}

.closing__totop:focus-visible {
  outline: 2px solid var(--color-text-main);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Display wordmark — large ARCHIVE mark closing the page.
   Reuses the site wordmark component (Garet light, uppercase, tight tracking)
   at display scale. Intentionally left un-revealed so it is always visible at
   the very bottom of the page (same reason as the footer bar above).
   -------------------------------------------------------------------------- */
.closing__displaymark {
  margin-top: var(--space-2xl);
  text-align: center;
  line-height: 0.85;
}

/* Doubled class raises specificity so the small-screen size override on
   .closing__wordmark (below) cannot shrink the display mark. */
.closing__wordmark.closing__wordmark--display {
  display: block;
  font-size: clamp(4rem, 17vw, 14rem);
  letter-spacing: -0.03em;
  line-height: 0.85;
}

/* --------------------------------------------------------------------------
   Reveal rhythm — gentle stagger down the closing page
   -------------------------------------------------------------------------- */
html.js .closing__message[data-reveal] {
  transition-delay: 80ms;
}

/* The footer is a structural row, not editorial content, so it is always
   visible. This also avoids the reveal-on-scroll dead zone at the very bottom
   of the page, where a -10% bottom rootMargin can leave a final element
   permanently unrevealed on tall viewports. */

/* --------------------------------------------------------------------------
   Responsiveness
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .closing {
    padding: var(--space-2xl) var(--space-lg);
  }

  .closing__message {
    padding: var(--space-2xl) 0;
  }

  .closing__headline {
    font-size: clamp(2rem, 7vw, 2.75rem);
  }
}

@media (max-width: 560px) {
  .closing__footer {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: var(--space-sm);
  }

  .closing__copyright,
  .closing__note,
  .closing__totop {
    justify-self: start;
  }

  .closing__note {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .closing {
    padding: var(--space-xl) var(--space-md);
  }

  .closing__wordmark {
    font-size: 1.15rem;
  }
}
