*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --slate-dark:  #2D3748;
  --slate:       #4A5568;
  --slate-light: #EDF2F7;
  --sage:        #5C7A5C;
  --sage-light:  #E8F0E8;
  --rose:        #8B5E6B;
  --rose-light:  #F5E6EC;
  --bg:          #FAFAF8;
}

html, body { height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #fff;
  color: var(--slate-dark);
}

/* ── Navbar ──────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 62px;
  background: rgba(250,250,248,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
}
.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-dot {
  width: 8px; height: 8px;
  background: var(--sage);
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-actions { display: flex; gap: 12px; align-items: center; }
.btn-nav {
  position: relative;
  overflow: hidden;
  padding: 9px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
}
.btn-nav-outline {
  background: transparent;
  border: 1.5px solid var(--slate-light);
  color: var(--slate);
}
.btn-nav-outline:hover { border-color: var(--slate); }
.btn-nav-filled {
  background: var(--slate-dark);
  border: none;
  color: #fff;
}
.btn-nav-filled:hover { opacity: 0.85; }
.btn-nav:active         { transform: scale(0.97); }
.btn-nav-filled:active  { opacity: 0.9; }



/* ── Hero split layout ───────────────────────────────── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 62px;
  /* Sticky: stays pinned while the section below scrolls over it */
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Left side */
.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 60px 80px 80px;
}

/* Subtle badge — no tautology with "Track" headline */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--slate);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px 6px 10px;
  border-radius: 100px;
  margin-bottom: 24px;
  width: fit-content;
  border: 1px solid var(--slate-light);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.badge-dot {
  width: 7px; height: 7px;
  background: var(--sage);
  border-radius: 50%;
  flex-shrink: 0;
  animation: badgePulse 2.2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

h1 {
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
h1 span { color: var(--sage); }
.hero-subtitle {
  color: var(--slate);
  font-size: 17px;
  line-height: 1.65;
  max-width: 460px;
  margin-bottom: 40px;
}

/* Track input */
.track-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
}
.track-input {
  flex: 1;
  padding: 15px 20px;
  border: 1.5px solid var(--slate-light);
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--slate-dark);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.track-input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(92,122,92,0.12);
}
.track-input::placeholder { color: #A0AEC0; }

.btn-track {
  position: relative;
  overflow: hidden;
  padding: 15px 28px;
  background: var(--slate-dark);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.12s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-track:hover { opacity: 0.88; }
.btn-track:active { transform: scale(0.97); opacity: 0.9; }
.btn-track:disabled { opacity: 0.55; cursor: not-allowed; }

/* Animated loading dots */
.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.loading-dots span {
  display: inline-block;
  width: 4px; height: 4px;
  background: currentColor;
  border-radius: 50%;
  animation: dotBounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: 0.35; }
  40%            { transform: translateY(-4px); opacity: 1;    }
}

/* Hint aligns with text inside the input (20px internal padding) */
.track-hint {
  margin-top: 10px;
  padding-left: 20px;
  font-size: 12px;
  color: var(--slate);
  display: none;
}
.track-hint.visible { display: block; }
.track-hint.error   { color: var(--rose); }

.supported-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 10px; padding-left: 20px;
  font-size: 12px; color: var(--slate); background: none;
  border: none; cursor: pointer; font-family: inherit;
  opacity: 0.7; transition: opacity 0.15s;
}
.supported-btn:hover { opacity: 1; }
.supported-btn .q-icon {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--slate); display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}

.supported-popup {
  display: none; position: absolute; z-index: 100;
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  padding: 20px 22px; width: 320px;
  margin-top: 6px;
}
.supported-popup.open { display: block; }
.supported-popup h4 {
  margin: 0; font-size: 13px; font-weight: 700;
  color: var(--slate-dark);
}
.supported-region { margin-bottom: 14px; }
.supported-region-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--slate); opacity: 0.6;
  margin-bottom: 6px;
}
.supported-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.supported-tag {
  font-size: 12px; padding: 4px 10px;
  background: #f5f7f5; border-radius: 20px;
  color: var(--slate-dark); font-weight: 500;
}

/* Right side */
.hero-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 80px 80px 40px;
  background: linear-gradient(135deg, #f0f4f0 0%, #faf8f5 100%);
  overflow: hidden;
}

/* Decorative rose symbols behind the card */
.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
}
.hero-deco span {
  position: absolute;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  color: rgba(139, 94, 107, 0.09);
  line-height: 1;
}

