body[data-page="apps"] {
  --page: min(1200px, calc(100vw - 48px));
  --serif: "Inter", -apple-system, BlinkMacSystemFont, "PingFang TC", "PingFang SC", sans-serif;
  --sans: var(--serif);
}

.site-header {
  position: relative;
}

.site-header .nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  gap: 38px;
  font-size: 16px;
  font-weight: 400;
}

.site-header .brand-mark {
  color: var(--near-black);
  font-size: 20px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
}

.apps-page {
  width: var(--page);
  margin: 32px auto;
}

.apps-showcase {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
}

.app-feature {
  flex: var(--preview-width) 1 0;
  min-width: 0;
  max-width: calc(var(--preview-width) * 1px);
}

.app-feature-full {
  flex: 0 1 100%;
}

.app-feature-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: #eeece5;
  color: var(--near-black);
  text-decoration: none;
}

html[data-theme="dark"] .app-feature-link {
  background: var(--paper);
}

.app-feature-link:focus-visible {
  outline-offset: 6px;
}

.app-feature-media {
  pointer-events: none;
}

.app-preview {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 240ms ease;
}

.app-preview-dark,
html[data-theme="dark"] .app-preview-light {
  display: none;
}

html[data-theme="dark"] .app-preview-dark {
  display: block;
}

.app-feature-caption {
  padding: 0 16px 12px;
}

.app-visit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-block: 6px;
  color: var(--dark-warm);
  font-size: 14px;
  line-height: 1.4;
}

.app-visit svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 240ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .app-feature-link:hover .app-preview {
    transform: translateY(-4px);
  }

  .app-feature-link:hover .app-visit svg {
    transform: translate(2px, -2px);
  }

  .app-feature-link:hover .app-visit span {
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }
}

@media (max-width: 820px) {
  .site-header .nav {
    position: static;
    transform: none;
    gap: 20px;
  }
}

@media (max-width: 720px) {
  .site-header .nav {
    font-size: 14px;
  }

  .apps-page {
    margin-block: 24px;
  }

  .apps-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .app-feature {
    width: 100%;
  }

  .app-visit {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-preview,
  .app-visit svg {
    transition: none;
  }

  .app-feature-link:hover .app-preview,
  .app-feature-link:hover .app-visit svg {
    transform: none;
  }
}
