/* The airdrop desk. One receipt on the left (the form), Zero at the desk on the right. Tokens come from base.css. */

:root {
  --strip: min(38rem, 100vw - 2rem);
  --edge: clamp(1rem, 4vw, 4.5rem);
  --gap: clamp(2rem, 5vw, 6rem);
  --pad: clamp(1.4rem, 3.4vw, 3rem);
  --tooth: 14px;
  --canton-ink: #b9c400;
  --error: #9b2c1f;
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { overflow-x: clip; background: var(--paper); }

/* ------------------------------------------------------------ now filing: the note at the top */
.serving { position: fixed; z-index: 40; left: 50%; top: 0.85rem; translate: -50% 0; rotate: -1.5deg; display: grid; gap: 0.3rem; padding: 0.7rem 1.3rem 0.8rem; background: var(--canton); color: var(--ink); box-shadow: 0 14px 24px -18px rgba(16, 17, 15, 0.55); white-space: nowrap; text-align: center; animation: serve 0.7s var(--settle) 0.2s both; pointer-events: none; }
.serving::before { content: ""; position: absolute; left: 50%; top: -0.45rem; width: 3.2rem; height: 0.9rem; translate: -50% 0; rotate: 2deg; background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 1px rgba(16, 17, 15, 0.12); }
.serving span { font: 600 var(--label)/1 var(--sans); letter-spacing: 0.055em; text-transform: uppercase; opacity: 0.7; }
.serving b { font: 800 1.15rem/1 var(--serif); letter-spacing: 0.04em; }
@keyframes serve { from { translate: -50% -170%; } }

/* ------------------------------------------------------------ the page: receipt + stage */
.page { max-width: 108rem; margin: 0 auto; padding: 0 var(--edge); display: grid; grid-template-columns: var(--strip) minmax(0, 1fr); gap: 0 var(--gap); align-items: start; }

.sheet {
  position: relative; margin: clamp(5.5rem, 12vh, 7.5rem) 0 clamp(3rem, 7vh, 5rem);
  background: var(--paper);
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--ink) 3%, transparent), transparent 1.2rem, transparent calc(100% - 1.2rem), color-mix(in srgb, var(--ink) 3%, transparent));
  box-shadow: -1px 0 0 var(--gray-line), 1px 0 0 var(--gray-line), 0 1px 0 var(--gray-line), 0 40px 80px -60px rgba(16, 17, 15, 0.35);
  animation: feed 0.9s var(--settle) both;
}
/* the sheet slides out of the till without fading, so it is painted (and counted) on the first frame */
@keyframes feed { from { transform: translateY(-3rem); } }
/* the torn top edge, the way the website's receipt starts */
.sheet::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: calc(var(--tooth) * -1 + 1px); height: var(--tooth);
  background:
    linear-gradient(135deg, transparent 50%, var(--gray-line) 50%, var(--gray-line) calc(50% + 1px), var(--paper) calc(50% + 1px)) 0 0 / var(--tooth) var(--tooth) repeat-x,
    linear-gradient(225deg, transparent 50%, var(--gray-line) 50%, var(--gray-line) calc(50% + 1px), var(--paper) calc(50% + 1px)) calc(var(--tooth) / 2) 0 / var(--tooth) var(--tooth) repeat-x;
}

.block { position: relative; padding: clamp(2.6rem, 6vh, 4rem) var(--pad); }
.block + .block::before { content: ""; position: absolute; left: var(--pad); right: var(--pad); top: 0; border-top: 1.5px dashed var(--ink); opacity: 0.55; }
.block h2.q-h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 0.95; letter-spacing: -0.012em; margin-bottom: clamp(1.4rem, 2.6vh, 2rem); }
.block--small { padding-top: clamp(2rem, 4.5vh, 3rem); padding-bottom: clamp(2rem, 4.5vh, 3rem); }
.block--small h2 { margin-bottom: 1.1rem; }

