@import url('/fonts/fonts.css');

:root {
  /* BuzzDJ: black, buzzer yellow; red only for warnings and declines */
  --ink: #111111;
  --ink-2: #1b1b1b;
  --ink-3: #262626;
  --paper: #f5f2e8;
  --paper-dim: rgba(245, 242, 232, 0.66);
  --paper-faint: rgba(245, 242, 232, 0.4);
  --line: rgba(245, 242, 232, 0.14);
  --line-strong: rgba(245, 242, 232, 0.45);
  --accent: #ffd60a;
  --accent-hover: #ffe14d;
  --accent-dim: rgba(255, 214, 10, 0.14);
  --red: #ff5a4e;
  --red-dim: rgba(255, 90, 78, 0.16);
  --green: #9cc788;
  --gold: #e8c46a;
  --orange: #ee8a3a;
  /* display: titles and the logo (Bricolage Grotesque once self-hosted, Archivo until then) */
  --serif: 'Bricolage Grotesque', 'Archivo', system-ui, sans-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;
}

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.03em;
  font-size: 22px;
  line-height: 1;
}
.logo i { font-style: normal; color: var(--accent); }
.logo .tld, .splash-word .tld { color: var(--paper-dim); }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand .logo-mark { flex-shrink: 0; }

/* 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 8px 2px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.2;
}
.stamp.solid { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.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(--accent);
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; color: var(--paper); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--paper); background: transparent; }
.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: 14px;
  font-size: 17px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--accent); }
.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, #0a0a0a 0 1.5px, #1c1c1c 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(--accent);
}
.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);
  border-radius: 999px;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform 0.35s var(--ease); }
.toast.red { background: var(--red); }

/* ---------- opening screen: the buzzer is pressed, waves go out, then the app fades in ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease), visibility 0s 0.5s;
}
.splash.done { opacity: 0; visibility: hidden; }
.splash-buzz { position: relative; width: 120px; height: 120px; }
.splash-buzz svg { position: relative; width: 120px; height: 120px; transform: scale(0); animation: buzz-in 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) 0.1s forwards, buzz-press 0.28s ease-in-out 0.75s; }
.splash-wave { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--accent); opacity: 0; animation: buzz-wave 1.1s ease-out 0.85s 2; }
.splash-wave.w2 { animation-delay: 1.15s; }
.splash-word {
  font-family: var(--serif); font-weight: 800; font-size: 40px; letter-spacing: -0.035em;
  margin-top: 26px; opacity: 0; transform: translateY(8px);
  animation: splash-word 0.5s var(--ease) 1.05s forwards;
}
.splash-word i { font-style: normal; color: var(--accent); }
.splash-credit {
  margin-top: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--paper-faint); opacity: 0; animation: splash-word 0.5s var(--ease) 1.4s forwards;
}
@keyframes buzz-in { to { transform: scale(1); } }
@keyframes buzz-press { 50% { transform: scale(0.86); } }
@keyframes buzz-wave { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.1); } }
@keyframes splash-word { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .splash-buzz svg { animation: none; transform: none; }
  .splash-wave { display: none; }
  .splash-word, .splash-credit { animation-duration: 0.01s; animation-delay: 0s; }
}

/* footer on the quiet screens */
.site-foot {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin: 48px 0 0; padding: 16px 0 calc(8px + env(safe-area-inset-bottom));
  border-top: 1px dashed var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--paper-faint);
}
.site-foot > * { white-space: nowrap; }
.site-foot a { color: var(--paper-dim); text-underline-offset: 3px; }
.site-foot a:hover { color: var(--paper); }

/* language dropdown in the footer */
.lang-pick { position: relative; display: inline-flex; align-items: center; gap: 5px; color: var(--paper-dim); cursor: pointer; }
.lang-pick span { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.lang-pick::after { content: ''; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; }
.lang-pick:hover, .lang-pick:focus-within { color: var(--paper); }
.lang-select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font: inherit; }
.lang-select option { background: var(--ink-2); color: var(--paper); }

.view > .site-foot { margin-top: 28px; }
