:root {
  --paper: #f7f1e1;
  --paper-bright: #fffdf6;
  --ink: #14110f;
  --pink: #ff2e88;
  --blue: #2230ff;
  --cyan: #15cfe0;
  --yellow: #ffd400;
  --green: #21c25a;
  --orange: #ff7a1a;
  --tape: rgba(255, 212, 0, 0.55);
  --hard: 4px 4px 0 var(--ink);
  --hard-pink: 6px 6px 0 var(--pink);
  --hard-cyan: 6px 6px 0 var(--cyan);
  --hard-blue: 6px 6px 0 var(--blue);

  /* memphis scatter tile */
  --memphis-scatter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg stroke='%2314110f' stroke-width='3' fill='none' stroke-linecap='round'%3E%3Cpath d='M22 30 l16 9'/%3E%3Cpath d='M64 22 l-11 13'/%3E%3Cpath d='M40 120 l11 -13'/%3E%3Cpath d='M86 158 l13 9'/%3E%3Cpath d='M188 150 l-13 11'/%3E%3Cpath d='M196 92 l-9 13'/%3E%3Cpath d='M150 196 l13 -9'/%3E%3Ccircle cx='120' cy='58' r='9'/%3E%3Cpolyline points='128,150 138,140 148,150 158,140'/%3E%3Cpath d='M30 178 l16 7'/%3E%3C/g%3E%3Cg fill='%23ff2e88'%3E%3Cpolygon points='170,178 186,178 178,164'/%3E%3C/g%3E%3Cg fill='%232230ff'%3E%3Crect x='98' y='116' width='11' height='11' transform='rotate(15 103 121)'/%3E%3C/g%3E%3Cg fill='%2315cfe0'%3E%3Ccircle cx='62' cy='86' r='6'/%3E%3C/g%3E%3C/svg%3E");
  --squiggle-pink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='20' viewBox='0 0 120 20'%3E%3Cpath d='M2 10 C 12 0 22 20 32 10 S 52 0 62 10 S 82 20 92 10 S 112 0 118 10' fill='none' stroke='%23ff2e88' stroke-width='4'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Space Mono", "SF Mono", Menlo, monospace;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--blue); }
a:hover { color: var(--pink); }

.page {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ---- decorative layers ---- */

.memphis-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--paper);
  background-image:
    var(--memphis-scatter),
    linear-gradient(rgba(34, 48, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 48, 255, 0.07) 1px, transparent 1px);
  background-size: 220px 220px, 26px 26px, 26px 26px;
  opacity: 0.5;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
}

/* ---- poster header ---- */

.poster {
  position: relative;
  border: 4px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: var(--hard-pink);
  padding: 1.75rem 1.5rem 1.5rem;
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.poster::before {
  content: "";
  position: absolute;
  left: -40px;
  bottom: -40px;
  width: 120px;
  height: 120px;
  background:
    repeating-conic-gradient(var(--ink) 0 25%, transparent 0 50%) 0 0 / 18px 18px;
  opacity: 0.12;
  transform: rotate(12deg);
}

.regmark {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  z-index: 2;
}

.regmark::before,
.regmark::after {
  content: "";
  position: absolute;
  background: var(--ink);
}

.regmark::before {
  top: 50%;
  left: 2px;
  right: 2px;
  height: 1px;
  transform: translateY(-50%);
}

.regmark::after {
  left: 50%;
  top: 2px;
  bottom: 2px;
  width: 1px;
  transform: translateX(-50%);
}

.regmark--tl { top: 10px; left: 10px; }
.regmark--tr { top: 10px; right: 10px; }
.regmark--bl { bottom: 10px; left: 10px; }
.regmark--br { bottom: 10px; right: 10px; }

.halftone {
  position: absolute;
  pointer-events: none;
}

.halftone--pink {
  top: -20px;
  right: -20px;
  width: 140px;
  height: 140px;
  background-image: radial-gradient(circle, var(--pink) 1.5px, transparent 1.5px);
  background-size: 8px 8px;
  opacity: 0.35;
}

.tape {
  position: absolute;
  width: 72px;
  height: 22px;
  background: var(--tape);
  border: 1px solid rgba(20, 17, 15, 0.15);
  transform: rotate(-4deg);
  z-index: 2;
}

.tape--a { top: -8px; left: 18%; }
.tape--b {
  bottom: 12px;
  right: 8%;
  background: rgba(21, 207, 224, 0.45);
  transform: rotate(3deg);
}

/* memphis confetti shapes on the poster */
.shape {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.shape--triangle {
  right: 16%;
  top: 14px;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 28px solid var(--cyan);
  transform: rotate(14deg);
}

.shape--circle {
  right: 6%;
  bottom: 38px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, var(--yellow) 50%, var(--ink) 50%);
  border: 3px solid var(--ink);
}

.shape--squiggle {
  left: 7%;
  bottom: 8px;
  width: 120px;
  height: 20px;
  background: var(--squiggle-pink) no-repeat center / contain;
}

.shape--bars {
  left: 40%;
  top: 6px;
  width: 34px;
  height: 22px;
  background: repeating-linear-gradient(
    90deg,
    var(--blue) 0 4px,
    transparent 4px 8px
  );
  transform: rotate(-8deg);
}

.poster__kicker {
  position: relative;
  z-index: 3;
  margin: 0 0 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--blue);
}

