/* DocketRadar — Layout Styles
   Grid, sections, responsive breakpoints */

/* ========== Container ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ========== Main content offset for sticky nav ========== */
main {
  padding-top: var(--nav-height);
}

/* ========== Sections ========== */
.section {
  padding: 80px 0;
}

.section-sm {
  padding: var(--space-12) 0;
}

.section-lg {
  padding: var(--space-20) 0;
}

.section-cloud {
  background-color: var(--color-cloud);
}

.section-white {
  background-color: var(--color-bg);
}

.section-navy {
  background-color: var(--color-navy);
  color: #ffffff;
}

.section-navy h2,
.section-navy h3 {
  color: #ffffff;
}

.section-navy p {
  color: rgba(255, 255, 255, 0.8);
}

.section-dark {
  background-color: var(--color-dark-bg, #0c1f17);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.section-dark::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.section-dark > * {
  position: relative;
  z-index: 1;
}

.section-dark h2,
.section-dark h3 {
  color: #ffffff;
}

.section-dark p {
  color: rgba(255, 255, 255, 0.85);
}

.section-dark .text-secondary,
.section-dark .text-caption,
.section-dark .text-slate {
  color: rgba(255, 255, 255, 0.4);
}

/* ========== Section Headers ========== */
.section-header {
  max-width: 640px;
  margin: 0 auto var(--space-12);
  text-align: center;
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header .text-overline {
  margin-bottom: var(--space-3);
}

.section-header p {
  color: var(--color-slate-500);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.section-navy .section-header p,
.section-dark .section-header p {
  color: rgba(255, 255, 255, 0.75);
}

/* ========== Hero ========== */
.hero {
  min-height: 85vh;
  min-height: 85dvh;
  padding: 80px 0 var(--space-16);
  background: linear-gradient(
    160deg,
    #0c1f17 0%,
    #1b3a2b 30%,
    #2d5a3f 60%,
    #3d6b50 100%
  );
  background-size: 200% 200%;
  animation: heroGradientShift 12s ease-in-out infinite;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

@keyframes heroGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Gradient mesh orbs */
.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  left: -20%;
  width: 160%;
  height: 160%;
  background:
    radial-gradient(
      ellipse 600px 600px at 25% 60%,
      rgba(184, 134, 11, 0.12) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 500px 500px at 75% 30%,
      rgba(212, 165, 51, 0.06) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 800px 400px at 50% 100%,
      rgba(45, 90, 63, 0.3) 0%,
      transparent 50%
    );
  pointer-events: none;
  animation: heroOrbDrift 20s ease-in-out infinite;
}

@keyframes heroOrbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(3%, -2%) scale(1.02); }
  66% { transform: translate(-2%, 3%) scale(0.98); }
}

/* Noise texture overlay for hero */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content {
  max-width: 560px;
}

.hero .display {
  color: #ffffff;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-6);
  opacity: 0;
  animation: fade-up 0.8s ease-out 0.3s forwards;
}

.hero-subtitle {
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--space-8);
  max-width: 480px;
  opacity: 0;
  animation: fade-up 0.8s ease-out 0.5s forwards;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  opacity: 0;
  animation: fade-up 0.8s ease-out 0.7s forwards;
}

.hero-image,
.hero-3d-scene {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== Grid Layouts ========== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

/* ========== County Grid ========== */
.county-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  max-width: 800px;
  margin: 0 auto;
}

/* ========== Pricing Grid ========== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
  max-width: 820px;
  margin: 0 auto;
}

/* ========== Feature Grid (features page) ========== */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

/* ========== FAQ Container ========== */
.faq-container {
  max-width: 720px;
  margin: 0 auto;
}

/* ========== CTA Banner ========== */
.cta-banner {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  position: relative;
  z-index: 1;
}

.cta-banner h2 {
  margin-bottom: var(--space-4);
}

.cta-banner p {
  max-width: 520px;
  margin: 0 auto var(--space-8);
}

/* ========== Responsive ========== */

/* < 1280px */
@media (max-width: 1280px) {
  .container {
    max-width: 1024px;
  }
}

/* < 1024px — Tablet landscape */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
    margin: 0 auto;
  }

  .hero-subtitle {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-image {
    display: none;
  }

  .hero-3d-scene {
    max-width: 420px;
    margin: 0 auto;
  }

  .hero-actions::after {
    content: "";
    display: block;
    width: 40px;
    height: 2px;
    background: linear-gradient(
      to right,
      var(--color-accent),
      var(--color-accent-light)
    );
    margin: var(--space-6) auto 0;
    border-radius: 1px;
    opacity: 0.6;
  }

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

  .grid-4,
  .county-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-8);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* < 768px — Tablet portrait */
@media (max-width: 768px) {
  :root {
    --text-display: 2rem;
    --text-h1: 1.5rem;
    --text-h2: 1.25rem;
    --text-h3: 1.125rem;
  }

  .section {
    padding: var(--space-12) 0;
  }

  .section-lg {
    padding: var(--space-16) 0;
  }

  .hero {
    min-height: auto;
    padding: var(--space-16) 0 var(--space-12);
  }

  .hero .display {
    font-size: 38px;
  }

  .hero::before {
    top: -10%;
    left: -30%;
    width: 160%;
    height: 160%;
    background:
      radial-gradient(
        ellipse 400px 400px at 50% 40%,
        rgba(184, 134, 11, 0.14) 0%,
        transparent 60%
      ),
      radial-gradient(
        ellipse 300px 500px at 30% 80%,
        rgba(212, 165, 51, 0.08) 0%,
        transparent 50%
      ),
      radial-gradient(
        ellipse 600px 300px at 70% 100%,
        rgba(45, 90, 63, 0.25) 0%,
        transparent 50%
      );
  }

  .cta-banner {
    padding: var(--space-16) var(--space-4);
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .grid-4,
  .county-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .section-header {
    margin-bottom: var(--space-8);
  }

  /* Make comparison table scrollable */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .comparison-table {
    min-width: 500px;
  }
}

/* < 640px — Mobile */
@media (max-width: 640px) {
  :root {
    --text-display: 1.875rem;
    --nav-height: 56px;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .hero {
    min-height: auto;
    padding: var(--space-12) 0 var(--space-10);
  }

  .hero .display {
    font-size: 30px;
  }

  .hero .hero-scroll-indicator {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 300px;
  }

  .card {
    padding: var(--space-6);
  }

  .grid-4,
  .county-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .pricing-card {
    padding: var(--space-6);
  }

  .feature-detail {
    flex-direction: column;
    padding: var(--space-6);
  }

  .cta-banner {
    padding: var(--space-14) var(--space-4);
  }

  .nav-inner {
    padding: 0 var(--space-4);
  }
}
