/* ==========================================================================
   Fake — design tokens (light theme)
   ========================================================================== */
:root {
  --bg: #ffffff;
  --ink: #1e1240;
  --ink-2: #3b2d63;
  --muted: #5f5384;
  --muted-2: #7a6f9c;

  --purple-900: #3b1487;
  --purple-800: #4c1d95;
  --purple-700: #5b21b6;
  --purple-600: #7c3aed;
  --purple-500: #8b5cf6;
  --purple-300: #c4b5fd;
  --purple-200: #ddd3fb;
  --purple-100: #efeafd;
  --purple-50: #f7f4ff;

  --line: #e6def9;
  --line-strong: #cfc2f5;

  --ok: #15803d;
  --warn: #b45309;
  --bad: #dc2626;

  --shadow-card: 0 1px 2px rgba(60, 30, 120, 0.05), 0 16px 34px -20px rgba(91, 33, 182, 0.32);

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "Cinzel", "Segoe UI", sans-serif;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --wrap: 1240px;
  --header-h: 78px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
* { box-sizing: border-box; }

[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}

p { margin: 0; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

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

:focus-visible {
  outline: 2px solid var(--purple-600);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Card surface (white)
   ========================================================================== */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-800));
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(91, 33, 182, 0.75);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -14px rgba(91, 33, 182, 0.9);
}

.btn-ghost {
  color: var(--purple-700);
  border: 1px solid var(--line-strong);
  background: #fff;
}

.btn-ghost:hover {
  background: var(--purple-50);
  border-color: var(--purple-500);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Glass: translucent white over a blurred, saturated backdrop */
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 0 rgba(124, 58, 237, 0.08), 0 10px 30px -18px rgba(60, 30, 120, 0.35);
  /* Overlap the hero so there is something behind the glass from the first pixel */
  margin-bottom: calc(-1 * var(--header-h));
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: rgba(255, 255, 255, 0.94); }
}

.site-header .btn-ghost { background: rgba(255, 255, 255, 0.5); }
.site-header .btn-ghost:hover { background: rgba(247, 244, 255, 0.85); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 104.9px;
  height: 32px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.main-nav {
  display: flex;
  gap: 34px;
}

.main-nav a {
  font-size: 14.5px;
  color: var(--ink);
  font-family: var(--font-mono);
  transition: color 0.2s ease;
  position: relative;
}

.main-nav a:hover { color: var(--purple-600); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions .btn-ghost { padding: 11px 20px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ==========================================================================
   Shared section bits
   ========================================================================== */
.kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--purple-700);
  display: inline-block;
  margin-bottom: 14px;
}

.section-head { margin-bottom: 44px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: calc(var(--header-h) + 76px) 0 40px;
  background:
    radial-gradient(50% 45% at 88% 0%, rgba(139, 92, 246, 0.2), transparent 70%),
    radial-gradient(40% 40% at 4% 12%, rgba(196, 181, 253, 0.32), transparent 70%);
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  gap: 56px;
  align-items: center;
  margin-bottom: 52px;
  opacity: 0;
  animation: rise 0.8s ease forwards;
}

.hero-intro {
  max-width: 640px;
}

.hero-intro h1 {
  font-size: clamp(42px, 6vw, 68px);
}

.hero-intro .ink {
  background: linear-gradient(120deg, var(--purple-600), var(--purple-800) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: 22px;
  font-size: 17px;
  color: var(--muted);
  max-width: 52ch;
}

/* ---------- Image comparison slider ---------- */
.compare {
  --pos: 50%;
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  background: var(--purple-100);
  user-select: none;
  -webkit-user-select: none;
}

.compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* The "real" image sits on top and is revealed from the left up to the handle */
.compare-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }

.compare-tag {
  position: absolute;
  bottom: 14px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(30, 18, 64, 0.78);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  pointer-events: none;
}
.compare-tag-left { left: 14px; }
.compare-tag-right { right: 14px; }

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 3;
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(30, 18, 64, 0.12);
  pointer-events: none;
}

.compare-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--purple-700);
  box-shadow: 0 8px 20px -6px rgba(30, 18, 64, 0.5);
}
.compare-knob svg { width: 22px; height: 22px; }

/* A real range input gives mouse, touch and keyboard control for free */
.compare-range {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
  -webkit-appearance: none;
  appearance: none;
}
.compare-range:focus-visible { outline: none; }
.compare-range:focus-visible ~ .compare-handle .compare-knob {
  outline: 2px solid var(--purple-600);
  outline-offset: 3px;
}