/* ------------------------------------------------------------ head */
.head { padding-top: clamp(3rem, 7vh, 4.5rem); }
.head__mark { --wordmark-width: min(100%, 17rem); display: block; margin: 0 auto; color: var(--ink); }
.head__mark:focus-visible { outline-offset: 8px; }
.head__sub { text-align: center; font: 400 0.95rem/1 var(--sans); letter-spacing: 0.04em; margin-top: 0.9rem; }
.meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 1rem; margin: clamp(2rem, 5vh, 3rem) 0 1.1rem; }
.meta dt { font: 600 var(--label)/1 var(--sans); letter-spacing: 0.055em; text-transform: uppercase; color: var(--gray-text); margin-bottom: 0.5rem; }
.meta dd { margin: 0; font: 500 0.95rem/1.2 var(--sans); }
.meta dd.q-num { font: 800 1.05rem/1 var(--serif); letter-spacing: 0.04em; }
.rule { border: 0; height: 0; margin: 0; }
.rule--ink { border-top: 2px solid var(--ink); }
.head__title { margin: clamp(2rem, 5vh, 3rem) 0 1.2rem; font-size: clamp(2.7rem, 5vw, 4.4rem); line-height: 0.92; letter-spacing: -0.012em; }
.head__lede { font-size: var(--body); max-width: 26rem; text-wrap: pretty; }
.head__zero { display: none; }

/* ------------------------------------------------------------ the four things */
.steps { display: grid; gap: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) 2.75rem; gap: 0 1rem; align-items: start; padding: 1.35rem 0 1.45rem; border-top: 1px solid var(--gray-line); }
.step:last-child { border-bottom: 1px solid var(--gray-line); }
.step__n { font: 800 1.35rem/1.1 var(--serif); letter-spacing: 0.02em; padding-top: 0.05rem; }
.step__title { font: 800 1.35rem/1.12 var(--serif); letter-spacing: -0.006em; text-wrap: balance; }
.step__note { font-size: var(--small); color: var(--gray-text); margin-top: 0.45rem; max-width: 24rem; line-height: 1.45; text-wrap: pretty; }
.step__act { margin-top: 0.95rem; text-align: center; justify-content: center; line-height: 1.15; }
.step__act svg { width: 1em; height: 1em; fill: currentColor; flex: none; }
.q-btn--line:hover, .q-btn--line:focus-visible { background: var(--canton); }
.q-btn:not(.q-btn--line):not(.q-btn--canton):focus-visible { outline-color: var(--ink); }
/* the box on the right: ticked by the visitor, or when they press the step's button. The yellow wipes in from the
   left, the box takes a small stamp press, the tick draws itself left to right; unticked, it all goes back quickly */
.step__box { position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-top: -0.1rem; box-shadow: inset 0 0 0 2px var(--ink); background: linear-gradient(var(--canton), var(--canton)) left center / 0% 100% no-repeat; transition: background-size 0.2s var(--settle), background-color 0.15s; }
.step__box[aria-pressed="true"] { background-size: 100% 100%; transition: background-size 0.32s cubic-bezier(0.65, 0, 0.35, 1); }
.step__box.is-stamped { animation: box-stamp 0.42s var(--press) both; }
@keyframes box-stamp { 0% { scale: 1; } 30% { scale: 0.88; } 62% { scale: 1.07; } 100% { scale: 1; } }
@media (hover: hover) { .step__box:not([aria-pressed="true"]):hover { background-color: color-mix(in srgb, var(--canton) 40%, var(--paper)); } }
.tick { width: 74%; height: 74%; overflow: visible; pointer-events: none; }
.tick path { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.16s ease-in; }
.step__box[aria-pressed="true"] .tick path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.46s cubic-bezier(0.65, 0, 0.35, 1) 0.14s; }
/* the title is struck through left to right, line after line, in ink; the words go grey under it */
.step__strike { background: linear-gradient(var(--ink), var(--ink)) left 56% / 0% 0.1em no-repeat; transition: background-size 0.2s ease-in, color 0.2s; }
.step.is-done .step__strike { background-size: 100% 0.1em; color: color-mix(in srgb, var(--ink) 55%, var(--paper)); transition: background-size 0.75s cubic-bezier(0.65, 0, 0.35, 1) 0.2s, color 0.4s ease 0.55s; }

