:root {
  --bg: #f5f5f7;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #6b7280;
  --soft: #9ca3af;
  --chip: #f3f4f6;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.06);
  --shadow-strong: 0 30px 80px rgba(15, 23, 42, 0.13);
  --radius-large: 32px;
  --radius: 20px;
  --accent: #f97316;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f5f5f7;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  padding: 32px 28px;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.swing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 20;
}

.swing-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.chrome-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0 auto 12px;
  max-width: 1560px;
}

.chrome-pill {
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease,
    transform 120ms ease, box-shadow 140ms ease;
}

.chrome-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.chrome-pill:hover {
  background: #0f172a;
  color: #f9fafb;
  border-color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.35);
}

@media (min-width: 921px) {
  .chrome-bar {
    margin-bottom: 18px;
  }

  .chrome-pill {
    display: none;
  }

  .swing-overlay {
    display: none;
  }
}

/* Shell */

.app-shell {
  width: min(1560px, 100%);
  margin: 0 auto;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 420px);
  gap: 22px;
  margin-bottom: 26px;
}

.hero-copy,
.hero-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  padding: 30px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #0f172a;
  color: #e5e7eb;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.hero-copy h1 {
  margin: 0;
  font-weight: 200;
  font-size: clamp(2.4rem, 4.4vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: 0.02em;
}

.hero-copy h1 span {
  color: var(--accent);
  font-weight: 300;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
  font-size: 0.98rem;
  line-height: 1.7;
}

/* Hero side panel */

.hero-panel {
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-strong);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: #0f172a;
  color: #e5e7eb;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-badge::after {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.hero-stats div {
  border-radius: 18px;
  padding: 14px 14px 12px;
  background: #f9fafb;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.hero-stats strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 4px;
  font-weight: 300;
}

.hero-stats span {
  font-size: 0.8rem;
  color: var(--soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Layout */

.app-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1.5fr) 380px;
  gap: 22px;
  align-items: flex-start;
}

.sidebar,
.main-area,
.detail-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Panels */

.panel {
  padding: 18px 18px 16px;
  border-radius: var(--radius);
}

.search-panel {
  padding: 20px 20px 18px;
}

/* Typography helpers */

.label,
.panel-heading,
.section-topline,
.insight-topline {
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10px;
  font-weight: 500;
}

.section-topline {
  letter-spacing: 0.16em;
}

/* Search */

.search-wrap {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

#searchInput {
  flex: 1;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #f9fafb;
  color: var(--text);
  border-radius: 999px;
  padding: 14px 18px;
  outline: none;
  font-size: 0.95rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

#searchInput::placeholder {
  color: #9ca3af;
}

#searchInput:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.02),
    0 0 0 6px rgba(249, 115, 22, 0.15);
}

.icon-btn {
  width: 46px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #ffffff;
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease,
    transform 120ms ease;
}

.icon-btn:hover {
  background: #0f172a;
  color: #f9fafb;
  border-color: #0f172a;
  transform: translateY(-1px);
}

/* Chips and filters */

.chip-grid,
.filter-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.chip,
.filter-chip,
.meta-chip {
  border-radius: 999px;
  border: 1px solid rgba(209, 213, 219, 0.9);
  padding: 7px 11px;
  background: var(--chip);
  color: #4b5563;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease,
    background 140ms ease, color 140ms ease, box-shadow 140ms ease;
  font-size: 0.82rem;
  font-weight: 500;
}

.chip:hover,
.filter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 23, 42, 0.26);
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.07);
}

.chip.active,
.filter-chip.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #f9fafb;
}

/* Helper list */

.helper-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 10px;
  line-height: 1.6;
  font-size: 0.88rem;
}

/* Insight */

.insight-panel {
  box-shadow: none;
  background: linear-gradient(
    135deg,
    #0f172a 0%,
    #111827 40%,
    #020617 100%
  );
  color: #e5e7eb;
}

.insight-topline {
  color: rgba(156, 163, 175, 0.9);
}

.insight-body {
  margin-top: 10px;
  color: #d1d5db;
  line-height: 1.7;
  font-size: 0.92rem;
}

/* Results header */

.results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.results-header h2 {
  margin: 6px 0 0;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  font-weight: 200;
  text-transform: uppercase;
}

.result-meta {
  color: var(--soft);
  font-size: 0.86rem;
}

/* Results grid */

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* Cards */