.hero-panels {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 24px;
  align-items: stretch;
  opacity: 0;
  animation: rise 0.8s ease 0.15s forwards;
}

/* While a report is on screen it replaces the intro + uploader */
.hero.has-report { padding-top: calc(var(--header-h) + 40px); }
.hero.has-report .hero-top,
.hero.has-report .hero-panels { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Uploader */
.uploader {
  position: relative;
  padding: 4px;
  overflow: hidden;
  min-height: 420px;
}

.uploader-frame {
  height: 100%;
  min-height: 412px;
  border: 1.5px dashed var(--line-strong);
  border-radius: calc(var(--radius-lg) - 4px);
  position: relative;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.uploader-frame.drag-over {
  border-color: var(--purple-600);
  background: var(--purple-50);
}

/* Empty state */
.uploader-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 40px;
}

.uploader-icon {
  width: 56px;
  height: 56px;
  color: var(--purple-600);
  margin-bottom: 6px;
}

.uploader-empty h3 {
  font-size: 21px;
  font-weight: 500;
}

.uploader-empty p {
  color: var(--muted);
  font-size: 14px;
}

.uploader-btn {
  margin-top: 14px;
}

/* Upload error (validation / decode / analysis failures) */
.uploader-frame.has-error {
  border-color: #fca5a5;
}

.uploader-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 440px;
  margin-top: 16px;
  padding: 12px 12px 12px 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  color: #7f1d1d;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.45;
}

.uploader-error[hidden] { display: none; }

.uploader-error > svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--bad);
}

.uploader-error > div { flex: 1; min-width: 0; }

.uploader-error strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  color: #991b1b;
}

.uploader-error-close {
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #991b1b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.uploader-error-close:hover { background: #fee2e2; }

/* Photo state — preview with a short "analysing" pass before the report opens */
.uploader-photo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: var(--purple-50);
}

.uploader-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uploader-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0) 40%, rgba(76, 29, 149, 0.28));
}

.uploader-scanline {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  top: 20%;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  box-shadow: 0 0 14px 2px rgba(255, 255, 255, 0.85), 0 0 28px 6px rgba(124, 58, 237, 0.55);
  opacity: 0.9;
  animation: scan 3.6s ease-in-out infinite;
  pointer-events: none;
}

.uploader-photo[hidden] ~ .uploader-scanline { display: none; }

@keyframes scan {
  0% { top: 14%; opacity: 0; }
  15% { opacity: 0.9; }
  50% { top: 82%; opacity: 0.9; }
  85% { opacity: 0; }
  100% { top: 82%; opacity: 0; }
}

.uploader-status {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 24px -10px rgba(30, 18, 64, 0.5);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--purple-200);
  border-top-color: var(--purple-600);
  animation: spin 0.8s linear infinite;
}

/* Examples */
.examples {
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.examples h4 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 18px;
  color: var(--ink);
}

.example-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.example-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.example-item:hover {
  border-color: var(--line);
  background: var(--purple-50);
}

.example-item img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--purple-100);
  flex-shrink: 0;
}

.example-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.example-meta span {
  font-size: 13.5px;
  color: var(--muted);
}

