@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/poppins-700.woff2") format("woff2"); }

:root {
  --bg: #1D2130;
  --bg-2: #232738;
  --surface: #2A2F42;
  --surface-2: #343A50;
  --border: #363C54;
  --text: #FFFFFF;
  --text-2: #C9CEDC;
  --muted: #8F96AD;
  --accent: #F3A93B;
  --accent-hover: #FFBC57;
  --accent-soft: rgba(243, 169, 59, .14);
  --on-accent: #1D2130;
  --success: #4ADE80;
  --success-bg: rgba(74, 222, 128, .14);
  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, .14);
  --warn: #F3A93B;
  --warn-bg: rgba(243, 169, 59, .14);
  --shadow: 0 12px 32px rgba(0, 0, 0, .28);
  --radius: 6px;
  --radius-sm: 4px;
  --max: 1080px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

main { max-width: var(--max); margin: 0 auto; padding: 0 24px 72px; }
h1, h2, h3 { margin: 0; color: var(--text); line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: 26px; font-weight: 600; margin-bottom: 22px; }
h3 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
a { color: var(--accent); }
.fine { font-size: 13px; color: var(--muted); }

.overline {
  font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.rule { display: block; width: 48px; height: 4px; background: var(--accent); margin: 22px 0 26px; }
.arrow-link { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.arrow-link:hover { color: var(--accent-hover); }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 36px;
  max-width: var(--max); margin: 0 auto;
  padding: calc(26px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) 26px calc(24px + env(safe-area-inset-left));
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 22px; color: var(--text); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: block; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { position: relative; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 16px; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 50%; bottom: -10px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent); transform: translateX(-50%);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.lang-switcher select {
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border, transparent);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}

.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface); color: var(--text-2); white-space: nowrap;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
body[data-state="loading-model"] .status::before { animation: pulse 1.2s ease-in-out infinite; }
body:not([data-state="loading-model"]) .status::before { background: var(--success); }
.status.is-offline::before { background: var(--danger) !important; }
@keyframes pulse { 50% { opacity: .3; } }

/* Hero */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; padding: 48px 0 40px; }
.hero h1 { font-size: clamp(36px, 4.4vw, 56px); font-weight: 700; letter-spacing: -.02em; }
.h1-break { display: block; }
.lead { font-size: 15px; color: var(--muted); max-width: 440px; }
.stats { list-style: none; margin: 34px 0 0; padding: 0; display: flex; gap: 40px; flex-wrap: wrap; }
.stats li { display: flex; align-items: center; gap: 12px; }
.stats strong {
  font-size: 44px; font-weight: 700; line-height: 1; color: var(--accent);
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.stats span { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}
.card.wide { grid-column: 1 / -1; }

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm); font: inherit; font-weight: 600;
  font-size: 14px; cursor: pointer; text-decoration: none; border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-primary:active, .btn-secondary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Drop zone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 40px 24px; border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--bg-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-disabled, .dropzone.is-busy { pointer-events: none; opacity: .55; }
