@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --display: "Sora", sans-serif;
  --body: "IBM Plex Sans", sans-serif;
  --ink: #201a14;
  --muted: #635b52;
  --bg: #f6f1ea;
  --card: #ffffff;
  --soft: #efe7dd;
  --accent: #ff8a00;
  --accent-2: #0fa3b1;
  --accent-3: #f7c59f;
  --shadow: 0 12px 30px rgba(32, 26, 20, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: radial-gradient(circle at top left, #ffe8c5, transparent 45%),
    radial-gradient(circle at 15% 20%, #dff5f7, transparent 40%),
    radial-gradient(circle at 80% 0%, #ffe2d6, transparent 45%),
    linear-gradient(120deg, #faf6f1, #f3efe9 35%, #f1e7db 100%);
  min-height: 100vh;
}

.bg-orbits {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(15, 163, 177, 0.18) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 138, 0, 0.18) 1px, transparent 1px);
  background-size: 36px 36px, 64px 64px;
  background-position: 0 0, 18px 18px;
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  gap: 24px;
  position: sticky;
  top: 0;
  background: rgba(248, 244, 238, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(239, 224, 212, 0.6);
  z-index: 5;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.logo-image {
  height: 44px;
  width: auto;
}

.logo-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.topnav {
  display: flex;
  gap: 20px;
  font-weight: 500;
}

.topnav a {
  text-decoration: none;
  color: var(--muted);
}

.topnav a:hover {
  color: var(--ink);
}

.ghost-btn,
.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--body);
  letter-spacing: 0.2px;
}

.ghost-btn {
  background: transparent;
  border: 1px solid #d4c7b9;
  color: var(--ink);
}

.ghost-btn:hover {
  background: rgba(255, 138, 0, 0.12);
}

.primary-btn {
  background: linear-gradient(140deg, var(--accent), #ffb76a);
  color: #1f1408;
  box-shadow: 0 10px 18px rgba(255, 138, 0, 0.3);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  background: #fff6ea;
  border: 1px solid #f0c68f;
  color: #422b12;
}

.secondary-btn:hover {
  background: #ffe8cf;
}

main {
  padding: 0 48px 80px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  padding: 20px 0 10px;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 12px 0;
}

.ram-figure {
  position: relative;
  max-width: 320px;
  width: min(80vw, 320px);
  z-index: 1;
}

.ram-figure-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 30px 40px rgba(15, 26, 43, 0.35));
}

.ram-orb {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 0, 0.5), transparent 70%);
  top: 6px;
  right: 12%;
  filter: blur(2px);
  z-index: 0;
}

.ram-caption {
  margin-top: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--muted);
}

.hero-text h1 {
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 42px);
  margin: 14px 0 12px;
}

.hero-text p {
  color: var(--muted);
  line-height: 1.6;
  max-width: 520px;
}

.hero-deals {
  margin: 18px 0 8px;
  display: grid;
  gap: 10px;
}

.hero-deal-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid #efe0d4;
  box-shadow: var(--shadow);
}

.hero-deal-img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f7efe5;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-deal-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.hero-deal-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hero-deal-meta {
  font-size: 12px;
  color: var(--muted);
}

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

.hero-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 163, 177, 0.14);
  color: #0b6e77;
  font-weight: 600;
  font-size: 13px;
}

.hero-panel {
  background: linear-gradient(160deg, #ffffff, #fff7ef);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid #efe3d6;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-title {
  font-family: var(--display);
  font-weight: 600;
}

.panel-subtitle,
.panel-date {
  color: var(--muted);
  font-size: 13px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--soft);
  border-radius: 16px;
  padding: 14px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
}

.stat-value {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  margin-top: 6px;
}