/* ------------------------------------------------------------ the form */
.form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.form-head__tag { font: 600 var(--label)/1 var(--sans); letter-spacing: 0.055em; text-transform: uppercase; color: var(--gray-text); white-space: nowrap; }
.form { display: grid; gap: 1.6rem; }
.form[hidden] { display: none; }
.field__label { display: flex; align-items: baseline; gap: 0.7rem; font: 600 var(--label)/1.2 var(--sans); letter-spacing: 0.055em; text-transform: uppercase; margin-bottom: 0.55rem; }
.field__n { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; flex: none; font: 800 0.85rem/1 var(--serif); letter-spacing: 0; box-shadow: inset 0 0 0 1.5px var(--ink); translate: 0 0.2rem; }
.field__input { width: 100%; min-width: 0; padding: 0.7rem 0 0.6rem; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); font: 500 1.05rem/1.3 var(--sans); outline: none; transition: background 0.15s, border-color 0.15s; -webkit-appearance: none; appearance: none; }
.field__input::placeholder { color: #a1a59a; opacity: 1; }
.field__input:focus { background: linear-gradient(to top, color-mix(in srgb, var(--canton) 70%, transparent) 0 0.55rem, transparent 0.55rem); }
.field__input:focus-visible { outline: none; }
#partyId { font-size: 0.98rem; letter-spacing: 0.005em; }
.field__at { display: flex; align-items: baseline; gap: 0.15rem; border-bottom: 2px solid var(--ink); }
.field__at > span { font: 600 1.05rem/1 var(--sans); color: var(--gray-text); }
.field__at .field__input { border-bottom: 0; }
.field__at:focus-within { background: linear-gradient(to top, color-mix(in srgb, var(--canton) 70%, transparent) 0 0.55rem, transparent 0.55rem); }
.field__at:focus-within .field__input { background: none; }
.field__help { margin-top: 0.55rem; font-size: var(--small); color: var(--gray-text); line-height: 1.45; text-wrap: pretty; }
.field__help b { color: var(--ink); font-weight: 600; }
.field__error { margin-top: 0.5rem; font-size: var(--small); font-weight: 500; line-height: 1.45; color: var(--error); text-wrap: pretty; }
.field__error:empty { display: none; }
.field.is-wrong .field__input, .field.is-wrong .field__at { border-bottom-color: var(--error); }
.field.is-wrong .field__at .field__input { border-bottom-color: transparent; }
.field.is-right .field__label::after { content: "In order"; margin-left: auto; color: var(--gray-text); letter-spacing: 0.055em; }
.field--trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.confirm { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0.8rem; align-items: start; font-size: var(--small); line-height: 1.45; cursor: pointer; padding-top: 0.2rem; }
.confirm input { position: absolute; opacity: 0; width: 1.6rem; height: 1.6rem; margin: 0; }
.confirm__box { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; box-shadow: inset 0 0 0 2px var(--ink); translate: 0 -0.08rem; background: linear-gradient(var(--canton), var(--canton)) left center / 0% 100% no-repeat; transition: background-size 0.18s var(--settle); }
.confirm input:checked + .confirm__box { background-size: 100% 100%; transition: background-size 0.28s cubic-bezier(0.65, 0, 0.35, 1); }
.confirm input:checked + .confirm__box .tick path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.1s; }
.confirm input:focus-visible + .confirm__box { outline: 2px solid var(--ink); outline-offset: 3px; }
.confirm.is-wrong .confirm__box { box-shadow: inset 0 0 0 2px var(--error); }

.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; margin-top: 0.4rem; }
.form__submit { min-width: 9.5rem; justify-content: center; font-size: 1rem; padding: 1.05em 1.6em 1em; }
.form__submit[disabled] { cursor: progress; transform: none; }
.form__submit[disabled] span { opacity: 0.85; }
.form__status { font-size: var(--small); color: var(--gray-text); flex: 1 1 12rem; line-height: 1.45; }
.form__status.is-wrong { color: var(--error); font-weight: 500; }
.form.is-closed { opacity: 0.45; pointer-events: none; }
.closed { margin-bottom: 1.6rem; padding: 1rem 1.1rem; background: var(--canton); font-weight: 500; }