.example-run,
.text-btn,
.tool-link {
  color: var(--purple-700);
  border-bottom: 1px solid rgba(91, 33, 182, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.example-run {
  align-self: flex-start;
  font-size: 12.5px;
  padding-bottom: 1px;
}

.example-run:hover,
.text-btn:hover,
.tool-link:hover {
  color: var(--purple-900);
  border-color: var(--purple-900);
}

/* ==========================================================================
   Verification report
   ========================================================================== */
.report {
  scroll-margin-top: calc(var(--header-h) + 20px);
  animation: fade-in 0.5s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.report-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-head-side {
  display: flex;
  align-items: center;
  gap: 14px 18px;
  flex-wrap: wrap;
}

.report-id {
  font-size: 13.5px;
  color: var(--muted);
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 10px;
  background: var(--purple-800);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 12px 24px -14px rgba(76, 29, 149, 0.9);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-export svg { width: 16px; height: 16px; }
.btn-export:hover { background: var(--purple-900); transform: translateY(-1px); }
.btn-export[disabled] { opacity: 0.7; cursor: progress; transform: none; }

.report-body {
  display: grid;
  gap: 24px;
}

.report-row {
  display: grid;
  gap: 24px;
  align-items: stretch;
}

.report-row-top { grid-template-columns: minmax(0, 1fr) 340px; }
.report-row-bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.report-card {
  border-radius: 14px;
  padding: 20px;
  min-width: 0;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.info-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--muted-2);
  border-radius: 50%;
  flex-shrink: 0;
}

.info-btn { position: relative; }
.info-btn:hover,
.info-btn:focus-visible { color: var(--purple-700); }

.info-btn[data-tip]:hover::after,
.info-btn[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 20;
  top: 30px;
  right: 0;
  width: min(260px, 70vw);
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 14px 30px -12px rgba(30, 18, 64, 0.6);
}
.info-btn svg { width: 100%; height: 100%; }

/* Image analysis */
.analysis-card { display: flex; flex-direction: column; }

.analysis-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  flex: 1;
  min-height: 300px;
}

.figure {
  position: relative;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--purple-50);
  border: 1px solid var(--line);
  min-height: 0;
}

.figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.figure figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(30, 18, 64, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}

.legend {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(30, 18, 64, 0.78);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
}

.legend i {
  width: 56px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #00007f, #0000ff, #00ffff, #7fff7f, #ffff00, #ff7f00, #ff0000, #7f0000);
}

/* Detection result */
.gauge {
  position: relative;
  width: min(100%, 264px);
  margin: 2px auto 0;
}

.gauge-art svg { display: block; width: 100%; height: auto; }

.gauge-progress {
  transition: stroke-dasharray 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  text-align: center;
  line-height: 1;
}

.gauge-label strong {
  display: block;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.gauge-label span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.verdict {
  margin-top: 16px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 21px);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
}

.result-card.is-fake .verdict { color: var(--bad); }
.result-card.is-real .verdict { color: var(--ok); }
.result-card.is-unknown .verdict { color: var(--warn); }

.verdict-sub {
  margin-top: 4px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

.stat-list {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.stat-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
}

.stat-list dt { color: var(--muted); }
.stat-list dd { margin: 0; font-weight: 600; text-align: right; }

/* Metadata table */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.meta-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.meta-table th {
  background: var(--purple-50);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
}

.meta-table th:first-child,
.meta-table td:first-child { width: 29%; }
.meta-table th:nth-child(2),
.meta-table td:nth-child(2) { width: 38%; }

.meta-table th:first-child { padding-left: 42px; }

.meta-table td {
  padding: 10px 12px;
  vertical-align: top;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
  color: var(--ink);
}

.meta-table th + th,
.meta-table td + td { border-left: 1px solid var(--line); }

.meta-table td.note { color: var(--muted); }

.meta-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.meta-label svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.meta-value span { display: block; }

/* Diffusion */
.diffusion-block {
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--purple-50);
}

.block-label {
  margin-bottom: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--purple-300);
  background: #fff;
  color: var(--purple-800);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
}

.chip.is-unidentified {
  border-style: dashed;
  border-color: var(--line-strong);
  color: var(--muted);
}

/* Provenance */
.prov-card {
  display: flex;
  flex-direction: column;
}

.prov-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.spectrum-chart {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 90px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.spectrum-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.spectrum-chart-sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted-2);
}

.spectrum-chart-svg {
  flex: 1;
  width: 100%;
  min-height: 60px;
  display: block;
}

.prov-item { margin: 0; min-width: 0; }

.prov-item img {
  width: 100%;
  aspect-ratio: 15 / 16;
  object-fit: cover;
  border-radius: 10px;
  background: var(--purple-100);
  border: 1px solid var(--line);
}

.prov-item figcaption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}

.prov-item figcaption strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Certificate
   ========================================================================== */
.certificate-section {
  padding: 40px 0;
}

.certificate-inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: center;
  padding: 52px;
}

.certificate-art {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.certificate-art img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  background: radial-gradient(circle, var(--purple-500), var(--purple-700));
  box-shadow: 0 0 0 8px rgba(124, 58, 237, 0.12);
}

.certificate-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--purple-500);
  animation: spin 40s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.certificate-copy h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 16px; }

.certificate-copy p {
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: 20px;
}

.certificate-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.certificate-points li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink-2);
}

.certificate-points li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-600);
  flex-shrink: 0;
  transform: translateY(-3px);
}

/* ==========================================================================
   Featured in
   ========================================================================== */
