/* Landing / dashboard hero — the first page.
   One bold element: a live algorithm visualization. Everything around it is
   quiet and disciplined. Built only on the shared design tokens in
   variables.css, and width-contained so the mobile layout never overflows the
   viewport (guarded by minmax(0,…) grid tracks, min-width:0 children, and an
   overflow clip on the viz column). */

.landing {
  display: block;
  max-width: 100%;
}

/* Hero: copy on the left, the live viz on the right; collapses to one column
   on narrow screens. minmax(0, …) lets each track shrink below its content
   width so the 640px-capped viz can never push the document past the viewport. */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--spacing-xl);
  align-items: center;
}

.landing-hero-copy,
.landing-hero-viz {
  min-width: 0; /* allow grid children to shrink below their content width */
}

.landing-headline {
  font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 var(--spacing-md);
  color: var(--text-primary);
}

.landing-subhead {
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 56ch;
  margin: 0 0 var(--spacing-lg);
  color: var(--text-secondary);
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

/* A real catalog strip, not decoration. */
.landing-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: var(--border-width) solid var(--border-color);
}

.landing-stat {
  display: flex;
  flex-direction: column;
}

.landing-stat .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary-color);
}

.landing-stat .stat-label {
  margin-top: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* The live viz is the single bold element: capped and centered so it stays a
   contained figure. The overflow clip is the belt-and-suspenders guard that
   keeps a wide internal control row from ever widening the document. */
.landing-hero-viz {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.landing-viz-caption {
  margin: var(--spacing-sm) 0 0;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  color: var(--text-secondary);
  text-align: center;
  max-width: 40ch;
}

.landing-section {
  margin-top: var(--spacing-xl);
}

.landing-section-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: 0 0 var(--spacing-md);
  color: var(--text-primary);
}

/* Benefits: a quiet left-ruled list — deliberately NOT the uniform grey-shadow
   card kit, so the page does not read as a template. */
.landing-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--spacing-md);
}

.landing-benefit {
  padding: var(--spacing-md) 0 var(--spacing-md) var(--spacing-md);
  border-left: 3px solid var(--primary-color);
}

.landing-benefit h3 {
  margin: 0 0 var(--spacing-xs);
  font-size: var(--font-size-base);
  font-weight: 600;
}

.landing-benefit p {
  margin: 0;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* How it works: a genuine Browse → Solve → Judge → Learn sequence, so the
   numbered markers are earned rather than decorative. */
.landing-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--spacing-md);
}

.landing-step {
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
  min-width: 0;
}

.landing-step-num {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--primary-color);
  flex: 0 0 auto;
  padding-top: 0.15rem;
}

.landing-step h3 {
  margin: 0 0 var(--spacing-xs);
  font-size: var(--font-size-base);
  font-weight: 600;
}

.landing-step p {
  margin: 0;
  line-height: 1.5;
  color: var(--text-secondary);
}

.landing-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

/* Narrow screens: one column; the hero stacks copy over the viz. */
@media (max-width: 768px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing * {
    transition: none !important;
  }
}
