@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/fraunces-wonk.woff2") format("woff2-variations");
  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;
}

:root {
  --bg: #f3e9d2;
  --bg-panel: #eadfc2;
  --border: #d6c6a0;
  --ink: #2e2318;
  --ink-soft: #7a6a52;
  --accent: #1e6e68;
  --accent-press: #175650;
  --accent-ink: #fbf4e4;
  --danger: #c0503b;
  --radius: 20px;
  --radius-sm: 12px;
  --font-display: "Fraunces Variable", ui-serif, Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gap: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.screen {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.header {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40, "SOFT" 40, "WONK" 1;
  font-weight: 560;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  line-height: 1.2;
  margin: 0;
  max-width: 34ch;
  color: var(--ink);
}

.sub {
  color: var(--ink-soft);
  margin: -8px 0 0;
  font-size: 0.98rem;
}

.small {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 0;
}

/* buttons */

.btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  cursor: pointer;
  transition: transform 140ms var(--ease), background 140ms var(--ease), opacity 140ms var(--ease);
  min-height: 48px;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-press); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--ink-soft); }

.btn-link {
  background: none;
  border: none;
  color: var(--ink-soft);
  text-decoration: underline;
  padding: 8px 0;
  font-weight: 500;
  min-height: auto;
}
.btn-link:hover { color: var(--ink); }

/* gate */

.gate-buttons {
  display: flex;
  gap: var(--gap);
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  min-height: 64px;
}

.no-btn {
  transition: transform 220ms var(--ease);
  will-change: transform;
}

@keyframes wobble {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-6deg); }
  50% { transform: rotate(5deg); }
  75% { transform: rotate(-3deg); }
  100% { transform: rotate(0deg); }
}
.no-btn.wobble { animation: wobble 320ms var(--ease); }

/* status list, plain, warm, no terminal styling */

.status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-line {
  margin: 0;
  padding: 12px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.status-line.in {
  opacity: 1;
  transform: translateY(0);
}

/* progress and chrome */

.progress {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 280ms var(--ease);
}

.screen-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -6px;
}
.step-count {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* fields */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.field-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: -6px 0 0;
}
.field-helper {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 0;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.option-card {
  font-family: var(--font-body);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease);
  min-height: 48px;
}
.option-card:hover { border-color: var(--ink-soft); }
.option-card:active { transform: scale(0.98); }
.option-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.option-card.selected {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}

.pick-helper { align-self: flex-start; }

.text-input {
  font-family: var(--font-body);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 1rem;
  resize: vertical;
}
.text-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.text-input::placeholder { color: var(--ink-soft); }

.other-input { margin-top: 6px; }

/* nav */

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--gap);
  margin-top: 6px;
}
.nav-row .btn-primary { margin-left: auto; }

/* summary */

.summary-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.94rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.summary-row:last-child { border-bottom: none; padding-bottom: 0; }
.summary-label { color: var(--ink-soft); flex-shrink: 0; }
.summary-value { text-align: right; }

.terms-body {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-style: italic;
  margin: -8px 0 0;
}

/* confirm and stamp */

.stamp {
  align-self: flex-start;
  border: 3px solid var(--accent);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transform: rotate(-4deg);
}

/* responsive and accessibility */

@media (max-width: 420px) {
  .options-grid { grid-template-columns: 1fr 1fr; }
}

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