:root {
  --paper: #f3eee4;
  --card: #fbf9f4;
  --ink: #15201b;
  --ink-soft: #4a5550;
  --muted: #7a837e;
  --line: #d9d2c3;
  --green: #0f5c4a;
  --green-deep: #0a4437;
  --amber: #b8651f;
  --amber-bg: #fbf1e4;
  --success-bg: #e8f2ec;
  --display: "Fraunces", Georgia, serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.33 0 0 0 0 0.28 0 0 0 0.35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.masthead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px clamp(20px, 5vw, 64px) 0;
  animation: rise 0.6s ease both;
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.wordmark {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 640px);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  padding: clamp(40px, 8vh, 96px) clamp(20px, 5vw, 64px) 80px;
  max-width: 1100px;
}

.rail { animation: rise 0.6s 0.1s ease both; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1.5px solid var(--line);
}

.steps li {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 10px 0 10px 20px;
  color: var(--muted);
  transition: color 0.3s ease;
}

.steps li::before {
  content: "";
  position: absolute;
  left: -5.5px;
  top: 19px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--line);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.steps li.is-active { color: var(--ink); }
.steps li.is-active::before { background: var(--green); border-color: var(--green); transform: scale(1.25); }
.steps li.is-done { color: var(--ink-soft); }
.steps li.is-done::before { background: var(--ink-soft); border-color: var(--ink-soft); }

.steps .num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; }
.steps .label { font-weight: 500; }

.rail-note {
  margin: 28px 0 0 20px;
  font-size: 13px;
  color: var(--muted);
  max-width: 180px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: clamp(28px, 4vw, 48px);
  animation: rise 0.6s 0.2s ease both;
}

.panel { animation: fade 0.35s ease both; }

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
}

h1, h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  font-variation-settings: "opsz" 144;
}

h1 { font-size: clamp(34px, 5vw, 52px); }
h2 { font-size: clamp(28px, 4vw, 40px); }

.lede { margin: 0 0 24px; font-size: 17px; color: var(--ink-soft); }
.lede strong { color: var(--ink); font-weight: 600; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.start-form { display: grid; gap: 16px; margin-top: 8px; }

.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-soft); }

.field input {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15, 92, 74, 0.15); }

.button {
  justify-self: start;
  padding: 14px 26px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  border: 1.5px solid var(--green-deep);
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.15s ease;
  box-shadow: 3px 3px 0 var(--green-deep);
}

.button:hover { background: var(--green-deep); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--green-deep); }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--green-deep); }
.button:disabled { opacity: 0.6; cursor: progress; transform: none; }

.button.ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.button.ghost:hover { background: #fff; box-shadow: 4px 4px 0 var(--ink); }

.form-error { margin: 0; font-size: 14px; color: var(--amber); }

.scan {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
  margin: 8px 0 20px;
}

.qr-frame {
  margin: 0;
  padding: 14px;
  background: #fff;
  border: 1.5px dashed var(--ink);
  border-radius: 6px;
}

.qr-frame img { display: block; width: 280px; height: 280px; image-rendering: pixelated; }

.howto {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  display: grid;
  gap: 12px;
  font-size: 15px;
}
.howto strong { color: var(--ink); font-weight: 600; }

.notice {
  margin: 20px 0 0;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--amber);
  background: var(--amber-bg);
  border-left: 3px solid var(--amber);
}

.notice.success { color: var(--green-deep); background: var(--success-bg); border-left-color: var(--green); margin-bottom: 24px; }

.counter {
  display: flex;
  gap: 40px;
  margin: 8px 0 24px;
}

.counter div { display: grid; gap: 2px; }
.counter strong { font-size: clamp(34px, 5vw, 48px); font-weight: 500; line-height: 1; color: var(--ink); }
.counter span { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

.progress {
  position: relative;
  height: 4px;
  overflow: hidden;
  background: var(--line);
  border-radius: 2px;
}

.progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 35%;
  background: var(--green);
  border-radius: 2px;
  animation: sweep 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.ellipsis span { animation: blink 1.4s infinite; }
.ellipsis span:nth-child(2) { animation-delay: 0.2s; }
.ellipsis span:nth-child(3) { animation-delay: 0.4s; }

.check {
  display: inline-grid;
  place-items: center;
  width: 0.9em;
  height: 0.9em;
  margin-right: 6px;
  font-size: 0.7em;
  vertical-align: 0.1em;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
}

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

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

@keyframes sweep {
  0% { left: -35%; }
  100% { left: 100%; }
}

@keyframes blink {
  0%, 60%, 100% { opacity: 0.2; }
  30% { opacity: 1; }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 28px; }
  .steps { display: flex; border-left: 0; border-top: 1.5px solid var(--line); }
  .steps li { flex: 1; flex-direction: column; gap: 4px; padding: 14px 0 0; }
  .steps li::before { left: 0; top: -5.5px; }
  .steps .label { font-size: 13px; }
  .rail-note { margin-left: 0; margin-top: 16px; max-width: none; }
  .scan { grid-template-columns: 1fr; justify-items: center; }
  .card { box-shadow: 4px 4px 0 var(--ink); }
}

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