:root {
  color-scheme: light;
  --bg: #f4f1e9;
  --bg-2: #e9e0cf;
  --ink: #15130f;
  --muted: #655f55;
  --line: rgba(21, 19, 15, 0.13);
  --card: rgba(255, 252, 244, 0.78);
  --card-strong: #fffaf0;
  --accent: #f27d2f;
  --accent-2: #126b52;
  --accent-3: #2026ff;
  --shadow: 0 26px 80px rgba(52, 39, 20, 0.16);
  --mono: "IBM Plex Mono", monospace;
  --sans: "Manrope", sans-serif;
  --display: "Onest", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgba(242, 125, 47, 0.34), transparent 34rem),
    radial-gradient(circle at 12% 18%, rgba(18, 107, 82, 0.16), transparent 28rem),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  font-family: var(--sans);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(21, 19, 15, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 19, 15, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.shell {
  width: min(1440px, calc(100% - 28px));
  margin: 0 auto;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin: 14px 0 34px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 250, 240, 0.78);
  box-shadow: 0 18px 60px rgba(52, 39, 20, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: #fffaf0;
  background: linear-gradient(135deg, #15130f, #3f2b1f);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.brand strong,
.brand em {
  display: block;
}

.brand strong {
  font-family: var(--display);
  font-size: 17px;
}

.brand em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.top-nav a,
.ghost-button,
.secondary-button,
.dark-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.top-nav a,
.ghost-button,
.secondary-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.44);
}

.ghost-button.is-loading {
  color: var(--accent-2);
}

.primary-button,
.dark-button {
  color: #fffaf0;
  border-color: transparent;
  background: var(--ink);
  box-shadow: 0 14px 34px rgba(21, 19, 15, 0.18);
}

.secondary-button {
  background: #fffaf0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 34px;
  align-items: center;
  min-height: 650px;
  padding: 32px 0 58px;
}

.hero-copy {
  max-width: 800px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

h1 {
  max-width: 860px;
  font-size: clamp(48px, 8vw, 118px);
}

h2 {
  font-size: clamp(34px, 5vw, 68px);
}

h3 {
  font-size: 28px;
}

.lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.source-card {
  display: grid;
  gap: 8px;
  max-width: 520px;
  margin-top: 34px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.66);
}

.source-card span,
.source-card strong {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.source-card a {
  width: fit-content;
  border-bottom: 1px solid currentColor;
  font-weight: 800;
}

.market-orbit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
}

.orbit-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(21, 19, 15, 0.16);
  stroke-width: 1.5;
  animation: orbitPulse 5s ease-in-out infinite;
}

.orbit-core,
.orbit-card {
  position: relative;
  z-index: 2;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.orbit-core {
  display: grid;
  place-items: center;
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  border-radius: 50%;
}

.orbit-core span,
.orbit-core em,
.orbit-card span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-style: normal;
  text-transform: uppercase;
}

.orbit-core strong {
  font-family: var(--display);
  font-size: 82px;
  letter-spacing: -0.08em;
}

.orbit-card {
  position: absolute;
  display: grid;
  gap: 8px;
  min-width: 150px;
  padding: 18px;
  border-radius: 24px;
}

.orbit-card strong {
  font-family: var(--display);
  font-size: 34px;
  letter-spacing: -0.06em;
}

.orbit-card-a {
  top: 48px;
  left: 42px;
}

.orbit-card-b {
  right: 36px;
  top: 130px;
}

.orbit-card-c {
  right: 78px;
  bottom: 76px;
  min-width: 220px;
}

.control-panel,
.request-builder,
.workspace,
.category-strip {
  margin-top: 18px;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 420px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 250, 240, 0.72);
  box-shadow: 0 18px 60px rgba(52, 39, 20, 0.09);
  backdrop-filter: blur(16px);
}

.search-box,
.range-box label,
.builder-form label {
  display: grid;
  gap: 8px;
}

.search-box span,
.range-box span,
.builder-form span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf0;
  color: var(--ink);
  outline: none;
}

input {
  height: 48px;
  padding: 0 16px;
}

textarea {
  min-height: 210px;
  padding: 16px;
  resize: vertical;
}

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

