/* Get a quote. Loaded after site.css and page.css.
   The screen is the top of a yellow parcel: --lw is the width of its label, --tape the width of its tape, --ty where the tape lies. */

html { scroll-padding: 6.5rem 0 4rem; }
[hidden] { display: none !important; }

.parcel { overflow-x: clip; --h: max(100svh, 33rem); --lw: min(47.4vw, 62rem); --ty: calc(4.9rem + 2.4svh); --tape: clamp(4.2rem, 13.2svh, 9rem); --paper: #fefefc;
  position: relative; background: linear-gradient(90deg, rgb(150 92 0 / 0) 58%, rgb(150 92 0 / .2)), var(--yellow) url("../assets/contact/card.webp") 0 0 / 30rem; color: var(--ink); }
.parcel :focus-visible { outline-color: var(--blue); }
.parcel__main { position: relative; padding-bottom: clamp(2rem, 5svh, 4rem); }
.parcel__top { position: sticky; top: 0; height: var(--h); overflow: clip; }
/* one lamp, up on the left */
.parcel__top::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 120% at 22% 0, rgb(255 236 120 / .5), rgb(255 236 120 / 0) 62%); }

/* the tape, with the visitor's name on it */
.tape { position: absolute; left: 0; right: 0; top: var(--ty); height: var(--tape); background: #232323 url("../assets/contact/tape.webp") 0 0 / auto 100%; box-shadow: 0 1px 2px rgb(70 46 0 / .55), 0 .35rem .8rem rgb(90 58 0 / .22), inset 0 1px 0 rgb(255 255 255 / .1); color: var(--white); }
.tape__run { display: flex; gap: 1.1em; width: calc(100% - var(--lw)); padding-left: var(--gut); overflow: clip; font-size: calc(var(--tape) * .5); font-weight: 800; font-stretch: 112%; line-height: calc(var(--tape) * .97); letter-spacing: -.035em; white-space: pre; }
.tape__run span { flex: none; }

/* what is printed on the cardboard */
.ask, .marks li, .up { -webkit-mask: url("../assets/contact/print.webp") 0 0 / 22rem; mask: url("../assets/contact/print.webp") 0 0 / 22rem; }
.ask { position: absolute; left: calc(var(--gut) - .03em); top: calc(var(--ty) + var(--tape)); bottom: 0; right: calc(var(--lw) + var(--gut) + 1.6rem); display: flex; flex-direction: column; justify-content: center; font-size: calc((var(--h) - var(--ty) - var(--tape)) * .46); line-height: .98; }

/* ---------- the label ---------- */
.label { position: relative; z-index: 1; width: var(--lw); margin: calc(var(--ty) + 1.3rem - var(--h)) var(--gut) 0 auto; padding: .8rem; background: var(--paper); border-radius: .55rem; box-shadow: 0 1px 2px rgb(70 46 0 / .5), 0 .6rem 1.4rem rgb(90 58 0 / .26), 0 2rem 3.4rem rgb(90 58 0 / .2); scroll-margin-top: 1.5rem; outline: 0; }
.label__head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1.6rem; padding: .3rem 1rem 1rem .95rem; }
.to { --logo-a: #000; --logo-h: 2.5rem; display: flex; align-items: center; gap: .9rem; font-size: .875rem; font-weight: 600; }
.label__lead { margin: 0; font-size: 1rem; font-weight: 500; line-height: 1.3; letter-spacing: -.01em; text-align: right; text-wrap: balance; }

/* cells with thick printed rules: the rules are the ground showing through */
.fill, .done__list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; border: 2px solid var(--ink); background: var(--ink); }
.cell { position: relative; display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 0; border: 0; background: var(--paper); transition: background .2s; }
.cell--all { grid-column: 1 / -1; }
.cell > label { position: absolute; left: 1rem; right: 1rem; top: .72rem; font-size: .875rem; font-weight: 600; line-height: 1.2; pointer-events: none; }
.cell small { margin-left: .3em; font-size: .8125rem; font-weight: 450; color: var(--graphite); }
.cell > :is(input, select, textarea) { display: block; width: 100%; margin: 0; padding: 2.02rem 1rem .72rem; border: 0; border-radius: 0; background: none; color: var(--ink); font: 700 1.25rem/1.25 var(--font); letter-spacing: -.025em; outline: 0; }
.cell--name > input { padding-top: 1.9rem; font-size: 2.1rem; font-weight: 800; letter-spacing: -.04em; }
.cell > input { height: 4.35rem; }
.cell--name > input { height: 5.3rem; }
.cell > select { appearance: none; height: 4.35rem; padding-right: 2.2rem; font-size: 1.125rem; letter-spacing: -.032em; text-overflow: ellipsis; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M2 2l8 8 8-8' fill='none' stroke='%230d0d0d' stroke-width='3'/%3E%3C/svg%3E") calc(100% - .9rem) 70% / .95rem no-repeat; }
.cell > select:has(option[value=""]:checked) { color: var(--steel); font-weight: 600; }
.cell > select option { font-size: 1rem; font-weight: 500; color: var(--ink); }
.cell > textarea { min-height: 7.4rem; resize: vertical; field-sizing: content; font-size: 1.125rem; font-weight: 600; line-height: 1.35; letter-spacing: -.012em; }
@media (hover: hover) { .cell:hover { background: #fffbe8; } }
.cell:focus-within { z-index: 1; background: var(--white); outline: 4px solid var(--blue); outline-offset: -3px; }
.cell > input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: inset 0 0 0 99rem #fffbe8; }

/* what is wrong, beside the field, in a strip like the reversed type on a label */
.err { margin: auto 0 0; padding: .5rem 1rem .55rem; background: var(--ink); box-shadow: 0 0 0 1px var(--ink); color: var(--white); font-size: .9375rem; font-weight: 600; line-height: 1.3; }
.err::before { content: "!"; display: inline-block; width: 1.25em; margin-right: .55em; background: var(--yellow); color: var(--ink); font-weight: 800; text-align: center; }
.cell.is-wrong { background: #fff6cf; }

.label__foot { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .4rem 1.6rem; padding: 1rem; background: var(--paper); }
.bars { min-width: 0; height: 4.4rem; }
.bars svg { height: 100%; }
.send { display: grid; justify-items: end; gap: .8rem; }
.send__note { max-width: 17.5em; font-size: .875rem; line-height: 1.3; text-align: right; text-wrap: balance; }
.send .btn { font-size: 1.125rem; }
.send .btn:hover { background: var(--yellow); color: var(--ink); }
.send__count { grid-column: 1 / -1; font-weight: 600; text-align: right; }
.send__count:empty { display: none; }
.fill noscript { grid-column: 1 / -1; }
.noscript { padding: 1rem; background: var(--paper); font-weight: 600; }

/* ---------- printed: after a valid send ---------- */
.label.is-done .label__lead { display: none; }
.done { position: relative; }
.done__say { margin-bottom: .8rem; padding: 1.5rem 1.4rem; background: var(--ink); color: var(--white); }
.done__say :focus-visible { outline-color: var(--yellow) !important; }
.done__h { margin: 0; font-size: clamp(2rem, 3.4vw, 3.6rem); font-weight: 700; line-height: 1; letter-spacing: -.045em; outline: 0 !important; }
.done__say p { max-width: 32em; margin-top: .8rem; }
.done__do { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.5rem; margin-top: 1.3rem; }
.done__say .btn { background: var(--yellow); color: var(--ink); }
.done__say .btn:hover { background: var(--white); }
.done__list div { min-width: 0; padding: .7rem 1rem .75rem; background: var(--paper); }
.done__list dt { font-size: .875rem; font-weight: 600; line-height: 1.2; }
.done__list dd { margin-top: .28rem; font-size: 1.25rem; font-weight: 700; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; white-space: pre-line; }
.done__list .is-name dd { font-size: 2.1rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.done__list .is-mail dd { font-size: 1.125rem; line-height: 1.39; }
.done__list .is-long dd { font-size: 1.125rem; font-weight: 600; line-height: 1.35; letter-spacing: -.012em; }
.done > .bars { height: 5.6rem; margin-top: -2px; padding: 1rem; border: 2px solid var(--ink); }
.scan { position: absolute; z-index: 3; left: -.8rem; right: -.8rem; top: 0; height: 3px; background: var(--blue); box-shadow: 0 0 1.6rem .5rem rgb(43 89 240 / .5); pointer-events: none; }

/* ---------- the foot of the parcel ---------- */
.marks { position: relative; display: flex; align-items: end; justify-content: space-between; gap: 3rem; padding: clamp(2rem, 4.5vw, 4.5rem) var(--gut) clamp(3rem, 5.4vw, 5.6rem); }
.marks ol { margin: 0; padding: 0; list-style: none; }
.marks li { padding: 0 .1em .12em 0; font-size: clamp(2.3rem, 6.1vw, 7.6rem); font-weight: 700; line-height: 1.02; letter-spacing: -.05em; }
.marks p { max-width: 31em; margin-top: 1.6em; font-size: clamp(1.0625rem, 1.5vw, 1.8rem); font-weight: 500; line-height: 1.32; letter-spacing: -.012em; text-wrap: balance; }
.marks address { margin-top: 1.2rem; font-style: normal; font-weight: 500; line-height: 1.4; }
.marks p .link { display: inline-block; margin-right: 1.2rem; }
.up { flex: none; width: clamp(5rem, 15.4vw, 19rem); margin-bottom: 1.2vw; }
/* the near edge of the box, and the floor */
.parcel::after { content: ""; display: block; height: .9rem; background: linear-gradient(#b98500, #8f6500); box-shadow: inset 0 2px 0 rgb(255 240 160 / .55); }

/* ---------- arriving: the tape is pulled across, the question is printed, the label goes on ---------- */
.live .tape { animation: pull .95s cubic-bezier(.6, 0, .15, 1) backwards; }
.live .ask span { animation: print .7s .42s var(--out) backwards; }
.live .ask span + span { animation-delay: .52s; }
.live .label { animation: stick .6s .62s cubic-bezier(.2, .9, .25, 1) backwards; }
@keyframes pull { from { transform: translateX(-101%); } }
@keyframes print { from { opacity: 0; transform: translateY(.07em); } }
@keyframes stick { from { opacity: 0; transform: translateY(-1.4rem) rotate(-1.4deg) scale(1.035); } }

/* ---------- upright and smaller screens: the tape, the question and then the label ---------- */
@media (max-width: 1080px), (max-aspect-ratio: 5/4) {
  .parcel { --lw: 0px; --h: auto; --ty: 5.6rem; --tape: clamp(3.4rem, 9.4vw, 5.4rem); }
  .parcel__top { position: relative; height: auto; padding-top: var(--ty); overflow: clip; }
  .tape { position: relative; top: auto; }
  .ask { position: relative; inset: auto; display: block; margin: .12em var(--gut); font-size: min(24vw, 15.5svh); line-height: 1; }
  .label { width: auto; margin: 0 clamp(.5rem, 2.6vw, 1.6rem); }
}
@media (max-width: 800px) {
  .label { padding: .5rem; }
  .marks address br { display: none; }
  .marks address { text-wrap: balance; }
  .marks p .link { margin-block: .35rem; }
  .label__head { grid-template-columns: 1fr; gap: .7rem; padding: .6rem .75rem .9rem; }
  .label__lead { text-align: left; }
  .fill, .done__list { grid-template-columns: 1fr; }
  .cell > label small { display: block; margin: .15rem 0 0; }
  .label__foot { grid-template-columns: 1fr; gap: 1.1rem; }
  .bars:empty { display: none; }
  .send { justify-items: stretch; }
  .send__note { max-width: none; text-align: left; }
  .send .btn { padding-block: 1.25em; text-align: center; }
  .send__count { text-align: left; }
  .marks { display: block; padding-top: 3rem; }
  .marks li { font-size: 9.7vw; white-space: nowrap; }
  .up { width: 25vw; margin: 2rem 0 0 auto; }
}
