/* GreySpot public pages: juicy, game/music/movie flavoured, mobile first.
   No inline styles anywhere (strict CSP): everything is a class. */

@font-face {
  font-family: "Russo One";
  src: url("/static/fonts/russo-one.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #1b1533;
  --pink: #ff3d81;
  --violet: #6d35f0;
  --blue: #2b7bff;
  --yellow: #ffd23f;
  --mint: #2de2a6;
  --paper: #fffdf7;
  --muted: #5b5675;
  --display: "Russo One", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 17px/1.5 var(--body);
  color: var(--ink);
  min-height: 100dvh;
  /* Default page background: doodles over a juicy gradient. A chosen background replaces it. */
  background:
    url("/static/img/bg-pattern.svg") center top / 420px 420px repeat,
    linear-gradient(165deg, #ff3d81 0%, #8a3ffc 52%, #2b7bff 100%);
  background-attachment: fixed;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18px 14px 36px;
}

h1, h2, h3, .display { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; }
h1 { margin: 0 0 8px; font-size: 1.7rem; line-height: 1.15; }
h2 { margin: 0 0 8px; font-size: 1.25rem; line-height: 1.2; }
p { margin: 0 0 12px; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- brand sticker ---------------------------------------------------------------- */

.brand {
  display: inline-flex;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: 0 5px 0 var(--ink);
}
.brand img { display: block; height: 26px; width: auto; }

/* ---- cards ------------------------------------------------------------------------ */

.card, .postcard, .panel {
  width: 100%;
  max-width: 460px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 8px 0 var(--ink);
}
.card { padding: 22px 20px 24px; text-align: center; }
.card .btn { margin-top: 4px; }
.panel { padding: 18px 18px 20px; box-shadow: 0 6px 0 var(--ink); }

/* The postcard: photo with a caption. The centrepiece of every client page. */
.postcard { padding: 12px 12px 8px; overflow: hidden; }
.postcard-photo {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: var(--ink);
}
.postcard-photo img { display: block; width: 100%; height: auto; }  /* never cropped */
.postcard-body { padding: 16px 10px 12px; text-align: center; }
.postcard-text {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.postcard-text.is-empty { color: #8c87a3; font-size: 1.1rem; font-family: var(--body); }
.postcard-number { margin: 10px 0 0; font-size: 0.85rem; color: var(--muted); }
.photo-btn { position: absolute; right: 10px; bottom: 10px; }

.lead { font-size: 1.05rem; }
.number { font-family: var(--display); letter-spacing: 0.06em; white-space: nowrap; }
.muted { color: var(--muted); font-size: 0.9rem; }

.steps { list-style: none; counter-reset: step; margin: 14px 0 18px; padding: 0; text-align: left; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 10px;
  line-height: 1.3;
}
.steps li::before {
  content: counter(step);
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
}
.secret { background: #efe9ff; border-radius: 14px; padding: 10px 14px; font-size: 0.95rem; text-align: left; }

/* ---- buttons and links ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  font: 1.05rem/1 var(--display);
  color: var(--ink);
  text-decoration: none;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { background: #ffdf6b; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 0.9rem; border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }
.btn-white { background: var(--paper); }
.btn-white:hover { background: #fff; }
.btn-wide { width: 100%; }

.quiet-link {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.95rem;
  color: var(--ink);
  background: rgb(255 253 247 / 88%);
  border-radius: 999px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link { color: var(--ink); }
.page > .link-light { color: #fff; font-weight: 600; }

/* ---- states ----------------------------------------------------------------------- */

.timer { margin: 14px 0 6px; }
.timer-value { display: block; font: 2.4rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.timer-label { color: var(--muted); font-size: 0.9rem; }

.notice-reject {
  width: 100%;
  max-width: 460px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
  padding: 14px 18px;
}
.notice-reject h2 { font-size: 1.05rem; margin-bottom: 6px; }
.notice-reject p { margin: 0 0 6px; }
.reason { font-weight: 700; white-space: pre-wrap; overflow-wrap: anywhere; }

.alert {
  background: #ffe3ea;
  color: #8a1236;
  border: 2px solid #8a1236;
  padding: 10px 12px;
  border-radius: 12px;
}

/* ---- the content form ------------------------------------------------------------- */

.form-page { gap: 18px; }
.form-stack { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 18px; }
.form-stack .panel { max-width: none; }
.panel h2 { margin-bottom: 10px; }
.field-label { display: block; font-weight: 700; margin: 0 0 6px; }
.panel + .panel { margin-top: 0; }

.panel textarea,
.panel select {
  width: 100%;
  font: 1rem/1.4 var(--body);
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
}
.panel textarea { resize: vertical; min-height: 110px; }
.panel select { min-height: 52px; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 6px 0 0; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.field { margin: 0 0 16px; }
.field:last-child { margin-bottom: 0; }

/* swatch pickers (colour, background) */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch-option { position: relative; display: block; cursor: pointer; }
.swatch-option input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch-dot,
.swatch-bg {
  display: block;
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 0 var(--ink);
  transition: box-shadow 0.1s ease, transform 0.1s ease;
}
.swatch-dot { width: 44px; height: 44px; border-radius: 50%; }
.swatch-bg { width: 62px; height: 62px; border-radius: 14px; background-attachment: scroll !important; background-size: cover !important; }
.swatch-option input:checked + .swatch-dot,
.swatch-option input:checked + .swatch-bg { box-shadow: 0 0 0 4px var(--yellow), 0 0 0 7px var(--ink); transform: scale(0.94); }
.swatch-option input:focus-visible + .swatch-dot,
.swatch-option input:focus-visible + .swatch-bg { outline: 3px solid var(--blue); outline-offset: 4px; }

/* palette colours for text (also used by the admin preview) live in colors.css */
.tc-bg-1b1533 { background: #1b1533; } .tc-bg-e11d48 { background: #e11d48; }
.tc-bg-ea580c { background: #ea580c; } .tc-bg-15803d { background: #15803d; }
.tc-bg-0f766e { background: #0f766e; } .tc-bg-1d4ed8 { background: #1d4ed8; }
.tc-bg-7e22ce { background: #7e22ce; } .tc-bg-db2777 { background: #db2777; }

.submit-bar { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ---- main page -------------------------------------------------------------------- */

.hero-logo { width: min(78vw, 340px); height: auto; display: block; margin: 0 auto 14px; }
.hero-card { padding-top: 26px; }
.facts { list-style: none; margin: 14px 0 0; padding: 0; text-align: left; }
.facts li { padding: 8px 0 8px 34px; position: relative; border-top: 2px dashed #d9d3ee; }
.facts li::before { content: "✦"; position: absolute; left: 6px; color: var(--pink); font-size: 1.1rem; }

@media (min-width: 560px) {
  h1 { font-size: 2rem; }
  .page { padding-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.fieldset-plain { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.fieldset-plain legend { padding: 0; }
.pill { margin: 0; padding: 6px 14px; text-align: center; font-size: 0.85rem; background: rgb(255 253 247 / 90%); border-radius: 16px; }
.photo-error { color: #b0123f; font-weight: 700; }
.postcard-body .hint { margin-top: 12px; }

.swatch-default {
  background:
    url("/static/img/bg-pattern.svg") center / 90px 90px repeat,
    linear-gradient(165deg, #ff3d81 0%, #8a3ffc 52%, #2b7bff 100%);
}

.photo-btn { flex-direction: column; gap: 0; min-height: 44px; line-height: 1.1; }
.photo-btn-note { font: 0.68rem/1.1 var(--body); color: var(--muted); }
.photo-error:empty { display: none; }
.photo-error { color: #b0123f; font-weight: 700; }

/* ---- emoji picker ---- */
.emoji-picker { margin-top: 10px; margin-bottom: 10px}
.emoji-picker summary { list-style: none; cursor: pointer; display: inline-flex; }
.emoji-picker summary::-webkit-details-marker { display: none; }
.emoji-panel { margin-top: 10px; max-height: 240px; overflow-y: auto; border: 3px solid var(--ink); border-radius: 14px; padding: 8px 10px 10px; background: #fff; }
.emoji-title { margin: 6px 0 4px; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 2px; }
.emoji-btn { width: 44px; height: 44px; font-size: 1.5rem; line-height: 1; background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.emoji-btn:hover, .emoji-btn:focus-visible { background: #efe9ff; }

.contacts { display: flex; flex-direction: column; gap: 12px; }
.contacts h2 { margin: 0; }
.contact-note { margin: 4px 0 -2px; font-size: 0.9rem; color: var(--muted); }

.submit-bar .btn { flex-direction: column; gap: 2px; }
.btn-note { font: 0.72rem/1.1 var(--body); opacity: 0.8; }

.contact-email { margin: 0; padding: 12px 14px; text-align: center; font-weight: 700; font-size: 1.1rem; word-break: break-all; border: 3px dashed var(--ink); border-radius: 14px; background: #fff; -webkit-user-select: all; user-select: all; }

.market-links { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.market-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.market-btn img { width: 28px; height: 28px; border-radius: 7px; flex: none; }
