/* =========================================================
   Real or Fake?  Same colouring-book look as the main site:
   white paper, thick black outlines, solid offset shadows,
   and pink only on things that respond to you.
   ========================================================= */

@font-face {
  font-family: 'Rampart One';
  src: url('fonts/RampartOne-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'M PLUS Rounded 1c';
  src: url('fonts/MPLUSRounded1c-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'M PLUS Rounded 1c';
  src: url('fonts/MPLUSRounded1c-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'M PLUS Rounded 1c';
  src: url('fonts/MPLUSRounded1c-800-latin.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

/* ---- Tokens (copied from the main site's tokens.css) ---- */
:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #000000;
  --ink-soft: #3d3d3d;
  --ink-faint: #8c8c8c;
  --accent: #f5aecb;
  --accent-ink: #000000;
  --shade: #c2c2c2;

  --line: 3px;
  --line-bold: 4px;
  --radius-s: 10px;
  --radius: 18px;
  --radius-l: 28px;
  --shadow-s: 3px 3px 0 var(--shade);
  --shadow: 5px 5px 0 var(--shade);
  --shadow-l: 8px 8px 0 var(--shade);

  --font-display: 'Rampart One', 'M PLUS Rounded 1c', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', -apple-system,
    BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-pop: cubic-bezier(0.34, 1.42, 0.64, 1);
  --dur-fast: 140ms;
  --dur: 280ms;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #0d0d0d;
  --ink: #ffffff;
  --ink-soft: #c9c9c9;
  --ink-faint: #7a7a7a;
  --shade: #3a3a3a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #0d0d0d;
    --ink: #ffffff;
    --ink-soft: #c9c9c9;
    --ink-faint: #7a7a7a;
    --shade: #3a3a3a;
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

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

:focus-visible {
  outline: var(--line) solid var(--accent);
  outline-offset: 3px;
}

.page {
  max-width: 64rem;
  margin-inline: auto;
  padding: 4.5rem 16px 4rem;
}

/* ---- Back link ---- */
.back-link {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 14px;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-s);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.back-link:hover {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translate(-1px, -1px);
}

/* ---- Intro ---- */
.intro__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 2rem + 4vw, 4.4rem);
  line-height: 1.06;
}
.intro__lede {
  max-width: 46ch;
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.2rem);
}

/* ---- Bench: the main card ---- */
.bench {
  position: relative;
  margin-top: 2.2rem;
  padding: clamp(16px, 3vw, 28px);
  border: var(--line-bold) solid var(--ink);
  border-radius: var(--radius-l);
  background: var(--paper);
  box-shadow: var(--shadow-l);
}

.step-label {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- Drop zone ---- */
.drop {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: clamp(28px, 6vw, 56px) 16px;
  border: var(--line) dashed var(--ink);
  border-radius: var(--radius);
  text-align: center;
  transition: background-color var(--dur-fast) var(--ease);
}
.drop.is-over {
  background: var(--accent);
  color: var(--accent-ink);
}
.drop__title {
  margin: 0;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  font-weight: 800;
}
.drop__or {
  margin: 0;
  color: var(--ink-faint);
  font-weight: 700;
}
.drop.is-over .drop__or {
  color: inherit;
}
.drop__note {
  margin: 0.6rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.drop.is-over .drop__note {
  color: inherit;
}

/* ---- Buttons ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.3rem;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.button:hover {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--shade);
}
.button:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--shade);
}
.button--primary {
  margin-top: 0.35rem;
}
/* The file input is visually hidden, so show its focus on the label */
.drop:has(input:focus-visible) .button {
  outline: var(--line) solid var(--accent);
  outline-offset: 3px;
}

/* ---- Workspace: photo on the left, verdict on the right ---- */
.workspace {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
}
@media (min-width: 52rem) {
  .workspace {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* Hugs the photo, so the square's coordinates line up with the image
   whatever its shape: no letterboxing to account for. */
.stage {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  overflow: hidden;
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  background: var(--shade);
  touch-action: none;           /* dragging the square must not scroll the page */
  user-select: none;
  -webkit-user-select: none;
}
.stage__photo {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
}

/* The square the model looks at. Everything outside it is dimmed by a
   huge spread shadow, which needs no extra elements and follows the
   square wherever it goes. */
.crop {
  position: absolute;
  border: var(--line) solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  cursor: grab;
  outline: none;
}
.crop:active {
  cursor: grabbing;
}
.crop:focus-visible {
  border-color: var(--accent);
}
.crop__corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 5px solid var(--accent);
}
.crop__corner--tl { top: -6px; left: -6px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.crop__corner--tr { top: -6px; right: -6px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.crop__corner--bl { bottom: -6px; left: -6px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.crop__corner--br { bottom: -6px; right: -6px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }

/* ---- Zoom slider ---- */
.zoom {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.9rem;
  font-weight: 800;
}
.zoom__label {
  font-size: 0.9rem;
}
.zoom input {
  flex: 1;
  height: 44px;                 /* comfortable touch target */
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---- Verdict ---- */
.verdict {
  display: grid;
  justify-items: start;
}
.verdict__seen {
  width: min(100%, 168px);
  height: auto;
  aspect-ratio: 1;
  border: var(--line) solid var(--ink);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-s);
  background: var(--shade);
}
.verdict__word {
  margin: 1.2rem 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.6rem);
  line-height: 1.1;
}

/* A track from Real to AI-made with a marker at the model's guess */
.meter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  font-size: 0.8rem;
  font-weight: 800;
}
.meter__track {
  position: relative;
  height: 18px;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}
.meter__marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  border: var(--line) solid var(--ink);
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  transition: left var(--dur) var(--ease-pop);
}
.verdict__detail {
  min-height: 3.2em;
  margin: 0.7rem 0 1.1rem;
  color: var(--ink-soft);
}
/* Phones: the verdict sits under the photo, so keep it short enough to
   see without scrolling far. The preview goes beside the verdict word. */
@media (max-width: 51.99rem) {
  .verdict {
    grid-template-columns: 96px minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
  }
  .verdict > .step-label,
  .meter,
  .verdict__detail,
  .verdict .button {
    grid-column: 1 / -1;
  }
  .verdict__seen {
    width: 96px;
  }
  .verdict__word {
    margin: 0;
    font-size: 1.75rem;
  }
  .meter {
    margin-top: 0.9rem;
  }
}

.verdict.is-busy .verdict__word,
.verdict.is-busy .meter {
  opacity: 0.45;
}

/* ---- Status ---- */
.status {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
}
.status:empty {
  display: none;
}
.status.is-error {
  color: #c2185b;
}
:root[data-theme='dark'] .status.is-error {
  color: var(--accent);
}

/* ---- Notes ---- */
.notes {
  max-width: 46rem;
  margin-top: 3rem;
}
.notes__title {
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
  font-weight: 800;
}
.notes__list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding-left: 1.2rem;
}
.notes__how {
  margin: 1.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

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