/* ═══════════════════════════════════════════════
   mandj.es — gooi je link in het mandje
   Toy-like, warm, basket-core.
   ═══════════════════════════════════════════════ */

:root {
  --paper: #fbf1de;
  --paper-deep: #f4e3c3;
  --ink: #2f1c0e;
  --ink-soft: #6b4f38;
  --tomato: #e8541d;
  --tomato-dark: #c23f0f;
  --wicker: #d9a05b;
  --wicker-dark: #a96e2f;
  --leaf: #3e7a4e;
  --card: #fffaf0;
  --shadow: 0 6px 0 rgba(47, 28, 14, 0.9);
  --radius: 18px;
  --font-display: "Lilita One", "Arial Black", sans-serif;
  --font-body: "Gantari", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(217, 160, 91, 0.28), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(232, 84, 29, 0.14), transparent 55%),
    repeating-linear-gradient(45deg, transparent 0 34px, rgba(169, 110, 47, 0.05) 34px 36px),
    repeating-linear-gradient(-45deg, transparent 0 34px, rgba(169, 110, 47, 0.05) 34px 36px),
    var(--paper);
  display: flex;
  flex-direction: column;
}

.view[hidden] { display: none; }

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 48px;
}

/* ── icons ──────────────────────────────────── */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.14em;
}
.ticker-icon { color: var(--wicker); margin: 0 6px; }
.footer-icon { color: var(--wicker-dark); font-size: 1.15em; }
.icon-big { width: 58px; height: 58px; color: var(--wicker-dark); display: block; margin: 0 auto; }
.icon-fall { width: 42px; height: 42px; color: var(--tomato); display: block; }
.result-eyebrow .icon { stroke-width: 3; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ── ticker ─────────────────────────────────── */
.ticker {
  width: 100vw;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  padding: 8px 0;
  border-bottom: 3px solid var(--tomato);
}
.ticker-track {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 28s linear infinite;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── hero ───────────────────────────────────── */
.hero {
  text-align: center;
  margin-top: clamp(36px, 7vh, 72px);
  animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
  margin: 0;
  font-size: clamp(2.6rem, 8.5vw, 5.5rem);
  text-transform: uppercase;
}
.hero-line { display: block; }
.hero-line-accent { color: var(--tomato); text-shadow: 3px 3px 0 var(--paper-deep), 5px 5px 0 var(--wicker-dark); }
.wiggle { display: inline-block; animation: wiggle 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes wiggle {
  0%, 78%, 100% { transform: rotate(0); }
  82% { transform: rotate(-4deg); }
  86% { transform: rotate(4deg); }
  90% { transform: rotate(-2.5deg); }
  94% { transform: rotate(2deg); }
}
.hero-sub {
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  max-width: 46ch;
  margin: 18px auto 0;
}

/* ── shortener ──────────────────────────────── */
.shortener {
  width: min(680px, 100%);
  margin-top: clamp(28px, 5vh, 48px);
  animation: rise 0.6s 0.12s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

.field-row {
  display: flex;
  gap: 10px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.field-row:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(47, 28, 14, 0.9);
}
#url-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: 600 1.05rem var(--font-body);
  color: var(--ink);
  padding: 10px 8px;
  outline: none;
}
#url-input::placeholder { color: #b99a76; font-weight: 400; }

.btn {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 22px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
  text-decoration: none;
  display: inline-block;
  color: var(--ink);
  background: var(--card);
}
.btn:active { transform: translateY(3px); box-shadow: none !important; }

.btn-primary {
  background: var(--tomato);
  color: #fff;
  box-shadow: 0 4px 0 var(--tomato-dark);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}
.btn-primary:hover { background: #f4611f; }
.btn-primary[disabled] { opacity: 0.6; cursor: wait; }

.btn-copy { background: var(--leaf); color: #fff; box-shadow: 0 4px 0 #2c5a38; }
.btn-copy:hover { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  border-color: var(--ink-soft);
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding: 8px 16px;
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* alias & houdbaarheid */
.options-row {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.alias-details { margin-top: 12px; }
.alias-details summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  width: fit-content;
}
.alias-details summary:hover { color: var(--tomato); }
.alias-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 8px 14px;
  width: fit-content;
  max-width: 100%;
}
.alias-prefix { font-family: var(--font-display); color: var(--ink-soft); }
#alias-input {
  border: none; background: transparent; outline: none;
  font: 600 1rem var(--font-body); color: var(--tomato);
  width: 14ch;
}

.validity-grid {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.validity-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.validity-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.validity-field input,
.validity-field select {
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  font: 600 0.95rem var(--font-body);
  color: var(--ink);
  padding: 7px 10px;
  outline: none;
}
.validity-field input:focus,
.validity-field select:focus { border-color: var(--tomato); }
.validity-field input[type="number"] { width: 11ch; }
.validity-time { display: flex; gap: 6px; }
.validity-time input { width: 8ch; }
.validity-hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.result-validity {
  margin: 10px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--leaf);
}

.form-error {
  margin: 12px 4px 0;
  color: var(--tomato-dark);
  font-weight: 600;
}
.form-error::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 7px;
  vertical-align: -0.14em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M6.5 6.5l11 11'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M6.5 6.5l11 11'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ── stage / basket ─────────────────────────── */
.stage {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 34px;
  min-height: 170px;
}
.basket { width: min(260px, 60vw); filter: drop-shadow(0 8px 0 rgba(47,28,14,0.18)); }
.basket.catch { animation: catch 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes catch {
  0% { transform: scale(1); }
  35% { transform: scale(1.08, 0.9) translateY(6px); }
  70% { transform: scale(0.97, 1.05) translateY(-3px); }
  100% { transform: scale(1); }
}

.falling-link {
  position: absolute;
  top: -70px;
  left: 50%;
  z-index: 2;
  animation: fall 0.65s cubic-bezier(0.5, 0, 0.9, 0.6) both;
}
@keyframes fall {
  from { transform: translate(-50%, -40px) rotate(-30deg); opacity: 1; }
  85%  { opacity: 1; }
  to   { transform: translate(-50%, 165px) rotate(40deg) scale(0.5); opacity: 0; }
}

/* ── result ─────────────────────────────────── */
.result {
  margin-top: 26px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  text-align: center;
  animation: pop 0.45s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.7) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.result-eyebrow {
  font-family: var(--font-display);
  color: var(--leaf);
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  margin: 0 0 10px;
}
.result-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.short-url {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4.5vw, 2rem);
  color: var(--tomato);
  text-decoration: none;
  word-break: break-all;
}
.short-url:hover { text-decoration: underline wavy var(--wicker-dark) 2px; }
.result-hint { color: var(--ink-soft); font-size: 0.88rem; margin: 14px 0 10px; }
.result-hint code { background: var(--paper-deep); padding: 2px 6px; border-radius: 6px; }
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.btn-donate {
  background: var(--wicker);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--wicker-dark);
  font-size: 0.95rem;
  padding: 8px 16px;
}
.btn-donate:hover { filter: brightness(1.06); }
.btn-donate .icon { margin-right: 4px; }

/* ── redirect & stats views ─────────────────── */
.redirect-card {
  margin: auto;
  text-align: center;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
  max-width: 480px;
  animation: pop 0.4s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}
.basket-mini { animation: bounce 1s ease-in-out infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.redirect-card h2 { font-family: var(--font-display); font-size: 1.7rem; margin: 14px 0 6px; }
.redirect-detail { color: var(--ink-soft); word-break: break-all; margin: 4px 0 18px; }

.stats-list {
  text-align: left;
  margin: 20px 0 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
}
.stats-list dt { font-family: var(--font-display); color: var(--ink-soft); }
.stats-list dd { margin: 0; font-weight: 600; }
.stats-target { word-break: break-all; }

/* ── footer ─────────────────────────────────── */
.footer {
  margin-top: auto;
  padding-top: 56px;
  text-align: center;
  color: var(--ink-soft);
}
.footer em { color: var(--tomato-dark); font-style: normal; font-weight: 800; }
.footer-donate {
  color: var(--tomato-dark);
  font-weight: 800;
  text-decoration: none;
}
.footer-donate:hover { text-decoration: underline wavy var(--wicker-dark) 2px; }
.footer-fine { font-size: 0.8rem; opacity: 0.75; }

/* ── cookie consent ─────────────────────────── */
.consent-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 50;
  width: min(600px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  animation: consent-pop 0.4s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}
@keyframes consent-pop {
  from { opacity: 0; transform: translateX(-50%) translateY(30px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.consent-banner[hidden] { display: none; }
.consent-text { margin: 0; flex: 1; min-width: 230px; }
.consent-actions { display: flex; gap: 10px; }

.footer-cookie {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.footer-cookie:hover { color: var(--tomato-dark); }

/* ── responsive ─────────────────────────────── */
@media (max-width: 560px) {
  .field-row { flex-direction: column; }
  .btn-primary { width: 100%; }
  .redirect-card { padding: 30px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
