/* PAPER — contact: "Let's talk." A letter taped to the table.
   JS hooks styled here (plumbing lives in app.js):
   .contact-type-btn(.active) · #contactOrgField (inline display none|flex) ·
   .contact-submit (innerHTML swapped to <span class="btn-inner">Sending...</span>, [disabled]) ·
   #contactSuccess(.show) · .merch-hp honeypot */

#contact { overflow-x: clip; }
@supports not (overflow: clip) { #contact { overflow: hidden; } }
#contact .contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); gap: clamp(40px, 6vw, 100px); align-items: start; }

/* ---------- left: the invitation ---------- */
#contact .contact-title { font-size: clamp(104px, 15.6vw, 240px); line-height: .97; margin: 14px 0 clamp(22px, 2.6vw, 36px) -.02em; }
#contact .contact-title > span { display: block; }
#contact .contact-intro { max-width: 30em; }

#contact .contact-list { margin-top: clamp(26px, 3vw, 40px); max-width: 520px; border-top: 1.5px solid var(--pp-ink); }
#contact .contact-list li { border-bottom: 1.5px dashed var(--pp-line); }
#contact .contact-list li:last-child { border-bottom: 1.5px solid var(--pp-ink); }
#contact .contact-list a {
  position: relative; display: grid; grid-template-columns: 8.2em minmax(0, 1fr); align-items: baseline; gap: 4px 18px;
  padding: 15px 34px 15px 2px; text-decoration: none; color: var(--pp-ink-soft); font-size: 15px; line-height: 1.45;
}
#contact .contact-list b { font-size: clamp(20px, 1.9vw, 25px); font-weight: 400; transition: color .25s; }
#contact .contact-list a::after {
  content: ''; position: absolute; right: 4px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  background: var(--pp-red); opacity: 0; transform: translateX(-10px); transition: opacity .25s, transform .4s var(--pp-ease);
  clip-path: polygon(0 40%, 58% 40%, 58% 12%, 100% 50%, 58% 88%, 58% 60%, 0 60%);
}
#contact .contact-list a:hover b, #contact .contact-list a:focus-visible b { color: var(--pp-red); }
#contact .contact-list a:hover::after, #contact .contact-list a:focus-visible::after { opacity: 1; transform: none; }

/* ---------- right: the sheet ---------- */
#contact .contact-sheet-wrap { position: relative; padding-top: 22px; }
#contact .contact-sheet {
  position: relative; rotate: 1.4deg;
  background: var(--pp-paper-hi) url(../../images/paper/paper.webp); background-size: 300px;
  box-shadow: var(--pp-shadow-3); padding: clamp(30px, 3.6vw, 52px) clamp(22px, 3.4vw, 50px) clamp(28px, 3.4vw, 46px);
}
#contact .contact-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: clamp(18px, 2vw, 26px); }
#contact .contact-dear { font-size: clamp(30px, 3.3vw, 44px); text-transform: none; rotate: -2deg; transform-origin: left center; }
#contact .contact-sparks { position: static; flex: none; width: 44px; height: 44px; margin-top: -6px; }

/* inquiry type — rubber stamps; the chosen one gets a red brush stroke */
#contact .contact-type-label { font-size: 11px; letter-spacing: .22em; margin-bottom: 12px; }
#contact .contact-type-selector { display: flex; flex-wrap: wrap; gap: 12px 14px; margin-bottom: clamp(24px, 2.6vw, 34px); }
#contact .contact-type-btn {
  position: relative; isolation: isolate; min-height: 46px; padding: .5em .95em .42em;
  font-family: var(--pp-f-display); font-size: clamp(18px, 1.6vw, 22px); line-height: 1; letter-spacing: .05em; text-transform: uppercase;
  color: var(--pp-red); border: 2.5px solid var(--pp-red); border-radius: 6px; rotate: -2deg;
  transition: color .2s .08s, border-color .2s, transform .35s var(--pp-ease);
}
#contact .contact-type-btn:nth-child(2) { rotate: 1.5deg; }
#contact .contact-type-btn:nth-child(3) { rotate: -1deg; }
#contact .contact-type-btn:nth-child(4) { rotate: 2deg; }
#contact .contact-type-btn::before {
  content: ''; position: absolute; inset: -6px -9px; z-index: -1; background: var(--pp-red); clip-path: var(--pp-brush-b);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .28s cubic-bezier(.6, 0, .9, .4);
}
#contact .contact-type-btn:hover { transform: translateY(-2px); }
#contact .contact-type-btn.active { color: #fff; border-color: transparent; animation: contact-press .5s var(--pp-ease-back); }
#contact .contact-type-btn.active::before { transform: scaleX(1); transition: transform .5s var(--pp-ease); }
@keyframes contact-press { 0% { transform: scale(1.16); } 100% { transform: scale(1); } }

