:root {
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow-soft: 0 20px 60px rgba(15, 23, 42, 0.16);
  --shadow-card: 0 14px 40px rgba(15, 23, 42, 0.2);
}

body[data-theme="dark"] {
  --bg: #0f1115;
  --bg-2: #141822;
  --card: rgba(26, 29, 36, 0.82);
  --card-strong: rgba(30, 34, 44, 0.96);
  --text: #e6eaf0;
  --muted: #9aa4b2;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(59, 130, 246, 0.35);
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 52%, #22d3ee 100%);
  --glow: 0 0 0 1px rgba(59, 130, 246, 0.15), 0 0 30px rgba(34, 211, 238, 0.08);
  --chip: rgba(59, 130, 246, 0.12);
  --empty: rgba(255, 255, 255, 0.04);
}

body[data-theme="light"] {
  --bg: #f8fafc;
  --bg-2: #eef4ff;
  --card: rgba(255, 255, 255, 0.84);
  --card-strong: rgba(255, 255, 255, 0.98);
  --text: #111827;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.22);
  --line-strong: rgba(37, 99, 235, 0.26);
  --blue: #2563eb;
  --violet: #7c3aed;
  --cyan: #0891b2;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 60%, #38bdf8 100%);
  --glow: 0 0 0 1px rgba(37, 99, 235, 0.08), 0 20px 45px rgba(37, 99, 235, 0.08);
  --chip: rgba(37, 99, 235, 0.08);
  --empty: rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.16), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(34, 211, 238, 0.1), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

a,
button,
input,
select {
  font: inherit;
}

button,
.theme-switch,
.review-card__link,
.glass-link {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    opacity 0.2s ease;
}

.app-shell {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft), var(--glow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--accent-gradient);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.32);
}

.brand__eyebrow,
.section-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--muted);
}

.brand h1,
.hero h2,
.insight-card h3,
.reviews-stage__header h3,
.product-spotlight h3 {
  margin: 0;
  font-family: var(--font-display);
}

.brand h1 {
  font-size: 1.1rem;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--card-strong);
  border: 1px solid var(--line);
  box-shadow: var(--glow);
  cursor: pointer;
  user-select: none;
}

.theme-switch:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.theme-switch span {
  color: var(--muted);
  font-size: 0.9rem;
}

.theme-switch__track {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-gradient);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.12);
}

.theme-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.24);
}

body[data-theme="dark"] .theme-switch__thumb {
  transform: translateX(24px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.creator-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: var(--glow);
}

.creator-strip p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.creator-strip__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero__copy,
.hero__glow-card,
.command-bar,
.glass-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft), var(--glow);
}

.hero__copy {
  padding: 34px;
}

.hero h2 {
  margin-top: 10px;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.02;
}

.hero__text {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.hero__glow-card {
  padding: 26px;
  display: grid;
  gap: 14px;
}

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(14px);
  opacity: 0.6;
}

.hero__orb--blue {
  top: -30px;
  right: -10px;
  width: 130px;
  height: 130px;
  background: rgba(59, 130, 246, 0.24);
}

.hero__orb--violet {
  bottom: -40px;
  left: -18px;
  width: 160px;
  height: 160px;
  background: rgba(139, 92, 246, 0.18);
}

.hero__stat {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-strong) 90%, transparent);
  border: 1px solid var(--line);
}

.hero__stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero__stat strong {
  font-size: 1rem;
  line-height: 1.5;
}

.command-bar {
  position: relative;
  z-index: 15;
  padding: 20px;
  margin-bottom: 20px;
}

.command-bar__grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 220px minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.field-group {
  display: grid;
  gap: 9px;
}

.field-group label {
  font-weight: 700;
  font-size: 0.92rem;
}

.field-group input,
.field-group select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card-strong) 88%, transparent);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.command-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

button:hover,
.review-card__link:hover,
.glass-link:hover,
.theme-switch:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#submit-button {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.24);
}

.ghost-button,
.glass-link,
.review-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-strong) 92%, transparent);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--glow);
}

.ghost-button--small {
  min-height: 40px;
  padding: 10px 12px;
  min-width: 0;
}

.status-row {
  margin-top: 14px;
}

.status-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-strong) 90%, transparent);
  color: var(--muted);
}

.status-card--loading {
  color: var(--cyan);
}

.status-card--error {
  color: #fca5a5;
}

.status-card--success {
  color: #86efac;
}

.progress {
  margin-top: 12px;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--empty);
  border: 1px solid var(--line);
}

.progress__bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-gradient);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.2);
  transition: width 0.24s ease;
}

