/* ==========================================================================
   SGFX Gold Rush — Expo 2026

   The entry is a bullion warrant. SGFX navy is the ink it is printed in, not a
   dark-mode chrome: the flow sits on a sheet of cool bond paper on a drenched
   navy field, because a visitor reads this on their own phone under the lights
   of a bright exhibition hall, where paper beats a dark UI.

   Three colours, three jobs, and they never swap:
     navy  = the ink       (rules, type, structure)
     cyan  = the system    (focus, the live step, the primary action)
     gold  = the prize     (the coin, the serial, the struck seal)

   Corners are square. Security printing has no rounded corners; only the
   things a thumb lands on get 2px of softening.
   ========================================================================== */

/* ---- Fonts: self-hosted, so a saturated hall wifi never blocks a render.
   Display type is Archivo pushed to 118% width at weight 800: the same family
   as the body, so there is no third download, and the extra width reads as a
   struck official mark rather than as decoration. --- */
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-latin.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-latin-ext.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
/* Martian Mono: codes and serial numbers only. Never decoration. */
@font-face {
  font-family: 'Martian Mono';
  src: url('../fonts/martianmono-latin.woff2') format('woff2-variations');
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens ------------------------------------------------------------- */
:root {
  /* The field the document sits on: flat, drenched SGFX navy. No gradient. */
  --field: oklch(0.183 0.062 263);
  --field-deep: oklch(0.145 0.048 263);
  --field-lift: oklch(0.245 0.062 263);

  /* Paper: cool bond stock, tinted toward the brand hue, never toward warm */
  --paper: oklch(0.968 0.005 250);
  --paper-well: oklch(0.934 0.008 252);
  --paper-line: oklch(0.855 0.011 252);
  --paper-rule: oklch(0.740 0.016 254);

  /* Ink */
  --ink: oklch(0.235 0.062 263);
  --ink-2: oklch(0.405 0.038 258);
  --ink-3: oklch(0.500 0.031 258);
  --on-field: oklch(0.968 0.005 250);
  --on-field-2: oklch(0.780 0.019 252);

  /* The system colour. A fill and a rule; never body text on paper. */
  --cyan: oklch(0.878 0.145 191);
  --cyan-rule: oklch(0.515 0.098 213);
  --cyan-wash: oklch(0.958 0.030 195);

  /* The prize colour. One value legible as ink, one bright on the field. */
  --gold-ink: oklch(0.490 0.094 74);
  --gold: oklch(0.760 0.128 84);
  --gold-bright: oklch(0.870 0.105 90);

  --alert: oklch(0.445 0.166 26);
  --alert-wash: oklch(0.955 0.028 26);

  /* Type */
  --sans: 'Archivo', ui-sans-serif, system-ui, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.45rem, 1.25rem + 1vw, 1.85rem);
  --step-3: clamp(1.9rem, 1.5rem + 2vw, 2.7rem);

  /* Space */
  --sp-2: 0.5rem;
  --sp-3: 0.875rem;
  --sp-4: 1.375rem;
  --sp-5: 2rem;
  --sp-6: clamp(2.25rem, 5vw, 3.5rem);

  /* Square by conviction. 2px only where a thumb lands. */
  --r: 2px;

  /* Motion. Strong ease-out; nothing over 300ms except the one struck moment. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --t-press: 140ms;
  --t: 200ms;
  --t-strike: 720ms;

  --z-base: 10;
  --z-sticky: 20;
  --z-toast: 60;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* .btn sets display:inline-flex, which outranks the UA [hidden] rule. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--field);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  line-height: 1.12;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--cyan-rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--cyan-rule);
  outline-offset: 2px;
}

/* ==========================================================================
   The field and the sheet
   ========================================================================== */
.field {
  min-height: 100dvh;
  padding: clamp(0.75rem, 3vw, 2.5rem) clamp(0.5rem, 3vw, 2rem) var(--sp-5);
}

.sheet {
  width: 100%;
  max-width: 35rem;
  margin-inline: auto;
  background: var(--paper);
  color: var(--ink);
  /* Double rule, the way a certificate is bordered. */
  border: 1px solid var(--paper-rule);
  outline: 1px solid oklch(0.968 0.005 250 / 0.22);
  outline-offset: 3px;
  box-shadow: 0 24px 60px -30px oklch(0.1 0.04 263 / 0.9);
}

/* ---- Guilloche ribbons at head and foot -------------------------------- */
.guilloche {
  display: block;
  width: 100%;
  height: 20px;
  color: var(--cyan-rule);
  opacity: 0.33;
}

.guilloche--foot {
  transform: scaleY(-1);
}

/* ---- Head -------------------------------------------------------------- */
.sheet__head {
  padding: var(--sp-4) clamp(1.125rem, 4vw, 2.125rem) var(--sp-3);
  border-bottom: 1px solid var(--paper-line);
}

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
}

