/* Countersign card */
.cs-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: center;
  margin-top: clamp(56px, 7vw, 110px);
}
.cs-intro {
  display: grid;
  gap: 18px;
  align-content: center;
}
.cs-intro h3 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(44px, 5vw, 84px);
  line-height: 0.88;
}
.cs-intro h3 em {
  font-family: var(--f-serif);
  text-transform: none;
  font-size: 0.9em;
}
.cs-intro p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  max-width: 38ch;
  opacity: 0.85;
}
.cs-hello {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-ink);
  color: var(--accent);
  border-radius: 999px;
  padding: 16px 24px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: csIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.cs-hello span {
  transition: transform 0.4s;
}
.cs-hello:hover span {
  transform: translateX(5px);
}
@keyframes csIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.cs-card {
  position: relative;
  margin: 0;
  background: #f4ead9;
  color: #1d130d;
  border-radius: 6px;
  padding: clamp(22px, 3vw, 44px) clamp(22px, 3.4vw, 52px) clamp(18px, 2.4vw, 30px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 40px 80px -30px rgba(19, 11, 7, 0.55),
    0 12px 24px -12px rgba(19, 11, 7, 0.35);
  transform: rotate(-1.2deg);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.cs-card::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(29, 19, 13, 0.18);
  border-radius: 3px;
  pointer-events: none;
}
.cs-row {
  position: relative;
}
.cs-author .c-sign {
  margin: 0;
  width: 100%;
  transform: none;
}
.cs-author .c-sign path {
  fill: #1d130d;
  stroke: #1d130d;
}
.cs-line {
  display: block;
  height: 1px;
  background: rgba(29, 19, 13, 0.45);
  margin-top: 4px;
}
.cs-cap {
  display: block;
  margin-top: 8px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f5848;
}
.cs-reader {
  margin-top: clamp(22px, 3vw, 40px);
}
#csPad {
  display: block;
  width: 100%;
  height: clamp(110px, 12vw, 170px);
  touch-action: none;
  cursor: crosshair;
}
.cs-x {
  position: absolute;
  left: 0;
  bottom: 30px;
  font-size: 26px;
  line-height: 1;
  color: #a3521c;
  pointer-events: none;
}
.cs-ph {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(20px, 2vw, 28px);
  color: rgba(29, 19, 13, 0.28);
  pointer-events: none;
  transition: opacity 0.4s;
}
.cs-card.inked .cs-ph {
  opacity: 0;
}
.cs-act {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.cs-btn {
  border: 1px solid #1d130d;
  background: none;
  color: #1d130d;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.3s,
    color 0.3s,
    opacity 0.3s;
}
.cs-btn.solid {
  background: #1d130d;
  color: #f4ead9;
}
.cs-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.cs-btn:not(:disabled):hover {
  background: #a3521c;
  border-color: #a3521c;
  color: #f4ead9;
}
.cs-seal {
  position: absolute;
  right: clamp(18px, 3vw, 46px);
  bottom: clamp(64px, 7vw, 96px);
  width: clamp(96px, 10vw, 140px);
  opacity: 0;
  transform: scale(2.4) rotate(-40deg);
  pointer-events: none;
  filter: drop-shadow(0 10px 14px rgba(19, 11, 7, 0.45));
}
.cs-seal svg {
  display: block;
  width: 100%;
  height: auto;
}
.cs-stamp {
  position: absolute;
  left: clamp(22px, 3.4vw, 52px);
  bottom: clamp(18px, 2.4vw, 30px);
  padding: 9px 14px;
  border: 1.5px solid #a3521c;
  color: #a3521c;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transform: rotate(-6deg) scale(1.6);
  opacity: 0;
  border-radius: 3px;
}
.cs-hello-g {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  animation: csIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.cs-hello-g[hidden] {
  display: none;
}
.cs-copy {
  background: none;
  border: 0;
  padding: 6px 0;
  color: inherit;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  opacity: 0.85;
}
.cs-copy:hover {
  opacity: 1;
}
.cs-ok {
  flex-basis: 100%;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  min-height: 1em;
  color: var(--accent-ink);
}
.contact .cs-card .cs-stamp {
  opacity: 0;
}
.contact .cs-card.sealed .cs-stamp {
  animation: csStamp 0.5s 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) forwards;
}
.cs-card.sealed {
  transform: rotate(-1.2deg) translateY(-2px);
}
.cs-card.sealed .cs-seal {
  animation: csSeal 0.9s cubic-bezier(0.3, 1.6, 0.5, 1) forwards;
}
.cs-card.sealed .cs-stamp {
  animation: csStamp 0.5s 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) forwards;
}
.cs-card.sealed .cs-act {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.cs-card.thud {
  animation: csThud 0.35s 0.32s;
}
@keyframes csSeal {
  0% {
    opacity: 0;
    transform: scale(2.4) rotate(-40deg);
  }
  60% {
    opacity: 1;
    transform: scale(0.92) rotate(-8deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(-10deg);
  }
}
@keyframes csStamp {
  to {
    opacity: 0.95;
    transform: rotate(-6deg) scale(1);
  }
}
@keyframes csThud {
  0%,
  100% {
    transform: rotate(-1.2deg);
  }
  40% {
    transform: rotate(-1.2deg) scale(0.985) translateY(3px);
  }
}
@media (max-width: 900px) {
  .cs-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .cs-card {
    transform: none;
  }
  .cs-card.sealed {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cs-card.sealed .cs-seal {
    animation: none;
    opacity: 1;
    transform: rotate(-10deg);
  }
  .cs-card.sealed .cs-stamp {
    animation: none;
    opacity: 0.95;
    transform: rotate(-6deg);
  }
  .cs-card.thud {
    animation: none;
  }
}
