:root {
  --bg: #0c0e12;
  --bg-elevated: #141820;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaef;
  --muted: #8b93a7;
  --accent: #7dd3c0;
  --accent-dim: rgba(125, 211, 192, 0.15);
  --danger: #f4717a;
  --radius: 16px;
  --font: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.site-header {
  position: relative;
  z-index: 1;
  padding: 2.5rem 1.5rem 1rem;
  text-align: center;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.banner {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.banner--error {
  background: rgba(244, 113, 122, 0.12);
  border: 1px solid rgba(244, 113, 122, 0.35);
  color: #ffc9cd;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 2rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone:focus-within {
  border-color: rgba(125, 211, 192, 0.45);
  background: var(--accent-dim);
}

.drop-zone.is-dragover {
  border-color: var(--accent);
  background: rgba(125, 211, 192, 0.12);
}

.drop-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.drop-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.drop-hint {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.file-name {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.95rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-primary {
  background: linear-gradient(145deg, #6ec4b3, #4a9d8c);
  color: #051212;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(5, 18, 18, 0.25);
  border-top-color: #051212;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.results {
  margin-top: 2rem;
  padding: 1.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
}

.results.animate-in {
  animation: rise 0.45s ease-out;
}

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

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.results-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .compare {
    grid-template-columns: 1fr;
  }
}

.compare-card {
  margin: 0;
}

.compare-card figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.compare-card .resolution {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(125, 211, 192, 0.1);
  border: 1px solid rgba(125, 211, 192, 0.22);
}

.img-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #080a0d;
}

.img-frame img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.compare-card--featured .img-frame {
  border-color: rgba(125, 211, 192, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.btn-ghost {
  margin-top: 1.25rem;
  width: auto;
  display: inline-flex;
  text-decoration: none;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(125, 211, 192, 0.45);
}

.btn-ghost:hover {
  background: var(--accent-dim);
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer .mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
}