/* Flat plate, no gradient: a struck mark, not an app icon. */
.wordmark__plate {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 800;
}

.wordmark__name {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

/* The one deliberate small-caps line on the page: what kind of document this
   is. A warrant states its own kind at the top. It is not a section eyebrow
   and it appears exactly once. */
.docline {
  color: var(--ink-3);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: right;
  line-height: 1.5;
}

.docline b {
  display: block;
  color: var(--ink);
  font-family: var(--mono);
  font-variation-settings: 'wdth' 87.5;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* ---- The stage line: a document's own progress notation ---------------- */
.stages {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--sp-3);
  font-size: 0.75rem;
}

.stages__item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-3);
  white-space: nowrap;
}

.stages__item:not(:last-child)::after {
  content: '';
  width: clamp(0.5rem, 3vw, 1.75rem);
  height: 1px;
  margin-left: 0.25rem;
  background: var(--paper-rule);
}

.stages__n {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--paper-rule);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.5625rem;
  font-weight: 600;
}

.stages__item[data-state='done'] .stages__n {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.stages__item[data-state='now'] {
  color: var(--ink);
  font-weight: 700;
}

.stages__item[data-state='now'] .stages__n {
  border-color: var(--cyan-rule);
  background: var(--cyan);
  color: var(--ink);
}

/* Step labels are the one thing that must not wrap the head onto three lines
   on a narrow phone, so the two inactive ones drop out below 26rem. */
@media (max-width: 21rem) {
  .stages__item:not([data-state='now']) .stages__label {
    display: none;
  }
}

/* ---- Body -------------------------------------------------------------- */
.sheet__body {
  padding: var(--sp-4) clamp(1.125rem, 4vw, 2.125rem) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.lede {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lede h1 {
  font-size: var(--step-3);
  font-family: var(--sans);
  font-variation-settings: 'wdth' 118;
  font-weight: 800;
  letter-spacing: -0.022em;
}

.lede p {
  color: var(--ink-2);
  font-size: 0.9375rem;
  max-width: 46ch;
}

.lede strong {
  color: var(--ink);
  font-weight: 700;
}

/* The prize, stated once, as a ruled line of the document. */
.consignment {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
}

.consignment__coin {
  flex: 0 0 auto;
  width: 60px;
  height: auto;
  filter: drop-shadow(0 4px 7px oklch(0.49 0.094 74 / 0.36));
}

.consignment__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.consignment__text b {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 700;
}

.consignment__text span {
  color: var(--ink-3);
  font-size: 0.8125rem;
}

/* Who is holding the device. A hostess hands the stand over by signing out. */
.capture-by {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--paper-line);
  border-radius: var(--r);
  background: var(--paper-well);
  color: var(--ink-2);
  font-size: 0.8125rem;
}

.capture-by b {
  color: var(--ink);
}

/* ==========================================================================
   Form: fields ruled onto the document
   ========================================================================== */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-row > label,
.fieldset__legend {
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 700;
}

.hint {
  color: var(--ink-3);
  font-size: 0.75rem;
}

/* A tinted well with a ruled baseline: the hit area stays obvious, and the
   rule is what moves on focus. */
.input,
.select {
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 0.7rem;
  border: 1px solid var(--paper-line);
  border-bottom: 2px solid var(--paper-rule);
  border-radius: var(--r);
  background: var(--paper-well);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem; /* 16px keeps iOS from zooming the viewport on focus */
  line-height: 1.3;
  transition: border-color var(--t) var(--ease-out), background var(--t) var(--ease-out);
}

.input::placeholder {
  color: var(--ink-3);
}

.input:hover,
.select:hover {
  background: oklch(0.952 0.008 252);
}

.input:focus,
.select:focus {
  outline: none;
  background: var(--paper);
  border-color: var(--cyan-rule);
}

.input:focus-visible,
.select:focus-visible {
  outline: 2px solid var(--cyan-rule);
  outline-offset: 1px;
}

.input[aria-invalid='true'] {
  border-color: var(--alert);
  background: var(--alert-wash);
}

.select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.phone {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr);
  gap: 0.4rem;
}

@media (max-width: 24rem) {
  .phone {
    grid-template-columns: 1fr;
  }
}

.error-text {
  color: var(--alert);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ---- Ruled choice list ------------------------------------------------- */
.fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.choices {
  border-top: 1px solid var(--paper-line);
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 58px;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--paper-line);
  cursor: pointer;
  transition: background var(--t-press) var(--ease-out);
}

.choice:hover {
  background: var(--paper-well);
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* A struck square, not a radio dot. Scales from 0.4, never from 0: nothing in
   the real world appears out of nothing. */
.choice__mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--paper-rule);
  background: var(--paper);
}

