:root {
  --bg: #060811;
  --bg-soft: #0d1221;
  --surface: rgba(17, 24, 39, 0.85);
  --surface-strong: #121a2e;
  --text: #edf2ff;
  --muted: #8fa3c8;
  --neon: #14f5d4;
  --neon-2: #00a8ff;
  --danger: #ff5d7d;
  --success: #35df8b;
  --border: rgba(143, 163, 200, 0.22);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --radius: 18px;
}

body.light {
  --bg: #f4f8ff;
  --bg-soft: #e8efff;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --text: #0c1530;
  --muted: #58698e;
  --neon: #00a698;
  --neon-2: #1f78ff;
  --danger: #d43255;
  --success: #138e52;
  --border: rgba(31, 59, 118, 0.14);
  --shadow: 0 16px 40px rgba(19, 36, 71, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Sora", "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      1200px 500px at 10% -10%,
      rgba(20, 245, 212, 0.2),
      transparent 60%
    ),
    radial-gradient(
      900px 480px at 90% 0%,
      rgba(0, 168, 255, 0.2),
      transparent 56%
    ),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  transition:
    background 0.35s ease,
    color 0.35s ease;
}

h1,
h2 {
  font-family:
    "Orbitron",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

.app {
  height: 100%;
  max-width: 1150px;
  margin: 0 auto;
  padding: 24px 18px 120px;
}

.hero {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.brand-lockup {
  display: grid;
  place-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.logo-shell {
  width: clamp(92px, 12vw, 118px);
  aspect-ratio: 1;
  padding: 6px;
  border-radius: 24px;
  border: 1px solid rgba(123, 177, 255, 0.26);
  background:
    linear-gradient(145deg, rgba(20, 245, 212, 0.2), rgba(0, 168, 255, 0.22)),
    rgba(4, 10, 24, 0.86);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(0, 168, 255, 0.16);
  backdrop-filter: blur(6px);
}

body.light .logo-shell {
  background:
    linear-gradient(145deg, rgba(0, 166, 152, 0.18), rgba(31, 120, 255, 0.18)),
    rgba(255, 255, 255, 0.96);
  box-shadow:
    0 12px 26px rgba(19, 36, 71, 0.18),
    0 0 20px rgba(31, 120, 255, 0.12);
}

.brand-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 18px;
  background: #02050d;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.32);
  user-select: none;
  -webkit-user-drag: none;
}

.chip-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chip-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  backdrop-filter: blur(10px);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 245, 212, 0.55);
  box-shadow: 0 0 0 3px rgba(20, 245, 212, 0.1);
}

h1 {
  text-align: center;
  margin: 0;
  font-size: clamp(1.75rem, 2.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  max-width: 72ch;
}

.audience-line {
  text-align: center;
  margin-top: 2rem !important;
  margin: 0 auto;
  color: var(--text);
  font-weight: 600;
  max-width: 84ch;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(12px);
}

.form-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 700;
  letter-spacing: 0.01em;
}

input,
select {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(20, 245, 212, 0.15);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

.output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.output-box {
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.output-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.output-value {
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
  min-height: 2.7em;
}

.copy-btn {
  width: fit-content;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.copy-btn:hover {
  border-color: var(--neon);
  color: var(--neon);
}

.copy-btn.copied {
  border-color: var(--success);
  color: var(--success);
}

.export-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.results-panel {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.results-panel.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.results-panel.loading {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.skeleton-grid {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.results-panel.loading .skeleton-grid {
  display: grid;
}

.results-panel.loading .intent-grid {
  display: none;
}

.skeleton-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 190px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.12) 37%,
    rgba(255, 255, 255, 0.04) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.results-panel.sticky {
  position: sticky;
  top: 14px;
  z-index: 3;
}

.intent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.intent-card {
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-strong);
  padding: 10px;
  min-height: 100%;
}

.intent-title {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--neon-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.title-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.title-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.08);
  display: grid;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  animation: fadeInUp 0.42s ease forwards;
}

.title-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.title-text {
  font-weight: 600;
  line-height: 1.38;
  flex: 1;
}

.count {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.count.good {
  color: var(--success);
}

.count.bad {
  color: var(--danger);
}

.metrics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.score {
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  background: rgba(20, 245, 212, 0.12);
  color: var(--neon);
  white-space: nowrap;
}

.floating-cta {
  position: fixed;
  right: 18px;
  bottom: 18px;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 800;
  color: #001317;
  background: linear-gradient(95deg, var(--neon), #7bffeb);
  box-shadow: 0 14px 36px rgba(20, 245, 212, 0.35);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  z-index: 10;
}

.floating-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(20, 245, 212, 0.42);
}

.floating-cta:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.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;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--surface);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  backdrop-filter: blur(10px);
  z-index: 11;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

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

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

  .form-grid,
  .output-grid {
    grid-template-columns: 1fr;
  }

  .results-panel.sticky {
    position: static;
  }
}
