/* Minor fixes that don't belong in the SCSS theme layers */
html {
  scroll-behavior: smooth;
}

/* full-bleed landing page: quarto's custom layout wrapper */
.page-layout-custom main {
  padding: 0;
}

/* ============ global grid-line backdrop (everything except the footer) ============ */
body {
  background-image:
    linear-gradient(var(--nw-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--nw-grid-line) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
}

/* sections sit transparent so the grid shows through; no gray alt bands */
.nw-alt {
  background: transparent;
}

#hero {
  background: radial-gradient(60rem 30rem at 50% -10%, var(--nw-hero-glow), transparent 70%);
}

/* ============ premium whitespace between sections ============ */
.nw-section {
  padding: 6rem 0;
}

#hero {
  padding-top: 7.5rem;
  padding-bottom: 5rem;
}

@media (max-width: 640px) {
  .nw-section {
    padding: 3.5rem 0;
  }
}

/* ============ hero name: plain fg color, not gradient ============ */
#hero h1 .nw-name {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
  color: var(--nw-fg);
}

/* ============ navbar Book Now: never wrap; hide when space is tight ============ */
.navbar .navbar-nav .nav-item a[href*="cal.com"] {
  white-space: nowrap;
}

@media (min-width: 992px) and (max-width: 1249.98px) {
  .navbar .navbar-nav .nav-item:has(> a[href*="cal.com"]) {
    display: none;
  }
}

/* ============ stats: only 4x1, 2x2, or 1x4 ============ */
#stats .nw-stats {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 860px) {
  #stats .nw-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 430px) {
  #stats .nw-stats {
    grid-template-columns: 1fr;
  }
}

/* ============ tech stack: single column, larger items ============ */
.nw-stack {
  grid-template-columns: 1fr;
  max-width: 36rem;
  margin: 0 auto;
  gap: 1.25rem;
}

.nw-stack-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2.75rem;
}

.nw-stack-cat {
  text-align: center;
}

.nw-stack-item {
  font-size: 0.95rem;
  gap: 0.6rem;
}

.nw-stack-item img {
  width: 3.25rem;
  height: 3.25rem;
}


/* ============ map: match the contact / CTA container width ============ */
#map .nw-map {
  max-width: 52rem;
  margin: 0 auto;
}

/* ============ consistent side margins on listing pages ============ */
.page-layout-full main.content {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4.5rem;
}

/* ============ awards grid: strict 4x1 / 2x2 / 1x4 ============ */
.nw-carousel {
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
}

@media (max-width: 991.98px) {
  .nw-carousel {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .nw-carousel {
    grid-template-columns: 1fr;
  }
}

.nw-carousel > p,
.nw-projects > p,
.nw-cites > p,
.nw-posts > p {
  display: none;
}

/* ============ detail pages: hero image injected from page metadata ============ */
/* taller frame + contain so the full image is visible without cropping */
img.nw-detail-hero {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 38rem;
  object-fit: contain;
  background: var(--nw-card);
  border-radius: 1rem;
  border: 1px solid var(--nw-border);
  margin-bottom: 1.5rem;
}

/* ============ back-to-top ============ */
.nw-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1030;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--nw-border);
  background: var(--nw-card);
  color: var(--nw-muted);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, border-color 0.15s, color 0.15s;
}

.nw-top.show {
  opacity: 0.85;
  visibility: visible;
  transform: none;
}

.nw-top:hover {
  opacity: 1;
  border-color: var(--nw-primary);
  color: var(--nw-primary);
}

.nw-top svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* ============ footer: topography backdrop + link columns ============ */
.nav-footer {
  position: relative;
  background: var(--nw-footer-bg);
  border-top: 1px solid var(--nw-border);
  overflow: hidden;
  padding: 0;
}

.nav-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--nw-topo);
  -webkit-mask: url(media/topography.svg) 0 0 / 37.5rem 37.5rem repeat;
  mask: url(media/topography.svg) 0 0 / 37.5rem 37.5rem repeat;
  pointer-events: none;
}

.nav-footer .nav-footer-center {
  position: relative;
  flex: 1 1 100%;
  margin: 0;
  text-align: left;
}

.nw-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 2.5rem;
}

.nw-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 2.5rem;
}

.nw-footer-brand .nw-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--nw-fg);
  text-decoration: none;
}

.nw-footer-brand .nw-footer-logo img {
  height: 1.75rem;
}

.nw-footer-brand p {
  color: var(--nw-muted);
  font-size: 0.9rem;
  margin: 0.75rem 0 1rem;
  max-width: 14rem;
}

.nw-footer-socials {
  display: flex;
  gap: 0.9rem;
}

.nw-footer-socials a {
  color: var(--nw-muted);
  display: inline-flex;
}

.nw-footer-socials a:hover {
  color: var(--nw-primary);
}

.nw-footer-socials svg {
  width: 1.2rem;
  height: 1.2rem;
}

.nw-footer-col h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--nw-fg);
  margin: 0 0 1rem;
}

.nw-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.nw-footer-col a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--nw-muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.nw-footer-col a:hover {
  color: var(--nw-primary);
}

.nw-footer-col a svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
}

.nw-footer-bottom {
  display: flex;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3.5rem;
  color: var(--nw-muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .nw-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 480px) {
  .nw-footer-grid {
    grid-template-columns: 1fr;
  }
}
