:root {
  color-scheme: dark;
  --bg: #15112a;
  --bg-raised: #1f1940;
  --card: #261f4b;
  --card-hover: #2e2659;
  --line: #3a3168;
  --ink: #f7f3ff;
  --muted: #b0a8d4;
  --accent: #ffd23f;
  --accent-ink: #1a1405;
  --hot: #ff4f7b;
  --ok: #5ee0a0;
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --judge: var(--hot);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
}

.spotlight {
  position: fixed;
  inset: -20vh -20vw auto;
  height: 90vh;
  background: radial-gradient(ellipse 50% 60% at 50% 0%, rgba(255, 210, 63, 0.16), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

main, .site-header, .site-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--accent); }

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

[hidden] { display: none !important; }

/* Header ---------------------------------------------------------------- */

.site-header { padding-top: 20px; padding-bottom: 8px; }

.wordmark {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark span { color: var(--accent); }

/* Hero ------------------------------------------------------------------ */

.hero { padding: 36px 0 12px; }

h1 {
  margin: 0;
  font-size: clamp(42px, 10vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.marker {
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0 0.12em;
  border-radius: 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  display: inline-block;
  transform: rotate(-2deg);
}

.lede { color: var(--muted); font-size: 20px; margin: 18px 0 0; }

/* Capture --------------------------------------------------------------- */

#roast-form { margin-top: 32px; }

.capture {
  border-radius: var(--radius);
  border: 2px dashed var(--line);
  background: var(--bg-raised);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.capture.dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-raised)); }

.capture-empty {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 40px 16px 28px;
}
.hint { width: 100%; text-align: center; color: var(--muted); font-size: 14px; margin: 4px 0 0; }

.camera { position: relative; background: #000; }
.camera video {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  transform: scaleX(-1);
}
.camera.rear video { transform: none; }
.camera-actions {
  position: absolute;
  left: 0; right: 0; bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: var(--hot);
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease;
}
.shutter:active { transform: scale(0.92); }

.preview { position: relative; }
.preview img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #000; }
.preview .btn { position: absolute; right: 12px; bottom: 12px; }

/* Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font: inherit;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 4px 4px 0 var(--hot);
}
.btn-primary:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--hot); }
.btn-primary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--hot); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.camera .btn-ghost, .preview .btn-ghost { background: rgba(0, 0, 0, 0.55); border-color: rgba(255, 255, 255, 0.3); backdrop-filter: blur(6px); }

.btn-small { min-height: 38px; padding: 6px 14px; font-size: 15px; }

.btn-big {
  width: 100%;
  margin-top: 32px;
  min-height: 68px;
  font-size: 26px;
  letter-spacing: -0.01em;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 6px 6px 0 var(--hot);
}
.btn-big:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--hot); }
.btn-big:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--hot); }
.btn-big:disabled { background: var(--card); color: var(--muted); cursor: not-allowed; box-shadow: none; }

.form-error {
  margin: 24px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hot) 22%, var(--bg));
  border: 2px solid var(--hot);
  font-weight: 600;
}

.turnstile:not(:empty) { margin-top: 24px; }

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}
.consent strong { color: var(--ink); }
.consent input { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; accent-color: var(--accent); }

.fine-print { color: var(--muted); font-size: 13px; margin: 20px 0 0; }

/* Judging overlay ------------------------------------------------------- */

.judging {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(13, 10, 28, 0.92);
  backdrop-filter: blur(8px);
  padding: 16px;
}
.judging-inner { text-align: center; }
.judging-avatar {
  display: inline-grid;
  place-items: center;
  width: 120px;
  height: 120px;
  border-radius: 34px;
  font-size: 64px;
  background: color-mix(in srgb, var(--judge) 30%, transparent);
  animation: bob 1.4s ease-in-out infinite;
}
.judging-line { font-size: 24px; font-weight: 800; margin: 24px 0 8px; min-height: 1.5em; }

.dots { display: inline-flex; gap: 8px; }
.dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--judge);
  animation: blink 1.2s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-12px) rotate(4deg); } }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* Result ---------------------------------------------------------------- */

#result-view { padding-top: 12px; }

.result {
  background: var(--bg-raised);
  border-radius: 24px;
  padding: 20px;
  border-top: 6px solid var(--judge);
}
@media (min-width: 620px) { .result { padding: 28px; } }

.result-hero {
  position: relative;
  margin: 20px 0 0;
}
.result-photo { margin: 0; }
.result-photo img {
  display: block;
  width: 100%;
  /* Small enough that the score, nickname and headline fit on a phone's first screen, for screenshots. */
  max-height: min(520px, 42vh);
  object-position: center 30%;
  object-fit: cover;
  border-radius: var(--radius);
}