.dashboard {
  display: grid;
  gap: 20px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.8fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.glass-card {
  padding: 22px;
}

.product-spotlight {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
}

.product-spotlight__media {
  position: relative;
  border-radius: 24px;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 40%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.product-spotlight__media img,
.product-spotlight__fallback {
  width: 100%;
  height: 100%;
}

.product-spotlight__media img {
  object-fit: contain;
  padding: 18px;
}

.product-spotlight__fallback {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 4rem;
  background: var(--accent-gradient);
  color: #fff;
}

.product-spotlight__content {
  display: grid;
  gap: 16px;
}

.product-spotlight__meta,
.product-spotlight__microstats,
.inline-actions,
.reviews-stage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.capsule {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 0.84rem;
}

.capsule--accent {
  color: var(--text);
  border-color: var(--line-strong);
}

.product-spotlight h3 {
  font-size: 1.6rem;
  line-height: 1.2;
}

.product-spotlight__subline {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.product-spotlight__subline strong {
  font-size: 1.45rem;
}

.product-spotlight__subline span,
.reviews-stage__subtext,
.summary-copy-like {
  color: var(--muted);
}

.product-spotlight__actions {
  display: grid;
  gap: 10px;
}

.product-spotlight__microstats div,
.hero__stat,
.rating-row,
.review-card {
  border: 1px solid var(--line);
}

.product-spotlight__microstats div {
  flex: 1 1 0;
  min-width: 120px;
  padding: 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--card-strong) 92%, transparent);
}

.product-spotlight__microstats span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.product-spotlight__microstats strong {
  display: block;
  margin-top: 8px;
  font-size: 1.3rem;
  font-family: var(--font-display);
}

.insight-card {
  display: grid;
  gap: 16px;
}

.insight-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.rating-bars {
  display: grid;
  gap: 12px;
}

.rating-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--card-strong) 94%, transparent);
}

.rating-row__track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--empty);
}

.rating-row__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-gradient);
}

.insight-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.insight-columns h4 {
  margin: 0 0 12px;
  font-family: var(--font-display);
}

.insight-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.reviews-stage {
  padding: 24px;
}

.reviews-stage__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.results-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.review-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--card-strong) 96%, transparent);
  box-shadow: var(--shadow-card);
}

.review-card__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.review-card__headline {
  display: grid;
  gap: 10px;
}

.review-card__rating {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.24);
}

.review-card__title {
  margin: 0;
  font-size: 1.1rem;
}

.review-card__meta {
  display: grid;
  gap: 6px;
  min-width: 220px;
  text-align: right;
  color: var(--muted);
}

.review-card__author {
  color: var(--text);
  font-weight: 700;
}

.review-card__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.review-card__details,
.review-card__attributes,
.review-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.review-card__photos {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.review-card__photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--empty);
}

.empty-state {
  margin-top: 18px;
  padding: 30px 24px;
  border-radius: 22px;
  border: 1px dashed var(--line);
  background: var(--empty);
  color: var(--muted);
  text-align: center;
}

.results-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--card-strong) 96%, transparent), color-mix(in srgb, var(--card) 92%, transparent));
  color: var(--text);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.26),
    0 0 0 1px rgba(59, 130, 246, 0.12),
    0 0 32px rgba(34, 211, 238, 0.12);
  backdrop-filter: blur(16px);
  animation: toast-in 0.28s ease;
}

.toast[hidden] {
  display: none !important;
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.24);
}

.toast__content {
  display: grid;
  gap: 2px;
}

.toast__title {
  font-size: 0.95rem;
}

.toast__message {
  color: var(--muted);
  font-size: 0.88rem;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

  .product-spotlight {
    grid-column: 1 / -1;
  }

  .command-bar__grid {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .command-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .topbar,
  .creator-strip,
  .hero,
  .overview-grid,
  .product-spotlight,
  .insight-columns,
  .command-bar__grid,
  .review-card__top,
  .reviews-stage__header {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .topbar {
    align-items: stretch;
  }

  .review-card__meta {
    min-width: 0;
    text-align: left;
  }

  .command-bar {
    top: 12px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 16px, 1320px);
  }

  .hero__copy,
  .hero__glow-card,
  .command-bar,
  .glass-card,
  .reviews-stage {
    padding: 18px;
  }

  button,
  .ghost-button,
  .glass-link,
  .review-card__link {
    width: 100%;
  }

  .command-actions,
  .inline-actions,
  .review-card__actions,
  .product-spotlight__actions,
  .reviews-stage__actions {
    display: grid;
  }
}