.card,
.best-card {
  border-radius: 26px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease,
    box-shadow 140ms ease, background 140ms ease;
}

.card:hover,
.best-card:hover {
  border-color: #0f172a;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
}

.card-cover {
  aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 0 0, #fde68a 0%, #f97316 32%, #111827 90%);
  display: grid;
  place-items: center;
}

.card-cover img,
.detail-cover img,
.best-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Card body */

.card-body {
  padding: 16px 16px 14px;
}

.card-title {
  margin: 0 0 4px;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  font-weight: 500;
}

.card-subtitle {
  margin: 0 0 10px;
  color: var(--soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.card-why {
  margin: 0 0 10px;
  color: #111827;
  font-size: 0.92rem;
  line-height: 1.55;
}

.card-copy {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.87rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Meta chip */

.meta-chip {
  cursor: default;
  color: #374151;
  font-size: 0.75rem;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(209, 213, 219, 0.9);
  background: #f9fafb;
  font-weight: 500;
}

/* Best match */

.best-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.best-cover {
  min-height: 100%;
  background: #0f172a;
}

.best-body {
  padding: 20px 20px 18px;
}

.best-title {
  margin: 4px 0 6px;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  font-weight: 200;
  text-transform: uppercase;
}

.best-subtitle {
  margin: 0 0 10px;
  color: var(--soft);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.best-why,
.best-copy {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

.best-copy {
  margin-top: 12px;
}

.best-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* Buttons */

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease,
    transform 120ms ease, border-color 150ms ease;
}

.primary-btn {
  background: #0f172a;
  color: #f9fafb;
  border-color: #0f172a;
}

.primary-btn:hover:not([disabled]) {
  background: #f97316;
  border-color: #f97316;
  box-shadow: 0 16px 38px rgba(249, 115, 22, 0.35);
  transform: translateY(-1px);
}

.primary-btn[disabled] {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #9ca3af;
  cursor: default;
  box-shadow: none;
}

.secondary-btn {
  background: #ffffff;
  color: #111827;
  border-color: rgba(148, 163, 184, 0.6);
}

.secondary-btn:hover {
  background: #0f172a;
  color: #f9fafb;
  border-color: #0f172a;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.25);
  transform: translateY(-1px);
}

/* Detail panel */

.detail-panel.sticky {
  position: sticky;
  top: 24px;
}

.detail-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-cover {
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 1 / 1.2;
  background: #0f172a;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.detail-head h2 {
  margin: 6px 0 4px;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  font-weight: 200;
  text-transform: uppercase;
}

.detail-subtitle {
  color: var(--soft);
  margin: 0 0 10px;
  line-height: 1.55;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Detail groups */

.detail-group {
  padding-top: 14px;
  border-top: 1px solid rgba(209, 213, 219, 0.9);
}

.detail-group h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #111827;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.detail-group p,
.detail-group li {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.9rem;
}

.detail-group ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

/* Link note */

.link-note {
  color: var(--soft);
  font-size: 0.82rem;
  margin-top: 8px;
}

/* Empty states */

.empty-detail,
.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
}

.detail-placeholder,
.empty-state {
  text-align: left;
  width: 100%;
}

.detail-placeholder-top {
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10px;
}

.empty-state h3,
.detail-placeholder h3 {
  margin: 10px 0 6px;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-state p,
.detail-placeholder p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.9rem;
}

/* Responsive */

@media (max-width: 1260px) {
  .app-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .detail-rail {
    grid-column: 1 / -1;
  }

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

@media (max-width: 920px) {
  body {
    padding: 18px 16px;
  }

  .hero,
  .app-layout {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    order: -1;
  }

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

  .best-cover {
    max-height: 260px;
  }

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

  .sidebar,
  .detail-rail {
    position: fixed;
    top: 64px;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    padding: 0 16px 16px;
    pointer-events: none;
    z-index: 30;
  }

  .sidebar {
    left: 0;
    transform: translateX(-104%);
  }

  .detail-rail {
    right: 0;
    transform: translateX(104%);
  }

  body.filters-open .sidebar,
  body.detail-open .detail-rail {
    pointer-events: auto;
  }

  body.filters-open .sidebar {
    transform: translateX(0);
  }

  body.detail-open .detail-rail {
    transform: translateX(0);
  }

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

  .swing-overlay {
    top: 48px;
  }
}