/* Home page only -- previously inline in markets/templates/markets/
   home.html's own {% block extra_head %}. Performance audit finding:
   ~9.5KB of pure, template-variable-free CSS was being re-sent and
   re-parsed on every single home page load with no way for a browser
   to cache it separately, same problem base.css/base.js's own earlier
   externalization already fixed sitewide -- this is the same fix,
   scoped to the one page that used it. */

/* Full-bleed hero -- escapes .page's centered max-width on purpose,
   same "break out of the container" trick as nothing else on this
   site needs, since nothing else is a full-width visual moment. */
.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
}
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.38;
  pointer-events: none;
  animation: hero-float 16s ease-in-out infinite;
}
.hero-blob-1 { width: 420px; height: 420px; background: var(--accent); top: -140px; left: -90px; }
.hero-blob-2 { width: 360px; height: 360px; background: var(--success); top: 20px; right: -110px; animation-delay: -5s; }
.hero-blob-3 { width: 300px; height: 300px; background: var(--warning); bottom: -160px; left: 38%; animation-delay: -10s; }
@keyframes hero-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -24px) scale(1.08); }
}
@media (prefers-color-scheme: dark) { .hero-blob { opacity: 0.24; } }
@media (prefers-reduced-motion: reduce) { .hero-blob { animation: none; } }

.hero-content { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 0.35em 0.9em; border-radius: 999px; margin-bottom: 1.1rem;
}
.hero-title { font-size: 3rem; line-height: 1.08; margin: 0 0 0.9rem; letter-spacing: -0.02em; }
.hero-title-accent {
  background: linear-gradient(90deg, var(--accent), var(--success));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 1.08rem; color: var(--text-secondary); margin: 0 auto 1.75rem; max-width: 34em; }
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.75rem; }
.hero-cta .btn-primary { box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 38%, transparent); }
.hero-stats { display: flex; gap: 2.75rem; justify-content: center; flex-wrap: wrap; }
.hero-stat-value { display: block; font-size: 2.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-stat-label { font-size: 0.78rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }

.auth-strip {
  position: relative; overflow: hidden; border: 1px solid var(--border);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface));
}

.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 2.5rem 0 1rem; gap: 1rem; flex-wrap: wrap; }
.section-heading h2 { margin: 0; }

/* Fades/slides a section in the first time it scrolls into view --
   toggled by IntersectionObserver below, not on every page (this
   block is scoped to home.html only via extra_head). */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Vertical list layout for the homepage's data strips -- one row
   per market, stacked top to bottom, instead of a multi-column
   grid -- so every item in a section is visible scanning straight
   down, not spread across rows you have to scan in two dimensions. */
.market-list { display: flex; flex-direction: column; gap: 0.6rem; }
.market-row {
  display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: box-shadow .15s, transform .1s, border-color .15s;
}
.market-row:hover {
  box-shadow: var(--shadow-md); transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.market-row-image { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--surface-hover); }
.market-row-info { flex: 1; min-width: 0; }
.market-row-question { font-weight: 600; margin-top: 0.15rem; }
.market-row-price { text-align: right; min-width: 100px; flex-shrink: 0; }

.upset-pill {
  display: inline-block; background: var(--danger-strong); color: #fff; font-size: 0.66rem; font-weight: 800;
  padding: 0.2em 0.55em; border-radius: 999px; margin-bottom: 0.3rem;
}
.source-volume-badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700; color: var(--success-strong);
  background: var(--success-bg); padding: 0.15em 0.5em; border-radius: 999px; margin-top: 0.25rem;
}

/* Side by side, not stacked one after another -- the four data
   strips as columns, so all of them are visible from the start
   instead of scrolling down through one at a time. Each column is
   still a vertical list internally (market-row-compact, below),
   just narrower -- collapses to 2 then 1 column as the viewport
   shrinks, same breakpoints as base.html's own mobile nav. */
/* 6 columns -- direct bug report: "the closing soon in home page
   is below all the other columns, put it to the right of them
   (make them tighter if need space)" -- Closing soon (added after
   this grid was originally sized for 5) was wrapping into its own
   half-empty second row instead of sitting alongside the rest.
   (Most controversial, added the same time, was removed again on
   a later direct ask.) */
.sections-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.9rem; align-items: start; }
@media (max-width: 1400px) { .sections-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .sections-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .sections-grid { grid-template-columns: 1fr; } }
.section-column { min-width: 0; }
.section-column-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin: 0 0 0.6rem; }
.section-column-heading h2 { margin: 0; font-size: 1rem; }
.section-column-heading a { font-size: 0.76rem; white-space: nowrap; }
.section-column-hint { font-size: 0.74rem; margin: -0.35rem 0 0.6rem; }

.market-row-compact {
  display: block; padding: 0.6rem 0.7rem; margin-bottom: 0.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: box-shadow .15s, transform .1s, border-color .15s;
}
.market-row-compact:hover {
  box-shadow: var(--shadow-md); transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.market-row-compact-top { display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.4rem; }
/* min-width:0 is the actual fix -- a flex item's default (auto)
   lets its own content's natural width push the row wider no
   matter what wrapping rules the text itself has. Real bug found
   auditing text overflow: a long market question could force this
   card wider than its column. */
.market-row-compact-top > div { min-width: 0; }
.market-row-compact-image { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--surface-hover); }
.market-row-compact-category { font-size: 0.7rem; }
.market-row-compact-question { font-weight: 600; font-size: 0.85rem; line-height: 1.32; margin-top: 0.1rem; }
.market-row-compact-price-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.market-row-compact-price-row .price { font-size: 1rem; }

/* Opening intro: an "iris" wipe -- a full-screen cover that shrinks
   away from covering everything to revealing everything, like an
   aperture opening, with the brand mark scaling/rotating in first.
   Static HTML + CSS (not JS-injected), so there's no flash of the
   page underneath before it appears -- see the inline script below
   for how it actually plays (once per browser session) and for why
   a no-JS visitor never sees it stuck covering the page at all. */
#intro-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  clip-path: circle(150% at 50% 50%);
  transition: clip-path 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}
#intro-overlay.intro-opening { clip-path: circle(0% at 50% 50%); }
.intro-logo {
  font-size: 4.5rem; line-height: 1; color: var(--accent);
  transform: scale(0) rotate(-60deg);
  animation: intro-logo-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  filter: drop-shadow(0 0 26px color-mix(in srgb, var(--accent) 55%, transparent));
}
@keyframes intro-logo-in { to { transform: scale(1) rotate(0deg); } }
@media (prefers-reduced-motion: reduce) {
  #intro-overlay { display: none !important; }
}
