/* Contact: "Write to the author". The form on paper, beside the book's cover and a small network of the
   cover's own icons, where your message (the gold envelope) travels to the book. */
.contact { padding: clamp(80px, 8vw, 120px) 0 clamp(88px, 9vw, 130px); overflow: clip; }
.contact__grid {
  position: relative; z-index: 1; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(40px, 6vw, 104px); align-items: start;
}
.contact__intro { display: flex; flex-direction: column; }
.contact__baton { width: min(100%, 420px); height: 22px; margin: 10px 0 18px; overflow: visible; }
.contact__baton path { fill: none; stroke: var(--gold-deep); stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(226, 176, 98, .7)); }
.contact__baton-pulse { stroke: #FFF1CF !important; stroke-width: 3.4 !important; filter: drop-shadow(0 0 6px rgba(226, 176, 98, 1)) !important; }
.contact__lede { color: var(--ink); }

/* the composition */
.contact__visual {
  --vis-w: min(100%, 560px);
  position: relative; width: var(--vis-w); aspect-ratio: 560 / 360; margin-top: clamp(28px, 4vh, 44px);
}
.contact__cover { position: absolute; left: 0; top: 4%; width: 33%; transform: rotate(-3deg); }
.contact__cover-img { position: relative; display: block; overflow: clip; box-shadow: 0 26px 50px -20px rgba(24, 32, 47, .55); }
.contact__cover img { width: 100%; height: auto; }
.contact__cover-frame { position: absolute; inset: 0; transform: translate(12px, 12px); border: 1px solid var(--gold-deep); }
.contact__cover-sweep {
  position: absolute; top: 0; bottom: 0; left: 0; width: 50%; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(100deg, transparent 10%, rgba(255, 228, 170, .35) 50%, transparent 90%);
  transform: translateX(-140%) skewX(-12deg);
}
.contact__net { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.contact__links path { fill: none; stroke: rgba(184, 135, 58, .55); stroke-width: 1.2; }
.contact__route { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(226, 176, 98, .9)); }
.contact__dots circle { fill: var(--gold-deep); }
.contact__node > circle { fill: var(--white); stroke: var(--gold-deep); stroke-width: 1.5; }
.contact__glyph { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.contact__glyph circle { fill: var(--ink); stroke: none; }
.contact__glyph text { fill: var(--ink); stroke: none; font-family: var(--f-body); font-weight: 700; font-size: 7.5px; }
.contact__node--you > circle { fill: var(--gold); stroke: var(--gold-deep); }
.contact__node--you .contact__glyph { stroke: var(--night); }
.contact__spark { fill: #FFF3D6; filter: drop-shadow(0 0 6px rgba(226, 176, 98, 1)); opacity: 0; }

/* the form */
.contact__panel {
  position: relative; padding: clamp(26px, 3vw, 44px) clamp(22px, 3vw, 44px) clamp(24px, 2.6vw, 38px);
  background: var(--white); border: 1px solid rgba(184, 135, 58, .38);
  box-shadow: 0 40px 70px -46px rgba(24, 32, 47, .55), 0 2px 0 rgba(255, 255, 255, .6) inset;
}
.contact__panel::before {
  content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px;
  background: linear-gradient(90deg, var(--gold-deep) 0%, var(--gold-deep) 40%, #FFE3A8 50%, var(--gold-deep) 60%, var(--gold-deep) 100%) 0 0 / 250% 100%;
  animation: contact-bar 6s ease-in-out infinite;
}
@keyframes contact-bar { 0% { background-position: 100% 0; } 60%, 100% { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .contact__panel::before { animation: none; background: var(--gold-deep); } }
.contact__panel::after {
  /* a second sheet under the letter */
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ivory-2); border: 1px solid rgba(184, 135, 58, .25);
  transform: translate(12px, 12px);
}
.contact__form { position: relative; display: flex; flex-direction: column; gap: 6px; }
.contact__form[hidden] { display: none; }
.contact__seal { position: absolute; left: 0; right: 0; top: 50%; width: 100%; height: 8px; overflow: visible; pointer-events: none; opacity: 0; }
.contact__seal path { fill: none; stroke: var(--gold); stroke-width: 3; filter: drop-shadow(0 0 8px rgba(226, 176, 98, 1)); }
.contact__status { display: none; padding: 12px 16px; border-left: 3px solid #9B2C1F; background: rgba(155, 44, 31, .07); color: #7E2117; font-weight: 500; }
.contact__status.is-on { display: block; margin-bottom: 10px; }
.contact__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.contact__field { display: flex; flex-direction: column; gap: 8px; }
.contact__field label { font-weight: 600; font-size: .98rem; color: var(--ink); }
.contact__control { position: relative; }
.contact__control input, .contact__control select, .contact__control textarea {
  display: block; width: 100%; min-height: 54px; padding: 14px 16px; border-radius: 0;
  background: #F6F0E3; color: var(--ink); border: 1px solid rgba(24, 32, 47, .28);
  font-size: 1.04rem; line-height: 1.5; transition: border-color .3s, box-shadow .3s, background-color .3s;
}
.contact__control textarea { resize: vertical; min-height: 140px; }
.contact__control select {
  appearance: none; -webkit-appearance: none; padding-right: 48px; cursor: pointer;
  background: #F6F0E3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4 7l5 5 5-5' fill='none' stroke='%2318202F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 18px center / 18px;
}
.contact__control select:invalid { color: rgba(24, 32, 47, .62); }
.contact__control select option { color: var(--ink); }
.contact__control input:hover, .contact__control select:hover, .contact__control textarea:hover { border-color: rgba(24, 32, 47, .55); }
.contact__control input:focus, .contact__control select:focus, .contact__control textarea:focus {
  outline: none; border-color: var(--gold-deep); background-color: #FFFDF8;
  box-shadow: 0 0 0 3px rgba(226, 176, 98, .45);
}
.contact__focus {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold); pointer-events: none;
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease-out);
  box-shadow: 0 0 10px rgba(226, 176, 98, .8);
}
.contact__control:focus-within .contact__focus { transform: scaleX(1); }
.contact__err { min-height: 1.5em; font-size: .92rem; font-weight: 500; color: #8E271B; line-height: 1.4; }
.contact__err:not(:empty)::before { content: '\25C6'; margin-right: 7px; font-size: .7em; vertical-align: .15em; }
.contact__field.is-bad input, .contact__field.is-bad select, .contact__field.is-bad textarea { border-color: #9B2C1F; box-shadow: inset 3px 0 0 #9B2C1F; }
.contact__trap { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; }
.contact__actions { display: flex; align-items: center; gap: 20px; padding-top: 6px; }
.contact__send { min-width: 210px; justify-content: center; }
.contact__send[disabled] { cursor: progress; opacity: .8; }

/* thank you */
.contact__thanks {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: clamp(8px, 1vw, 16px) 0;
}
.contact__thanks[hidden] { display: none; }
.contact__thanks:focus { outline: none; }
.contact__thanks p { color: var(--ink); font-size: 1.1rem; }
.contact__thanks .btn { margin-top: 8px; }
.contact__tick { width: 64px; height: 64px; }
.contact__tick path { fill: none; stroke: var(--gold-deep); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.contact__tick path + path { stroke: var(--ink); stroke-width: 3; }

@media (max-width: 980px) {
  .contact__grid { grid-template-columns: 1fr; gap: 0; }
  .contact__intro { display: contents; }
  .contact__title { order: 1; }
  .contact__baton { order: 2; }
  .contact__lede { order: 3; }
  .contact__visual { order: 4; margin: 28px auto 0; width: min(100%, 440px); }
  .contact__panel { order: 5; margin-top: 36px; }
}
@media (max-width: 600px) {
  .contact__row { grid-template-columns: 1fr; }
  .contact__send { width: 100%; }
}