.poster__title {
  position: relative;
  z-index: 3;
  margin: 0 0 0.75rem;
  line-height: 0.9;
}

.word {
  display: block;
  font-family: "Archivo Black", system-ui, sans-serif;
  text-transform: uppercase;
}

.word--solid {
  font-size: clamp(2.6rem, 11vw, 3.8rem);
  color: var(--ink);
  text-shadow: 4px 0 var(--cyan), -3px 0 var(--pink), 6px 6px 0 rgba(20, 17, 15, 0.12);
}

.word--ghost {
  font-size: clamp(2.1rem, 8.5vw, 3rem);
  color: transparent;
  -webkit-text-stroke: 2.5px var(--ink);
}

.word--accent {
  display: inline-block;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  color: #fff;
  font-style: italic;
  letter-spacing: 0.03em;
  background: var(--pink);
  border: 3px solid var(--ink);
  padding: 0.05em 0.4em;
  box-shadow: 4px 4px 0 var(--blue);
  transform: rotate(-2deg);
}

.poster__sub {
  position: relative;
  z-index: 3;
  margin: 0;
  max-width: 34rem;
  font-size: 0.82rem;
}

.poster__sub code {
  background: var(--yellow);
  padding: 0 0.25rem;
  border: 1px solid var(--ink);
}

.poster__meta {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.poster__meta code {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 0.1rem 0.35rem;
}

.poster__fine {
  margin: 2rem 0 0;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}

.poster__fine a { color: inherit; }

/* ---- status ---- */

.status {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 3px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: var(--hard);
  font-size: 0.8rem;
}

.status[data-kind="error"] {
  background: #ffe8f2;
  border-color: var(--pink);
}

.status[data-kind="success"] {
  background: #e8fff0;
}

.status[hidden] { display: none; }

/* ---- panels & buttons ---- */

.panel {
  border: 3px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: var(--hard);
  padding: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 3px solid var(--ink);
  background: var(--paper-bright);
  padding: 0.65rem 1rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}

.btn--primary {
  background: var(--pink);
  color: #fff;
  font-size: 0.95rem;
  padding: 0.9rem 1.4rem;
  box-shadow: 5px 5px 0 var(--blue);
  transform: rotate(-1deg);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn--primary:hover {
  transform: rotate(-1deg) translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--blue);
}

.btn--primary:active {
  transform: rotate(-1deg) translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--blue);
}

.btn__arrow { opacity: 0.95; }

.form-actions {
  position: relative;
  margin-top: 1.5rem;
  border-color: var(--ink);
  box-shadow: var(--hard-cyan);
  overflow: hidden;
}

.form-actions::before {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 80px;
  height: 80px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  opacity: 0.4;
}

.form-actions__note {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  opacity: 0.85;
}

/* ---- form layout ---- */

.declaration-form { display: block; }

/* each section is a solid card so the busy background never sits behind text */
.form-section {
  position: relative;
  margin-bottom: 1.85rem;
  border: 4px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: var(--hard);
  padding: 0 1.25rem 1.25rem;
  overflow: hidden;
}

/* cycling colour shadows on every card; tilt on roughly one in three */
.form-section:nth-of-type(4n+1) { box-shadow: 6px 6px 0 var(--cyan); }
.form-section:nth-of-type(4n+2) { box-shadow: 6px 6px 0 var(--yellow); }
.form-section:nth-of-type(4n+3) { box-shadow: 6px 6px 0 var(--pink); }
.form-section:nth-of-type(4n+4) { box-shadow: 6px 6px 0 var(--green); }

.form-section:nth-of-type(6n+2) { transform: rotate(-0.45deg); }
.form-section:nth-of-type(6n+5) { transform: rotate(0.45deg); }

.instruction {
  margin-bottom: 1.25rem;
}

/* full-width coloured header bar, flush to the top of the card */
.section-header {
  position: relative;
  margin: 0 -1.25rem 1.25rem;
  padding: 0.7rem 1.25rem;
  border: none;
  border-bottom: 4px solid var(--ink);
  background: var(--cyan);
  box-shadow: none;
}

