.layout {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  --home-header-height: 61px;
}

.layout__header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  min-height: 61px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.layout--home .layout__header {
  z-index: 200;
  border-bottom: 1px solid oklch(90% 0.006 95 / 0.35);
  background: oklch(98% 0.004 95 / 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 -1px 0 oklch(100% 0.002 95 / 0.55);
}

.layout__topnav-left,
.layout__nav,
.layout__brand,
.layout__pill-link {
  display: flex;
  align-items: center;
}

.layout__topnav-left {
  min-width: 0;
  flex: 1;
}

.layout__brand {
  gap: 10px;
  padding-right: 20px;
  color: var(--fg);
}

.layout__brand-logo {
  display: grid;
  width: 80px;
  height: 32px;
  overflow: hidden;
  place-items: center;
}

.layout__brand-wordmark {
  width: auto;
  height: 32px;
}

.layout__nav {
  gap: clamp(16px, 2.5vw, 28px);
}

.layout__nav--actions {
  gap: 16px;
}

.layout__mobile-menu {
  display: none;
  position: relative;
}

.layout__mobile-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.layout__mobile-menu-trigger::-webkit-details-marker {
  display: none;
}

.layout__mobile-menu-panel {
  display: grid;
  gap: 4px;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.layout__mobile-menu-panel a {
  display: flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--fg);
  font-size: 14px;
}

.layout__mobile-menu-panel a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.layout__nav a,
.layout__pill-link {
  color: var(--muted);
  font-size: 14px;
}

.layout__auth-placeholder {
  display: inline-block;
  width: 150px;
  height: 32px;
}

.layout__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.layout__main.layout__main--home {
  width: 100%;
  max-width: none;
  padding: 0;
}

@media (max-width: 720px) {
  .layout--home .layout__header {
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .layout--home .layout__topnav-left {
    flex: 1 1 auto;
    width: auto;
  }

  .layout--home .layout__nav--primary {
    display: none;
  }

  .layout--home .layout__mobile-menu {
    display: block;
    margin-left: auto;
  }

  .layout--home .layout__mobile-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 240;
  }

  .layout--home .layout__nav--actions {
    flex: 0 0 auto;
  }
}