/* ------------------------------------------------------------ the receipt, after filing */
.receipt { position: relative; outline: none; }
.receipt[hidden] { display: none; }
.receipt__title { font: 800 clamp(2rem, 3.6vw, 2.9rem)/0.95 var(--serif); letter-spacing: -0.012em; margin-bottom: 1.2rem; text-wrap: balance; }
.receipt__num { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; padding: 1.1rem 0 1rem; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); margin: 0 0 0.3rem; }
.receipt__num span { font: 600 var(--label)/1 var(--sans); letter-spacing: 0.055em; text-transform: uppercase; color: var(--gray-text); }
.receipt__num b { font: 800 clamp(1.15rem, 2.4vw, 1.45rem)/1 var(--serif); letter-spacing: 0.04em; white-space: nowrap; }
.lines { display: grid; }
.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: baseline; padding: 0.85rem 0; border-bottom: 1px dashed color-mix(in srgb, var(--ink) 40%, transparent); font-size: 0.95rem; line-height: 1.35; }
.lines li span:last-child { text-align: right; font-weight: 600; }
.lines li small { display: block; color: var(--gray-text); font-size: var(--small); font-weight: 400; margin-top: 0.15rem; }
.lines .is-ok span:last-child { color: var(--ink); }
.lines .is-wait span:last-child { color: var(--gray-text); }
.lines .is-no span:last-child { color: var(--error); }
.receipt__after { margin-top: 1.4rem; font-size: var(--small); color: var(--gray-text); line-height: 1.5; max-width: 30rem; }
.receipt__after b { color: var(--ink); font-weight: 600; }
.receipt__acts { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; }
.receipt .q-stamp { display: inline-flex; margin: 0.2rem 0 1.3rem; font-size: clamp(1.25rem, 2.6vw, 1.6rem); mix-blend-mode: multiply; pointer-events: none; }
.q-stamp--received { color: var(--ink); }
.q-stamp--pending { color: var(--gray-text); }
.q-stamp--returned { color: var(--error); }
.q-stamp--ok { color: var(--ink); background: var(--canton); }

/* ------------------------------------------------------------ already filed */
.lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.8rem; align-items: end; }
.lookup .q-btn { min-height: 2.75rem; padding: 0.8em 1.2em 0.75em; justify-content: center; }
.lookup__out { margin-top: 1rem; font-size: 0.95rem; }
.lookup__out:empty { display: none; }
.lookup__out .lines { margin-top: 0.4rem; }
.lookup__out p { line-height: 1.45; }
.lookup__out .is-wrong { color: var(--error); font-weight: 500; font-size: var(--small); }

/* ------------------------------------------------------------ the rules */
.rules { display: grid; gap: 0.6rem; font-size: var(--small); line-height: 1.5; }
.rules li { position: relative; padding-left: 1.3rem; max-width: 32rem; text-wrap: pretty; }
.rules li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.6rem; height: 0.38rem; background: var(--canton); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent); }
.rules a { font-weight: 600; }
.risk { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--gray-line); font-size: var(--small); font-weight: 600; line-height: 1.5; max-width: 32rem; }

.sheet__end { padding: 1.4rem var(--pad) 2rem; display: flex; justify-content: center; }
.sheet__sign { font: 800 1.3rem/1 var(--serif); }

/* ------------------------------------------------------------ the stage: Zero beside the sheet */
/* the figure is as tall as Zero (H) and as wide as the widest pose; every pose stands on its floor, centred.
   The note stands just right of Zero's head, the arrow pointing at the spectacles. */
