/* Epilogue: error pages and plain form replies, printed like the rest of the poster.
   Loaded after poster.css. Paths are absolute because these pages appear at any address. */

.msg {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100vh;
  min-height: 100svh;
}

.msg-bar,
.msg-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.85rem var(--gutter);
}

.msg-bar {
  padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
  border-bottom: 2px solid var(--toner);
}

.msg-logo {
  font-family: var(--display);
  font-variation-settings: "wdth" 62, "wght" 900;
  font-size: 1.45rem;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
}

.msg-main {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1.25rem;
  padding: clamp(2.5rem, 7vw, 5rem) var(--gutter);
}

/* The number, printed twice and slightly out of register */
.msg-code {
  position: relative;
  margin: 0 0 -0.04em -0.04em;
  font-family: var(--display);
  font-variation-settings: "wdth" 62, "wght" 900;
  font-size: clamp(9rem, 44vw, 36rem);
  line-height: 0.76;
  letter-spacing: -0.02em;
  color: var(--red);
  text-shadow: 0.035em 0.025em 0 var(--toner);
}

.msg-stamp {
  position: absolute;
  top: clamp(2rem, 9vw, 6rem);
  right: var(--gutter);
  padding: 0.45rem 1rem;
  border: 3px solid var(--red);
  background: var(--paper);
  color: var(--red);
  font-size: clamp(0.85rem, 1.6vw, 1.15rem);
  letter-spacing: 0.16em;
  transform: rotate(-8deg);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.4 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.msg-title {
  max-width: 18ch;
  font-variation-settings: "wdth" 70, "wght" 900;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  line-height: 0.9;
  text-transform: uppercase;
  text-wrap: balance;
}

/* Form replies have no number: the title is the big print */
.msg-main:not(:has(.msg-code)) .msg-title {
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 0.85;
}

.msg-text {
  max-width: 46ch;
  font-size: 1.1875rem;
  line-height: 1.5;
}

.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.msg-foot {
  padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 2px solid var(--toner);
  color: var(--grey);
}

/* Arrival: the number drops in, the stamp comes down after it */
@media (prefers-reduced-motion: no-preference) {
  .msg-code {
    animation: msg-drop 0.9s var(--ease-out) both;
  }

  .msg-stamp {
    animation: msg-stamp 0.3s cubic-bezier(0.7, 0, 0.84, 0) 0.7s both;
  }

  .msg-title,
  .msg-text,
  .msg-actions {
    animation: msg-rise 0.8s var(--ease-out) both;
  }

  .msg-title {
    animation-delay: 0.15s;
  }

  .msg-text {
    animation-delay: 0.25s;
  }

  .msg-actions {
    animation-delay: 0.35s;
  }
}

@keyframes msg-drop {
  from {
    opacity: 0;
    transform: translateY(-0.12em);
    text-shadow: 0 0 0 var(--toner);
  }
}

@keyframes msg-stamp {
  from {
    opacity: 0;
    transform: rotate(-26deg) scale(2.4);
  }
}

@keyframes msg-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@media (max-width: 640px) {
  .msg-stamp {
    top: 1.25rem;
  }

  .msg-actions .btn {
    flex: 1 1 100%;
  }
}

/* ---------- Text pages: privacy notice, unsubscribe ---------- */

.doc {
  width: 100%;
  max-width: 48rem;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(3rem, 7vw, 5rem);
}

.doc-title {
  font-variation-settings: "wdth" 62, "wght" 900;
  font-size: clamp(3.5rem, 13vw, 8.5rem);
  line-height: 0.82;
  text-transform: uppercase;
}

.doc-meta {
  margin: 1rem 0 2rem;
  color: var(--red);
}

.doc-title + .doc-lead {
  margin-top: 1.5rem;
}

.doc-lead {
  margin-bottom: 2.5rem;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-variation-settings: "wdth" 100, "wght" 500;
  line-height: 1.4;
}

.doc h2 {
  margin: 2.75rem 0 0.8rem;
  padding-top: 0.8rem;
  border-top: 2px solid var(--toner);
  font-variation-settings: "wdth" 75, "wght" 850;
  font-size: 1.6rem;
  line-height: 1;
  text-transform: uppercase;
}

.doc p,
.doc li,
.doc dd {
  max-width: 62ch;
}

.doc p + p,
.doc ul + p,
.doc dl + p {
  margin-top: 0.9em;
}

.doc a:not(.btn) {
  text-decoration-color: var(--red);
}

.doc-facts {
  border-top: 1px solid rgba(15, 15, 14, 0.25);
}

.doc-facts div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.35rem 1.25rem;
  padding-block: 0.8rem;
  border-bottom: 1px solid rgba(15, 15, 14, 0.25);
}

.doc-facts dt {
  padding-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-list {
  margin: 0.75rem 0;
  padding-left: 1.25rem;
  list-style: square;
}

.doc-list li::marker {
  color: var(--red);
}

.doc-list li + li {
  margin-top: 0.35rem;
}

.doc-form {
  margin: 0 0 2.5rem;
}

.doc-back {
  margin-top: 3rem;
}

.msg-foot a {
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .msg-foot a:hover {
    text-decoration: underline;
  }
}

@media (max-width: 640px) {
  .doc-facts div {
    grid-template-columns: minmax(0, 1fr);
  }
}

.msg-logo {
  color: var(--red);
}

.msg-logo svg,
.msg-logo img {
  display: block;
  width: auto;
  height: 1.2rem;
}