.stat-foot {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.size-bars {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.size-bar {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.size-bar span:last-child {
  text-align: right;
}

.size-bar .bar {
  height: 8px;
  background: #efe0d1;
  border-radius: 999px;
  overflow: hidden;
}

.size-bar .bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.controls {
  margin-top: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 18px 20px;
  border: 1px solid #eee0d0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.control-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: end;
}

label span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.search,
.select,
.field {
  display: grid;
  gap: 6px;
}

.search input,
.select select,
.field input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e0d3c5;
  font-family: "IBM Plex Sans", sans-serif;
}

.search {
  flex: 1 1 260px;
}

.select,
.field {
  min-width: 150px;
}

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

.chip {
  border-radius: 999px;
  border: 1px solid #d9caba;
  background: #fffaf5;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

.chip.active {
  background: rgba(15, 163, 177, 0.15);
  border-color: rgba(15, 163, 177, 0.4);
  color: #0b6e77;
}

.control-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e4d5c6;
  background: #fff8ef;
  font-size: 13px;
  font-weight: 600;
  color: #5c4a35;
}

.toggle input {
  accent-color: var(--accent-2);
}

.toggle.small {
  padding: 4px 10px;
  font-size: 12px;
}

.featured {
  margin-top: 32px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-head h2 {
  font-family: var(--display);
  font-size: 20px;
}

.featured-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.featured-card {
  background: linear-gradient(160deg, #ffffff, #fff7ef);
  border-radius: 18px;
  padding: 14px;
  border: 1px solid #ede0d2;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  scroll-snap-align: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(32, 26, 20, 0.18);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.featured-card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #f8f0e6;
  border-radius: 14px;
  pointer-events: none;
}

.featured-image {
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}

.featured-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.featured-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.grid-section {
  margin-top: 28px;
}

.signals {
  margin-top: 32px;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.signal-card {
  background: linear-gradient(140deg, #fff7ec, #ffffff);
  border-radius: 18px;
  border: 1px solid #f0dcc6;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.signal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(32, 26, 20, 0.18);
}

.alerts {
  margin-top: 32px;
}

.alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.alert-card {
  background: linear-gradient(160deg, #ffffff, #fff7ef);
  border-radius: 18px;
  border: 1px solid #f0dcc6;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.alert-title {
  font-weight: 600;
  font-family: var(--display);
}

.alert-note,
.alert-status {
  font-size: 12px;
  color: var(--muted);
}

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

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

.alert-contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
}

.alert-item {
  display: grid;
  gap: 4px;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff2df;
  border: 1px solid #f0c68f;
}

.alert-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.alert-unit {
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 6px;
}

.signal-title {
  font-weight: 600;
}

.signal-metric {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
}

.signal-sub {
  color: var(--muted);
  font-size: 12px;
}

.signal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.signal-actions button {
  border: none;
  background: #f4ebe0;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: linear-gradient(160deg, #ffffff, #fff7ef);
  border-radius: 20px;
  padding: 14px;
  border: 1px solid #efe0d4;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  animation: fadeUp 0.4s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(32, 26, 20, 0.18);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.card-top .source {
  font-weight: 600;
  color: #5a4b39;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge.drop {
  background: rgba(15, 163, 177, 0.15);
  color: #0b6e77;
}

.badge.save {
  background: rgba(255, 138, 0, 0.2);
  color: #7a3f00;
}

.badge.value {
  background: rgba(107, 142, 255, 0.2);
  color: #2e3f8d;
}

.badge.hot {
  background: rgba(255, 91, 82, 0.18);
  color: #8a2a22;
}

.card-image {
  background: linear-gradient(140deg, #f7efe5, #fff7ef);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  place-items: center;
  min-height: 160px;
  text-decoration: none;
}

.image-button {
  border: none;
  width: 100%;
  cursor: pointer;
  padding: 0;
  background: none;
}

.image-link {
  cursor: pointer;
  text-decoration: none;
}

.card-image {
  overflow: hidden;
}

.card-image img {
  display: block;
}

#scroll-sentinel {
  height: 1px;
}

.hero-deal-card {
  cursor: pointer;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  pointer-events: none;
}

.card-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  min-height: 38px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
}

.card-price .price {
  font-size: 18px;
}

.card-price .delta {
  font-size: 12px;
  color: var(--muted);
}

.delta.up {
  color: #1a6b3e;
}

.delta.down {
  color: #a44123;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.card-metrics {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #5c4a35;
}

.card-metrics:empty {
  display: none;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

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

.tag {
  background: #f6eee3;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: #5b4c3c;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  gap: 8px;
  flex-wrap: wrap;
}

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

.card-actions span {
  flex: 1 1 140px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff2df;
  border: 1px solid #f0c68f;
  text-decoration: none;
  color: #422b12;
  font-weight: 700;
  font-size: 12px;
}

.card-actions button {
  border: none;
  background: linear-gradient(140deg, #ffe2bd, #ffd19a);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.load-row {
  display: grid;
  place-items: center;
  margin-top: 18px;
}

.footer {
  padding: 40px 48px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

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

.footer-logo {
  height: 34px;
  width: auto;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 50;
}

.modal.open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, 0.6);
}

.modal-card {
  position: relative;
  background: linear-gradient(160deg, #ffffff, #fff6ec);
  border-radius: 24px;
  padding: 22px;
  max-width: 960px;
  width: min(90vw, 960px);
  z-index: 1;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #f1dfca;
  padding-bottom: 12px;
}

.modal-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
}

.modal-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 18px;
}

.modal-media {
  background: linear-gradient(140deg, #f7efe5, #fff8f0);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  place-items: center;
}

.modal-media a {
  text-decoration: none;
  width: 100%;
  display: grid;
  place-items: center;
}

.modal-media img {
  width: 100%;
  height: 240px;
  object-fit: contain;
}

.modal-details {
  display: grid;
  gap: 10px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.detail-row {
  color: var(--muted);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-chart {
  margin-top: 20px;
  background: linear-gradient(160deg, #fff7ec, #ffffff);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid #f0dcc6;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chart-controls {
  display: grid;
  gap: 8px;
}

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

.chart-controls .chip {
  background: #fff;
  border: 1px solid #e6d2bd;
}

.chart-controls .chip.active {
  background: rgba(15, 163, 177, 0.18);
  border-color: rgba(15, 163, 177, 0.45);
  color: #0b6e77;
}

.chart-title {
  font-weight: 600;
}

.chart-note {
  color: var(--muted);
  font-size: 12px;
}

.chart-frame {
  position: relative;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ead9c8;
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.chart-frame img {
  width: 100%;
  display: none;
}

.chart-frame img.loaded {
  display: block;
}

.chart-placeholder {
  color: var(--muted);
  font-size: 13px;
}

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

.chart-actions .primary-btn {
  box-shadow: 0 12px 18px rgba(255, 138, 0, 0.25);
}

.chart-actions .ghost-btn {
  background: #fff;
  border: 1px solid #e7d4bf;
}

.section-note {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topnav {
    flex-wrap: wrap;
  }

  main {
    padding: 0 20px 60px;
  }

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

  .hero-visual {
    order: 2;
  }

  .hero-panel {
    order: 3;
  }
}

@media (min-width: 1100px) {
  .hero {
    grid-template-columns: 1.2fr 0.9fr 1.1fr;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 20px;
  }

  .controls {
    padding: 14px;
  }
}
