/* Shared base + public redemption page.
   Look: bottle-green page, cream "ticket" form with an ink outline and a butter-yellow hard shadow. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Warm neutrals, tinted toward the brand hue */
  --bg: oklch(0.975 0.008 75);
  --surface: oklch(0.995 0.004 80);
  --surface-2: oklch(0.965 0.011 75);
  --border: oklch(0.905 0.014 70);
  --border-strong: oklch(0.82 0.02 65);
  --text: oklch(0.2 0.03 160);
  --muted: oklch(0.48 0.03 50);
  --faint: oklch(0.6 0.025 60);

  /* Brand */
  --ink: oklch(0.2 0.03 160);
  --paper: oklch(0.985 0.012 85);
  --felt: oklch(0.36 0.07 162);       /* page background */
  --felt-deep: oklch(0.27 0.05 162);
  --felt-text: oklch(0.86 0.035 150); /* secondary text on --felt */
  --sun: oklch(0.9 0.15 95);

  --accent: oklch(0.42 0.08 162);
  --accent-hover: oklch(0.36 0.07 162);
  --accent-soft: oklch(0.95 0.03 155);
  --on-accent: oklch(0.99 0.008 85);
  --focus: oklch(0.42 0.08 162 / 0.28);

  --ok: oklch(0.5 0.13 145);
  --ok-soft: oklch(0.95 0.045 140);
  --warn: oklch(0.55 0.13 70);
  --warn-soft: oklch(0.96 0.05 88);
  --danger: oklch(0.53 0.19 27);
  --danger-soft: oklch(0.96 0.03 27);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px oklch(0.3 0.04 160 / 0.06), 0 8px 24px oklch(0.3 0.05 160 / 0.07);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
[hidden] { display: none !important; }
::selection { background: var(--sun); color: var(--ink); }

/* ---------- Form controls ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 0.875rem; font-weight: 650; }
.hint { font-size: 0.8125rem; color: var(--muted); }
.error { font-size: 0.8125rem; color: var(--danger); font-weight: 550; }
.error:empty { display: none; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a6a5e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--focus); }
input[aria-invalid="true"] { border-color: var(--danger); }
input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px oklch(0.53 0.19 27 / 0.2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px;
  font: inherit; font-size: 0.875rem; font-weight: 650; line-height: 1;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease), transform 150ms var(--ease);
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn-ok { color: var(--ok); }
.btn-ok:hover { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 1rem; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 0.8125rem; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--accent); text-decoration: underline; cursor: pointer; }

.form-error {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid oklch(0.86 0.06 27);
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 550;
}

/* ---------- Public page ---------- */
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

body.public {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  color: var(--paper);
  background-color: var(--felt);
  background-image: radial-gradient(oklch(0.985 0.012 85 / 0.07) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
}
.public :focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.public .ticket :focus-visible { outline-color: var(--ink); }

.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 76px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.125rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.logo:hover { color: var(--text); }
.logo, .secure-pill { white-space: nowrap; }
.logo-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: var(--sun); flex: none; }
.public .logo, .public .logo:hover { color: var(--paper); }
.public .logo-mark { background: var(--sun); color: var(--ink); }
.logo-mark svg { width: 19px; height: 19px; }
.public .logo-mark { transform: rotate(-6deg); }
.secure-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border: 2px solid oklch(0.985 0.012 85 / 0.35); border-radius: 999px;
  font-size: 0.8125rem; font-weight: 700; color: var(--paper);
}
.secure-pill svg { width: 15px; height: 15px; }

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 468px);
  grid-template-areas: "intro ticket" "how ticket";
  grid-template-rows: auto 1fr;
  column-gap: clamp(40px, 6vw, 88px);
  row-gap: 48px;
  align-items: start;
  padding-top: clamp(24px, 5vw, 56px);
  padding-bottom: 72px;
}
.intro { grid-area: intro; display: grid; gap: 22px; justify-items: start; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--sun); color: var(--ink);
  font-size: 0.8125rem; font-weight: 700;
}
.kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--felt); }
.intro h1 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 78%;
  font-size: clamp(2.75rem, 6.4vw, 5.25rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  max-width: 10ch;
  text-wrap: balance;
}
.mark {
  display: inline-block;
  padding: 0 0.12em 0.04em;
  margin: 0.04em 0;
  border-radius: 0.14em;
  background: var(--sun);
  color: var(--ink);
  box-shadow: 0.06em 0.06em 0 var(--felt-deep);
  transform: rotate(-2.5deg);
}
.lead { font-size: 1.125rem; line-height: 1.5; color: var(--felt-text); max-width: 40ch; font-weight: 500; }

