/* Homepage hero polish: keep the existing background/content, only rebalance the first screen visual. */
@media (min-width: 1024px) {
  #root > div > section:first-of-type [class*="lg:grid-cols-5"] {
    align-items: center;
  }

  #root > div > section:first-of-type [class*="lg:col-span-3"] {
    --hero-card-width: 118%;
    --hero-card-pull: -9%;
    --hero-card-pad-y: 3.5rem;
    --hero-badge-x: 1.5rem;
    --hero-badge-right: calc(var(--hero-card-pull) + var(--hero-badge-x));
    --hero-badge-y: 0.5rem;
    padding-block: var(--hero-card-pad-y);
  }

  #root > div > section:first-of-type [class*="lg:col-span-3"] > div:first-child,
  #root > div > section:first-of-type [class*="lg:col-span-3"] > div:nth-child(2) {
    width: var(--hero-card-width);
    margin-inline: auto var(--hero-card-pull);
  }

  #root > div > section:first-of-type [class*="lg:col-span-3"] > div:first-child {
    inset: var(--hero-card-pad-y) var(--hero-card-pull) var(--hero-card-pad-y) auto;
    height: auto;
  }

  #root > div > section:first-of-type [class*="lg:col-span-3"] > div:nth-child(2) {
    transform: none;
    transform-origin: center;
  }

  #root > div > section:first-of-type [class*="lg:col-span-3"] > a {
    z-index: 3;
  }

  #root > div > section:first-of-type [class*="lg:col-span-3"] > a:nth-of-type(1) {
    top: var(--hero-badge-y);
    right: auto;
    left: var(--hero-badge-x);
  }

  #root > div > section:first-of-type [class*="lg:col-span-3"] > a:nth-of-type(2) {
    top: var(--hero-badge-y);
    right: var(--hero-badge-right);
    left: auto;
  }

  #root > div > section:first-of-type [class*="lg:col-span-3"] > a:nth-of-type(3) {
    top: auto;
    right: auto;
    bottom: var(--hero-badge-y);
    left: var(--hero-badge-x);
  }

  #root > div > section:first-of-type [class*="lg:col-span-3"] > a:nth-of-type(4) {
    top: auto;
    right: var(--hero-badge-right);
    bottom: var(--hero-badge-y);
    left: auto;
  }
}

@media (min-width: 1280px) {
  #root > div > section:first-of-type [class*="lg:grid-cols-5"] {
    gap: clamp(2rem, 3vw, 4rem);
  }

  #root > div > section:first-of-type [class*="lg:col-span-3"] {
    --hero-card-width: 130%;
    --hero-card-pull: -15%;
    --hero-card-pad-y: 4rem;
    --hero-badge-x: 2rem;
    --hero-badge-y: 0.625rem;
    transform: translateX(1rem);
  }
}

@media (min-width: 1536px) {
  #root > div > section:first-of-type [class*="lg:col-span-3"] {
    --hero-card-width: 136%;
    --hero-card-pull: -18%;
    --hero-card-pad-y: 4.25rem;
    --hero-badge-x: 2.5rem;
    transform: translateX(1.5rem);
  }
}

/* Header material downloads: replace the duplicate consult CTA with a compact download menu. */
.material-download-popover {
  position: absolute;
  z-index: 10000;
  width: min(20rem, calc(100vw - 2rem));
  padding: 0.5rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
}

.material-download-link {
  display: block;
  padding: 0.8rem 0.9rem;
  border-radius: 0.65rem;
  color: #0f172a;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.material-download-link:hover {
  background: #f0f9ff;
  color: #0284c7;
}

.material-download-title,
.material-download-meta {
  display: block;
  line-height: 1.35;
}

.material-download-title {
  font-size: 0.875rem;
  font-weight: 700;
}

.material-download-meta {
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.75rem;
}

/* Cloud platform: enlarge the three switchable screenshots only. */
@media (min-width: 1024px) {
  #platform > .container > .grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 3vw, 3rem);
  }

  #platform > .container > .grid > div:nth-child(2) {
    margin-right: -1rem;
  }
}

@media (min-width: 1280px) {
  #platform > .container > .grid {
    grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  }

  #platform > .container > .grid > div:nth-child(2) {
    margin-right: -2rem;
  }
}

@media (min-width: 1536px) {
  #platform > .container > .grid > div:nth-child(2) {
    margin-right: -2.75rem;
  }
}

/* Certificates: keep the homepage compact, then show the full set in a modal. */
#honors .certificate-preview-grid > div:nth-child(n+11) {
  display: none;
}

@media (max-width: 1023.98px) {
  #honors .certificate-preview-grid > div:nth-child(n+9) {
    display: none;
  }
}

@media (max-width: 639.98px) {
  #honors .certificate-preview-grid > div:nth-child(n+5) {
    display: none;
  }
}

.certificate-more-wrap {
  margin-top: 2rem;
  text-align: center;
}

.certificate-more-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.5rem;
  border: 1px solid rgba(2, 132, 199, 0.22);
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.certificate-more-button:hover {
  background: rgba(2, 132, 199, 0.16);
  border-color: rgba(2, 132, 199, 0.34);
  transform: translateY(-1px);
}

body.certificate-modal-open {
  overflow: hidden;
}

.certificate-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
}

.certificate-modal-panel {
  width: min(1180px, 100%);
  max-height: min(88vh, 920px);
  overflow: hidden;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.34);
  display: flex;
  flex-direction: column;
}

.certificate-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.certificate-modal-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 800;
}

.certificate-modal-header p {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.875rem;
}

.certificate-modal-close {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.certificate-modal-close:hover {
  background: #e2e8f0;
}

.certificate-modal-grid {
  overflow: auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.certificate-modal-card {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.certificate-modal-card:hover {
  border-color: rgba(2, 132, 199, 0.38);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.certificate-modal-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #f8fafc;
}

.certificate-modal-card span {
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
}

@media (max-width: 1023.98px) {
  .certificate-modal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .certificate-modal {
    padding: 0.75rem;
  }

  .certificate-modal-panel {
    max-height: 92vh;
    border-radius: 0.875rem;
  }

  .certificate-modal-header {
    padding: 1rem;
  }

  .certificate-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem;
  }
}

/* National map: tighten the top whitespace without changing the map asset. */
#honors {
  padding-bottom: 3.5rem;
}

#national-map {
  padding-top: 2.5rem;
}

#national-map > .container:first-child > .text-center {
  margin-bottom: 2rem;
}

#national-map > .container,
#national-map > div:nth-child(2) {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

#national-map > div:nth-child(2) > div {
  max-width: none;
}

#national-map > .container:last-child > div {
  max-width: 100%;
}

@media (max-width: 767.98px) {
  #honors {
    padding-bottom: 2.5rem;
  }

  #national-map {
    padding-top: 2rem;
  }

  #national-map > .container:first-child > .text-center {
    margin-bottom: 1.5rem;
  }

  #national-map > .container,
  #national-map > div:nth-child(2) {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