.choice__mark::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--cyan-rule);
  opacity: 0;
  transform: scale(0.4);
  transition: transform var(--t) var(--ease-out), opacity var(--t) var(--ease-out);
}

.choice__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.choice__text b {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 700;
}

.choice__text span {
  color: var(--ink-3);
  font-size: 0.75rem;
  line-height: 1.45;
}

.choice:has(input:checked) {
  background: var(--cyan-wash);
}

.choice:has(input:checked) .choice__mark {
  border-color: var(--cyan-rule);
}

.choice:has(input:checked) .choice__mark::after {
  opacity: 1;
  transform: scale(1);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--cyan-rule);
  outline-offset: -2px;
}

/* ---- Segmented control ------------------------------------------------- */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper-well);
}

.seg {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0.3rem 0.25rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background var(--t-press) var(--ease-out), color var(--t-press) var(--ease-out);
}

.seg + .seg {
  border-left: 1px solid var(--paper-line);
}

.seg input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.seg:hover {
  background: var(--paper);
}

.seg:has(input:checked) {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.seg:has(input:focus-visible) {
  outline: 2px solid var(--cyan-rule);
  outline-offset: -2px;
}

/* Rendered open; collapsed only once JS takes over, so the field never
   disappears for a visitor without scripting. */
.conditional {
  display: grid;
  gap: 0.3rem;
  overflow: hidden;
  transition: opacity var(--t) var(--ease-out), max-height var(--t) var(--ease-out),
    margin-top var(--t) var(--ease-out);
}

.conditional[data-collapsed] {
  max-height: 0;
  opacity: 0;
  margin-top: -0.3rem;
  pointer-events: none;
}

.conditional[data-open] {
  max-height: 12rem;
  opacity: 1;
}

/* ---- Consent ----------------------------------------------------------- */
.consent {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
  line-height: 1.5;
  cursor: pointer;
}

.check input {
  flex: 0 0 auto;
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1px solid var(--paper-rule);
  border-radius: var(--r);
  background: var(--paper);
  cursor: pointer;
  transition: background var(--t-press) var(--ease-out), border-color var(--t-press) var(--ease-out);
}

.check input:checked {
  border-color: var(--cyan-rule);
  background: var(--cyan)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='%23132a4d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 13px no-repeat;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 54px;
  padding: 0.8rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: var(--cyan);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background var(--t-press) var(--ease-out);
}

.btn:hover {
  background: oklch(0.918 0.132 191);
  color: var(--ink);
}

/* A real press. The interface should feel like it heard the tap. */
.btn:active {
  transform: scale(0.97);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--block {
  width: 100%;
}

.btn--quiet {
  background: transparent;
  border-color: var(--paper-rule);
  color: var(--ink);
  font-weight: 700;
}

.btn--quiet:hover {
  background: var(--paper-well);
  border-color: var(--ink-3);
  color: var(--ink);
}

.btn__spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid oklch(0.235 0.062 263 / 0.3);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 640ms linear infinite;
}

.btn[data-busy] .btn__spinner {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ==========================================================================
   Notices
   ========================================================================== */
.note {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--paper-rule);
  border-radius: var(--r);
  background: var(--paper-well);
  color: var(--ink-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.note strong {
  color: var(--ink);
}

.note--alert {
  border-color: var(--alert);
  background: var(--alert-wash);
  color: var(--alert);
}

.note--live {
  border-color: var(--cyan-rule);
  background: var(--cyan-wash);
  color: var(--ink-2);
}

.note--dev {
  border-color: var(--gold-ink);
  background: oklch(0.968 0.028 88);
  color: var(--gold-ink);
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.65;
}

/* ==========================================================================
   Code entry
   ========================================================================== */
.sent-to {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.sent-to b {
  color: var(--ink);
  font-weight: 700;
  word-break: break-word;
}

.code {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.25rem, 2vw, 0.5rem);
}

.code input {
  width: 100%;
  aspect-ratio: 4 / 5;
  min-height: 58px;
  padding: 0;
  border: 1px solid var(--paper-line);
  border-bottom: 2px solid var(--paper-rule);
  border-radius: var(--r);
  background: var(--paper-well);
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(1.15rem, 5.5vw, 1.5rem);
  font-weight: 700;
  text-align: center;
  caret-color: var(--cyan-rule);
  transition: border-color var(--t-press) var(--ease-out), background var(--t-press) var(--ease-out);
}

.code input:focus {
  outline: none;
  border-color: var(--cyan-rule);
  background: var(--paper);
}

.code input:not(:placeholder-shown) {
  border-bottom-color: var(--ink);
  background: var(--paper);
}

.code[data-shake] {
  animation: shake 340ms var(--ease-out);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
  88% { transform: translateX(2px); }
}

.aside-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
  color: var(--ink-3);
  font-size: 0.8125rem;
}

.aside-row form {
  display: contents;
}

.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--cyan-rule);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.linkbtn:hover {
  color: var(--ink);
}

.linkbtn[disabled] {
  color: var(--ink-3);
  text-decoration: none;
  cursor: default;
}

/* ==========================================================================
   The counterfoil: the part you tear off and keep
   ========================================================================== */
.counterfoil {
  position: relative;
  padding: var(--sp-5) clamp(1.125rem, 4vw, 2.125rem) var(--sp-4);
}

/* A punched perforation, not a dashed border. */
.counterfoil::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background:
    radial-gradient(circle at 5.5px 3.5px, var(--paper-rule) 0 1.7px, transparent 1.9px)
      0 0 / 11px 7px repeat-x,
    linear-gradient(var(--paper-line), var(--paper-line)) 0 3px / 100% 1px repeat-x;
}