.how { grid-area: how; align-self: start; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.steps li { display: grid; gap: 6px; padding-top: 14px; border-top: 2px solid oklch(0.985 0.012 85 / 0.3); align-content: start; }
.step-num { color: var(--sun); font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 1.75rem; line-height: 1; letter-spacing: -0.03em; }
.steps strong { font-size: 0.9375rem; line-height: 1.3; }
.steps span:not(.step-num) { font-size: 0.875rem; line-height: 1.4; color: var(--felt-text); }

/* The ticket */
.ticket {
  grid-area: ticket;
  position: relative;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 8px 0 var(--sun);
  animation: ticket-in 700ms var(--ease-expo) both;
}
.ticket-stub { padding: 26px 28px 24px; display: grid; gap: 12px; }
.ticket-body { padding: 24px 28px 26px; }
.ticket-tear {
  position: relative; height: 2px;
  background-image: linear-gradient(90deg, oklch(0.2 0.03 160 / 0.35) 55%, transparent 0);
  background-size: 12px 2px;
  margin: 0 26px;
}
.ticket-tear::before, .ticket-tear::after {
  content: ""; position: absolute; top: -15px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--felt); border: 2px solid var(--ink);
}
/* Center each notch on the ticket's outer edge and keep only the half inside the ticket. */
.ticket-tear::before { left: -43px; clip-path: inset(0 0 0 50%); }
.ticket-tear::after { right: -43px; clip-path: inset(0 50% 0 0); }