.stage { position: sticky; top: 0; height: 100svh; padding: clamp(6.5rem, 14vh, 8.5rem) 0 clamp(2.5rem, 7vh, 4.5rem); pointer-events: none; }
.stage__inner { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; container-type: size; }
.stage__figure { --h: min(100cqh, 34rem, 100cqw * 0.95); position: relative; height: var(--h); width: calc(var(--h) * 0.62); margin: 0 auto 0 18%; }
.stage__zero { position: absolute; bottom: 0; left: 50%; height: 100%; width: auto; max-width: none; translate: -50% 0.6rem; opacity: 0; transition: opacity 0.35s var(--settle), translate 0.45s var(--settle); }
.stage__zero.is-on { opacity: 1; translate: -50% 0; }
.stage__zero[data-pose="beckon"] { left: 42%; }
.stage__zero[data-pose="stamping"] { height: 84%; left: 46%; }
.stage__note { position: absolute; left: calc(100% - 0.6rem); top: -1%; display: flex; align-items: flex-start; gap: 0.8rem; font: 800 clamp(1.25rem, 1.7vw, 1.7rem)/1.06 var(--serif); letter-spacing: -0.008em; white-space: nowrap; z-index: 2; animation: note-in 0.6s var(--settle) 1.1s both; }
.stage__note img { width: 3.6rem; height: auto; flex: none; margin-top: 0.35em; transform: rotate(-160deg); }
.stage__figure[data-pose="proud"] .stage__note, .stage__figure[data-pose="waiting"] .stage__note { left: calc(100% - 3rem); }
.stage__figure[data-pose="stamping"] .stage__note { left: calc(100% + 1.5rem); top: 10%; }
@keyframes note-in { from { opacity: 0; transform: translateX(-14px); } }

/* ------------------------------------------------------------ the factual footer (base.css has the rest) */
.q-footer { max-width: 108rem; margin: 0 auto; }

/* ------------------------------------------------------------ narrower: the stage gives way */
@media (max-width: 1399px) {
  .stage__figure { --h: min(100cqh - 9rem, 34rem, 100cqw * 1); margin: 0 auto; }
  .stage__note { left: 50%; top: auto; bottom: calc(100% + 1rem); translate: -50% 0; align-items: flex-end; font-size: 1.3rem; }
  .stage__note img { width: 2.6rem; margin: 0 0.2rem 0 0; transform: rotate(100deg); }
}
@media (max-width: 1080px) {
  .page { grid-template-columns: minmax(0, 1fr); padding: 0 max(0.75rem, env(safe-area-inset-left)); }
  .sheet { width: 100%; max-width: 38rem; margin: 5.4rem auto 2.5rem; }
  .stage { display: none; }
  .head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.5rem; }
  .head > :not(.head__zero) { grid-column: 1 / -1; }
  .head__title { grid-column: 1 / 2 !important; }
  .head__lede { grid-column: 1 / 2 !important; }
  .head__zero { display: block; grid-column: 2; grid-row: 5 / span 2; align-self: end; width: clamp(5.6rem, 24vw, 8.5rem); margin: 0 -0.6rem -0.6rem 0; }
  .head__zero img { width: 100%; height: auto; }
}
@media (max-width: 520px) {
  :root { --pad: 1.15rem; }
  .serving { top: 0.6rem; padding: 0.55rem 1rem 0.6rem; }
  .serving b { font-size: 1rem; }
  .sheet { margin-top: 4.6rem; }
  .meta { grid-template-columns: repeat(3, auto); gap: 0.6rem; }
  .meta dd { font-size: 0.85rem; }
  .meta dd.q-num { font-size: 0.95rem; }
  .head__title { font-size: clamp(2.35rem, 11vw, 2.9rem); }
  .head__lede { font-size: 1rem; }
  .step { grid-template-columns: 2rem minmax(0, 1fr) 2.75rem; gap: 0 0.75rem; }
  .step__title { font-size: 1.22rem; }
  /* the step's button runs on under the tick column, so its label stays on one line */
  .step__act { width: calc(100% + 2.75rem + 0.75rem); justify-content: center; padding-inline: 0.9em; }
  .lookup { grid-template-columns: minmax(0, 1fr); }
  .lookup .q-btn { justify-self: start; }
  .form__submit { width: 100%; }
}

@media (max-width: 359px) {
  .step__act { font-size: 0.86rem; padding-inline: 0.6em; letter-spacing: -0.005em; min-height: 2.75rem; }
  .meta dd { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .serving, .stage__note, .step__box.is-stamped { animation: none; }
  .step__box, .step__box .tick path, .confirm__box, .confirm__box .tick path, .step__strike { transition: none !important; }
  .stage__zero { transition: none; }
}