.counterfoil__coin {
  display: block;
  width: min(56%, 14rem);
  height: auto;
  margin: 0 auto var(--sp-4);
  filter: drop-shadow(0 14px 20px oklch(0.49 0.094 74 / 0.42));
}

.warrant-no {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: var(--sp-4) var(--sp-3);
  border: 1px solid var(--gold-ink);
  border-radius: var(--r);
  background: oklch(0.974 0.021 88);
  text-align: center;
}

.warrant-no__label {
  color: var(--gold-ink);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.warrant-no__code {
  color: var(--ink);
  font-family: var(--mono);
  font-variation-settings: 'wdth' 87.5;
  font-size: clamp(1.3rem, 6.5vw, 1.8rem);
  font-weight: 700;
  word-break: break-all;
}

.warrant-no__actions {
  margin-top: 0.55rem;
}

/* ---- The struck seal --------------------------------------------------- */
.seal-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.seal {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  color: var(--gold-ink);
}

.seal__legend {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2em;
  fill: currentColor;
}

.seal__centre {
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.05em;
  fill: currentColor;
}

.seal__fine {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  fill: currentColor;
}

.seal__rosette {
  opacity: 0.26;
}

.keep {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.keep h2 {
  font-size: var(--step-1);
  font-family: var(--sans);
  font-variation-settings: 'wdth' 118;
  font-weight: 800;
  letter-spacing: -0.022em;
}

.keep p {
  color: var(--ink-2);
  font-size: 0.875rem;
}

/* Terms of the warrant, set as a ruled list. */
.terms-list {
  margin: var(--sp-4) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--paper-line);
}

.terms-list li {
  display: grid;
  grid-template-columns: 1.3rem 1fr;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--paper-line);
  color: var(--ink-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.terms-list b {
  color: var(--ink);
}

.terms-list__n {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 600;
  padding-top: 0.3em;
}

/* ==========================================================================
   Foot of the sheet, and the field footer
   ========================================================================== */
.sheet__foot {
  padding: var(--sp-3) clamp(1.125rem, 4vw, 2.125rem);
  border-top: 1px solid var(--paper-line);
  color: var(--ink-3);
  font-size: 0.75rem;
}

.sheet__foot dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.15rem;
  margin: 0;
}

.sheet__foot div {
  display: flex;
  gap: 0.35rem;
}

.sheet__foot dd {
  margin: 0;
  color: var(--ink-2);
  font-weight: 600;
}

.field__footer {
  max-width: 35rem;
  margin: var(--sp-5) auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--on-field-2);
  font-size: 0.75rem;
  line-height: 1.55;
}