/* Floating demo card — overflow visible so tooltip can escape the card bounds */
.product-card-demo {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  width: 320px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  animation: float 4s ease-in-out infinite;
  overflow: visible;
}
/* Pause float on hover so chart tooltips are easy to read */
.product-card-demo:hover { animation-play-state: paused; }
@keyframes float {
  0%, 100% { transform: translateY(0px);   }
  50%       { transform: translateY(-14px); }
}

/* Demo card image — square, full-coverage */
.demo-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.demo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 4px;
}
.demo-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--slate-dark);
  margin-bottom: 8px;
}
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--sage-light);
  color: var(--sage);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 18px;
}
.demo-chart-wrap {
  height: 70px;
  overflow: visible;
}

/* ── Stats bar ───────────────────────────────────────── */
.stats-bar {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1.5px solid var(--slate-light);
}
.stats-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--slate); margin-top: 2px; }
.stat-demo-note {
  margin-top: 14px;
  font-size: 11px;
  color: #A0AEC0;
  font-style: italic;
}

/* ── Currently tracking section ──────────────────────── */
/* z-index > hero so it slides over the sticky hero on scroll */
.section {
  position: relative;
  z-index: 10;
  background: #fff;
  border-radius: 28px 28px 0 0;
  margin-top: -28px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.07);
  padding: 80px 0;   /* no horizontal padding — handled by inner elements */
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 0 8%;
}
.section-title {
  font-size: 24px;
  font-weight: 800;
}

/* Grid cards — fixed card width, equal gaps on all 4 sides via space-evenly */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 300px);
  justify-content: space-evenly;
}

.product-card-grid {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.product-card-grid:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.11);
}

/* Square full-coverage image */
.grid-card-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.grid-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.product-card-grid:hover .grid-card-img { transform: scale(1.04); }

.grid-card-source {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  opacity: 0.55;
}
.grid-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 8px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.grid-card-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--slate-dark);
  margin-bottom: 8px;
}
.grid-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
}
.grid-card-badge.down { background: var(--sage-light); color: var(--sage); }
.grid-card-badge.up   { background: var(--rose-light); color: var(--rose); }

/* Card meta row — watchers + last updated */
.grid-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--slate-light);
  font-size: 11px;
  color: var(--slate);
  opacity: 0.7;
}
.grid-card-meta-sep { opacity: 0.4; }

/* ── Toast ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--slate-dark);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  animation: slideIn 0.3s ease;
  max-width: 320px;
}
.toast.success { background: var(--sage); }
.toast.error   { background: var(--rose); }
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Currency banner ─────────────────────────────────── */
.currency-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--slate-light);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  z-index: 200;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.07);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}
.currency-banner.visible { transform: translateY(0); visibility: visible; }
.currency-banner-text { font-size: 14px; color: var(--slate); line-height: 1.5; }
.currency-banner-text strong { color: var(--slate-dark); }
.currency-banner-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.btn-currency-yes {
  position: relative;
  overflow: hidden;
  padding: 9px 20px;
  background: var(--slate-dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.12s;
}
.btn-currency-yes:hover { opacity: 0.85; }
.btn-currency-yes:active { transform: scale(0.97); opacity: 0.9; }
.btn-currency-no {
  padding: 9px 16px;
  background: transparent;
  color: var(--slate);
  border: 1.5px solid var(--slate-light);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.12s;
}
.btn-currency-no:hover  { border-color: var(--slate); }
.btn-currency-no:active { transform: scale(0.97); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  .hero-left { padding: 60px 32px; }
  .section { padding: 40px 0; }
  .section-header { padding: 0 24px; }
  .cards-grid { grid-template-columns: 1fr; column-gap: 0; row-gap: 20px; padding: 0 24px; }
  .stats-row { gap: 24px; }
  nav { padding: 0 24px; }
  .currency-banner { padding: 16px 24px; flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 600px) {
  nav { padding: 0 16px; }
  .hero-left { padding: 36px 20px 48px; }
  .section-header { padding: 0 16px; }
  .cards-grid { padding: 0 16px; row-gap: 14px; }

  /* Smaller image without cropping */
  .grid-card-img-wrap { aspect-ratio: 4/3; }
  .grid-card-img { object-fit: contain; }

  /* Currency banner buttons */
  .currency-banner { padding: 14px 16px; }
  .btn-currency-yes, .btn-currency-no { padding: 8px 14px; font-size: 12px; }
  .currency-banner-actions { width: 100%; }
  .btn-currency-yes { flex: 1; text-align: center; }
}
