:root {
  --bg: #070b12;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --text: #eef4ff;
  --muted: #9fb0c8;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --blue-light: #93c5fd;
  --green: #22c55e;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.35), transparent 28%),
    radial-gradient(circle at 85% 0%, rgba(34, 197, 94, 0.12), transparent 25%),
    radial-gradient(circle at 50% 100%, rgba(37, 99, 235, 0.16), transparent 35%),
    linear-gradient(135deg, #050814, #0f172a 55%, #020617);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 70px;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 24px;
  padding: 34px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(15, 23, 42, 0.88)),
    rgba(15, 23, 42, 0.74);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "AI";
  position: absolute;
  right: 28px;
  top: 18px;
  font-size: 96px;
  font-weight: 900;
  letter-spacing: -8px;
  color: rgba(255,255,255,0.035);
  pointer-events: none;
}

h1 {
  margin: 0 0 12px;
  max-width: 760px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: -1.4px;
}

h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.4px;
}

.lead {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.card {
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.uploader {
  padding: 24px;
}

.dropzone {
  min-height: 240px;
  border: 2px dashed rgba(147, 197, 253, 0.55);
  border-radius: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 38px;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(34, 197, 94, 0.04)),
    rgba(2, 6, 23, 0.32);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.dropzone:hover {
  border-color: var(--blue-light);
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.16), 0 16px 40px rgba(37, 99, 235, 0.16);
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(34, 197, 94, 0.07)),
    rgba(2, 6, 23, 0.34);
}

.dropzone input {
  display: none;
}

.icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  font-size: 29px;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.42);
}

.dropzone strong {
  display: block;
  font-size: 23px;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.dropzone small {
  color: var(--muted);
  font-size: 14px;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0;
}

.radio,
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #dbeafe;
  cursor: pointer;
  transition: 0.16s ease;
}

.radio:hover,
.checkbox:hover {
  border-color: rgba(147, 197, 253, 0.42);
  background: rgba(30, 41, 59, 0.98);
}

.radio input,
.checkbox input {
  accent-color: var(--blue);
}

.selected {
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.2px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.34);
  transition: 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.button:active {
  transform: translateY(0);
}

.button.secondary {
  background: rgba(30, 41, 59, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: none;
}

.alert {
  padding: 15px 17px;
  border-radius: 18px;
  margin-bottom: 18px;
}

.alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.results {
  margin-top: 34px;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
  justify-content: center;
  gap: 22px;
}

.result {
  padding: 14px;
  transition: transform 0.16s ease, border-color 0.16s ease;
  overflow: hidden;
}

.result:hover {
  transform: translateY(-3px);
  border-color: rgba(147, 197, 253, 0.32);
}

.result-preview {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.055) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.055) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.055) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.055) 75%),
    #081120;
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  overflow: hidden;
}

.result-preview img {
  max-width: 92%;
  max-height: 245px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.28));
}

.result-footer {
  margin-top: 13px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-footer span {
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cbd5e1;
  font-size: 14px;
}

.result-footer a {
  color: var(--blue-light);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.result-footer a:hover {
  color: #bfdbfe;
}

@media (max-width: 700px) {
  .container {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero {
    padding: 24px;
    border-radius: 24px;
  }

  .hero::after {
    display: none;
  }

  .uploader {
    padding: 16px;
  }

  .dropzone {
    min-height: 190px;
    padding: 26px 18px;
  }

  .dropzone strong {
    font-size: 20px;
  }

  .options {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .results-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .result-preview {
    height: 240px;
  }

  .result-preview img {
    max-height: 210px;
  }

  .result-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-footer span {
    max-width: 100%;
  }
}