.page-main,
.shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.page-main {
  --section-space: 1.35rem;
  padding: 1.15rem 0 4rem;
}

main.page-main > section {
  margin: 0;
}

main.page-main > section + section {
  margin-top: var(--section-space);
}

.section-stack {
  display: grid;
  gap: 1.2rem;
}

.hero {
  margin: 0;
  padding: 1.45rem;
  border: 1px solid rgba(255, 227, 166, 0.22);
  border-radius: var(--radius-lg);
  color: var(--ink-soft);
  background:
    linear-gradient(135deg, rgba(17, 23, 29, 0.97), rgba(31, 38, 45, 0.94)),
    radial-gradient(circle at top right, rgba(246, 163, 19, 0.18), transparent 16rem);
  box-shadow: var(--shadow);
}

.hero-grid,
.summary-strip,
.tool-grid,
.content-grid,
.faq-grid,
.footer-grid {
  display: grid;
  gap: 1rem;
}

.hero-grid > *,
.summary-strip > *,
.tool-grid > *,
.content-grid > *,
.faq-grid > *,
.footer-grid > *,
.split-layout > * {
  min-width: 0;
}

.hero-grid,
.content-grid {
  grid-template-columns: 1fr;
}

.tool-grid {
  grid-template-columns: 1fr;
  align-items: start;
}

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

.summary-strip {
  margin-top: 1.25rem;
}

.split-layout {
  display: grid;
  gap: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

@media (min-width: 1100px) {
  .page-main {
    --section-space: 1.9rem;
  }

  .section-stack {
    gap: 1.35rem;
  }

  .hero-grid,
  .summary-strip,
  .tool-grid,
  .content-grid,
  .faq-grid,
  .footer-grid,
  .split-layout {
    gap: 1.25rem;
  }

  .hero,
  .tool-card,
  .site-footer {
    padding: 1.7rem;
  }

  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-grid--wide {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  }

  .content-grid,
  .hero-grid,
  .faq-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}

@media (min-width: 1200px) {
  .page-main {
    --section-space: 2.2rem;
    padding-top: 1.5rem;
  }

  .section-stack {
    gap: 1.55rem;
  }

  .hero-grid,
  .summary-strip,
  .tool-grid,
  .content-grid,
  .faq-grid,
  .footer-grid,
  .split-layout {
    gap: 1.45rem;
  }

  .hero {
    padding: 2rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }

  /* In two-column hero mode, keep summary cards readable by stacking them. */
  .summary-strip {
    margin-top: 0;
    grid-template-columns: 1fr;
  }
}
