/* ---------------------------------------------
   AI Text Detection - prototype styles
   Minimal, serious business style
--------------------------------------------- */

:root {
  --ink: #1b1e23;
  --ink-muted: #5a6068;
  --paper: #fcfcfb;
  --surface: #ffffff;
  --line: #e3e4e2;
  --accent: oklch(45% 0.09 250);
  --accent-soft: oklch(96% 0.012 250);
  --danger: oklch(50% 0.16 25);
  --radius: 6px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "IBM Plex Sans", Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

.container {
  max-width: 880px;
}

.hidden {
  display: none !important;
}

/* Language switching: only the active language is visible */
body[data-lang="en"] [lang="lv"] { display: none; }
body[data-lang="lv"] [lang="en"] { display: none; }

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 16px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.version-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.lang-switch {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  min-height: 32px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-btn + .lang-btn {
  border-left: 1px solid var(--line);
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.is-active {
  background: var(--ink);
  color: var(--paper);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

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

.hero {
  padding: 72px 0 8px;
}

.hero-inner {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.hero-title {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 auto 16px;
  max-width: 22ch;
  text-wrap: balance;
}

.hero-lead {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0 auto;
  max-width: 48ch;
  text-wrap: pretty;
}

/* ---------- Upload ---------- */

.upload-section {
  padding: 40px 0 16px;
}

.upload-inner {
  max-width: 720px;
  margin-inline: auto;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1.5px dashed #c9cbc8;
  border-radius: var(--radius);
  background: var(--surface);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
}

.dropzone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-icon {
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.dropzone-text {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

.dropzone-or {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin: 0;
}

.btn-outline-quiet {
  display: inline-block;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 20px;
  min-height: 38px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropzone:hover .btn-outline-quiet {
  background: var(--ink);
  color: var(--paper);
}

.file-requirements {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin: 12px 0 0;
  text-align: center;
}

.file-note {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin: 4px 0 0;
  text-align: center;
}

.file-error {
  font-size: 0.875rem;
  color: var(--danger);
  margin: 12px 0 0;
  text-align: center;
}

/* ---------- Selected file ---------- */

.selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 16px;
  margin-top: 16px;
}

.selected-file-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.selected-file-name {
  font-size: 0.9375rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.selected-file-size {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.btn-remove {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 6px 8px;
  min-height: 32px;
  cursor: pointer;
  border-radius: var(--radius);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.btn-remove:hover {
  color: var(--danger);
}

.btn-remove:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Analyze button ---------- */

.btn-analyze {
  appearance: none;
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 12px 28px;
  min-height: 48px;
  margin-top: 12px;
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.btn-analyze:hover:not(:disabled) {
  filter: brightness(1.12);
}

.btn-analyze:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.btn-analyze:disabled {
  background: #c4c7cb;
  cursor: not-allowed;
}

/* ---------- Progress ---------- */

.progress-wrap {
  margin-top: 24px;
}

.progress-label {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

.progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
}

.progress-wrap.is-running .progress-fill {
  animation: progress-run 12s ease-out forwards;
}

.progress-wrap.is-complete .progress-fill {
  animation: none;
  width: 100%;
  transition: width 0.25s ease-out;
}

@keyframes progress-run {
  0%   { width: 0; }
  25%  { width: 62%; }
  100% { width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-wrap.is-running .progress-fill {
    animation: none;
    width: 90%;
  }
  .progress-wrap.is-complete .progress-fill {
    width: 100%;
  }
}

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

.result-section {
  padding: 24px 0 8px;
}

.result-inner {
  max-width: 720px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px;
}

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

.result-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.result-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.result-score-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.result-score {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.result-score-label {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.score-track {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 16px;
}

.score-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease-out;
}

.result-guidance {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 28px;
  text-wrap: pretty;
}

.result-card.is-elevated .result-score {
  color: var(--danger);
}

.result-card.is-elevated .score-fill {
  background: var(--danger);
}

.result-card.is-elevated .result-guidance {
  color: var(--danger);
}

.result-substitution-note {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--danger);
  margin: 0 0 28px;
  text-wrap: pretty;
}

.result-stat.result-stat-substitution dt,
.result-stat.result-stat-substitution dd {
  color: var(--danger);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 0 0 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.result-stat dt {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.result-stat dd {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0;
}

.result-disclaimer {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-wrap: pretty;
}

/* ---------- Steps ---------- */

.steps-section {
  padding: 56px 0 64px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.step {
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}

.step-number {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.step-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.step-desc {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0;
  text-wrap: pretty;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
  padding-bottom: 20px;
}

.footer-note,
.footer-tag {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin: 0;
}

.footer-tag {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.6875rem;
  font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .hero {
    padding-top: 44px;
  }

  .dropzone {
    padding: 36px 16px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .result-stats {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .result-card {
    padding: 20px;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
