/* Minimal home navigation and squared site controls. */

.topbar .nav-links a,
.button,
.workflow-back-link {
  border-radius: 0 !important;
}

.topbar .nav-links[hidden] {
  display: none !important;
}

.home-page {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: calc(100svh - 72px);
  padding: clamp(48px, 9vh, 84px) 28px 56px;
}

.home-page h1 {
  margin: 0 0 clamp(42px, 7vh, 68px);
  font-size: clamp(48px, 7vw, 88px);
  line-height: .95;
}

.home-panel-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
}

.home-panel {
  display: flex;
  min-height: clamp(180px, 26vh, 290px);
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 22px;
  border: 1px solid #fff;
  border-radius: 0;
  background: #000;
  color: #fff;
  text-align: center;
  transition: background 150ms ease, color 150ms ease;
}

.home-panel span {
  color: inherit;
  font: 500 13px/1.45 var(--mono);
  letter-spacing: 0;
  text-transform: lowercase;
}

.home-panel:hover,
.home-panel:focus-visible {
  background: #fff;
  color: #000;
}

.home-panel:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 4px;
}

@media (min-width: 621px) {
  /* Match the mobile title offset and keep only the desktop homepage to one viewport. */
  body:has(.home-page) {
    overflow: hidden;
  }

  .site-shell:has(.home-page) {
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
  }

  .site-shell:has(.home-page) .home-page {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 28px;
    overflow: hidden;
  }

  .site-shell:has(.home-page) .home-page > h1 {
    position: absolute;
    top: 14px;
    left: 28px;
    right: 28px;
    margin: 0 !important;
  }

  .home-panel-stack {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
  }

  .home-panel {
    min-height: clamp(90px, 13vh, 145px);
  }
}

@media (max-width: 620px) {
  /* Lock only the homepage to one mobile viewport. Interior pages keep normal scrolling. */
  body:has(.home-page) {
    overflow: hidden;
  }

  .site-shell:has(.home-page) {
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
  }

  .topbar {
    justify-content: flex-start;
    min-height: 64px;
    padding-inline: 18px;
  }

  .topbar .brand {
    width: auto;
    gap: 9px;
    font-size: 10px;
    letter-spacing: .07em;
  }

  .topbar .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .site-shell:has(.home-page) .home-page {
    position: relative;
    flex: 1 1 auto;
    display: block;
    height: auto;
    min-height: 0;
    padding: 0 18px;
    overflow: hidden;
  }

  /* Higher specificity keeps the later app stylesheet from pushing this title down or enlarging it. */
  .site-shell:has(.home-page) .home-page > h1 {
    position: absolute;
    top: 14px;
    left: 18px;
    right: 18px;
    margin: 0 !important;
    font-size: clamp(40px, 11vw, 46px) !important;
    line-height: .9 !important;
  }

  .site-shell:has(.home-page) .home-panel-stack {
    position: absolute;
    top: 52%;
    left: 50%;
    width: 72% !important;
    max-width: none !important;
    margin: 0 !important;
    gap: 10px;
    transform: translate(-50%, -50%);
  }

  .site-shell:has(.home-page) .home-panel {
    min-height: 0 !important;
    aspect-ratio: 5 / 1;
    padding: 8px 10px;
  }

  .site-shell:has(.home-page) .home-panel span {
    font-size: 10px;
  }
}

@media (max-width: 390px) {
  .site-shell:has(.home-page) .home-page > h1 {
    top: 12px;
    font-size: 36px !important;
  }

  .site-shell:has(.home-page) .home-panel-stack {
    width: 76% !important;
    top: 53%;
  }

  .site-shell:has(.home-page) .home-panel {
    aspect-ratio: 4.8 / 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-panel {
    transition: none;
  }
}

/* Replace the legacy UL text with the User's Lab mark while preserving the existing white square border. */
.topbar .brand-mark {
  overflow: hidden;
  background: #000 url('/userslab-logo.svg') center / 100% 100% no-repeat;
  color: transparent;
  font-size: 0 !important;
}
