@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;700;800&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,800;1,9..144,400;1,9..144,500&family=Space+Mono:wght@400;700&display=swap');

:root {
  --ink: #16120e;
  --ink-2: #1f1a14;
  --ink-3: #2a231b;
  --paper: #f1e7d6;
  --paper-dim: rgba(241, 231, 214, 0.64);
  --paper-faint: rgba(241, 231, 214, 0.38);
  --line: rgba(241, 231, 214, 0.16);
  --line-strong: rgba(241, 231, 214, 0.5);
  --red: #e2533b;
  --red-dim: rgba(226, 83, 59, 0.16);
  --green: #9cc788;
  --gold: #e8c46a;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Archivo', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* paper grain, very subtle */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }
.dim { color: var(--paper-dim); }

.logo {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 21px;
  line-height: 1;
}
.logo i { font-weight: 400; color: var(--red); }

/* rubber stamp label */
.stamp {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 6px 2px;
  border: 1.5px solid currentColor;
  transform: rotate(-3deg);
  white-space: nowrap;
  line-height: 1.2;
}
.stamp.solid { background: var(--red); color: var(--ink); border-color: var(--red); transform: rotate(3deg); }
.stamp.green { color: var(--green); }
.stamp.red { color: var(--red); }
.stamp.gold { color: var(--gold); }
.stamp.faint { color: var(--paper-faint); }

/* buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 1.5px solid var(--paper);
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.ghost { background: transparent; color: var(--paper); }
.btn.red { background: var(--red); border-color: var(--red); color: var(--ink); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 12px; width: auto; }
.btn[disabled] { opacity: 0.5; }

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-dim);
  margin-bottom: 6px;
}
.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--ink-2);
  border-radius: 0;
  font-size: 17px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--paper); }
.input::placeholder { color: var(--paper-faint); }
.input.code { font-family: var(--mono); font-size: 22px; letter-spacing: 0.25em; text-transform: uppercase; }
.error { color: var(--red); font-size: 14px; margin: -6px 0 14px; }
.input.invalid { border-color: var(--red); }

/* vinyl: grooves with the cover as the label */
.disc {
  --size: 52px;
  position: relative;
  width: var(--size);
  height: var(--size);
  flex-shrink: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.10), transparent 40%),
    repeating-radial-gradient(circle, #0b0907 0 1.5px, #1d1813 1.5px 3px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.disc .label {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--red);
}
.disc .label img { width: 100%; height: 100%; object-fit: cover; }
.disc .label::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 14%; height: 14%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--ink);
}
/* the grooves are symmetric, so only the label visibly turns */
.disc.spin .label { animation: spin 1.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .disc.spin .label { animation: none; } }

.rule { border: 0; border-top: 1px dashed var(--line); margin: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 140%);
  background: var(--paper);
  color: var(--ink);
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  max-width: calc(100vw - 32px);
  width: max-content;
  z-index: 50;
  transition: transform 0.35s var(--ease), visibility 0s 0.35s;
  visibility: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform 0.35s var(--ease); }
.toast.red { background: var(--red); }