.field__footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.field__footer a {
  color: var(--on-field);
  font-weight: 600;
}

.field__footer a:hover {
  color: var(--cyan);
}

.field__footer p {
  max-width: 62ch;
}

/* ==========================================================================
   Document pages (draw terms, privacy notice)
   ========================================================================== */
.doc {
  padding: var(--sp-5) clamp(1.125rem, 4vw, 2.125rem) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.doc h1 {
  font-size: var(--step-2);
  font-family: var(--sans);
  font-variation-settings: 'wdth' 118;
  font-weight: 800;
  letter-spacing: -0.022em;
}

.doc h2 {
  margin-top: var(--sp-4);
  font-size: var(--step-1);
  font-family: var(--sans);
  font-variation-settings: 'wdth' 118;
  font-weight: 800;
  letter-spacing: -0.022em;
}

.doc__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 66ch;
}

.doc p,
.doc li {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.doc ul,
.doc ol {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.doc code {
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.doc__meta {
  color: var(--ink-3);
  font-size: 0.75rem;
}

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  width: fit-content;
}

.backlink:hover {
  color: var(--cyan-rule);
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: var(--z-toast);
  translate: -50% 0;
  padding: 0.6rem 1rem;
  border: 1px solid var(--cyan-rule);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--t) var(--ease-out), transform var(--t) var(--ease-out);
}

.toast[data-show] {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Motion. One choreographed moment: the seal strikes and the number appears.
   Everything else is feedback, under 300ms, and there is no page-load stagger.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .struck {
    /* Delayed so the number inks in first and the seal comes down over it. */
    animation: strike var(--t-strike) var(--ease-out) 400ms both;
    transform-origin: center;
    display: inline-block;
  }

  @keyframes strike {
    0% { opacity: 0; transform: scale(1.16) rotate(-8deg); }
    55% { opacity: 1; }
    100% { opacity: 1; transform: none; }
  }

  .inked {
    animation: ink 380ms var(--ease-out) 200ms both;
  }

  @keyframes ink {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
  }
}

/* Reduced motion keeps the fades that aid comprehension and drops the movement
   that causes trouble. */
@media (prefers-reduced-motion: reduce) {
  .struck,
  .inked {
    animation: fadein 200ms ease both;
  }

  @keyframes fadein {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .code[data-shake] {
    animation: none;
  }

  .btn:active {
    transform: none;
  }
}

/* ==========================================================================
   Utilities. These exist so no page needs an inline style attribute, which
   would force 'unsafe-inline' into the Content-Security-Policy.
   ========================================================================== */
.ink {
  color: var(--ink);
}

.muted-sm {
  color: var(--ink-3);
  font-size: 0.875rem;
}

.note--narrow {
  max-width: 32rem;
}

.inline-form {
  display: inline;
}

/* Bot bait: off-canvas, out of the tab order, invisible to assistive tech. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- Brand mark ---------------------------------------------------------
   The logo is white type with a cyan arrow, so it is never placed on paper
   directly. On the sheet it sits in a navy plate, the ground it was drawn for,
   which reads as a printed letterhead block.                                */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* The lockup carries a "by Spectra Global" line under the wordmark, which
   stops resolving below about 28px of height. That sets the floor. */
.brand img {
  display: block;
  width: auto;
  height: 28px;
}

@media (min-width: 30rem) {
  .brand img {
    height: 32px;
  }
}

.brand--plate {
  padding: 0.55rem 0.8rem;
  background: var(--ink);
  border-radius: var(--r);
}

/* ==========================================================================
   The sales question

   Its own marked row rather than a line among the consent boxes: ticking it
   changes what the hostess does next, so it has to be seen and not skimmed.
   ========================================================================== */
.ask {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--cyan-rule);
  border-radius: var(--r);
  background: var(--cyan-wash);
  cursor: pointer;
  transition: background var(--t-press) var(--ease-out);
}

.ask:hover {
  background: oklch(0.945 0.038 195);
}

.ask input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.ask__mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1px solid var(--cyan-rule);
  border-radius: var(--r);
  background: var(--paper);
}