.featured-in { padding: 56px 0; }

.featured-label {
  text-align: center;
  color: var(--muted-2);
  font-size: 13.5px;
  margin-bottom: 26px;
}

.featured-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vw, 72px);
  flex-wrap: wrap;
}

.featured-strip img {
  height: 26px;
  width: auto;
  min-width: 100px;
  object-fit: cover;
  filter: brightness(0);
  opacity: 0.55;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.featured-strip img:hover {
  opacity: 1;
  filter: none;
}

/* ==========================================================================
   Tools
   ========================================================================== */
.tools { padding: 60px 0; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.tool-card {
  padding: 30px 26px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
}

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-100);
  color: var(--purple-700);
  margin-bottom: 20px;
}

.tool-icon svg { width: 26px; height: 26px; }

.tool-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.tool-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.tool-link {
  font-size: 13.5px;
  padding-bottom: 2px;
}

/* ==========================================================================
   Text analyzer
   ========================================================================== */
.analyzer-section { padding: 0 0 60px; }

.analyzer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 56px;
  align-items: center;
  padding: 52px;
  background: var(--purple-50);
}

.analyzer-copy h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 16px; }

.analyzer-copy p {
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 28px;
}

.analyzer-art {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.analyzer-art img { width: 100%; height: auto; }

/* ==========================================================================
   Articles
   ========================================================================== */
.articles { padding: 60px 0 100px; }

.articles-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
}

.slider-controls {
  display: flex;
  gap: 10px;
}

.slider-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-700);
  transition: background 0.2s ease, transform 0.2s ease;
}

.slider-btn svg { width: 18px; height: 18px; }

.slider-btn:hover {
  background: var(--purple-50);
  transform: translateY(-2px);
}

.article-slider {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* room so card shadows aren't clipped by the scroller */
  padding: 4px 4px 28px;
  margin: -4px -4px 0;
  scrollbar-width: none;
}

.article-slider::-webkit-scrollbar { display: none; }

.article-card {
  display: block;
  flex: 0 0 320px;
  scroll-snap-align: start;
  overflow: hidden;
  color: inherit;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.article-card:focus-visible { outline-offset: 2px; border-radius: var(--radius-lg); }

.article-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }

.article-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--purple-100), var(--purple-300));
}

.article-body { padding: 22px; }

.article-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--purple-700);
}

.article-body h3 {
  font-size: 17px;
  margin: 12px 0 10px;
  line-height: 1.3;
}

.article-body p {
  font-size: 13.5px;
  color: var(--muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 60px;
  background: #fff;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 50px;
}

.footer-brand p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  max-width: 34ch;
}

.footer-social {
  display: flex;
  gap: 14px;
  margin-top: 22px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-700);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.footer-social svg { width: 16px; height: 16px; }

.footer-social a:hover {
  border-color: var(--purple-600);
  background: var(--purple-50);
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 14px;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.footer-col a:hover { color: var(--purple-700); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 24px 32px 30px;
  font-size: 13px;
  color: var(--muted-2);
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a:hover { color: var(--purple-700); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .report-row-top { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 900px) {
  .hero-top { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .analyzer-inner { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 40px 28px; }
  .hero-panels { grid-template-columns: 1fr; }
  .certificate-inner { grid-template-columns: 1fr; text-align: center; padding: 40px 28px; }
  .certificate-points { align-items: center; }
  .certificate-points li { text-align: left; }

  /* Report: single column, verdict first */
  .report-row { display: contents; }
  .report-body { grid-template-columns: minmax(0, 1fr); }
  .result-card { order: 1; }
  .analysis-card { order: 2; }
  .meta-card { order: 3; }
  .prov-card { order: 4; }
  .analysis-images { min-height: 0; }
  .figure { aspect-ratio: 4 / 3; }
  .result-card .gauge { width: min(100%, 300px); }
}

@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -20px rgba(91, 33, 182, 0.35);
    padding: 8px 20px 18px;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px 0; font-family: var(--font-mono); border-bottom: 1px solid var(--purple-100); }
  .nav-toggle { display: flex; }

  .header-actions .btn-ghost { display: none; }
  .hero { padding: calc(var(--header-h) + 46px) 0 30px; }
  .hero.has-report { padding-top: calc(var(--header-h) + 28px); }
  .analyzer-inner { padding: 32px 22px; }
  .tools-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 14px; text-align: center; padding: 24px 20px 30px; }
  .article-card { flex-basis: 78vw; }
  .certificate-inner { padding: 32px 22px; }

  .report-head-side { width: 100%; }
  .report-id { width: 100%; }
  .report-card { padding: 16px; }
}

/* Metadata table becomes stacked rows on small screens */
@media (max-width: 620px) {
  .meta-table thead { display: none; }
  .meta-table, .meta-table tbody, .meta-table tr, .meta-table td { display: block; width: 100%; }
  .meta-table tr { padding: 12px 14px; border-top: 1px solid var(--line); }
  .meta-table tr:first-child { border-top: none; }
  .meta-table td,
  .meta-table td:first-child,
  .meta-table td:nth-child(2) { width: 100%; padding: 0; border: none; }
  .meta-table td + td { border-left: none; margin-top: 4px; }
  .meta-table td:first-child { font-weight: 600; }
  .meta-table td.meta-value { padding-left: 28px; }
  .meta-table td.note { padding-left: 28px; font-size: 13px; }
  .meta-table td.note:empty { display: none; }
}

@media (max-width: 520px) {
  .analysis-images { grid-template-columns: minmax(0, 1fr); }
  .btn-export, .report-head-side .btn-outline { flex: 1 1 auto; justify-content: center; }
  .stat-list > div { font-size: 14px; }
}

/* Secondary button used next to Export */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--purple-700);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-outline:hover { background: var(--purple-50); border-color: var(--purple-500); }

