.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Header */

/* The wrapper elements must not create a box: the sticky header needs body as its container. */
x-site-header,
x-site-footer {
  display: contents;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--color-header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: auto;
}

.brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.site-nav > a {
  padding: 12px;
  color: var(--color-muted);
}

.site-nav > a:hover {
  color: var(--color-text);
  opacity: 1;
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

@media (max-width: 860px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 20px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav > a {
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-buttons {
    margin: 16px 0 0;
    gap: 8px;
  }
}

/* Hero */

.hero {
  padding-top: 88px;
  padding-bottom: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px;
}

.hero-text {
  flex: 1 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-text > .mono {
  font-size: 14px;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero-lead {
  max-width: 34rem;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--color-muted);
}

.hero-logo {
  flex: 1 1 320px;
  min-width: 0;
  align-self: flex-start;
  display: flex;
  justify-content: flex-end;
}

.hero-logo img {
  width: 100%;
  max-width: 300px;
  height: auto;
}

/* Sections */

.section {
  padding-top: 72px;
  padding-bottom: 72px;
}

#tools.section {
  padding-top: 40px;
}

.band {
  background: var(--color-band);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.band + .band,
#about.band {
  border-bottom: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.section-title {
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.section-title-spaced {
  margin-bottom: 28px;
}

.section-number {
  color: var(--color-teal);
  font-size: 1.1rem;
  font-weight: 500;
}

.section-intro {
  color: var(--color-muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.about {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}

.about-text {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.about-text p {
  color: var(--color-muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

.contact {
  padding-top: 88px;
  padding-bottom: 88px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.contact h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
}

.contact p {
  color: var(--color-muted);
  font-size: 1.1rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--color-muted);
}

@media (max-width: 600px) {
  .hero {
    padding-top: 48px;
    gap: 32px;
  }

  .hero-logo {
    order: -1;
    align-self: auto;
    justify-content: center;
  }

  .hero-logo img {
    max-width: 220px;
  }

  .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .section-title {
    font-size: 1.7rem;
  }
}