.ask__mark::after {
  content: '';
  width: 11px;
  height: 11px;
  background: var(--cyan-rule);
  opacity: 0;
  transform: scale(0.4);
  transition: transform var(--t) var(--ease-out), opacity var(--t) var(--ease-out);
}

.ask:has(input:checked) .ask__mark::after {
  opacity: 1;
  transform: scale(1);
}

.ask:has(input:focus-visible) {
  outline: 2px solid var(--cyan-rule);
  outline-offset: 2px;
}

.ask__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ask__text b {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
}

.ask__text span {
  color: var(--ink-2);
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* ==========================================================================
   Handover instruction on the confirmation screen

   Addressed to the hostess holding the device, so it outranks everything else
   on the screen and uses the system colour, not the prize colour.
   ========================================================================== */
.handover {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--cyan-rule);
  border-radius: var(--r);
  background: var(--cyan-wash);
}

.handover__arrow {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--cyan-rule);
}

.handover__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.handover__text b {
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.3;
}

.handover__text span {
  color: var(--ink-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ==========================================================================
   The shareable studio

   The canvas is the picture at full resolution; the page just scales it down
   to fit. Everything the visitor does happens on the device.
   ========================================================================== */
.studio {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.studio__stage {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--paper-well);
  border: 1px solid var(--paper-line);
  border-radius: var(--r);
  padding: var(--sp-3);
}

.studio__canvas {
  display: block;
  width: 100%;
  max-width: 15rem;
  height: auto;
  aspect-ratio: 9 / 16;
  border-radius: var(--r);
  touch-action: none; /* let the pointer handlers own drag and pinch */
  cursor: grab;
}

.studio__canvas.is-feed {
  aspect-ratio: 4 / 5;
}

.studio__canvas:active {
  cursor: grabbing;
}

.studio__empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--ink-3);
  font-size: 0.875rem;
  pointer-events: none;
}

.studio__empty svg {
  width: 34px;
  height: 34px;
}

.studio__hint {
  color: var(--ink-3);
  font-size: 0.8125rem;
  text-align: center;
}

.studio__formats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper-well);
}

/* The file input is off-canvas and driven by its label, which is the button. */
label.btn {
  cursor: pointer;
}