/* ==========================================================================
   Consent modal — shown after picking a file, before any processing starts
   ========================================================================== */
.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(30, 18, 64, 0.55);
  backdrop-filter: blur(2px);
}

.consent-modal {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  padding: 28px;
  animation: consent-in 0.2s ease;
}

@keyframes consent-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.consent-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

.consent-intro {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 20px;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.consent-check:last-of-type { border-bottom: 1px solid var(--line); }

.consent-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--purple-600);
  cursor: pointer;
}

.consent-check span {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.consent-check a {
  color: var(--purple-700);
  text-decoration: underline;
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.consent-actions .btn { padding: 11px 22px; font-size: 14px; }

.consent-actions .btn-primary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

@media (max-width: 480px) {
  .consent-modal { padding: 22px; }
  .consent-actions { flex-direction: column-reverse; }
  .consent-actions .btn { width: 100%; }
}

/* ==========================================================================
   Text detector (detect.php)
   ========================================================================== */
.text-uploader { min-height: 420px; padding: 24px; }

.text-input-frame {
  height: 100%;
  min-height: 372px;
  display: flex;
  flex-direction: column;
}

.text-input-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

.text-input {
  flex: 1;
  width: 100%;
  resize: none;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.text-input::placeholder { color: var(--muted-2); }

.text-input:focus {
  outline: none;
  border-color: var(--purple-600);
  background: var(--purple-50);
}

.text-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.text-counter {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.text-counter.is-invalid { color: var(--bad); }
.text-counter.is-valid { color: var(--ok); }

/* Example list icons (text page has no thumbnail image, so a small badge stands in) */
.example-icon {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-800));
}

.example-icon-human { background: linear-gradient(135deg, #15803d, #166534); }

/* Flagged-passages panel */
.flag-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.flag-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--purple-200);
  border: 1px solid var(--purple-500);
}

.annotated-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.annotated-text mark.flag {
  background: var(--purple-200);
  border-radius: 4px;
  padding: 1px 2px;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--purple-500);
}

/* Formatting artifacts (#, **, *, —) get their own color — distinct from
   AI-phrase matches, since they're a different kind of tell. */
.annotated-text mark.flag-format {
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px #3b82f6;
}

.annotated-text mark.flag-hyphen {
  background: #fef3c7;
  box-shadow: inset 0 0 0 1px #d97706;
}

.annotated-text mark.flag-longrun {
  background: #e0f2fe;
  box-shadow: inset 0 0 0 1px #0891b2;
}

/* "Why this verdict" signal list */
.signal-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.signal-block-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
}

.signal-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.signal {
  position: relative;
  padding-left: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.signal::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
}

.signal.high::before { background: var(--bad); }
.signal.medium::before { background: var(--warn); }
.signal.low::before { background: var(--line-strong); }
.signal.is-human { color: var(--ok); }
.signal.is-human::before { background: var(--ok); }

.text-disclaimer {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--purple-50);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 860px) {
  .text-input-frame { min-height: 280px; }
}
