.contact-layout {
  color-scheme: light;
  width: min(70rem, 92%);
  margin: clamp(1.3rem, 4vw, 3.8rem) auto;
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  color: #321b1b;
  background: #fffdf8;
  border: 1px solid #dbcdc0;
  border-radius: 1.5rem;
  overflow: clip;
  box-shadow: 0 16px 42px -25px #56201b66;
}
.contact-intro {
  --mail-x: 0deg;
  --mail-y: 0deg;
  --mail-lift: 0%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.35rem;
  padding: clamp(1.65rem, 4vw, 3.5rem);
  color: #fff5df;
  background:
    radial-gradient(ellipse at 27% 98%, #af3826 0%, transparent 55%),
    linear-gradient(140deg, #330000, #551013 64%, #77201c);
}
.contact-copy { position: relative; z-index: 1; }
.contact-copy h1 {
  margin: 0;
  font-size: clamp(3.15rem, 5.1vw, 4.9rem);
  line-height: .96;
  font-weight: 700;
  letter-spacing: -.035em;
}
.contact-copy h1 em { display: block; color: #ffad86; font-weight: 700; }
.contact-copy p { margin: 1rem 0 0; max-width: 32ch; font-size: 1.18rem; line-height: 1.4; color: #fff1e1; }

.mail-scene {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(10.5rem, 16vw, 14.8rem);
  perspective: 46rem;
  pointer-events: none;
}
.mail-piece {
  position: relative;
  width: min(78%, 15rem);
  aspect-ratio: 1.78;
  transform: rotateX(calc(5deg + var(--mail-x))) rotateY(calc(-8deg + var(--mail-y))) rotateZ(-8deg);
  transition: transform .26s ease-out;
  filter: drop-shadow(0 18px 12px #26030066);
}
.mail-lining, .mail-pocket { position: absolute; inset: 0; }
.mail-lining {
  inset: -26% 0 0;
  background: linear-gradient(160deg,#f9956d,#9d321f 72%);
  clip-path: polygon(0 33%,45% 1%,50% 0,55% 1%,100% 33%,100% 100%,0 100%);
  border-radius: 4%;
}
.mail-note {
  position: absolute;
  left: 7%;
  bottom: 24%;
  width: 86%;
  height: 98%;
  overflow: hidden;
  border-radius: 5% 5% 2% 2%;
  background: linear-gradient(120deg,#fff9e9,#ffe5bd);
  box-shadow: inset 0 0 0 1px #fff4dc;
  transform: translateY(var(--mail-lift)) rotate(4deg);
  transition: transform .32s ease-out;
}
.mail-wordmark { position: absolute; left: 7%; top: 13%; width: 61%; aspect-ratio: 703/247; }
.mail-wordmark img { position: absolute; inset: 0; width: 100%; height: 100%; filter: grayscale(1) invert(1); mix-blend-mode: multiply; }
.mail-stamp {
  position: absolute;
  top: 10%; right: 6%; width: 16%; aspect-ratio: .83;
  display: grid; place-items: center;
  background: #fed2ae; color: #8c2c1d;
  border: 2px dotted #963f2c;
  transform: rotate(6deg); font: 700 clamp(.9rem,2vw,1.4rem)/1 var(--site-font);
}
.mail-ink { position: absolute; left: 9%; top: 57%; height: 9%; width: 45%; border-block: 1px solid #c4a78e; }
.mail-pocket {
  overflow: hidden;
  border-radius: 0 0 .6rem .6rem;
  clip-path: polygon(0 9%,50% 51%,100% 9%,100% 100%,0 100%);
  background: linear-gradient(110deg,#ffb288,#ee754b 82%);
  box-shadow: inset 0 -2px #ad4428;
}
.mail-pocket::before, .mail-pocket i { position: absolute; inset: 0; }
.mail-pocket::before { content: ""; background: linear-gradient(158deg,#ffd0a2,#ff875a); clip-path: polygon(0 9%,54% 51%,0 100%); }
.mail-pocket i { background: linear-gradient(155deg,#ffb183,#ee7449); clip-path: polygon(0 100%,50% 43%,100% 100%); }
.mail-seal {
  position: absolute; bottom: 13%; left: 50%; transform: translateX(-50%) rotate(-3deg);
  border: 1px solid #823421; border-radius: 2px;
  padding: .16em .52em; color: #662112; white-space: nowrap;
  font: 700 .85rem/1.1 var(--site-font); letter-spacing: .06em; text-transform: uppercase;
}
.mail-trails { position: absolute; right: -28%; top: 4%; width: 90%; height: 90%; transform: rotate(-18deg); }
.mail-trails i { position: absolute; inset: 6% 0 0; border: 1px solid #ffc5aa33; border-radius: 50%; }
.mail-trails i:nth-child(2) { inset: 15% -6% -9% 6%; }
.mail-trails i:nth-child(3) { inset: 24% -12% -18% 12%; }
.contact-write { align-self: center; min-width: 0; padding: clamp(1.6rem, 4vw, 3.7rem); }
.contact-write h2 { font: 700 clamp(1.8rem, 2.8vw, 2.45rem)/1.1 var(--site-font); margin: 0 0 1.5rem; color: #330000; }
#contact-form { display: grid; gap: 1.1rem; }
.contact-from { display: grid; grid-template-columns: .85fr 1.15fr; gap: 1rem; }
#contact-form label { display: grid; gap: .38rem; align-content: start; margin: 0; color: #36211e; font-size: 1.05rem; line-height: 1.35; font-weight: 700; }
#contact-form :is(input,textarea) { min-width: 0; width: 100%; border: 1px solid #968377; border-radius: .55rem; background: #fffcf8; color: #241816; padding: .68rem .82rem; font-size: 1.05rem; font-weight: 400; line-height: 1.4; }
#contact-form textarea { resize: vertical; min-height: 7.5rem; }
#contact-form :is(input,textarea):focus-visible { border-color: #792d25; outline: 2px solid #792d25; outline-offset: 2px; }
#message-help { margin: -.68rem 0 0; color: #5e4e47; font-size: .96rem; line-height: 1.4; }
.contact-actions { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.contact-actions button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .6rem 1.25rem; font-size: 1.05rem; font-weight: 600; color: #fff6e6; background: #530b0c; border: 1px solid #530b0c; border-radius: .65rem; }
.contact-actions button:hover { background: #79211b; }
.contact-actions a { padding-block: .6rem; color: #664138; font-weight: 600; text-underline-offset: .18em; }
#contact-status { font-weight: 600; font-size: 1.05rem; line-height: 1.4; }
#contact-status:empty { margin-top: -1.1rem; }
#contact-status:not(:empty) { padding: .65rem .9rem; border-radius: .45rem; background: #f4eae0; }
#contact-status[data-state="success"] { color: #23462e; background: #e6f2e4; }
#contact-status[data-state="error"] { color: #741d1c; background: #fce9e4; }
@media(max-width: 54rem) {
  .contact-layout { grid-template-columns: 1fr; max-width: 42rem; }
  .contact-intro { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,.8fr); align-items: center; gap: .6rem; }
  .contact-copy h1 { font-size: clamp(2.3rem,6.3vw,3.3rem); }
  .contact-copy h1 em { display: inline; }
  .contact-copy p { font-size: 1.05rem; margin-top: .65rem; }
  .mail-scene { height: 9rem; }
  .mail-piece { width: 95%; }
  .mail-seal { font-size: clamp(.56rem,1.4vw,.78rem); }
}
@media(max-width: 33rem) {
  .contact-layout { margin-block: 1rem 1.4rem; border-radius: 1.05rem; }
  .contact-intro { padding: 1.25rem; grid-template-columns: minmax(0,1.5fr) minmax(0,.8fr); }
  .contact-copy h1 em { display: block; }
  .mail-piece { width: 110%; }
  .mail-stamp { border-width: 1px; }
  .contact-from { grid-template-columns: 1fr; gap: 1rem; }
  .contact-write { padding: 1.3rem; }
  .contact-write h2 { margin-bottom: 1.1rem; }
}
@media(prefers-reduced-motion:reduce) {
  .mail-piece, .mail-note { transition: none; }
}