.upload-icon {
  width: 60px; height: 60px; padding: 15px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.dz-title { font-size: 19px; font-weight: 600; color: var(--text); }
.dz-sub { color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.dz-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dz-note { margin-top: 18px; font-size: 12px; color: var(--muted); }

/* Pointer-specific copy: mouse users see drag/paste hints, touch users see photo/camera */
.pointer-coarse { display: none; }
@media (hover: none) and (pointer: coarse) {
  .pointer-fine { display: none; }
  .pointer-coarse { display: inline; }
  .dz-buttons .pointer-coarse { display: inline-flex; }
  .dropzone { padding: 32px 16px; }
}

/* Alert + loading */
.alert {
  display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 12px 14px;
  border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger);
  border: 1px solid rgba(248, 113, 113, .35); font-size: 13px; font-weight: 600;
}
.alert button { margin-left: auto; background: none; border: 0; color: inherit; font-size: 20px; cursor: pointer; line-height: 1; }
.analyzing { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-size: 13px; color: var(--muted); }
.analyzing strong { color: var(--text); font-weight: 600; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
  border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Result grid */
.result { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 24px; }
.verdict-card { display: flex; flex-direction: column; gap: 16px; }
.verdict-card .overline, .preview-card .overline { margin-bottom: 0; }

.chip { align-self: flex-start; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.ai { background: var(--danger-bg); color: var(--danger); }
.chip.real { background: var(--success-bg); color: var(--success); }
.chip.uncertain { background: var(--warn-bg); color: var(--warn); }

.verdict-headline { display: flex; flex-direction: column; gap: 2px; }
.v-label { font-size: 15px; font-weight: 600; }
.v-label.ai { color: var(--danger); }
.v-label.real { color: var(--success); }
.v-label.uncertain { color: var(--warn); }
.v-percent {
  font-size: 68px; font-weight: 700; line-height: 1; color: var(--text);
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}

.meter-track {
  position: relative; height: 10px; border-radius: 999px; margin-top: 4px;
  background: linear-gradient(90deg, var(--success) 0%, var(--warn) 50%, var(--danger) 100%);
}
.meter-track::after {
  content: ""; position: absolute; left: 40%; width: 20%; top: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(29, 33, 48, .5) 4px 8px);
}
.meter-marker {
  position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; z-index: 1;
  transform: translate(-50%, -50%); border: 3px solid var(--surface); box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
  transition: left .5s ease;
}
.meter-marker.ai { background: var(--danger); }
.meter-marker.real { background: var(--success); }
.meter-marker.uncertain { background: var(--warn); }
.meter-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

/* Preview */
.preview-card { display: flex; flex-direction: column; gap: 16px; }
.preview-frame {
  display: flex; align-items: center; justify-content: center; min-height: 240px; max-height: 360px;
  border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--border); overflow: hidden;
}
.preview-frame img { max-width: 100%; height: auto; max-height: 360px; object-fit: contain; display: block; }
.preview-frame.unavailable img { display: none; }
.preview-frame.unavailable::after { content: "Preview not available for this format"; color: var(--muted); font-size: 13px; }

/* Metadata */
.meta-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.meta-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bg-2); }
.meta-list .name { font-weight: 600; color: var(--text); min-width: 52px; }
.meta-list .state { font-size: 12px; font-weight: 600; }
.meta-list li.found .state { color: var(--accent); }
.meta-list li.absent { opacity: .55; }
.meta-list li.absent .state { color: var(--muted); }
.meta-list .sigs { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.meta-list .sigs code, .chips span {
  padding: 2px 8px; border-radius: 3px; font-size: 11px; background: var(--surface-2); color: var(--text-2);
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chips .empty { background: none; padding: 0; color: var(--muted); font-size: 12px; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.actions a.btn-secondary { text-decoration: none; }
.meta-actions { align-items: center; margin-top: 18px; }
.meta-actions .fine a { color: var(--muted); }

/* Sections */
.section { margin-top: 88px; }
.section-note { margin-top: 22px; }
.section-note a { color: var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li {
  padding: 34px 28px; background: var(--surface); border-radius: var(--radius);
  display: flex; flex-direction: column; min-height: 230px;
}
.steps li.featured { background: var(--accent); }
.steps li.featured h3, .steps li.featured p, .steps li.featured .step-num { color: var(--on-accent); }
.steps p { color: var(--muted); font-size: 13px; }
.step-num { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: auto; padding-bottom: 40px; letter-spacing: .1em; }

details { border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; }
summary { padding: 16px 22px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "→"; color: var(--accent); font-weight: 600; transition: transform .2s; }
details[open] summary::after { transform: rotate(90deg); }
details p { padding: 0 22px 18px; color: var(--muted); font-size: 14px; }

.footer {
  display: flex; gap: 28px; flex-wrap: wrap; justify-content: center;
  max-width: var(--max); margin: 0 auto; padding: 30px 24px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
}

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 24px; }
  .result { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps li { min-height: 0; }
  .step-num { padding-bottom: 18px; }
}
@media (max-width: 600px) {
  .topbar { gap: 14px; padding: calc(18px + env(safe-area-inset-top)) 20px 18px; }
  main { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .footer { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
  .nav-links a:not(:last-child) { display: none; }
  .status { font-size: 11px; padding: 6px 10px; }
  main { padding: 0 20px 56px; }
  .card { padding: 20px; }
  .dropzone { padding: 28px 16px; }
  .stats { gap: 24px; }
  .stats strong { font-size: 36px; }
  .v-percent { font-size: 52px; }
  .actions .btn-primary { width: 100%; }
  .dz-buttons { width: 100%; }
  .dz-buttons .btn-primary, .dz-buttons .btn-secondary { flex: 1 1 140px; }
}
