/* ==========================================================================
   Contact page. A postcard left on the desk: one of Zhen's film stills
   face-up behind, the writing side on top, stamped and postmarked.
   ========================================================================== */

body.contact { background: var(--paper-sunk); }

.desk {
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(4rem, 9vw, 7rem);
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Head ---------- */
.desk__head { text-align: center; margin-bottom: clamp(3.5rem, 9vw, 6.5rem); }
.desk__kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.25rem;
}
.desk__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem);
  letter-spacing: -0.01em;
}

/* ---------- Postcard ---------- */
.post {
  --card: #FFFDF8;
  position: relative;
  width: min(100%, 780px);
  aspect-ratio: 3 / 2;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.post__front,
.post__back {
  position: absolute;
  inset: 0;
  margin: 0;
  box-shadow:
    0 1px 2px rgba(19, 18, 16, .06),
    0 12px 32px -8px rgba(19, 18, 16, .18);
}

/* The photo side, lying underneath and askew. A white border, like a print. */
.post__front {
  background: var(--card);
  padding: 10px;
  transform: translate(-7%, -9%) rotate(-5deg);
}
.post__front img { width: 100%; height: 100%; object-fit: cover; }

/* The writing side, on top. Faint grain so it reads as card, not screen. */
.post__back {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: var(--card);
  background-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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transform: rotate(1.5deg);
  padding: clamp(1.25rem, 4%, 2.25rem);
}

/* Left half: the note */
.post__note {
  padding-right: clamp(1rem, 4%, 2rem);
  border-right: 1px solid var(--rule-firm);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9em;
}
.post__sign::before { content: "— "; color: var(--ink-3); }
.post__sign { color: var(--accent-ink); }

/* Right half: stamp, postmark, address lines */
.post__address {
  position: relative;
  padding-left: clamp(1rem, 4%, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Perforated edge: a mask of small circles bitten out of every side. */
.stamp {
  position: absolute;
  top: 0;
  right: 0;
  width: 26%;
  aspect-ratio: 4 / 5;
  padding: 6px;
  background: #fff;
  --perf: radial-gradient(circle 3px, #0000 96%, #000) -5px -5px / 10px 10px round;
  -webkit-mask: var(--perf), linear-gradient(#000 0 0) content-box;
          mask: var(--perf), linear-gradient(#000 0 0) content-box;
  filter: drop-shadow(0 1px 1px rgba(19, 18, 16, .15));
  transform: rotate(3deg);
}
.stamp img { width: 100%; height: 100%; object-fit: cover; }
.stamp__value {
  position: absolute;
  left: 11px;
  bottom: 9px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 4px rgba(0, 0, 0, .5);
}

/* Postmark: ink rings and cancel waves, laid over the stamp's corner. */
.postmark {
  position: absolute;
  top: 8%;
  right: 14%;
  width: 62%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  opacity: .72;
  mix-blend-mode: multiply;
  transform: rotate(-9deg);
  pointer-events: none;
}
.postmark text {
  fill: var(--accent);
  stroke: none;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
}
.postmark .postmark__date { font-size: 9px; letter-spacing: 0.06em; }

/* Address lines, ruled like the back of a real card */
.lines li {
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  align-items: baseline;
  gap: 0.5rem;
  padding-block: 0.7rem 0.4rem;
  border-bottom: 1px solid var(--rule-firm);
  font-size: clamp(0.8rem, 0.7rem + 0.35vw, 0.95rem);
  min-width: 0;
}
.lines__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.lines a {
  text-decoration: none;
  color: var(--ink);
  overflow-wrap: anywhere;
  transition: color .18s ease;
}
.lines a:hover { color: var(--accent); }
.lines span:not(.lines__label) { color: var(--ink-2); }

/* ---------- Copy button ---------- */
.copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule-firm);
  padding: 0.25rem 0;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.copy:hover { color: var(--accent); border-bottom-color: var(--accent); }
.copy.is-done { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---------- Arrival ----------
   The card slides onto the desk, then the postmark lands on it. */
@keyframes lay-back  { from { opacity: 0; transform: translateY(40px) rotate(-3deg); } }
@keyframes lay-front { from { opacity: 0; transform: translate(-7%, calc(-9% + 40px)) rotate(-12deg); } }
@keyframes stamp-in  { from { opacity: 0; transform: rotate(-9deg) scale(1.35); } }

.post__front { animation: lay-front .9s cubic-bezier(.2, .7, .3, 1) both; }
.post__back  { animation: lay-back  .9s cubic-bezier(.2, .7, .3, 1) .15s both; }
.postmark    { animation: stamp-in  .35s cubic-bezier(.3, 1.4, .5, 1) 1.05s both; }

/* ---------- Small screens ----------
   The card stands up: note above, address below. The photo tucks behind. */
@media (max-width: 640px) {
  .post { aspect-ratio: auto; }
  .post__back {
    position: relative;
    grid-template-columns: 1fr;
    padding: 1.5rem 1.25rem 1.25rem;
  }
  .post__front { transform: translate(-3%, -4%) rotate(-4deg); animation-name: lay-front-sm; }
  .post__note {
    border-right: 0;
    border-bottom: 1px solid var(--rule-firm);
    padding: 0 0 1.5rem;
  }
  .post__address { padding: 1.25rem 0 0; }
  .stamp { position: relative; top: auto; right: auto; align-self: flex-end; width: 28%; margin-bottom: 0.5rem; }
  .postmark { top: 0.5rem; right: 12%; width: 72%; }
}
@keyframes lay-front-sm { from { opacity: 0; transform: translate(-3%, calc(-4% + 40px)) rotate(-10deg); } }