.form-section:nth-of-type(4n+1) .section-header { background: var(--cyan); }
.form-section:nth-of-type(4n+2) .section-header { background: var(--yellow); }
.form-section:nth-of-type(4n+3) .section-header { background: var(--pink); }
.form-section:nth-of-type(4n+4) .section-header { background: var(--green); color: #fff; }

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.section-square {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background:
    repeating-conic-gradient(var(--ink) 0 25%, transparent 0 50%) 0 0 / 11px 11px;
  border: 2px solid var(--ink);
  background-color: #fff;
}

.section-title-text {
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.45);
}

.section-description {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  opacity: 0.9;
}

/* instructions block (Keep / Copy / Machine right) */
.form-section-instructions .section-header { background: var(--blue); color: #fff; }
.form-section-instructions .section-square { background-color: var(--yellow); }

.instruction {
  position: relative;
  border: 3px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 1rem;
}

.instruction-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
  border-bottom: 3px dashed rgba(20, 17, 15, 0.3);
  padding-bottom: 0.55rem;
}

.instruction-square {
  width: 16px;
  height: 16px;
  background: var(--pink);
  border: 2px solid var(--ink);
  transform: rotate(45deg);
}

.instruction-name {
  font-family: "Archivo Black", system-ui, sans-serif;
  color: var(--pink);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.instruction-description {
  font-size: 0.78rem;
  opacity: 0.85;
}

.instruction-empty-hint {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.75rem;
  background: var(--yellow);
  border: 2px solid var(--ink);
  font-size: 0.75rem;
}

.instruction-empty-hint[hidden] { display: none; }

.field,
.form-group {
  margin: 0 0 1.35rem;
  padding: 0;
  border: 0;
}

.form-group {
  border: 3px dashed rgba(20, 17, 15, 0.3);
  padding: 0.85rem;
}

.form-group legend {
  padding: 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--cyan);
  border: 2px solid var(--ink);
}

.question-label {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
}

.instruction .field:first-of-type .question-label {
  margin-top: 0.15rem;
}

.form-note {
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem 0.6rem 1rem;
  border-left: 6px solid var(--yellow);
  background: rgba(255, 212, 0, 0.12);
  font-size: 0.8rem;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  max-width: 100%;
  border: 3px solid var(--ink);
  background: var(--paper-bright);
  padding: 0.6rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  box-shadow: 3px 3px 0 var(--ink);
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 3px 3px 0 var(--cyan);
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

/* ---- options: bubblegum radios + checkboxes ---- */

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.option-stack {
  display: flex;
  flex-direction: column;
}

.option-label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

/* coloured tilt on roughly one in three options; the rest stay square */
.options-grid .option-stack:nth-child(6n+2) .option-label {
  box-shadow: 3px 3px 0 var(--cyan);
  transform: rotate(-0.5deg);
}

.options-grid .option-stack:nth-child(6n+5) .option-label {
  box-shadow: 3px 3px 0 var(--pink);
  transform: rotate(0.5deg);
}

.option-label:hover {
  transform: translate(-1px, -1px) rotate(0deg);
  box-shadow: 5px 5px 0 var(--cyan);
}

/* custom memphis radio / checkbox markers */
.option-label input[type="radio"],
.option-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 22px;
  height: 22px;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  display: grid;
  place-content: center;
}

.option-label input[type="radio"] { border-radius: 50%; }

.option-label input[type="radio"]::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink);
  transform: scale(0);
  transition: transform 0.1s ease;
}

.option-label input[type="checkbox"]::after {
  content: "";
  width: 11px;
  height: 11px;
  background: var(--pink);
  transform: scale(0) rotate(0deg);
  transition: transform 0.1s ease;
}

.option-label input[type="radio"]:checked::after { transform: scale(1); }
.option-label input[type="checkbox"]:checked::after { transform: scale(1) rotate(15deg); }

/* selected = bubblegum pop, always straight (unwonk wonky ones, don't wonk straight ones) */
.options-grid .option-stack .option-label:has(input:checked) {
  background: #ffe8f2;
  box-shadow: 5px 5px 0 var(--pink);
  transform: none;
}

.options-grid .option-stack:nth-child(6n+2) .option-label:has(input:checked),
.options-grid .option-stack:nth-child(6n+5) .option-label:has(input:checked) {
  transform: none;
}

.options-grid .option-stack .option-label:has(input:checked):hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--pink);
}

/* When a follow-up is showing, group it with its parent option in one box */
.option-stack:has(.followup-inline:not([hidden])) {
  border: 3px solid var(--ink);
  background: #ffe8f2;
  box-shadow: 5px 5px 0 var(--pink);
}

.options-grid .option-stack:has(.followup-inline:not([hidden])) .option-label {
  border: none;
  background: transparent;
  box-shadow: none;
  transform: none;
  border-bottom: 3px dashed rgba(20, 17, 15, 0.3);
}

.option-stack:has(.followup-inline:not([hidden])) .followup-inline {
  margin: 0;
  padding: 0.7rem 0.8rem 0.8rem;
}

.followup { margin-top: 0; }

.followup-inline .followup-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pink);
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
