/* Dan Party — dispatch-slip visual system */

:root {
  --paper: #dfe2db;
  --paper-slip: #f2f3ee;
  --ink: #16191a;
  --ink-soft: #5f665e;
  --stamp: #1f4fd8;
  --rule: #b9bfb4;
  --alert: #a8321f;

  --measure: 40rem;
  --slip-shadow: 0 1px 0 var(--rule), 0 12px 28px -20px rgba(22, 25, 26, 0.55);
}

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

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

body {
  margin: 0;
  padding: 0 1.25rem 5rem;
  background: var(--paper);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ---- masthead ---------------------------------------------------- */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.5rem 0 1.25rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 2.5rem;
}

.masthead a {
  color: inherit;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.masthead .mono {
  color: var(--ink-soft);
}

/* ---- type -------------------------------------------------------- */

h1 {
  font-size: clamp(2.1rem, 7vw, 3.1rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.6rem;
}

.lede {
  font-size: 1.06rem;
  color: var(--ink-soft);
  margin: 0 0 2.25rem;
  max-width: 32rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--stamp);
  text-underline-offset: 0.2em;
}

/* ---- the slip ---------------------------------------------------- */

.slip {
  position: relative;
  background: var(--paper-slip);
  border: 1px solid var(--rule);
  border-top: none;
  padding: 1.75rem 1.5rem;
  box-shadow: var(--slip-shadow);
}

/* perforated top edge — the one flourish */
.slip::before {
  content: "";
  display: block;
  position: absolute;
  top: -9px;
  left: -1px;
  right: -1px;
  height: 9px;
  background:
    radial-gradient(circle at 6px 0, transparent 5px, var(--paper-slip) 5.5px) repeat-x
      0 0 / 12px 9px;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.slip-no {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
}

.field {
  display: block;
  margin-bottom: 1.4rem;
}

.field > .mono {
  display: block;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.field input[type="tel"] {
  width: 100%;
  padding: 0.8rem 0.85rem;
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
}

.field input[type="tel"]:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 2px;
}

/* consent — deliberately the most prominent block on the slip */

.consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem;
  border: 2px solid var(--ink);
  background: transparent;
  cursor: pointer;
  margin-bottom: 1.25rem;
}

.consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  accent-color: var(--stamp);
}

.consent span {
  font-size: 0.94rem;
  line-height: 1.5;
}

.disclosure {
  border-left: 3px solid var(--rule);
  padding: 0.1rem 0 0.1rem 0.9rem;
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.65;
}

.disclosure p {
  margin: 0 0 0.35rem;
}

.disclosure p:last-child {
  margin-bottom: 0;
}

button {
  width: 100%;
  padding: 0.95rem 1rem;
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-slip);
  background: var(--ink);
  border: none;
  border-radius: 0;
  cursor: pointer;
}

button:hover {
  background: var(--stamp);
}

button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.msg {
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.4rem;
}

.msg[data-state="error"] {
  color: var(--alert);
}

.msg[data-state="ok"] {
  color: var(--ink);
}

/* stamped confirmation — the signature moment */
.stamped {
  position: relative;
}

.stamped::after {
  content: "ENROLLED — REPLY YES TO CONFIRM";
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--stamp);
  border: 3px double var(--stamp);
  padding: 0.6rem 0.9rem;
  background: rgba(242, 243, 238, 0.92);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .stamped::after {
    animation: stamp 220ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
  }
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-6deg) scale(1.6);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-6deg) scale(1);
  }
}

/* ---- keyword alternative ----------------------------------------- */

.keyword {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.keyword strong {
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  letter-spacing: 0.02em;
}

/* ---- legal pages ------------------------------------------------- */

.legal {
  font-size: 0.96rem;
}

.legal h1 {
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  margin-bottom: 0.35rem;
}

.legal ul {
  padding-left: 1.15rem;
  margin: 0 0 1rem;
}

.legal li {
  margin-bottom: 0.4rem;
}

.updated {
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

/* ---- footer ------------------------------------------------------ */

footer {
  max-width: var(--measure);
  margin: 3.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  color: var(--ink-soft);
}

footer a {
  color: var(--ink-soft);
}