/* the form — write on the lines */
#contact .contact-form { display: grid; gap: clamp(18px, 2vw, 24px); }
#contact .contact-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 2vw, 28px); }
#contact .contact-field { flex-direction: column; min-width: 0; }  /* JS shows #contactOrgField with display:flex */
#contact .contact-field input, #contact .contact-field textarea {
  background: transparent; border: 0; border-bottom: 2px solid var(--pp-ink); border-radius: 0; box-shadow: none;
  padding: 8px 2px 9px; min-height: 46px; transition: border-color .2s, box-shadow .2s;
}
#contact .contact-field input:focus, #contact .contact-field textarea:focus { transform: none; border-color: var(--pp-red); box-shadow: none; }
#contact .contact-field input:focus { border-bottom-width: 3px; padding-bottom: 8px; }
#contact .contact-field textarea {
  min-height: 170px; line-height: 34px; padding-top: 0; padding-bottom: 0; border-bottom: 0;
  background-image: linear-gradient(transparent 31px, var(--pp-ink) 31px, var(--pp-ink) 33px, transparent 33px); background-size: 100% 34px; background-attachment: local;
}
#contact .contact-field textarea:focus { box-shadow: none; background-image: linear-gradient(transparent 31px, var(--pp-red) 31px, var(--pp-red) 33px, transparent 33px); }
#contact #contactOrgField { animation: contact-org .55s var(--pp-ease); }
@keyframes contact-org { from { opacity: 0; transform: translateY(-10px); } }

#contact .contact-submit { margin-top: 6px; font-size: clamp(16px, 1.35vw, 19px); min-height: 60px; }
#contact .contact-submit .btn-inner { display: inline-flex; align-items: center; justify-content: center; gap: .6em; }

/* sent! — a rubber stamp */
#contact .contact-success {
  display: none; justify-self: center; margin-top: 4px; text-align: center;
  font-family: var(--pp-f-display); font-size: clamp(20px, 2vw, 27px); line-height: 1.05; letter-spacing: .04em; text-transform: uppercase;
  color: var(--pp-red); border: 3px solid var(--pp-red); border-radius: 6px; padding: .42em .7em .32em; rotate: -3deg;
}
#contact .contact-success.show { display: block; animation: contact-stamp .42s cubic-bezier(.6, 0, .9, .4) both; }
@keyframes contact-stamp { from { opacity: 0; transform: scale(1.9) rotate(8deg); } }

/* honeypot stays in the DOM, never on screen */
#contact .merch-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- tablet / phone ---------- */
@media (max-width: 940px) {
  #contact .contact-grid { grid-template-columns: 1fr; gap: 56px; }
  #contact .contact-title { font-size: clamp(96px, 27vw, 220px); }
  #contact .contact-list { max-width: none; }
  #contact .contact-sheet { rotate: .8deg; max-width: 640px; margin-inline: auto; }
}
@media (max-width: 560px) {
  #contact .contact-list a { grid-template-columns: 1fr; padding-block: 13px; }
  #contact .contact-sheet { rotate: 0deg; margin-inline: -4px; }
  /* corner tapes stay on the screen: they wrap the corners instead of running off the edge of the phone */
  #contact .contact-tape.pp-tape--tl { left: -13px; top: 2px; width: 74px; height: 24px; }
  #contact .contact-tape.pp-tape--tr { right: -13px; top: 2px; width: 74px; height: 24px; }
  #contact .contact-form-row { grid-template-columns: 1fr; }
  #contact .contact-type-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  #contact .contact-type-btn { min-height: 48px; font-size: 19px; }
  #contact .contact-field textarea { min-height: 204px; }   /* six ruled lines: room to write without the box scrolling straight away */
}