.paddle {
  position: absolute;
  right: 14px;
  bottom: -26px;
  display: flex;
  align-items: baseline;
  gap: 2px;
  padding: 12px 20px 10px;
  border-radius: 18px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 6px 6px 0 var(--hot);
  transform: rotate(4deg) scale(0.4);
  opacity: 0;
}
.paddle.revealed { animation: paddle-in 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
.paddle-score { font-size: clamp(48px, 13vw, 64px); font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.paddle-out { font-size: 22px; font-weight: 800; opacity: 0.7; }

@keyframes paddle-in {
  to { transform: rotate(4deg) scale(1); opacity: 1; }
}

.result-title {
  display: inline-block;
  margin: 38px 0 0;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--judge);
  color: #111;
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transform: rotate(-1.5deg);
}

.result-headline {
  margin: 16px 0 0;
  font-size: clamp(22px, 5.8vw, 34px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.result-headline::before { content: "“"; color: var(--judge); }
.result-headline::after { content: "”"; color: var(--judge); }

.result-verdict { font-size: 18px; margin: 16px 0 0; color: var(--ink); opacity: 0.92; }

.result-block { margin-top: 28px; }
.result-block h2 {
  margin: 0 0 12px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--judge);
}

.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.points li {
  position: relative;
  padding: 12px 14px 12px 46px;
  border-radius: var(--radius-sm);
  background: var(--card);
  font-weight: 600;
}
.points li::before {
  counter-increment: point;
  content: counter(point);
  position: absolute;
  left: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--judge);
  color: #111;
  font-size: 13px;
  font-weight: 800;
}
.points { counter-reset: point; }

.tip {
  padding: 16px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--judge) 14%, var(--card));
}
.tip p { margin: 0; font-weight: 600; }

.format-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.format-toggle button {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
}
.format-toggle button[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.format-toggle button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}
.result-actions .btn { flex: 1 1 140px; }
.result-actions .btn-primary { flex-basis: 100%; min-height: 56px; font-size: 20px; }

/* Dialog ---------------------------------------------------------------- */

.dialog {
  border: 0;
  border-radius: 24px;
  padding: 28px 24px 24px;
  max-width: min(420px, calc(100vw - 32px));
  background: var(--bg-raised);
  color: var(--ink);
  text-align: center;
}
.dialog::backdrop { background: rgba(10, 8, 22, 0.8); backdrop-filter: blur(4px); }
.dialog h2 { margin: 4px 0 8px; font-size: 26px; letter-spacing: -0.02em; }
.dialog p { margin: 0; color: var(--muted); }
.dialog-emoji { font-size: 48px; margin: 0 !important; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }

/* Footer ---------------------------------------------------------------- */

.site-footer {
  padding-top: 48px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.site-footer p { margin: 4px 0; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Cookie banner (only when analytics is set up in the admin) -------------- */

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  background: var(--bg-raised);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-size: 15px;
}
.cookie-banner p { flex: 1 1 260px; margin: 0; color: var(--muted); }
.cookie-banner strong { color: var(--ink); }
.cookie-actions { display: flex; gap: 10px; margin-left: auto; }

/* Pets line (homepage) and example roast (About page) -------------------- */

.dog-line {
  display: inline-block;
  margin: 16px 0 0;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-weight: 600;
  transform: rotate(-1deg);
}

.example { margin-top: 8px; }
.example-card { margin-top: 12px; }
.example-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border-top: 4px solid var(--hot);
}
.example-photo { flex: 0 0 104px; }
.example-photo img {
  display: block;
  width: 104px;
  height: 130px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 12px;
}
.example-text { min-width: 0; display: grid; gap: 10px; align-content: start; }
.example-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.example-score {
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  box-shadow: 3px 3px 0 var(--hot);
  transform: rotate(3deg);
}
.example-score strong { font-size: 22px; }
.example-title {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--hot);
  color: #111;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transform: rotate(-1.5deg);
}
.example-headline { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.2; }
.example-headline::before { content: "“"; color: var(--hot); }
.example-headline::after { content: "”"; color: var(--hot); }
.example-burns { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--muted); font-size: 14px; }

/* Under 18 -------------------------------------------------------------- */

.too-young { padding: 64px 0 24px; text-align: center; }
.too-young h1 { font-size: clamp(36px, 8vw, 56px); }

/* Content pages (privacy) ------------------------------------------------ */

.prose { padding-top: 24px; }
.prose h1 { font-size: clamp(36px, 8vw, 52px); }
.prose h2 { margin-top: 32px; font-size: 22px; }
.prose p, .prose li { color: var(--ink); opacity: 0.92; }

/* About page */
.about .lede { margin-top: 18px; }
.about h2 { margin-top: 40px; }

.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: step; }
.steps li {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 14px 16px 14px 60px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  opacity: 1;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--hot);
  color: #fff;
  font-weight: 800;
  transform: rotate(-4deg);
}
.steps strong { font-size: 18px; }
.steps span { color: var(--muted); }

.rules { margin: 16px 0 0; display: grid; gap: 4px 0; }
.rules dt { font-weight: 800; font-size: 18px; margin-top: 14px; }
.rules dt:first-child { margin-top: 0; }
.rules dd { margin: 2px 0 0; color: var(--muted); }

.about-cta { margin-top: 40px; }
.about-cta .btn-big { text-decoration: none; }

.footer-links a { margin: 0 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .paddle { opacity: 1; transform: rotate(4deg); }
}