.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 2px 14px;
  scrollbar-width: thin;
}

.category-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.72);
  cursor: pointer;
}

.category-chip.active {
  color: #fffaf0;
  border-color: transparent;
  background: var(--accent-2);
}

.category-chip span {
  color: inherit;
  opacity: 0.72;
  font-family: var(--mono);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.offers-panel,
.side-panel > section,
.request-builder {
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(255, 250, 240, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.offers-panel {
  padding: 22px;
}

.side-panel {
  display: grid;
  gap: 18px;
}

.side-panel > section {
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-head.compact {
  align-items: start;
}

.view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
}

.view-toggle button,
.output-head button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.view-toggle button.active,
.output-head button {
  color: #fffaf0;
  background: var(--ink);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(242, 125, 47, 0.16);
  color: #7b3a12;
  font-size: 13px;
  font-weight: 800;
}

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

.offer-card,
.supplier-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.5);
}

.offer-card {
  padding: 18px;
}

.offer-card::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(18, 107, 82, 0.1);
}

.offer-card h3 {
  max-width: 86%;
  font-size: 24px;
  line-height: 1.05;
}

.offer-meta,
.offer-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag,
.price-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(21, 19, 15, 0.07);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.price-tag {
  color: #fffaf0;
  background: var(--accent);
}

.supplier-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--accent-2);
  font-weight: 900;
}

.offers-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.insight-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.mini-stats {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.mini-stats span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
}

.supplier-list {
  display: grid;
  gap: 10px;
}

.supplier-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.supplier-card strong {
  font-size: 15px;
}

.supplier-card span {
  color: var(--muted);
  font-size: 13px;
}

.request-builder {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 34px;
  padding: 22px;
}

.builder-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.builder-form {
  display: grid;
  gap: 12px;
}

.request-output {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.output-head span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-footer {
  padding: 22px 0 36px;
  color: var(--muted);
}

.site-footer a {
  border-bottom: 1px solid currentColor;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 24px;
  color: var(--muted);
  text-align: center;
}

@keyframes orbitPulse {
  0%,
  100% {
    opacity: 0.56;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

@media (max-width: 1080px) {
  .hero,
  .workspace,
  .request-builder {
    grid-template-columns: 1fr;
  }

  .market-orbit {
    min-height: 500px;
  }

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 16px, 1440px);
  }

  .site-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
    border-radius: 24px;
  }

  .brand {
    min-width: 0;
  }

  .top-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .top-nav a,
  .ghost-button,
  .primary-button,
  .secondary-button,
  .dark-button {
    min-height: 40px;
    padding: 0 13px;
    font-size: 14px;
  }

  .hero {
    min-height: auto;
    padding-top: 10px;
  }

  h1 {
    font-size: clamp(38px, 12vw, 56px);
    line-height: 1.02;
    letter-spacing: -0.065em;
  }

  .market-orbit {
    min-height: 430px;
  }

  .orbit-core {
    width: 210px;
    height: 210px;
  }

  .orbit-core strong {
    font-size: 58px;
  }

  .orbit-card {
    min-width: 128px;
    padding: 14px;
  }

  .orbit-card-a {
    left: 0;
    top: 28px;
  }

  .orbit-card-b {
    right: 0;
    top: 94px;
  }

  .orbit-card-c {
    right: 14px;
    bottom: 34px;
    min-width: 170px;
  }

  .range-box,
  .offers-grid {
    grid-template-columns: 1fr;
  }

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

  .offers-panel,
  .side-panel > section,
  .request-builder {
    border-radius: 24px;
    padding: 16px;
  }

  table {
    min-width: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.48);
  }

  td {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    border-bottom: 1px solid rgba(21, 19, 15, 0.08);
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
  }
}

/* Suppliers page */
.suppliers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 2rem;
}

.supplier-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
}

.supplier-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.supplier-header img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--line);
}

.supplier-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.supplier-city {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}

.supplier-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  font-size: 15px;
}

.rating-label {
  font-size: 13px;
  color: var(--muted);
}

.supplier-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.supplier-link:hover {
  background: var(--muted);
  color: white;
}