.stub-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stub-head label { font-family: var(--display); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.code-count { font-size: 0.8125rem; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.code-count.is-complete { color: var(--ok); }

.public .code-input {
  min-height: 66px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: clamp(1.25rem, 4.6vw, 1.625rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
}
.public .code-input::placeholder { color: oklch(0.2 0.03 160 / 0.22); letter-spacing: 0.12em; }
.public .code-input:hover { border-color: var(--ink); }
.public .code-input[aria-invalid="true"] { border-color: var(--danger); }

.code-meter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.code-meter span { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.code-meter i { height: 6px; border-radius: 3px; background: oklch(0.2 0.03 160 / 0.12); transition: background-color 200ms var(--ease), transform 300ms var(--ease-expo); }
.code-meter i.is-on { background: var(--felt); transform: scaleY(1.35); }
.code-meter.is-complete i { background: var(--ok); }

.form { display: grid; gap: 16px; }
.public .field input:not(.code-input) { min-height: 48px; border-radius: 12px; }
.suggest { font-size: 0.875rem; padding: 8px 11px; border-radius: var(--radius-sm); background: var(--warn-soft); color: oklch(0.42 0.1 70); }
.fine { font-size: 0.75rem; color: var(--muted); text-align: center; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { min-height: 65px; }

.public .btn-primary {
  min-height: 58px;
  margin-top: 4px;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 14px;
  color: var(--paper);
}
.public .btn-primary svg { width: 20px; height: 20px; transition: transform 250ms var(--ease-expo); }
.public .btn-primary:hover { background: var(--ink); color: var(--paper); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--sun); }
.public .btn-primary:hover svg { transform: translateX(4px); }
.public .btn-primary:active { transform: none; box-shadow: none; }
.public .btn-primary:focus-visible { outline: 3px solid var(--felt); outline-offset: 3px; box-shadow: none; }
.btn.is-loading::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid oklch(0.985 0.012 80 / 0.3); border-top-color: var(--paper);
  animation: spin 700ms linear infinite;
}
.btn.is-loading svg { display: none; }

/* Success */
.success-stub { position: relative; padding-top: 30px; overflow: hidden; }
.success-icon {
  width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: 50%; background: var(--ok); color: var(--paper);
  border: 2px solid var(--ink);
  animation: pop 500ms var(--ease-expo) 150ms both;
}
.success-icon svg { width: 28px; height: 28px; }
.success-stub h2 { font-family: var(--display); font-size: clamp(1.625rem, 4vw, 2rem); font-weight: 800; font-stretch: 85%; line-height: 1.02; letter-spacing: -0.03em; max-width: 12ch; }
.success-lead { font-size: 1.0625rem; font-weight: 600; }
.stamp {
  position: absolute; top: 26px; right: 22px;
  padding: 6px 12px;
  border: 3px solid var(--accent); border-radius: 10px;
  color: var(--accent);
  font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 1.125rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  transform: rotate(-12deg);
  animation: stamp 550ms var(--ease-expo) 350ms both;
}
.burst { position: absolute; top: 54px; left: 54px; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; width: 8px; height: 8px; border-radius: 2px; opacity: 0; animation: burst 900ms var(--ease-expo) 200ms both; }
.burst i:nth-child(1) { background: var(--felt); --x: 70px; --y: -40px; }
.burst i:nth-child(2) { background: var(--sun); --x: 90px; --y: 10px; border-radius: 50%; }
.burst i:nth-child(3) { background: var(--ink); --x: 40px; --y: -60px; }
.burst i:nth-child(4) { background: var(--ok); --x: -10px; --y: -64px; border-radius: 50%; }
.burst i:nth-child(5) { background: var(--sun); --x: 110px; --y: -24px; }
.burst i:nth-child(6) { background: var(--sun); --x: 60px; --y: 40px; }
.burst i:nth-child(7) { background: var(--ink); --x: 20px; --y: 56px; border-radius: 50%; }
.burst i:nth-child(8) { background: var(--accent); --x: 96px; --y: 48px; }

.summary { margin: 0 0 16px; font-size: 0.9375rem; }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 2px dotted oklch(0.2 0.03 160 / 0.2); }
.summary div:first-child { padding-top: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.summary .order-no { font-family: var(--mono); }
.note { font-size: 0.875rem; color: var(--muted); margin-bottom: 18px; }
.btn-again { width: 100%; min-height: 50px; border: 2px solid var(--ink); border-radius: 14px; background: transparent; color: var(--ink); font-weight: 750; font-size: 0.9375rem; }
.btn-again:hover { background: var(--ink); color: var(--paper); }

.site-footer { font-size: 0.8125rem; color: var(--felt-text); font-weight: 550; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 24px; border-top: 2px solid oklch(0.985 0.012 85 / 0.15); }

@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ticket-in { from { opacity: 0; transform: translateY(18px) rotate(1.5deg); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes stamp { from { opacity: 0; transform: rotate(-12deg) scale(1.8); } to { opacity: 1; transform: rotate(-12deg) scale(1); } }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(0.6) rotate(180deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .burst { display: none; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "ticket" "how";
    grid-template-rows: auto;
    row-gap: 32px;
    padding-bottom: 48px;
  }
  .ticket { max-width: 520px; width: 100%; }
  .intro { gap: 16px; }
  .intro h1 { max-width: 12ch; }
}
@media (max-width: 520px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .site-header .wrap { height: 64px; }
  .logo { font-size: 1rem; }
  .secure-pill { height: 30px; padding: 0 10px; font-size: 0.75rem; }
  .pill-extra { display: none; }
  .intro h1 { font-size: clamp(2.5rem, 12.5vw, 3.25rem); }
  .lead { font-size: 1rem; }
  .ticket { border-radius: 20px; box-shadow: 5px 5px 0 var(--sun); }
  .ticket-stub { padding: 22px 18px 20px; }
  .ticket-body { padding: 20px 18px 22px; }
  .ticket-tear { margin: 0 18px; }
  .ticket-tear::before { left: -35px; }
  .ticket-tear::after { right: -35px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .steps li { grid-template-columns: 44px minmax(0, 1fr); column-gap: 8px; padding: 12px 0; border-top-width: 2px; }
  .steps .step-num { grid-row: span 2; font-size: 1.5rem; }
}
